@@ -55,8 +55,7 @@ private async Task MvcTemplateCore(string languageOverride, string[] args = null
5555 {
5656 var project = await ProjectFactory . CreateProject ( Output ) ;
5757
58- var createResult = await project . RunDotNetNewAsync ( "mvc" , language : languageOverride , args : args ) ;
59- Assert . True ( 0 == createResult . ExitCode , ErrorMessages . GetFailedProcessMessage ( "create/restore" , project , createResult ) ) ;
58+ await project . RunDotNetNewAsync ( "mvc" , language : languageOverride , args : args ) ;
6059
6160 var noHttps = args ? . Contains ( ArgConstants . NoHttps ) ?? false ;
6261 var expectedLaunchProfileNames = noHttps
@@ -78,15 +77,13 @@ private async Task MvcTemplateCore(string languageOverride, string[] args = null
7877 return ;
7978 }
8079
81- var publishResult = await project . RunDotNetPublishAsync ( ) ;
82- Assert . True ( 0 == publishResult . ExitCode , ErrorMessages . GetFailedProcessMessage ( "publish" , project , publishResult ) ) ;
80+ await project . RunDotNetPublishAsync ( ) ;
8381
8482 // Run dotnet build after publish. The reason is that one uses Config = Debug and the other uses Config = Release
8583 // The output from publish will go into bin/Release/netcoreappX.Y/publish and won't be affected by calling build
8684 // later, while the opposite is not true.
8785
88- var buildResult = await project . RunDotNetBuildAsync ( ) ;
89- Assert . True ( 0 == buildResult . ExitCode , ErrorMessages . GetFailedProcessMessage ( "build" , project , buildResult ) ) ;
86+ await project . RunDotNetBuildAsync ( ) ;
9087
9188 IEnumerable < string > menuLinks = new List < string > {
9289 PageUrls . HomeUrl ,
@@ -157,8 +154,7 @@ private async Task MvcTemplate_IndividualAuth_Core(bool useLocalDB, bool useProg
157154 : noHttps
158155 ? new [ ] { ArgConstants . NoHttps }
159156 : null ;
160- var createResult = await project . RunDotNetNewAsync ( "mvc" , auth : "Individual" , useLocalDB : useLocalDB , args : args ) ;
161- Assert . True ( 0 == createResult . ExitCode , ErrorMessages . GetFailedProcessMessage ( "create/restore" , project , createResult ) ) ;
157+ await project . RunDotNetNewAsync ( "mvc" , auth : "Individual" , useLocalDB : useLocalDB , args : args ) ;
162158
163159 var expectedLaunchProfileNames = noHttps
164160 ? new [ ] { "http" , "IIS Express" }
@@ -171,18 +167,15 @@ private async Task MvcTemplate_IndividualAuth_Core(bool useLocalDB, bool useProg
171167 Assert . Contains ( ".db" , projectFileContents ) ;
172168 }
173169
174- var publishResult = await project . RunDotNetPublishAsync ( ) ;
175- Assert . True ( 0 == publishResult . ExitCode , ErrorMessages . GetFailedProcessMessage ( "publish" , project , publishResult ) ) ;
170+ await project . RunDotNetPublishAsync ( ) ;
176171
177172 // Run dotnet build after publish. The reason is that one uses Config = Debug and the other uses Config = Release
178173 // The output from publish will go into bin/Release/netcoreappX.Y/publish and won't be affected by calling build
179174 // later, while the opposite is not true.
180175
181- var buildResult = await project . RunDotNetBuildAsync ( ) ;
182- Assert . True ( 0 == buildResult . ExitCode , ErrorMessages . GetFailedProcessMessage ( "build" , project , buildResult ) ) ;
176+ await project . RunDotNetBuildAsync ( ) ;
183177
184- var migrationsResult = await project . RunDotNetEfCreateMigrationAsync ( "mvc" ) ;
185- Assert . True ( 0 == migrationsResult . ExitCode , ErrorMessages . GetFailedProcessMessage ( "run EF migrations" , project , migrationsResult ) ) ;
178+ await project . RunDotNetEfCreateMigrationAsync ( "mvc" ) ;
186179 project . AssertEmptyMigration ( "mvc" ) ;
187180
188181 // Note: if any links are updated here, RazorPagesTemplateTest.cs should be updated as well
@@ -284,11 +277,9 @@ public async Task MvcTemplate_SingleFileExe()
284277 var project = await ProjectFactory . CreateProject ( Output ) ;
285278 project . RuntimeIdentifier = runtimeIdentifer ;
286279
287- var createResult = await project . RunDotNetNewAsync ( "mvc" ) ;
288- Assert . True ( 0 == createResult . ExitCode , ErrorMessages . GetFailedProcessMessage ( "create/restore" , project , createResult ) ) ;
280+ await project . RunDotNetNewAsync ( "mvc" ) ;
289281
290- var publishResult = await project . RunDotNetPublishAsync ( additionalArgs : $ "/p:PublishSingleFile=true -r { runtimeIdentifer } --self-contained", noRestore : false ) ;
291- Assert . True ( 0 == publishResult . ExitCode , ErrorMessages . GetFailedProcessMessage ( "publish" , project , publishResult ) ) ;
282+ await project . RunDotNetPublishAsync ( additionalArgs : $ "/p:PublishSingleFile=true -r { runtimeIdentifer } --self-contained", noRestore : false ) ;
292283
293284 var menuLinks = new [ ]
294285 {
@@ -361,20 +352,17 @@ private async Task<Project> MvcTemplateBuildsAndPublishes(string auth, string[]
361352 {
362353 var project = await ProjectFactory . CreateProject ( Output ) ;
363354
364- var createResult = await project . RunDotNetNewAsync ( "mvc" , auth : auth , args : args ) ;
365- Assert . True ( 0 == createResult . ExitCode , ErrorMessages . GetFailedProcessMessage ( "create/restore" , project , createResult ) ) ;
355+ await project . RunDotNetNewAsync ( "mvc" , auth : auth , args : args ) ;
366356
367357 // Identity Web auth requires https and thus ignores the --no-https option if passed so there should never be an 'http' profile
368358 var expectedLaunchProfileNames = new [ ] { "https" , "IIS Express" } ;
369359 await project . VerifyLaunchSettings ( expectedLaunchProfileNames ) ;
370360
371361 // Verify building in debug works
372- var buildResult = await project . RunDotNetBuildAsync ( ) ;
373- Assert . True ( 0 == buildResult . ExitCode , ErrorMessages . GetFailedProcessMessage ( "build" , project , buildResult ) ) ;
362+ await project . RunDotNetBuildAsync ( ) ;
374363
375364 // Publish builds in "release" configuration. Running publish should ensure we can compile in release and that we can publish without issues.
376- buildResult = await project . RunDotNetPublishAsync ( ) ;
377- Assert . True ( 0 == buildResult . ExitCode , ErrorMessages . GetFailedProcessMessage ( "publish" , project , buildResult ) ) ;
365+ await project . RunDotNetPublishAsync ( ) ;
378366
379367 return project ;
380368 }
0 commit comments