@@ -247,7 +247,6 @@ void SetupWorkloadSetInGlobalJson(out WorkloadSet originalRollback)
247
247
result . StdErr . Should ( ) . Contain ( versionToUpdateTo ) ;
248
248
249
249
AddNuGetSource ( @"C:\SdkTesting\workloadsets" , SdkTestingDirectory ) ;
250
-
251
250
}
252
251
253
252
[ Fact ]
@@ -294,6 +293,52 @@ public void InstallWithVersionAndSkipManifestUpdate()
294
293
. And . HaveStdErrContaining ( "--sdk-version" ) ;
295
294
}
296
295
296
+ [ Fact ]
297
+ public void InstallWithVersionWhenPinned ( )
298
+ {
299
+ InstallSdk ( ) ;
300
+
301
+ AddNuGetSource ( @"c:\SdkTesting\WorkloadSets" ) ;
302
+
303
+ string originalVersion = GetWorkloadVersion ( ) ;
304
+ originalVersion . Should ( ) . NotBe ( "8.0.300-preview.0.24178.1" ) ;
305
+
306
+ VM . CreateRunCommand ( "dotnet" , "workload" , "update" , "--version" , "8.0.300-preview.0.24178.1" )
307
+ . Execute ( ) . Should ( ) . Pass ( ) ;
308
+
309
+ GetWorkloadVersion ( ) . Should ( ) . Be ( "8.0.300-preview.0.24178.1" ) ;
310
+
311
+ VM . CreateRunCommand ( "dotnet" , "workload" , "install" , "aspire" , "--version" , "8.0.300-preview.0.24217.2" )
312
+ . Execute ( ) . Should ( ) . Pass ( ) ;
313
+
314
+ GetWorkloadVersion ( ) . Should ( ) . Be ( "8.0.300-preview.0.24217.2" ) ;
315
+ }
316
+
317
+ [ Fact ]
318
+ public void InstallWithGlobalJsonWhenPinned ( )
319
+ {
320
+ SetupWorkloadSetInGlobalJson ( out var originalRollback ) ;
321
+
322
+ //AddNuGetSource(@"c:\SdkTesting\WorkloadSets");
323
+
324
+ string originalVersion = GetWorkloadVersion ( ) ;
325
+ originalVersion . Should ( ) . NotBe ( "8.0.300-preview.0.24178.1" ) ;
326
+
327
+ VM . CreateRunCommand ( "dotnet" , "workload" , "update" , "--version" , "8.0.300-preview.0.24178.1" )
328
+ . Execute ( ) . Should ( ) . Pass ( ) ;
329
+
330
+ GetWorkloadVersion ( ) . Should ( ) . Be ( "8.0.300-preview.0.24178.1" ) ;
331
+
332
+ VM . CreateRunCommand ( "dotnet" , "workload" , "install" , "aspire" )
333
+ . WithWorkingDirectory ( SdkTestingDirectory )
334
+ . Execute ( ) . Should ( ) . Pass ( ) ;
335
+
336
+ GetWorkloadVersion ( SdkTestingDirectory ) . Should ( ) . Be ( "8.0.300-preview.0.24217.2" ) ;
337
+
338
+ GetRollback ( SdkTestingDirectory ) . Should ( ) . NotBe ( originalRollback ) ;
339
+
340
+ }
341
+
297
342
[ Fact ]
298
343
public void UpdateShouldNotPinWorkloadSet ( )
299
344
{
0 commit comments