Skip to content

Commit

Permalink
Fixed parsing SequenceTypes and add Compute acceptance test
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Schulte committed May 10, 2016
1 parent 3eef4f2 commit 31f3a92
Show file tree
Hide file tree
Showing 7 changed files with 5,832 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,35 +11,35 @@ namespace AutoRest.Generator.AzureResourceSchema.Tests
[Collection("AutoRest Azure Resource Schema Tests")]
public static class AcceptanceTests
{
private static string SwaggerFile(string fileName)
[Fact]
public static void Storage()
{
return Path.Combine("Swagger", fileName);
RunSwaggerTest("storage.json", "Storage");
}

private static string ExpectedFolder(string folderName)
[Fact]
public static void Batch()
{
return Path.Combine("Expected", folderName);
RunSwaggerTest("BatchManagement.json", "Batch");
}

[Fact]
public static void Storage()
public static void Cdn()
{
SwaggerSpecHelper.RunTests<AzureResourceSchemaCodeGenerator>(
SwaggerFile("storage.json"), ExpectedFolder("Storage"));
RunSwaggerTest("cdn.json", "CDN");
}

[Fact]
public static void Batch()
public static void Compute()
{
SwaggerSpecHelper.RunTests<AzureResourceSchemaCodeGenerator>(
SwaggerFile("BatchManagement.json"), ExpectedFolder("Batch"));
RunSwaggerTest("compute.json", "Compute");
}

[Fact]
public static void Cdn()
private static void RunSwaggerTest(string swaggerFileName, string expectedFolderName)
{
SwaggerSpecHelper.RunTests<AzureResourceSchemaCodeGenerator>(
SwaggerFile("cdn.json"), ExpectedFolder("CDN"));
Path.Combine("Swagger", swaggerFileName),
Path.Combine("Expected", expectedFolderName));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@
<Content Include="Expected\CDN\Microsoft.Cdn.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Expected\Compute\Microsoft.Compute.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<None Include="packages.config">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
Expand All @@ -100,6 +103,9 @@
<Content Include="Swagger\cdn.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Swagger\compute.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Modelers\Swagger.Tests\AutoRest.Modeler.Swagger.Tests.csproj">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,11 @@
"description": "The path used for origin requests."
},
"contentTypesToCompress": {
"type": "array"
"type": "array",
"items": {
"type": "string"
},
"description": "List of content types on which compression will be applied. The value for the elements should be a valid MIME type."
},
"isCompressionEnabled": {
"type": "boolean",
Expand All @@ -221,7 +225,11 @@
"description": "Defines the query string caching behavior. Possible values include: 'IgnoreQueryString', 'BypassCaching', 'UseQueryString', 'NotSet'"
},
"origins": {
"type": "array"
"type": "array",
"items": {
"$ref": "#/definitions/DeepCreatedOrigin"
},
"description": "The set of origins for the CDN endpoint. When multiple origins exist, the first origin will be used as primary and rest will be used as failover options."
}
},
"required": [
Expand Down
Loading

0 comments on commit 31f3a92

Please sign in to comment.