public void FormatAdditionalFieldsForClientValidation_WithInvalidPropertyName_Throws(string property) { // Arrange var attribute = new RemoteAttribute(routeName: "default"); var expectedMessage = "Value cannot be null or empty."; // Act & Assert ExceptionAssert.ThrowsArgument( () => attribute.FormatAdditionalFieldsForClientValidation(property), "property", expectedMessage); }
public void FormatAdditionalFieldsForClientValidation_WithInvalidPropertyName_Throws(string property) { // Arrange var attribute = new RemoteAttribute(routeName: "default"); var expected = "Value cannot be null or empty." + Environment.NewLine + "Parameter name: property"; // Act & Assert var exception = Assert.Throws <ArgumentException>( "property", () => attribute.FormatAdditionalFieldsForClientValidation(property)); Assert.Equal(expected, exception.Message); }
public void FormatAdditionalFieldsForClientValidation_WithInvalidPropertyName_Throws(string property) { // Arrange var attribute = new RemoteAttribute(routeName: "default"); var expected = "Value cannot be null or empty." + Environment.NewLine + "Parameter name: property"; // Act & Assert var exception = Assert.Throws<ArgumentException>( "property", () => attribute.FormatAdditionalFieldsForClientValidation(property)); Assert.Equal(expected, exception.Message); }