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
Esempio n. 1
0
        public void IsTrueFailsWithFalseExpression()
        {
            var assert = new AssertClass();
            assert.IsTrue(false);

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