示例#1
0
        public void FormatPropertyForClientValidation_WithInvalidPropertyName_Throws(string property)
        {
            // Arrange
            var expected = "Value cannot be null or empty.";

            // Act & Assert
            ExceptionAssert.ThrowsArgument(
                () => RemoteAttribute.FormatPropertyForClientValidation(property),
                "property",
                expected);
        }
示例#2
0
        public void FormatPropertyForClientValidation_WithInvalidPropertyName_Throws(string property)
        {
            // Arrange
            var expected = "Value cannot be null or empty." + Environment.NewLine + "Parameter name: property";

            // Act & Assert
            var exception = Assert.Throws <ArgumentException>(
                "property",
                () => RemoteAttribute.FormatPropertyForClientValidation(property));

            Assert.Equal(expected, exception.Message);
        }