コード例 #1
0
        public void DisableProfileSucceedsNoPassThru()
        {
            // Setup
            clientMock.Setup(c => c.ListProfiles()).Verifiable();
            cmdlet = new DisableAzureTrafficManagerProfile
                {
                    Name = ProfileName,
                    CommandRuntime = mockCommandRuntime,
                    TrafficManagerClient = clientMock.Object
                };

            // Action
            cmdlet.ExecuteCmdlet();

            // Assert
            clientMock.Verify(c => c.UpdateProfileStatus(ProfileName, ProfileDefinitionStatus.Disabled), Times.Once());
            Assert.AreEqual(0, mockCommandRuntime.OutputPipeline.Count);
        }
コード例 #2
0
        public void DisableProfileSucceedsPassThru()
        {
            clientMock.Setup(c => c.ListProfiles()).Verifiable();

            // Setup
            cmdlet = new DisableAzureTrafficManagerProfile
                {
                    Name = ProfileName,
                    CommandRuntime = mockCommandRuntime,
                    TrafficManagerClient = clientMock.Object,
                    PassThru = new SwitchParameter(true)
                };

            // Action
            cmdlet.ExecuteCmdlet();

            // Assert
            clientMock.Verify(c => c.UpdateProfileStatus(ProfileName, ProfileDefinitionStatus.Disabled), Times.Once());
            Assert.AreEqual(true, (bool)mockCommandRuntime.OutputPipeline[0]);
        }