public void IsInvalidWhenPositive() { //Arrange var attribute = new PositiveDecimalAttribute(); //Act var result = attribute.IsValid(5M); //Assert Assert.True(result); }
public void IsInvalidWhenParameterIsNotDecimal() { //Arrange var attribute = new PositiveDecimalAttribute(); //Act var result = attribute.IsValid(5); //Assert Assert.False(result); }
public void Should_ReturnFalse_When_ValueEmpty() { var actualValidationResult = new PositiveDecimalAttribute().IsValid(null); Assert.IsFalse(actualValidationResult); }
public void Should_ReturnTrue_When_PositiveDecimalValue() { var actualValidationResult = new PositiveDecimalAttribute().IsValid(1.23m); Assert.IsTrue(actualValidationResult); }
public void Should_ReturnFalse_When_NegativeDecimalValue() { var actualValidationResult = new PositiveDecimalAttribute().IsValid(-1.23m); Assert.IsFalse(actualValidationResult); }