public void IsFalseNullable_ExpressionIsNull_ShouldThrowArgumentNullException() { Assert.ThrowsException <ArgumentNullException>( () => { Asserter.IsFalse(default(Expression <Func <bool?> >)); }); }
public void IsFalse_ExpressionIsNull_ShouldThrowArgumentNullException() { Assert.ThrowsException <ArgumentNullException>( () => { Asserter.IsFalse(null); }); }
public void IsFalseNullable_ConditionIsTrueBooleanMethodResult_ShouldThrowAssertFailedException() { var o = new TestObject(); Assert.ThrowsException <AssertFailedException>( () => { Asserter.IsFalse(() => o.NullableBooleanMethodTest(true)); }); }
public void IsFalseNullable_ConditionIsFalseBooleanMethodResult_ShouldNotThrowAssertFailedException() { var o = new TestObject(); ExceptionAsserter.DoesNotThrowException <AssertFailedException>( () => { Asserter.IsFalse(() => o.NullableBooleanMethodTest(false)); }); }
public void IsFalseNullable_ConditionIsTrueBooleanProperty_ShouldThrowAssertFailedException() { var o = new TestObject { NullableBooleanPropertyTest = true }; Assert.ThrowsException <AssertFailedException>( () => { Asserter.IsFalse(() => o.NullableBooleanPropertyTest); }); }
public void IsFalseNullable_ConditionIsFalseBooleanProperty_ShouldNotThrowAssertFailedException() { var o = new TestObject { NullableBooleanPropertyTest = false }; ExceptionAsserter.DoesNotThrowException <AssertFailedException>( () => { Asserter.IsFalse(() => o.NullableBooleanPropertyTest); }); }
public void IsFalse_ConditionIsSimpleAndBinaryExpressionThatReturnsFalse_ShouldNotThrowAssertFailedException() { var o = new TestObject { BooleanPropertyTest = true }; ExceptionAsserter.DoesNotThrowException <AssertFailedException>( () => { Asserter.IsFalse(() => !(o.BooleanPropertyTest && o.BooleanMethodTest(true))); }); }
public void IsFalse_ConditionIsSimpleAndBinaryExpressionThatReturnsTrue_ShouldThrowAssertFailedException() { var o = new TestObject { BooleanPropertyTest = false }; Assert.ThrowsException <AssertFailedException>( () => { // (!(false && true)) == true Asserter.IsFalse(() => !(o.BooleanPropertyTest && o.BooleanMethodTest(true))); }); }
IsFalse_ConditionIsComplexAndOrBinaryExpressionThatReturnsTrueForLeftPartButFalseForRightPart_ShouldNotThrowAssertFailedException() { var o = new TestObject { BooleanPropertyTest = true }; var p = new TestObject { BooleanPropertyTest = false }; ExceptionAsserter.DoesNotThrowException <AssertFailedException>( () => { // (!(true && true) || false ) == false Asserter.IsFalse(() => !(o.BooleanPropertyTest && o.BooleanMethodTest(true)) || p.BooleanPropertyTest); }); }
IsFalse_ConditionIsComplexAndOrBinaryExpressionThatReturnsTrueForAllParts_ShouldThrowAssertFailedException() { var o = new TestObject { BooleanPropertyTest = true }; var p = new TestObject { BooleanPropertyTest = true }; Assert.ThrowsException <AssertFailedException>( () => { // (!(true && false) || true) == true Asserter.IsFalse(() => !(o.BooleanPropertyTest && o.BooleanMethodTest(false)) || p.BooleanPropertyTest); }); }