Notes on Junit
Junit class is nothing but a normal class but with no main() method Junit class will get executed test by test based on @Test annotations. Actually we generally use Junit framework to test methods in Main class (or some class) Each method in main class is treated as test scenario in Junit class. So test scenarios are actual methods in Junit class. Each method in Junit is associated with method in Main Class, thats how test cases are written. We write test cases using Assert.assertEquals Actually Junit class has Test methods of actual methods of someother class which we are testing in Junit class Each method in main class will generally have test method in junit class with annotation @Test on top of these test methods Each test methods will have test cases of specific method which are testing and test cases are generally validated with Assert.assertEquals(Expected, Actual) Generally we create Junit class on someother class, so that Junit class will have test cases(@Test)...
Comments
Post a Comment