@@ -878,96 +878,6 @@ public void GetResourceWithIncorrectTypeThrowsException()
878
878
Assert . Throws < ArgumentException > ( ( ) => resourcesClient . FilterPSResources ( parameters ) ) ;
879
879
}
880
880
881
- [ Fact ]
882
- [ Trait ( Category . AcceptanceType , Category . CheckIn ) ]
883
- public void NewResourceGroupFailsWithInvalidDeployment ( )
884
- {
885
- Uri templateUri = new Uri ( "http://templateuri.microsoft.com" ) ;
886
- Deployment deploymentFromGet = new Deployment ( ) ;
887
- Deployment deploymentFromValidate = new Deployment ( ) ;
888
- CreatePSResourceGroupParameters parameters = new CreatePSResourceGroupParameters ( )
889
- {
890
- ResourceGroupName = resourceGroupName ,
891
- Location = resourceGroupLocation ,
892
- DeploymentName = deploymentName ,
893
- TemplateFile = templateFile ,
894
- StorageAccountName = storageAccountName ,
895
- ConfirmAction = ConfirmAction
896
- } ;
897
- resourceGroupMock . Setup ( f => f . CheckExistenceAsync ( parameters . ResourceGroupName , new CancellationToken ( ) ) )
898
- . Returns ( Task . Factory . StartNew ( ( ) => new ResourceGroupExistsResult
899
- {
900
- Exists = false
901
- } ) ) ;
902
-
903
- resourceGroupMock . Setup ( f => f . CreateOrUpdateAsync (
904
- parameters . ResourceGroupName ,
905
- It . IsAny < ResourceGroup > ( ) ,
906
- new CancellationToken ( ) ) )
907
- . Returns ( Task . Factory . StartNew ( ( ) => new ResourceGroupCreateOrUpdateResult
908
- {
909
- ResourceGroup = new ResourceGroupExtended ( ) { Name = parameters . ResourceGroupName , Location = parameters . Location }
910
- } ) ) ;
911
- resourceGroupMock . Setup ( f => f . GetAsync ( resourceGroupName , new CancellationToken ( ) ) )
912
- . Returns ( Task . Factory . StartNew ( ( ) => new ResourceGroupGetResult
913
- {
914
- ResourceGroup = new ResourceGroupExtended ( ) { Location = resourceGroupLocation }
915
- } ) ) ;
916
- deploymentsMock . Setup ( f => f . CreateOrUpdateAsync ( resourceGroupName , deploymentName , It . IsAny < Deployment > ( ) , new CancellationToken ( ) ) )
917
- . Returns ( Task . Factory . StartNew ( ( ) => new DeploymentOperationsCreateResult
918
- {
919
- RequestId = requestId
920
- } ) )
921
- . Callback ( ( string name , string dName , Deployment bDeploy , CancellationToken token ) => { deploymentFromGet = bDeploy ; } ) ;
922
- deploymentsMock . Setup ( f => f . GetAsync ( resourceGroupName , deploymentName , new CancellationToken ( ) ) )
923
- . Returns ( Task . Factory . StartNew ( ( ) => new DeploymentGetResult
924
- {
925
- Deployment = new DeploymentExtended ( )
926
- {
927
- Name = deploymentName ,
928
- Properties = new DeploymentPropertiesExtended ( )
929
- {
930
- Mode = DeploymentMode . Incremental ,
931
- ProvisioningState = ProvisioningState . Succeeded
932
- } ,
933
- }
934
- } ) ) ;
935
- deploymentsMock . Setup ( f => f . ValidateAsync ( resourceGroupName , It . IsAny < string > ( ) , It . IsAny < Deployment > ( ) , new CancellationToken ( ) ) )
936
- . Returns ( Task . Factory . StartNew ( ( ) => new DeploymentValidateResponse
937
- {
938
- Error = new ResourceManagementErrorWithDetails ( )
939
- {
940
- Code = "404" ,
941
- Message = "Awesome error message" ,
942
- Target = "Bad deployment"
943
- }
944
- } ) )
945
- . Callback ( ( string rg , string dn , Deployment d , CancellationToken c ) => { deploymentFromValidate = d ; } ) ;
946
- SetupListForResourceGroupAsync ( parameters . ResourceGroupName , new List < GenericResourceExtended > ( ) { new GenericResourceExtended ( ) { Name = "website" } } ) ;
947
- deploymentOperationsMock . Setup ( f => f . ListAsync ( resourceGroupName , deploymentName , null , new CancellationToken ( ) ) )
948
- . Returns ( Task . Factory . StartNew ( ( ) => new DeploymentOperationsListResult
949
- {
950
- Operations = new List < DeploymentOperation > ( )
951
- {
952
- new DeploymentOperation ( )
953
- {
954
- OperationId = Guid . NewGuid ( ) . ToString ( ) ,
955
- Properties = new DeploymentOperationProperties ( )
956
- {
957
- ProvisioningState = ProvisioningState . Succeeded ,
958
- TargetResource = new TargetResource ( )
959
- {
960
- ResourceName = resourceName ,
961
- ResourceType = "Microsoft.Website"
962
- }
963
- }
964
- }
965
- }
966
- } ) ) ;
967
-
968
- Assert . Throws < ArgumentException > ( ( ) => resourcesClient . CreatePSResourceGroup ( parameters ) ) ;
969
- }
970
-
971
881
[ Fact ]
972
882
[ Trait ( Category . AcceptanceType , Category . CheckIn ) ]
973
883
public void TestTemplateShowsErrorMessage ( )
@@ -1304,9 +1214,6 @@ public void NewResourceGroupWithDeploymentSucceeds()
1304
1214
Assert . Equal ( DeploymentMode . Incremental , deploymentFromGet . Properties . Mode ) ;
1305
1215
Assert . NotNull ( deploymentFromGet . Properties . Template ) ;
1306
1216
1307
- Assert . Equal ( DeploymentMode . Incremental , deploymentFromValidate . Properties . Mode ) ;
1308
- Assert . NotNull ( deploymentFromValidate . Properties . Template ) ;
1309
-
1310
1217
progressLoggerMock . Verify (
1311
1218
f => f ( string . Format ( "Resource {0} '{1}' provisioning status is {2}" ,
1312
1219
"Microsoft.Website" ,
@@ -1417,8 +1324,6 @@ public void CreatesResourceGroupWithDeploymentFromTemplateParameterObject()
1417
1324
// Skip: Test produces different outputs since hashtable order is not guaranteed.
1418
1325
//EqualsIgnoreWhitespace(File.ReadAllText(templateParameterFile), deploymentFromGet.Parameters);
1419
1326
1420
- Assert . Equal ( DeploymentMode . Incremental , deploymentFromValidate . Properties . Mode ) ;
1421
- Assert . NotNull ( deploymentFromValidate . Properties . Template ) ;
1422
1327
// Skip: Test produces different outputs since hashtable order is not guaranteed.
1423
1328
//EqualsIgnoreWhitespace(File.ReadAllText(templateParameterFile), deploymentFromValidate.Parameters);
1424
1329
@@ -1524,9 +1429,6 @@ public void ShowsFailureErrorWhenResourceGroupWithDeploymentFails()
1524
1429
Assert . Equal ( DeploymentMode . Incremental , deploymentFromGet . Properties . Mode ) ;
1525
1430
Assert . NotNull ( deploymentFromGet . Properties . Template ) ;
1526
1431
1527
- Assert . Equal ( DeploymentMode . Incremental , deploymentFromValidate . Properties . Mode ) ;
1528
- Assert . NotNull ( deploymentFromValidate . Properties . Template ) ;
1529
-
1530
1432
errorLoggerMock . Verify (
1531
1433
f => f ( string . Format ( "Resource {0} '{1}' failed with message '{2}'" ,
1532
1434
"Microsoft.Website" ,
@@ -1632,9 +1534,6 @@ public void ExtractsErrorMessageFromFailedDeploymentOperation()
1632
1534
Assert . Equal ( DeploymentMode . Incremental , deploymentFromGet . Properties . Mode ) ;
1633
1535
Assert . NotNull ( deploymentFromGet . Properties . Template ) ;
1634
1536
1635
- Assert . Equal ( DeploymentMode . Incremental , deploymentFromValidate . Properties . Mode ) ;
1636
- Assert . NotNull ( deploymentFromValidate . Properties . Template ) ;
1637
-
1638
1537
errorLoggerMock . Verify (
1639
1538
f => f ( string . Format ( "Resource {0} '{1}' failed with message '{2}'" ,
1640
1539
"Microsoft.Website" ,
0 commit comments