Skip to content

Commit

Permalink
AzureResourceSchemaCodeGenerator shows up in AutoRest help and tests …
Browse files Browse the repository at this point in the history
…pass
  • Loading branch information
Dan Schulte committed Apr 6, 2016
1 parent 7bfc5c2 commit a8c0328
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 38 deletions.
2 changes: 1 addition & 1 deletion AutoRest/AutoRest/AutoRest.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"type": "AzurePythonCodeGenerator, AutoRest.Generator.Azure.Python"
},
"AzureResourceSchema": {
"type": "AzureResourceSchema, AutoRest.Generator.AzureResourceSchema"
"type": "AzureResourceSchemaCodeGenerator, AutoRest.Generator.AzureResourceSchema"
}
},
"modelers": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,53 +13,44 @@ public class AzureResourceSchemaCodeGeneratorTests
[Fact]
public void DescriptionThrowsException()
{
Settings settings = new Settings();
AzureResourceSchemaCodeGenerator codeGen = new AzureResourceSchemaCodeGenerator(settings);
Assert.Throws<NotImplementedException>(() => { string value = codeGen.Description; });
Assert.Equal("Azure Resource Schema generator", CreateGenerator().Description);
}

[Fact]
public void ImplementationFileExtensionThrowsException()
{
Settings settings = new Settings();
AzureResourceSchemaCodeGenerator codeGen = new AzureResourceSchemaCodeGenerator(settings);
Assert.Throws<NotImplementedException>(() => { string value = codeGen.ImplementationFileExtension; });
Assert.Equal(".json", CreateGenerator().ImplementationFileExtension);
}

[Fact]
public void NameThrowsException()
{
Settings settings = new Settings();
AzureResourceSchemaCodeGenerator codeGen = new AzureResourceSchemaCodeGenerator(settings);
Assert.Throws<NotImplementedException>(() => { string value = codeGen.Name; });
Assert.Equal("AzureResourceSchema", CreateGenerator().Name);
}

[Fact]
public void UsageInstructionsThrowsException()
{
Settings settings = new Settings();
AzureResourceSchemaCodeGenerator codeGen = new AzureResourceSchemaCodeGenerator(settings);
Assert.Throws<NotImplementedException>(() => { string value = codeGen.UsageInstructions; });
Assert.Equal("MOCK USAGE INSTRUCTIONS", CreateGenerator().UsageInstructions);
}

[Fact]
public void GenerateThrowsException()
{
Settings settings = new Settings();
AzureResourceSchemaCodeGenerator codeGen = new AzureResourceSchemaCodeGenerator(settings);

ServiceClient serviceClient = new ServiceClient();
Assert.Throws<NotImplementedException>(() => { codeGen.Generate(serviceClient); });
Assert.Throws<NotImplementedException>(() => { CreateGenerator().Generate(serviceClient); });
}

[Fact]
public void NormalizeClientModelThrowsException()
{
Settings settings = new Settings();
AzureResourceSchemaCodeGenerator codeGen = new AzureResourceSchemaCodeGenerator(settings);

ServiceClient serviceClient = new ServiceClient();
Assert.Throws<NotImplementedException>(() => { codeGen.NormalizeClientModel(serviceClient); });
Assert.Throws<NotImplementedException>(() => { CreateGenerator().NormalizeClientModel(serviceClient); });
}

private static AzureResourceSchemaCodeGenerator CreateGenerator()
{
return new AzureResourceSchemaCodeGenerator(new Settings());
}
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.

using Microsoft.Rest.Generator.ClientModel;
using System;
using System.Threading.Tasks;
using Microsoft.Rest.Generator.ClientModel;

namespace Microsoft.Rest.Generator.AzureResourceSchema
{
Expand All @@ -16,34 +16,22 @@ public AzureResourceSchemaCodeGenerator(Settings settings)

public override string Description
{
get
{
throw new NotImplementedException();
}
get { return "Azure Resource Schema generator"; }
}

public override string ImplementationFileExtension
{
get
{
throw new NotImplementedException();
}
get { return ".json"; }
}

public override string Name
{
get
{
throw new NotImplementedException();
}
get { return "AzureResourceSchema"; }
}

public override string UsageInstructions
{
get
{
return "MOCK USAGE INSTRUCTIONS";
}
get { return "MOCK USAGE INSTRUCTIONS"; }
}

public override Task Generate(ServiceClient serviceClient)
Expand Down

0 comments on commit a8c0328

Please sign in to comment.