public void Constructor_SetErrorMessage() { // Arrange / Act var compareValue = new ValidatableValue <int> { Value = 100 }; var sut = new GreaterThanValidationRule <int>(ERROR_MESSAGE, compareValue); // Assert sut.ErrorMessage.Should().Be(ERROR_MESSAGE); }
public void Validate_WithLower_IsNotValid(int initValue, int newValue, int current) { // Arrange var compareValue = new ValidatableValue <int> { Value = initValue }; var sut = new GreaterThanValidationRule <int>(ERROR_MESSAGE, compareValue); sut.Validate(current).Should().BeTrue(); // Act compareValue.Value = newValue; var result = sut.Validate(current); // Assert result.Should().BeFalse(); }