1212// limitations under the License. 
1313// ---------------------------------------------------------------------------------- 
1414
15- // using Microsoft.Azure.Commands.Common.Test.Mocks ;
15+ using  System . Management . Automation ; 
1616using  Microsoft . Azure . Commands . ResourceManager . Cmdlets . Implementation ; 
1717using  Microsoft . Azure . Commands . ResourceManager . Cmdlets . SdkClient ; 
18- using  Microsoft . Azure . Commands . ScenarioTest ; 
1918using  Microsoft . Azure . ServiceManagemenet . Common . Models ; 
20- using  Microsoft . WindowsAzure . Commands . Common . Test . Mocks ; 
21- using  Microsoft . WindowsAzure . Commands . ScenarioTest ; 
2219using  Moq ; 
23- using  System . Management . Automation ; 
24- using  System . Management . Automation ; 
2520using  Xunit ; 
2621using  Xunit . Abstractions ; 
2722
23+ 
2824namespace  Microsoft . Azure . Commands . Resources . Test . Resources 
2925{ 
3026    public  class  StopAzureResourceGroupDeploymentCommandTests 
@@ -34,37 +30,36 @@ public class StopAzureResourceGroupDeploymentCommandTests
3430        private  Mock < ResourceManagerSdkClient >  resourcesClientMock ; 
3531
3632        private  Mock < ICommandRuntime >  commandRuntimeMock ; 
37-         private  MockCommandRuntime  mockRuntime ; 
3833
3934        private  string  resourceGroupName  =  "myResourceGroup" ; 
4035
36+         private  string  deploymentName  =  "myDeployment" ; 
37+ 
4138        public  StopAzureResourceGroupDeploymentCommandTests ( ITestOutputHelper  output ) 
4239        { 
4340            resourcesClientMock  =  new  Mock < ResourceManagerSdkClient > ( ) ; 
4441            XunitTracingInterceptor . AddToContext ( new  XunitTracingInterceptor ( output ) ) ; 
4542            commandRuntimeMock  =  new  Mock < ICommandRuntime > ( ) ; 
4643            cmdlet  =  new  StopAzureResourceGroupDeploymentCmdlet ( ) 
4744            { 
48-                 // CommandRuntime = commandRuntimeMock.Object,
45+                 CommandRuntime  =  commandRuntimeMock . Object , 
4946                ResourceManagerSdkClient  =  resourcesClientMock . Object 
5047            } ; 
51-             PSCmdletExtensions . SetCommandRuntimeMock ( cmdlet ,  commandRuntimeMock . Object ) ;  
52-             mockRuntime  =  new  MockCommandRuntime ( ) ;  
53-             commandRuntimeMock . Setup ( f =>  f . Host ) . Returns ( mockRuntime . Host ) ;  
54- 
5548        } 
5649
5750        [ Fact ] 
5851        public  void  StopsActiveDeployment ( ) 
5952        { 
6053            commandRuntimeMock . Setup ( f =>  f . ShouldProcess ( It . IsAny < string > ( ) ,  It . IsAny < string > ( ) ) ) . Returns ( true ) ; 
54+             resourcesClientMock . Setup ( f =>  f . CancelDeployment ( resourceGroupName ,  deploymentName ) ) ; 
6155
6256            cmdlet . ResourceGroupName  =  resourceGroupName ; 
57+             cmdlet . Name  =  deploymentName ; 
6358            cmdlet . Force  =  true ; 
6459
6560            cmdlet . ExecuteCmdlet ( ) ; 
6661
67-             commandRuntimeMock . Verify ( f =>  f . WriteObject ( true ) ,  Times . Once ( ) ) ; 
62+             resourcesClientMock . Verify ( f =>  f . CancelDeployment ( resourceGroupName ,   deploymentName ) ,  Times . Once ( ) ) ; 
6863        } 
6964    } 
7065} 
0 commit comments