Wednesday, 30 September 2015

Commenly used Assert comparisons

package Flowell_testing;
import org.junit.Ignore;
import org.junit.Test;
import org.testng.Assert;

public class AssertTest {
 
    @Ignore
    @Test
    public void assertBooleanCompare() throws Exception {
        boolean actual = true;
        boolean expected = false;
        Assert.assertEquals(actual, expected);
    }
  
    @Ignore
    @Test
    public void assertStringCompare(){
        String actual = "yes";
        String expected = "no";
        Assert.assertEquals(actual, expected);
    }
   
    @Ignore
    @Test
    public void assertIntCompare(){
        int actual = 10;
        int expected = 10;
        Assert.assertEquals(actual, expected);
    }
   
    @Ignore
    @Test
    public void AssertTrue(){
        boolean status = true;
        Assert.assertTrue(status);
    }
   
    @Test
    public void AssertFalse(){
        boolean status = false;
        Assert.assertFalse(status);
    }
   
}

No comments:

Post a Comment