Skip to content

Commit

Permalink
Add AzureResourceSchema Microsoft.Resources test (Azure#1134)
Browse files Browse the repository at this point in the history
* Add AzureResourceSchema Microsoft.Resources test

* Add AzureResourceSchema Microsoft.Scheduler test

* Add AzureResourceSchema Microsoft.Logic test and remove 'Possible values' from descriptions

* Add AzureResourceSchema MachineLearning test. Add minimum and maximum to JsonSchema. Fix SequenceType bug

* Add AzureResourceSchema PowerBIEmbedded test

* Add Redis generated schema

* Add Microsoft.Search test

* Add TrafficManager schema

* Fix analysis errors

* Add Microsoft.Logic.json expected test file

* Update Microsoft.MachineLearning 2016-05-01-preview tests

* Add discriminator support to AzureResourceSchema generator

* Add discriminator property to generated schema definitions

* Fix the AzureResourceSchema generator by moving child resources property to be inside the first level properties property
  • Loading branch information
Dan Schulte authored and tbombach committed Jun 17, 2016
1 parent 5dfea14 commit f1df2ab
Show file tree
Hide file tree
Showing 42 changed files with 14,535 additions and 1,135 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="AcceptanceTests.cs" />
<Compile Include="AzureResourceSchemaAcceptanceTests.cs" />
<Compile Include="AzureResourceSchemaCodeGeneratorTests.cs" />
<Compile Include="JSONSchemaTests.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
Expand Down Expand Up @@ -138,6 +138,30 @@
<Content Include="Expected\DevTestLabs\2015-05-21-preview\Microsoft.DevTestLabs.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Expected\Resources\2016-02-01\Microsoft.Resources.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Expected\Scheduler\2016-03-01\Microsoft.Scheduler.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Expected\Logic\2015-02-01-preview\Microsoft.Logic.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Expected\MachineLearning\2016-05-01-preview\Microsoft.MachineLearning.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Expected\PowerBIEmbedded\2016-01-29\Microsoft.PowerBI.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Expected\Redis\2016-04-01\Microsoft.Cache.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Expected\Search\2015-02-28\Microsoft.Search.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Expected\TrafficManager\2015-11-01\Microsoft.Network.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<None Include="packages.config">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
Expand Down Expand Up @@ -198,6 +222,30 @@
<Content Include="Swagger\DevTestLabs\2015-05-21-preview\DTL.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Swagger\Resources\2016-02-01\resources.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Swagger\Scheduler\2016-03-01\scheduler.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Swagger\Logic\2015-02-01-preview\logic.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Swagger\MachineLearning\2016-05-01-preview\webservices.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Swagger\PowerBIEmbedded\2016-01-29\powerbiembedded.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Swagger\Redis\2016-04-01\redis.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Swagger\Search\2015-02-28\search.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Swagger\TrafficManager\2015-11-01\trafficmanager.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 @@ -9,7 +9,7 @@
namespace AutoRest.Generator.AzureResourceSchema.Tests
{
[Collection("AutoRest Azure Resource Schema Tests")]
public static class AcceptanceTests
public static class AzureResourceSchemaAcceptanceTests
{
[Fact]
public static void Batch()
Expand Down Expand Up @@ -77,6 +77,18 @@ public static void Dns_2016_04_01()
RunSwaggerTest("DNS", "2016-04-01", "dns.json");
}

[Fact]
public static void Logic_2015_02_01_preview()
{
RunSwaggerTest("Logic", "2015-02-01-preview", "logic.json");
}

[Fact]
public static void MachineLearning_2016_05_01_preview()
{
RunSwaggerTest("MachineLearning", "2016-05-01-preview", "webservices.json");
}

[Fact]
public static void Network_2015_05_01_preview()
{
Expand All @@ -95,6 +107,36 @@ public static void Network_2016_03_30()
RunSwaggerTest("Network", "2016-03-30", "network.json");
}

[Fact]
public static void PowerBIEmbedded_2016_01_29()
{
RunSwaggerTest("PowerBIEmbedded", "2016-01-29", "powerbiembedded.json");
}

[Fact]
public static void Redis_2016_04_01()
{
RunSwaggerTest("Redis", "2016-04-01", "redis.json");
}

[Fact]
public static void Resources_2016_02_01()
{
RunSwaggerTest("Resources", "2016-02-01", "resources.json");
}

[Fact]
public static void Scheduler_2016_03_01()
{
RunSwaggerTest("Scheduler", "2016-03-01", "scheduler.json");
}

[Fact]
public static void Search_2015_02_28()
{
RunSwaggerTest("Search", "2015-02-28", "search.json");
}

[Fact]
public static void Storage_2015_05_01_preview()
{
Expand All @@ -113,6 +155,12 @@ public static void Storage_2016_01_01()
RunSwaggerTest("Storage", "2016-01-01", "storage.json");
}

[Fact]
public static void TrafficManager_2015_11_01()
{
RunSwaggerTest("TrafficManager", "2015-11-01", "trafficmanager.json");
}

[Fact]
public static void Web()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,16 @@
}
],
"description": "The properties of the account."
}
},
"resources": {
"type": "array",
"items": {
"oneOf": [
{
"$ref": "#/definitions/batchAccounts_applications_childResource"
}
]
},
"resources": {
"type": "array",
"items": {
"oneOf": [
{
"$ref": "#/definitions/batchAccounts_applications_childResource"
}
]
}
}
},
"required": [
Expand Down Expand Up @@ -95,16 +95,16 @@
"displayName": {
"type": "string",
"description": "The display name for the application."
}
},
"resources": {
"type": "array",
"items": {
"oneOf": [
{
"$ref": "#/definitions/batchAccounts_applications_versions_childResource"
}
]
},
"resources": {
"type": "array",
"items": {
"oneOf": [
{
"$ref": "#/definitions/batchAccounts_applications_versions_childResource"
}
]
}
}
},
"required": [
Expand Down Expand Up @@ -196,16 +196,16 @@
"displayName": {
"type": "string",
"description": "The display name for the application."
}
},
"resources": {
"type": "array",
"items": {
"oneOf": [
{
"$ref": "#/definitions/batchAccounts_applications_versions_childResource"
}
]
},
"resources": {
"type": "array",
"items": {
"oneOf": [
{
"$ref": "#/definitions/batchAccounts_applications_versions_childResource"
}
]
}
}
},
"required": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,16 @@
"$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
}
]
}
},
"resources": {
"type": "array",
"items": {
"oneOf": [
{
"$ref": "#/definitions/profiles_endpoints_childResource"
}
]
},
"resources": {
"type": "array",
"items": {
"oneOf": [
{
"$ref": "#/definitions/profiles_endpoints_childResource"
}
]
}
}
},
"required": [
Expand Down Expand Up @@ -108,19 +108,19 @@
"$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
}
]
}
},
"resources": {
"type": "array",
"items": {
"oneOf": [
{
"$ref": "#/definitions/profiles_endpoints_customDomains_childResource"
},
{
"$ref": "#/definitions/profiles_endpoints_origins_childResource"
}
]
},
"resources": {
"type": "array",
"items": {
"oneOf": [
{
"$ref": "#/definitions/profiles_endpoints_customDomains_childResource"
},
{
"$ref": "#/definitions/profiles_endpoints_origins_childResource"
}
]
}
}
},
"required": [
Expand Down Expand Up @@ -342,7 +342,7 @@
"$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
}
],
"description": "Defines the query string caching behavior. Possible values include: 'IgnoreQueryString', 'BypassCaching', 'UseQueryString', 'NotSet'"
"description": "Defines the query string caching behavior."
},
"origins": {
"oneOf": [
Expand Down Expand Up @@ -458,19 +458,19 @@
"$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
}
]
}
},
"resources": {
"type": "array",
"items": {
"oneOf": [
{
"$ref": "#/definitions/profiles_endpoints_customDomains_childResource"
},
{
"$ref": "#/definitions/profiles_endpoints_origins_childResource"
}
]
},
"resources": {
"type": "array",
"items": {
"oneOf": [
{
"$ref": "#/definitions/profiles_endpoints_customDomains_childResource"
},
{
"$ref": "#/definitions/profiles_endpoints_origins_childResource"
}
]
}
}
},
"required": [
Expand Down Expand Up @@ -563,7 +563,7 @@
"$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
}
],
"description": "Name of the pricing tier. Possible values include: 'Standard', 'Premium'"
"description": "Name of the pricing tier."
}
},
"description": "The SKU (pricing tier) of the CDN profile."
Expand Down
Loading

0 comments on commit f1df2ab

Please sign in to comment.