@@ -442,6 +442,74 @@ private void PerfomrCollectionTestHelper(
442
442
Assert . True ( trackingIds . Any ( t => t . TrackingId == trackingId ) , "The actual result does not match the expected." ) ;
443
443
}
444
444
445
+ [ Fact ]
446
+ public void SetCollectionAdConfigTest ( )
447
+ {
448
+ SetAzureRemoteAppCollection mockCmdlet = SetUpTestCommon < SetAzureRemoteAppCollection > ( ) ;
449
+ string collectionName = "mycol" ;
450
+ System . Security . SecureString password = new System . Security . SecureString ( ) ;
451
+ string expectedTrackingId = "2432145" ;
452
+ CollectionUpdateDetails requestData = null ;
453
+ string userName = @"Administrator@MyDomain" ;
454
+ Collection expectedCollection = null ;
455
+
456
+ // Required parameters for this test
457
+ mockCmdlet . CollectionName = collectionName ;
458
+ password . AppendChar ( 'p' ) ;
459
+ mockCmdlet . Credential = new PSCredential ( userName , password ) ;
460
+ requestData = new CollectionUpdateDetails ( )
461
+ {
462
+ AdInfo = new ActiveDirectoryConfig ( )
463
+ {
464
+ UserName = userName ,
465
+ Password = "p"
466
+ }
467
+ } ;
468
+
469
+ expectedCollection = new Collection ( )
470
+ {
471
+ Name = collectionName ,
472
+ Status = "Active" ,
473
+ AdInfo = new ActiveDirectoryConfig ( )
474
+ } ;
475
+
476
+ PerformCollectionTestWithAdInfoHelper ( mockCmdlet , collectionName , expectedCollection , expectedTrackingId , requestData , false ) ;
477
+ }
478
+
479
+ [ Fact ]
480
+ public void SetInactiveCollectionAdConfigTest ( )
481
+ {
482
+ SetAzureRemoteAppCollection mockCmdlet = SetUpTestCommon < SetAzureRemoteAppCollection > ( ) ;
483
+ string collectionName = "mycol" ;
484
+ System . Security . SecureString password = new System . Security . SecureString ( ) ;
485
+ string expectedTrackingId = "fasdfsadfsdf" ;
486
+ CollectionUpdateDetails requestData = null ;
487
+ string userName = @"MyDomain\Administrator" ;
488
+ Collection expectedCollection = null ;
489
+
490
+ // Required parameters for this test
491
+ mockCmdlet . CollectionName = collectionName ;
492
+ password . AppendChar ( 'f' ) ;
493
+ mockCmdlet . Credential = new PSCredential ( userName , password ) ;
494
+ requestData = new CollectionUpdateDetails ( )
495
+ {
496
+ AdInfo = new ActiveDirectoryConfig ( )
497
+ {
498
+ UserName = userName ,
499
+ Password = "f"
500
+ }
501
+ } ;
502
+
503
+ expectedCollection = new Collection ( )
504
+ {
505
+ Name = collectionName ,
506
+ Status = "Inactive" ,
507
+ AdInfo = new ActiveDirectoryConfig ( )
508
+ } ;
509
+
510
+ PerformCollectionTestWithAdInfoHelper ( mockCmdlet , collectionName , expectedCollection , expectedTrackingId , requestData , true ) ;
511
+ }
512
+
445
513
[ Fact ]
446
514
public void RemoveCollection ( )
447
515
{
0 commit comments