Skip to content

Commit

Permalink
Add ability to seperate acceptance tests for AzureResourceSchema gene…
Browse files Browse the repository at this point in the history
…rator by resource provider and api version
  • Loading branch information
Dan Schulte committed May 25, 2016
1 parent 4652810 commit 19a6cc5
Show file tree
Hide file tree
Showing 20 changed files with 2,153 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,50 +14,56 @@ public static class AcceptanceTests
[Fact]
public static void Storage()
{
RunSwaggerTest("storage.json", "Storage");
RunSwaggerTest("Storage", "2016-01-01", "storage.json");
}

[Fact]
public static void Batch()
{
RunSwaggerTest("BatchManagement.json", "Batch");
RunSwaggerTest("Batch", "2015-12-01", "BatchManagement.json");
}

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

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

[Fact]
public static void Dns()
public static void Dns_2015_05_04_preview()
{
RunSwaggerTest("dns.json", "DNS");
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()
{
RunSwaggerTest("network.json", "Network");
RunSwaggerTest("Network", "2016-03-30", "network.json");
}

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

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,55 +78,61 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="Expected\Storage\Microsoft.Storage.json">
<Content Include="Expected\Storage\2016-01-01\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\Microsoft.Network.json">
<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>
<None Include="packages.config">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<Content Include="Swagger\storage.json">
<Content Include="Swagger\Storage\2016-01-01\storage.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Swagger\Batch\2015-12-01\BatchManagement.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Swagger\BatchManagement.json">
<Content Include="Swagger\CDN\2016-04-02\cdn.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Swagger\cdn.json">
<Content Include="Swagger\Compute\2016-03-30\compute.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Swagger\compute.json">
<Content Include="Swagger\Network\2016-03-30\network.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Swagger\network.json">
<Content Include="Swagger\Web\2015-08-01\web.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Swagger\web.json">
<Content Include="Swagger\DNS\2016-04-01\dns.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Swagger\dns.json">
<Content Include="Swagger\DNS\2015-05-04-preview\dns.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
Expand Down
Loading

0 comments on commit 19a6cc5

Please sign in to comment.