JUnit
27 FebruaryJUnit assertSame example
Junit 5’s org.junit.jupiter.Assertions class provides different static assertions method to write test cases. Please note that you need to use JUnit’s org.junit.Assert class in case of JUnit 4 or JUnit 3 to assert using assertNull method. Assertions.assertSame() checks whether expected and actual object refer to same object. In case, both do not refer to same […]
23 SeptemberJUnit assertFalse example
Junit 5’s org.junit.jupiter.Assertions class provides different static assertions method to write test cases. Please note that you need to use JUnit’s org.junit.Assert class in case of JUnit 4 or JUnit 3 to assert using assertFalse method. Assertions.AssertFalse() checks if supplied boolean condition is false. In case, condition is true, it will through AssertError. public static […]
19 SeptemberJUnit assertTrue example
Junit 5’s org.junit.jupiter.Assertions class provides different static assertions method to write test cases. Please note that you need to use JUnit’s org.junit.Assert class in case of JUnit 4 or JUnit 3 to assert using assertTrue method. Assertions.assertTrue() checks if supplied boolean condition is true. In case, condition is false, it will through AssertError. public static […]
16 SeptemberJUnit assertEquals example
Junit 5’s org.junit.jupiter.Assertions class provides different static assertions method to write test cases. Please note that you need to use JUnit’s org.junit.Assert class in case of JUnit 4 or JUnit 3 to assert using assertEquals method. assertEquals usage Assertions.assertEquals() checks if expected and actual are equal. In case, both are not equal, it will through […]
11 SeptemberJunit assertNotNull example
Junit 5’s org.junit.jupiter.Assertions class provides different static assertions method to write test cases. Please note that you need to use JUnit’s org.junit.Assert class in case of JUnit 4 or JUnit 3 to assert using assertNotNull method. Assertions.assertNotNull() checks if object is not null. In case, object is null, it will through AssertError. public static void […]
11 SeptemberJUnit assertNull example
Junit 5’s org.junit.jupiter.Assertions class provides different static assertions method to write test cases. Please note that you need to use JUnit’s org.junit.Assert class in case of JUnit 4 or JUnit 3 to assert using assertNull method. Assertions.assertNull() checks that object is null. In case, object is not null, it will through AssertError. public static void […]
10 SeptemberJUnit assertNotSame example
Junit 5’s org.junit.jupiter.Assertions class provides different static assertions method to write test cases. Please note that you need to use JUnit’s org.junit.Assert class in case of JUnit 4 or JUnit 3 to assert using assertNull method. Assertions.assertNotSame() checks whether expected and actual object refer to different objects. In case, both refer to same object, it […]