ExecuteCmdlet() public method

public ExecuteCmdlet ( ) : void
return void
        public void RemoveAzureTrafficManagerEndpointConfig_ThrowsExceptionWhenNullEndpoints()
        {
            var cmdlet = new RemoveAzureTrafficManagerEndpointConfig
            {
                TrafficManagerProfile = new TrafficManagerProfile(),
                EndpointName = "Name"
            };

            var exception = Assert.Throws<PSArgumentException>(() => cmdlet.ExecuteCmdlet());
            Assert.Equal("The profile provided does not have any endpoints with name 'Name'.", exception.Message);
        }
        public void RemoveAzureTrafficManagerEndpointConfig_ThrowsExceptionWhenNoEndpointWithName()
        {
            var cmdlet = new RemoveAzureTrafficManagerEndpointConfig
            {
                TrafficManagerProfile = new TrafficManagerProfile
                {
                    Endpoints = new List<Endpoint>
                    {
                        new Endpoint
                        {
                            Name = "My external endpoint"
                        }
                    }
                },
                EndpointName = "Name"
            };

            var exception = Assert.Throws<PSArgumentException>(() => cmdlet.ExecuteCmdlet());
            Assert.Equal("The profile provided does not have any endpoints with name 'Name'.", exception.Message);
        }