Skip to content

Commit

Permalink
added test case to get coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
sampath-methuku-servicenow committed Oct 6, 2021
1 parent 05b4cd2 commit 7b842c8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main/java/com/lib/Library.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
5 changes: 5 additions & 0 deletions src/test/java/com/test/LibraryTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

0 comments on commit 7b842c8

Please sign in to comment.