-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Web api contract first as abstract controllers #1
Web api contract first as abstract controllers #1
Conversation
…from ControllerTemplate
…nd GenerateAbstractController setting is added + created new test classes
…faces and GenerateAbstractController setting is added
var code = codeGen.GenerateFile(); | ||
|
||
//// Assert | ||
Assert.IsTrue(code.Contains("abstract class TestController")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be Assert.IsFalse(code.Contains("abstract class TestController"));
//// Act | ||
var codeGen = new SwaggerToCSharpClientGenerator(document, new SwaggerToCSharpClientGeneratorSettings | ||
{ | ||
GenerateControllerInterfaces = true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since you are testing only the abstract controller setting here I would keep GenerateControllerInterfaces = false
|
||
//// Assert | ||
Assert.IsTrue(code.Contains("abstract class TestController")); | ||
Assert.IsTrue(code.Contains("abstract Foo")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one also should be false
<# if (Model.WrapResponses){#> | ||
var result = await _implementation.<#=operation.ActualOperationName#>Async(<#foreach(var parameter in operation.Parameters){#><#=parameter.VariableName#><#if(!parameter.IsLast){#>, <#}}#>); | ||
var result = await _implementation.<#=operation.ActualOperationName#>Async(<#foreach(var parameter in operation.Parameters){#><#=parameter.VariableName#><# if(!parameter.IsLast){#>, <#}}#>); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can probably revert formatting changes on this line and on lines 48 and 55 as well
…are deleted. ControllerGenerationFormat parameter is added. (default:partial)Test classes are deleted and new test class is added.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
WrapResponses bugfix - using System.Net.Http carried on FileTemplate
New futures added GenerateControllerInterfaces and GenerateAbstractController in SwaggerToCSharpControllerCommand and SwaggerToCSharpController