Skip to content

Commit

Permalink
Merge pull request #1089 from daschult/master
Browse files Browse the repository at this point in the history
Add DNS schema acceptance test
  • Loading branch information
tbombach committed Jun 1, 2016
2 parents 836c71f + 1a9e4e5 commit f980c82
Show file tree
Hide file tree
Showing 45 changed files with 48,789 additions and 131 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,53 +12,125 @@ namespace AutoRest.Generator.AzureResourceSchema.Tests
public static class AcceptanceTests
{
[Fact]
public static void Storage()
public static void Batch()
{
RunSwaggerTest("storage.json", "Storage");
RunSwaggerTest("Batch", "2015-12-01", "BatchManagement.json");
}

[Fact]
public static void Batch()
public static void Cdn_2015_06_01()
{
RunSwaggerTest("CDN", "2015-06-01", "cdn.json");
}

[Fact]
public static void Cdn_2016_04_02()
{
RunSwaggerTest("CDN", "2016-04-02", "cdn.json");
}

[Fact]
public static void CognitiveServices_2016_02_01_preview()
{
RunSwaggerTest("CognitiveServices", "2016-02-01-preview", "cognitiveservices.json");
}

[Fact]
public static void Compute_2015_06_15()
{
RunSwaggerTest("Compute", "2015-06-15", "compute.json");
}

[Fact]
public static void Compute_2016_03_30()
{
RunSwaggerTest("Compute", "2016-03-30", "compute.json");
}

[Fact]
public static void DataLakeAnalytics_2015_10_01_preview()
{
RunSwaggerTest("DataLakeAnalytics", "2015-10-01-preview", "account.json");
}

[Fact]
public static void DataLakeStore_2015_10_01_preview()
{
RunSwaggerTest("DataLakeStore", "2015-10-01-preview", "account.json");
}

[Fact]
public static void DevTestLabs_2015_05_21_preview()
{
RunSwaggerTest("DevTestLabs", "2015-05-21-preview", "DTL.json");
}

[Fact]
public static void Dns_2015_05_04_preview()
{
RunSwaggerTest("DNS", "2015-05-04-preview", "dns.json");
}

[Fact]
public static void Dns_2016_04_01()
{
RunSwaggerTest("DNS", "2016-04-01", "dns.json");
}

[Fact]
public static void Network_2015_05_01_preview()
{
RunSwaggerTest("Network", "2015-05-01-preview", "network.json");
}

[Fact]
public static void Network_2015_06_15()
{
RunSwaggerTest("Network", "2015-06-15", "network.json");
}

[Fact]
public static void Network_2016_03_30()
{
RunSwaggerTest("BatchManagement.json", "Batch");
RunSwaggerTest("Network", "2016-03-30", "network.json");
}

[Fact]
public static void Cdn()
public static void Storage_2015_05_01_preview()
{
RunSwaggerTest("cdn.json", "CDN");
RunSwaggerTest("Storage", "2015-05-01-preview", "storage.json");
}

[Fact]
public static void Compute()
public static void Storage_2015_06_15()
{
RunSwaggerTest("compute.json", "Compute");
RunSwaggerTest("Storage", "2015-06-15", "storage.json");
}

[Fact]
public static void Network()
public static void Storage_2016_01_01()
{
RunSwaggerTest("network.json", "Network");
RunSwaggerTest("Storage", "2016-01-01", "storage.json");
}

[Fact]
public static void Web()
{
RunSwaggerTest("web.json", "Web");
RunSwaggerTest("Web", "2015-08-01", "web.json");
}

[Fact]
public static void WebYaml()
{
// same test as Web(), but converted to YAML
RunSwaggerTest("web.yaml", "Web");
RunSwaggerTest("Web", "2015-08-01", "web.yaml");
}

private static void RunSwaggerTest(string swaggerFileName, string expectedFolderName)
private static void RunSwaggerTest(string resourceType, string apiVersion, string swaggerFileName)
{
SwaggerSpecHelper.RunTests<AzureResourceSchemaCodeGenerator>(
Path.Combine("Swagger", swaggerFileName),
Path.Combine("Expected", expectedFolderName));
Path.Combine("Swagger", resourceType, apiVersion, swaggerFileName),
Path.Combine("Expected", resourceType, apiVersion));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -78,52 +78,124 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="Expected\Storage\Microsoft.Storage.json">
<Content Include="Expected\Storage\2015-05-01-preview\Microsoft.Storage.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Expected\Batch\Microsoft.Batch.json">
<Content Include="Expected\Batch\2015-12-01\Microsoft.Batch.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Expected\CDN\Microsoft.Cdn.json">
<Content Include="Expected\CDN\2016-04-02\Microsoft.Cdn.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Expected\Compute\Microsoft.Compute.json">
<Content Include="Expected\Compute\2016-03-30\Microsoft.Compute.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Expected\Network\Microsoft.Network.json">
<Content Include="Expected\Network\2016-03-30\Microsoft.Network.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Expected\Web\Microsoft.Web.json">
<Content Include="Expected\Web\2015-08-01\Microsoft.Web.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Expected\Web\Microsoft.DomainRegistration.json">
<Content Include="Expected\Web\2015-08-01\Microsoft.DomainRegistration.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Expected\Web\Microsoft.CertificateRegistration.json">
<Content Include="Expected\Web\2015-08-01\Microsoft.CertificateRegistration.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Expected\DNS\2016-04-01\Microsoft.Network.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Expected\DNS\2015-05-04-preview\Microsoft.Network.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Expected\CDN\2015-06-01\Microsoft.Cdn.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Expected\Storage\2015-06-15\Microsoft.Storage.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Expected\Storage\2016-01-01\Microsoft.Storage.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Expected\Compute\2015-06-15\Microsoft.Compute.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Expected\Network\2015-05-01-preview\Microsoft.Network.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Expected\Network\2015-06-15\Microsoft.Network.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Expected\CognitiveServices\2016-02-01-preview\Microsoft.CognitiveServices.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Expected\DataLakeAnalytics\2015-10-01-preview\Microsoft.DataLakeAnalytics.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Expected\DataLakeStore\2015-10-01-preview\Microsoft.DataLakeStore.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Expected\DevTestLabs\2015-05-21-preview\Microsoft.DevTestLabs.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<None Include="packages.config">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<Content Include="Swagger\storage.json">
<Content Include="Swagger\Storage\2015-05-01-preview\storage.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Swagger\Batch\2015-12-01\BatchManagement.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Swagger\CDN\2015-06-01\cdn.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Swagger\Compute\2016-03-30\compute.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Swagger\Network\2015-05-01-preview\network.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Swagger\Web\2015-08-01\web.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Swagger\DNS\2016-04-01\dns.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Swagger\DNS\2015-05-04-preview\dns.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Swagger\CDN\2016-04-02\cdn.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Swagger\Storage\2015-06-15\storage.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Swagger\Storage\2016-01-01\storage.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Swagger\Compute\2015-06-15\compute.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Swagger\Network\2015-06-15\network.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Swagger\BatchManagement.json">
<Content Include="Swagger\Network\2016-03-30\network.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Swagger\cdn.json">
<Content Include="Swagger\CognitiveServices\2016-02-01-preview\cognitiveservices.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Swagger\compute.json">
<Content Include="Swagger\DataLakeAnalytics\2015-10-01-preview\account.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Swagger\network.json">
<Content Include="Swagger\DataLakeStore\2015-10-01-preview\account.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Swagger\web.json">
<Content Include="Swagger\Web\2015-08-01\web.yaml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Swagger\web.yaml">
<Content Include="Swagger\DevTestLabs\2015-05-21-preview\DTL.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
Expand Down
Loading

0 comments on commit f980c82

Please sign in to comment.