Advertisement
JeffGrigg

Untitled

Apr 3rd, 2021
2,122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 5 0.42 KB | None | 0 0
  1. import junit.framework.TestCase;
  2.  
  3. public class MyFirstTest extends TestCase {
  4.     public void testOneAndOneIsTwo() {
  5.         assertEquals(2, add(1, 1));
  6.     }
  7.  
  8.     public void testTwoAndTwoIsFour() {
  9.         assertEquals(4, add(2, 2));
  10.     }
  11.  
  12.     public void testTwoAndThreeIsFive() {
  13.         assertEquals(5, add(2, 3));
  14.     }
  15.  
  16.     private int add(int left, int right) {
  17.         return left + right;
  18.     }
  19. }
  20.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement