IsTrue() public method

Verifies that the specified condition is true. The assertion fails if the condition is false.
public IsTrue ( bool condition, string message = null ) : void
condition bool Any Boolean value or expression.
message string An optional message to display if the assertion fails.
return void
Exemplo n.º 1
0
        public void IsTrueFailsWithFalseExpression()
        {
            var assert = new AssertClass();
            assert.IsTrue(false);

            Assert.AreEqual(TestOutcome.Failed, _args.Result.Outcome);
        }
Exemplo n.º 2
0
 public void IsTrueSucceedsWithTrueExpression()
 {
     var assert = new AssertClass();
     assert.IsTrue(true);
     
     Assert.AreEqual(TestOutcome.Succeeded, _args.Result.Outcome);
 }