public void RemoveAzureDedicatedCircuitSuccessful()
        {
            string serviceKey = "aa28cd19-b10a-41ff-981b-53c6bbf15ead";
            ExpressRouteOperationStatusResponse expected =
                new ExpressRouteOperationStatusResponse()
            {
                Status         = ExpressRouteOperationStatus.Successful,
                HttpStatusCode = HttpStatusCode.OK
            };

            MockCommandRuntime mockCommandRuntime      = new MockCommandRuntime();
            Mock <ExpressRouteManagementClient> client = InitExpressRouteManagementClient();
            var dcMock = new Mock <IDedicatedCircuitOperations>();

            var t = new Task <ExpressRouteOperationStatusResponse>(() => expected);

            t.Start();

            dcMock.Setup(f => f.RemoveAsync(It.Is <string>(sKey => sKey == serviceKey), It.IsAny <CancellationToken>())).Returns((string sKey, CancellationToken cancellation) => t);
            client.SetupGet(f => f.DedicatedCircuits).Returns(dcMock.Object);

            RemoveAzureDedicatedCircuitCommand cmdlet = new RemoveAzureDedicatedCircuitCommand()
            {
                ServiceKey         = serviceKey,
                CommandRuntime     = mockCommandRuntime,
                ExpressRouteClient = new ExpressRouteClient(client.Object)
            };

            cmdlet.ExecuteCmdlet();

            Assert.True(mockCommandRuntime.VerboseStream[0].Contains(serviceKey));
        }
        public void RemoveAzureDedicatedCircuitSuccessful()
        {
            string serviceKey = "aa28cd19-b10a-41ff-981b-53c6bbf15ead";
            ExpressRouteOperationStatusResponse expected =
                new ExpressRouteOperationStatusResponse()
                {
                    Status = ExpressRouteOperationStatus.Successful,
                    HttpStatusCode = HttpStatusCode.OK
                };
            
            MockCommandRuntime mockCommandRuntime = new MockCommandRuntime();
            Mock<ExpressRouteManagementClient> client = InitExpressRouteManagementClient();
            var dcMock = new Mock<IDedicatedCircuitOperations>();

            var t = new Task<ExpressRouteOperationStatusResponse>(() => expected);
            t.Start();

            dcMock.Setup(f => f.RemoveAsync(It.Is<string>(sKey => sKey == serviceKey), It.IsAny<CancellationToken>())).Returns((string sKey, CancellationToken cancellation) => t);
            client.SetupGet(f => f.DedicatedCircuit).Returns(dcMock.Object);

            RemoveAzureDedicatedCircuitCommand cmdlet = new RemoveAzureDedicatedCircuitCommand()
            {
                ServiceKey = serviceKey,
                CommandRuntime = mockCommandRuntime,
                ExpressRouteClient = new ExpressRouteClient(client.Object)
            };

            cmdlet.ExecuteCmdlet();

            Assert.IsTrue(mockCommandRuntime.VerboseStream[0].Contains(serviceKey));
        }