Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }