public void AddAzureTrafficManagerEndpointConfig_ThrowsExceptionIfAddingExistingEndpoint()
        {
            var cmdlet = new AddAzureTrafficManagerEndpointConfig
            {
                TrafficManagerProfile = new TrafficManagerProfile
                {
                    Endpoints = new List<Endpoint>
                    {
                        new Endpoint
                        {
                            Name = "Name"
                        }
                    }
                },
                EndpointName = "Name"
            };

            var exception = Assert.Throws<PSArgumentException>(() => cmdlet.ExecuteCmdlet());
            Assert.Equal("There is already an existing endpoint with name 'Name'.", exception.Message);
        }
Пример #2
0
        public void AddAzureTrafficManagerEndpointConfig_ThrowsExceptionIfAddingExistingEndpoint()
        {
            var cmdlet = new AddAzureTrafficManagerEndpointConfig
            {
                TrafficManagerProfile = new TrafficManagerProfile
                {
                    Endpoints = new List <TrafficManagerEndpoint>
                    {
                        new TrafficManagerEndpoint
                        {
                            Name = "Name"
                        }
                    }
                },
                EndpointName = "Name"
            };

            var exception = Assert.Throws <PSArgumentException>(() => cmdlet.ExecuteCmdlet());

            Assert.Equal("There is already an existing endpoint with name 'Name'.", exception.Message);
        }