public void ValidateBooleanToBeNull() { // Given var validator = new NullableBoolValidator(null); // When validator.Be(null); // Then Assert.True(true); }
public void ValidateBooleanToBeFalse() { // Given var validator = new NullableBoolValidator(false); // When validator.BeFalse(); // Then Assert.True(true); }
public void ValidateNullableBooleanToBeFalseViolated() { // Given var validator = new NullableBoolValidator(null); // When var exception = Assert.Throws <XunitException>(() => validator.BeFalse(because: "that's the bottom line")); // Then Assert.NotNull(exception); var rn = Environment.NewLine; Assert.Equal( $"{rn}validator{rn}is \"\"{rn}but was expected to be false{rn}because that's the bottom line", exception.UserMessage); }
public void ValidateNullableToBeNullWithReasonViolated() { // Given var validator = new NullableBoolValidator(true); // When var exception = Assert.Throws <XunitException>(() => validator.BeNull("that's the bottom line")); // Then Assert.NotNull(exception); var rn = Environment.NewLine; Assert.Equal( $"{rn}validator{rn}is \"True\"{rn}but was expected to be null{rn}because that's the bottom line", exception.UserMessage); }