diff --git a/src/main/java/com/lib/Library.java b/src/main/java/com/lib/Library.java index 3c396d12f..96fee54ae 100644 --- a/src/main/java/com/lib/Library.java +++ b/src/main/java/com/lib/Library.java @@ -7,4 +7,10 @@ public class Library { public boolean someLibraryMethod() { return true; } + public int add(int a,int b) { + int c=0; + c=a+b; + + return c; + } } diff --git a/src/test/java/com/test/LibraryTest.java b/src/test/java/com/test/LibraryTest.java index 0e8184c68..6cee9077b 100644 --- a/src/test/java/com/test/LibraryTest.java +++ b/src/test/java/com/test/LibraryTest.java @@ -14,4 +14,9 @@ public class LibraryTest { Library classUnderTest = new Library(); assertTrue("someLibraryMethod should return 'true'", classUnderTest.someLibraryMethod()); } + @Test public void testAdd() + { + Library classUnderTest = new Library(); + assertTrue("1+2 should be 3", classUnderTest.add(1,2)==3); + } }