@@ -29,7 +29,7 @@ public void Publish_MinimalApp_Works()
29
29
var testAppName = "BlazorWasmMinimal" ;
30
30
var testInstance = CreateAspNetSdkTestAsset ( testAppName ) ;
31
31
32
- var publishCommand = new PublishCommand ( Log , testInstance . TestRoot ) ;
32
+ var publishCommand = new PublishCommand ( testInstance ) ;
33
33
publishCommand . Execute ( ) . Should ( ) . Pass ( )
34
34
. And . NotHaveStdOutContaining ( "warning IL" ) ;
35
35
@@ -61,7 +61,7 @@ public void Publish_WithDefaultSettings_Works()
61
61
var testAppName = "BlazorWasmWithLibrary" ;
62
62
var testInstance = CreateAspNetSdkTestAsset ( testAppName ) ;
63
63
64
- var publishCommand = new PublishCommand ( Log , Path . Combine ( testInstance . TestRoot , "blazorwasm" ) ) ;
64
+ var publishCommand = new PublishCommand ( testInstance , "blazorwasm" ) ;
65
65
publishCommand . Execute ( ) . Should ( ) . Pass ( ) ;
66
66
67
67
var publishDirectory = publishCommand . GetOutputDirectory ( DefaultTfm ) ;
@@ -119,7 +119,7 @@ public void Publish_Works_WithLibraryUsingHintPath()
119
119
reference . Name = "Reference" ;
120
120
reference . Add ( new XElement (
121
121
"HintPath" ,
122
- Path . Combine ( ".." , "razorclasslibrary" , "bin " , "Debug " , DefaultTfm , "RazorClassLibrary.dll" ) ) ) ;
122
+ Path . Combine ( ".." , "razorclasslibrary" , "artifacts " , "bin " , "debug" , "RazorClassLibrary.dll" ) ) ) ;
123
123
}
124
124
} ) ;
125
125
@@ -128,7 +128,7 @@ public void Publish_Works_WithLibraryUsingHintPath()
128
128
buildLibraryCommand . Execute ( "/bl" )
129
129
. Should ( ) . Pass ( ) ;
130
130
131
- var publishCommand = new PublishCommand ( Log , Path . Combine ( testInstance . TestRoot , "blazorwasm" ) ) ;
131
+ var publishCommand = new PublishCommand ( testInstance , "blazorwasm" ) ;
132
132
publishCommand . WithWorkingDirectory ( testInstance . TestRoot ) ;
133
133
publishCommand . Execute ( "/bl" ) . Should ( ) . Pass ( ) ;
134
134
@@ -155,7 +155,7 @@ public void Publish_WithScopedCss_Works()
155
155
var testInstance = CreateAspNetSdkTestAsset ( testAppName ) ;
156
156
File . WriteAllText ( Path . Combine ( testInstance . TestRoot , "blazorwasm" , "App.razor.css" ) , "h1 { font-size: 16px; }" ) ;
157
157
158
- var publishCommand = new PublishCommand ( Log , Path . Combine ( testInstance . TestRoot , "blazorwasm" ) ) ;
158
+ var publishCommand = new PublishCommand ( testInstance , "blazorwasm" ) ;
159
159
publishCommand . Execute ( ) . Should ( ) . Pass ( ) ;
160
160
161
161
var publishDirectory = publishCommand . GetOutputDirectory ( DefaultTfm ) ;
@@ -197,7 +197,7 @@ public void Publish_InRelease_Works()
197
197
var testInstance = CreateAspNetSdkTestAsset ( testAppName ) ;
198
198
File . WriteAllText ( Path . Combine ( testInstance . TestRoot , "blazorwasm" , "App.razor.css" ) , "h1 { font-size: 16px; }" ) ;
199
199
200
- var publishCommand = new PublishCommand ( Log , Path . Combine ( testInstance . TestRoot , "blazorwasm" ) ) ;
200
+ var publishCommand = new PublishCommand ( testInstance , "blazorwasm" ) ;
201
201
publishCommand . Execute ( "/p:Configuration=Release" ) . Should ( ) . Pass ( ) ;
202
202
203
203
var publishDirectory = publishCommand . GetOutputDirectory ( DefaultTfm , "Release" ) ;
@@ -235,14 +235,14 @@ public void Publish_WithExistingWebConfig_Works()
235
235
var webConfigContents = "test webconfig contents" ;
236
236
File . WriteAllText ( Path . Combine ( testInstance . TestRoot , "blazorwasm" , "web.config" ) , webConfigContents ) ;
237
237
238
- var publishCommand = new PublishCommand ( Log , Path . Combine ( testInstance . TestRoot , "blazorwasm" ) ) ;
238
+ var publishCommand = new PublishCommand ( testInstance , "blazorwasm" ) ;
239
239
publishCommand . Execute ( "/p:Configuration=Release" ) . Should ( ) . Pass ( ) ;
240
240
241
- var publishDirectory = publishCommand . GetOutputDirectory ( DefaultTfm , "Release" ) ;
242
-
243
241
// Verify web.config
244
- new FileInfo ( Path . Combine ( publishDirectory . ToString ( ) , ".." , "web.config" ) ) . Should ( ) . Exist ( ) ;
245
- new FileInfo ( Path . Combine ( publishDirectory . ToString ( ) , ".." , "web.config" ) ) . Should ( ) . Contain ( webConfigContents ) ;
242
+ var outputDirectory = new BuildCommand ( testInstance , "blazorwasm" ) . GetOutputDirectory ( configuration : "Release" ) ;
243
+ var webConfig = outputDirectory . File ( "web.config" ) ;
244
+ webConfig . Should ( ) . Exist ( ) ;
245
+ webConfig . Should ( ) . Contain ( webConfigContents ) ;
246
246
}
247
247
248
248
[ Fact ]
@@ -256,7 +256,7 @@ public void Publish_WithNoBuild_Works()
256
256
buildCommand . Execute ( )
257
257
. Should ( ) . Pass ( ) ;
258
258
259
- var publishCommand = new PublishCommand ( Log , Path . Combine ( testInstance . TestRoot , "blazorwasm" ) ) ;
259
+ var publishCommand = new PublishCommand ( testInstance , "blazorwasm" ) ;
260
260
publishCommand . WithWorkingDirectory ( testInstance . TestRoot ) ;
261
261
publishCommand . Execute ( "/p:NoBuild=true" , "/bl" ) . Should ( ) . Pass ( ) ;
262
262
@@ -437,7 +437,7 @@ public void Publish_WithTrimmingdDisabled_Works()
437
437
438
438
} ) ;
439
439
440
- var publishCommand = new PublishCommand ( Log , Path . Combine ( testInstance . TestRoot , "blazorwasm" ) ) ;
440
+ var publishCommand = new PublishCommand ( testInstance , "blazorwasm" ) ;
441
441
publishCommand . Execute ( ) . Should ( ) . Pass ( ) ;
442
442
443
443
var publishDirectory = publishCommand . GetOutputDirectory ( DefaultTfm ) ;
@@ -510,7 +510,7 @@ public void Publish_SatelliteAssemblies_AreCopiedToBuildOutput()
510
510
}
511
511
} ) ;
512
512
513
- var publishCommand = new PublishCommand ( Log , Path . Combine ( testInstance . TestRoot , "blazorwasm" ) ) ;
513
+ var publishCommand = new PublishCommand ( testInstance , "blazorwasm" ) ;
514
514
publishCommand . Execute ( ) . Should ( ) . Pass ( ) ;
515
515
516
516
var publishDirectory = publishCommand . GetOutputDirectory ( DefaultTfm ) ;
@@ -536,7 +536,7 @@ public void Publish_HostedApp_DefaultSettings_Works()
536
536
var testAppName = "BlazorHosted" ;
537
537
var testInstance = CreateAspNetSdkTestAsset ( testAppName ) ;
538
538
539
- var publishCommand = new PublishCommand ( Log , Path . Combine ( testInstance . TestRoot , "blazorhosted" ) ) ;
539
+ var publishCommand = new PublishCommand ( testInstance , "blazorhosted" ) ;
540
540
publishCommand . WithWorkingDirectory ( testInstance . TestRoot ) ;
541
541
publishCommand . Execute ( "/bl" ) . Should ( ) . Pass ( ) ;
542
542
@@ -624,7 +624,7 @@ public void Publish_HostedApp_ProducesBootJsonDataWithExpectedContent()
624
624
File . WriteAllText ( Path . Combine ( wwwroot , "appsettings.json" ) , "Default settings" ) ;
625
625
File . WriteAllText ( Path . Combine ( wwwroot , "appsettings.development.json" ) , "Development settings" ) ;
626
626
627
- var publishCommand = new PublishCommand ( Log , Path . Combine ( testInstance . TestRoot , "blazorhosted" ) ) ;
627
+ var publishCommand = new PublishCommand ( testInstance , "blazorhosted" ) ;
628
628
publishCommand . Execute ( ) . Should ( ) . Pass ( ) ;
629
629
630
630
var buildOutputDirectory = publishCommand . GetOutputDirectory ( DefaultTfm ) . ToString ( ) ;
@@ -674,7 +674,7 @@ public void Publish_HostedApp_WithSatelliteAssemblies()
674
674
var resxfileInProject = Path . Combine ( testInstance . TestRoot , "blazorwasm" , "Resources.ja.resx.txt" ) ;
675
675
File . Move ( resxfileInProject , Path . Combine ( testInstance . TestRoot , "blazorwasm" , "Resource.ja.resx" ) ) ;
676
676
677
- var publishCommand = new PublishCommand ( Log , Path . Combine ( testInstance . TestRoot , "blazorhosted" ) ) ;
677
+ var publishCommand = new PublishCommand ( testInstance , "blazorhosted" ) ;
678
678
publishCommand . WithWorkingDirectory ( testInstance . TestRoot ) ;
679
679
publishCommand . Execute ( "/bl" ) . Should ( ) . Pass ( ) ;
680
680
@@ -805,7 +805,7 @@ public void Publish_HostedApp_WithNoBuild_Works()
805
805
var buildCommand = new BuildCommand ( testInstance , "blazorhosted" ) ;
806
806
buildCommand . Execute ( ) . Should ( ) . Pass ( ) ;
807
807
808
- var publishCommand = new PublishCommand ( Log , Path . Combine ( testInstance . TestRoot , "blazorhosted" ) ) ;
808
+ var publishCommand = new PublishCommand ( testInstance , "blazorhosted" ) ;
809
809
publishCommand . WithWorkingDirectory ( testInstance . TestRoot ) ;
810
810
publishCommand . Execute ( "/p:NoBuild=true" , "/bl" ) . Should ( ) . Pass ( ) ;
811
811
@@ -861,7 +861,7 @@ public void Publish_HostedApp_VisualStudio()
861
861
buildCommand . Execute ( "/p:BuildInsideVisualStudio=true" ) . Should ( ) . Pass ( ) ;
862
862
863
863
// Publish
864
- var publishCommand = new PublishCommand ( Log , Path . Combine ( testInstance . TestRoot , "blazorhosted" ) ) ;
864
+ var publishCommand = new PublishCommand ( testInstance , "blazorhosted" ) ;
865
865
publishCommand . Execute ( "/p:BuildProjectReferences=false /p:BuildInsideVisualStudio=true" ) . Should ( ) . Pass ( ) ;
866
866
867
867
var publishDirectory = publishCommand . GetOutputDirectory ( DefaultTfm ) ;
@@ -945,7 +945,7 @@ public void Publish_HostedAppWithScopedCss_VisualStudio()
945
945
buildCommand . Execute ( "/p:BuildInsideVisualStudio=true /p:Configuration=Release" ) . Should ( ) . Pass ( ) ;
946
946
947
947
// Publish
948
- var publishCommand = new PublishCommand ( Log , Path . Combine ( testInstance . TestRoot , "blazorhosted" ) ) ;
948
+ var publishCommand = new PublishCommand ( testInstance , "blazorhosted" ) ;
949
949
publishCommand . Execute ( "/p:BuildProjectReferences=false /p:BuildInsideVisualStudio=true" ) . Should ( ) . Pass ( ) ;
950
950
951
951
var publishDirectory = publishCommand . GetOutputDirectory ( DefaultTfm ) ;
@@ -1051,7 +1051,7 @@ public void Publish_HostedApp_VisualStudio_WithSatelliteAssemblies()
1051
1051
buildCommand . WithWorkingDirectory ( testInstance . TestRoot ) ;
1052
1052
buildCommand . Execute ( "/bl:build-msbuild.binlog" ) . Should ( ) . Pass ( ) ;
1053
1053
1054
- var publishCommand = new PublishCommand ( Log , Path . Combine ( testInstance . TestRoot , "blazorwasm" ) ) ;
1054
+ var publishCommand = new PublishCommand ( testInstance , "blazorwasm" ) ;
1055
1055
publishCommand . WithWorkingDirectory ( testInstance . TestRoot ) ;
1056
1056
publishCommand . Execute ( "/p:BuildProjectReferences=false" , "/bl:publish-msbuild.binlog" ) . Should ( ) . Pass ( ) ;
1057
1057
@@ -1080,7 +1080,7 @@ public void Publish_HostedApp_WithRidSpecifiedInCLI_Works()
1080
1080
var testAppName = "BlazorHostedRID" ;
1081
1081
var testInstance = CreateAspNetSdkTestAsset ( testAppName ) ;
1082
1082
1083
- var publishCommand = new PublishCommand ( Log , Path . Combine ( testInstance . TestRoot , "blazorhosted" ) ) ;
1083
+ var publishCommand = new PublishCommand ( testInstance , "blazorhosted" ) ;
1084
1084
publishCommand . WithWorkingDirectory ( testInstance . TestRoot ) ;
1085
1085
publishCommand . Execute ( "/p:RuntimeIdentifier=linux-x64" , "/bl" ) . Should ( ) . Pass ( ) ;
1086
1086
@@ -1094,7 +1094,7 @@ public void Publish_HostedApp_WithRid_Works()
1094
1094
var testAppName = "BlazorHostedRID" ;
1095
1095
var testInstance = CreateAspNetSdkTestAsset ( testAppName ) ;
1096
1096
1097
- var publishCommand = new PublishCommand ( Log , Path . Combine ( testInstance . TestRoot , "blazorhosted" ) ) ;
1097
+ var publishCommand = new PublishCommand ( testInstance , "blazorhosted" ) ;
1098
1098
publishCommand . WithWorkingDirectory ( testInstance . TestRoot ) ;
1099
1099
publishCommand . Execute ( "/bl" ) . Should ( ) . Pass ( ) ;
1100
1100
@@ -1196,7 +1196,7 @@ public void Publish_WithInvariantGlobalizationEnabled_DoesNotCopyGlobalizationDa
1196
1196
project . Root . Add ( itemGroup ) ;
1197
1197
} ) ;
1198
1198
1199
- var publishCommand = new PublishCommand ( Log , testInstance . TestRoot ) ;
1199
+ var publishCommand = new PublishCommand ( testInstance ) ;
1200
1200
publishCommand . Execute ( ) . Should ( ) . Pass ( ) ;
1201
1201
1202
1202
var publishOutputDirectory = publishCommand . GetOutputDirectory ( DefaultTfm ) . ToString ( ) ;
@@ -1227,7 +1227,7 @@ public void Publish_HostingMultipleBlazorWebApps_Works()
1227
1227
var testAppName = "BlazorMultiApp" ;
1228
1228
var testInstance = CreateAspNetSdkTestAsset ( testAppName ) ;
1229
1229
1230
- var publishCommand = new PublishCommand ( Log , Path . Combine ( testInstance . TestRoot , "BlazorMultipleApps.Server" ) ) ;
1230
+ var publishCommand = new PublishCommand ( testInstance , "BlazorMultipleApps.Server" ) ;
1231
1231
publishCommand . Execute ( ) . Should ( ) . Pass ( ) ;
1232
1232
1233
1233
var publishOutputDirectory = publishCommand . GetOutputDirectory ( DefaultTfm ) . ToString ( ) ;
0 commit comments