File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
src/ProjectTemplates/test/Templates.Tests Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,30 @@ public async Task WebApiNativeAotTemplateProgramMainCSharp()
4444 await WebApiNativeAotTemplateCore ( languageOverride : null , args : new [ ] { ArgConstants . UseProgramMain } ) ;
4545 }
4646
47+ [ ConditionalTheory ]
48+ [ InlineData ( false ) ]
49+ [ InlineData ( true ) ]
50+ [ SkipOnHelix ( "https://github.com/dotnet/aspnetcore/issues/47478" , Queues = HelixConstants . NativeAotNotSupportedHelixQueues ) ]
51+ public async Task WebApiTemplateCSharp_WithoutOpenAPI ( bool useProgramMain )
52+ {
53+ var project = await FactoryFixture . CreateProject ( Output ) ;
54+
55+ var args = useProgramMain
56+ ? new [ ] { ArgConstants . UseProgramMain , ArgConstants . NoOpenApi }
57+ : new [ ] { ArgConstants . NoOpenApi } ;
58+
59+ await project . RunDotNetNewAsync ( "webapi" , args : args ) ;
60+
61+ await project . RunDotNetBuildAsync ( ) ;
62+
63+ using var aspNetProcess = project . StartBuiltProjectAsync ( ) ;
64+ Assert . False (
65+ aspNetProcess . Process . HasExited ,
66+ ErrorMessages . GetFailedProcessMessageOrEmpty ( "Run built project" , project , aspNetProcess . Process ) ) ;
67+
68+ await aspNetProcess . AssertNotFound ( "openapi/v1.json" ) ;
69+ }
70+
4771 private async Task WebApiNativeAotTemplateCore ( string languageOverride , string [ ] args = null )
4872 {
4973 var project = await ProjectFactory . CreateProject ( Output ) ;
You can’t perform that action at this time.
0 commit comments