Exemplo n.º 1
0
        public void DefaultMessage()
        {
            // Act
            var exception = new EnumArgumentException();

            // Assert
            Assert.Equal("The value of argument is invalid for Enum type.", exception.Message);
        }
Exemplo n.º 2
0
        public void MessageGivenParameterNameValueAndType()
        {
            // Arrange
            string paramName    = "myParam";
            int    invalidValue = 42;
            Type   enumType     = typeof(FileAccess);

            // Act
            var exception = new EnumArgumentException(paramName, invalidValue, enumType);

            // Assert
            string expected = "The value of argument 'myParam' (42) is invalid for Enum type 'FileAccess'.";

            Assert.Equal(expected, exception.Message.Substring(0, expected.Length));
        }