@@ -55,8 +55,7 @@ private async Task MvcTemplateCore(string languageOverride, string[] args = null
55
55
{
56
56
var project = await ProjectFactory . CreateProject ( Output ) ;
57
57
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 ) ;
60
59
61
60
var noHttps = args ? . Contains ( ArgConstants . NoHttps ) ?? false ;
62
61
var expectedLaunchProfileNames = noHttps
@@ -78,15 +77,13 @@ private async Task MvcTemplateCore(string languageOverride, string[] args = null
78
77
return ;
79
78
}
80
79
81
- var publishResult = await project . RunDotNetPublishAsync ( ) ;
82
- Assert . True ( 0 == publishResult . ExitCode , ErrorMessages . GetFailedProcessMessage ( "publish" , project , publishResult ) ) ;
80
+ await project . RunDotNetPublishAsync ( ) ;
83
81
84
82
// Run dotnet build after publish. The reason is that one uses Config = Debug and the other uses Config = Release
85
83
// The output from publish will go into bin/Release/netcoreappX.Y/publish and won't be affected by calling build
86
84
// later, while the opposite is not true.
87
85
88
- var buildResult = await project . RunDotNetBuildAsync ( ) ;
89
- Assert . True ( 0 == buildResult . ExitCode , ErrorMessages . GetFailedProcessMessage ( "build" , project , buildResult ) ) ;
86
+ await project . RunDotNetBuildAsync ( ) ;
90
87
91
88
IEnumerable < string > menuLinks = new List < string > {
92
89
PageUrls . HomeUrl ,
@@ -157,8 +154,7 @@ private async Task MvcTemplate_IndividualAuth_Core(bool useLocalDB, bool useProg
157
154
: noHttps
158
155
? new [ ] { ArgConstants . NoHttps }
159
156
: 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 ) ;
162
158
163
159
var expectedLaunchProfileNames = noHttps
164
160
? new [ ] { "http" , "IIS Express" }
@@ -171,18 +167,15 @@ private async Task MvcTemplate_IndividualAuth_Core(bool useLocalDB, bool useProg
171
167
Assert . Contains ( ".db" , projectFileContents ) ;
172
168
}
173
169
174
- var publishResult = await project . RunDotNetPublishAsync ( ) ;
175
- Assert . True ( 0 == publishResult . ExitCode , ErrorMessages . GetFailedProcessMessage ( "publish" , project , publishResult ) ) ;
170
+ await project . RunDotNetPublishAsync ( ) ;
176
171
177
172
// Run dotnet build after publish. The reason is that one uses Config = Debug and the other uses Config = Release
178
173
// The output from publish will go into bin/Release/netcoreappX.Y/publish and won't be affected by calling build
179
174
// later, while the opposite is not true.
180
175
181
- var buildResult = await project . RunDotNetBuildAsync ( ) ;
182
- Assert . True ( 0 == buildResult . ExitCode , ErrorMessages . GetFailedProcessMessage ( "build" , project , buildResult ) ) ;
176
+ await project . RunDotNetBuildAsync ( ) ;
183
177
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" ) ;
186
179
project . AssertEmptyMigration ( "mvc" ) ;
187
180
188
181
// Note: if any links are updated here, RazorPagesTemplateTest.cs should be updated as well
@@ -284,11 +277,9 @@ public async Task MvcTemplate_SingleFileExe()
284
277
var project = await ProjectFactory . CreateProject ( Output ) ;
285
278
project . RuntimeIdentifier = runtimeIdentifer ;
286
279
287
- var createResult = await project . RunDotNetNewAsync ( "mvc" ) ;
288
- Assert . True ( 0 == createResult . ExitCode , ErrorMessages . GetFailedProcessMessage ( "create/restore" , project , createResult ) ) ;
280
+ await project . RunDotNetNewAsync ( "mvc" ) ;
289
281
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 ) ;
292
283
293
284
var menuLinks = new [ ]
294
285
{
@@ -361,20 +352,17 @@ private async Task<Project> MvcTemplateBuildsAndPublishes(string auth, string[]
361
352
{
362
353
var project = await ProjectFactory . CreateProject ( Output ) ;
363
354
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 ) ;
366
356
367
357
// Identity Web auth requires https and thus ignores the --no-https option if passed so there should never be an 'http' profile
368
358
var expectedLaunchProfileNames = new [ ] { "https" , "IIS Express" } ;
369
359
await project . VerifyLaunchSettings ( expectedLaunchProfileNames ) ;
370
360
371
361
// 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 ( ) ;
374
363
375
364
// 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 ( ) ;
378
366
379
367
return project ;
380
368
}
0 commit comments