2

I tried the code

package Base;

import org.testng.Assert;
import org.testng.annotations.Test;

public class Assertcheck 
{
    @Test
    public void check() {
        Assert.assertTrue(true, "testing the string true");
    }
}

and the code succeeds but the message "testing the string true" is not displayed. i checked in console output and also in testNG results.

4

3 に答える 3

1

詳細については、サイトを参照してください: http://junit.sourceforge.net/javadoc/org/junit/Assert.html#assertTrue(java.lang.String , boolean)

public static void assertTrue(java.lang.String message, boolean condition)

条件が真であることをアサートします。そうでない場合は、指定されたメッセージで AssertionError をスローします。パラメータ: message- AssertionError の識別メッセージ (null OK)

condition- チェックする条件

于 2013-07-31T13:53:09.277 に答える