forked from heldinz/Play--Framework-Example--Library
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added more unit tests to get code-coverage closer to 100%
- Loading branch information
Showing
3 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import org.junit.*; | ||
import java.util.*; | ||
import play.test.*; | ||
import controllers.*; | ||
import models.*; | ||
|
||
public class BookTest extends UnitTest { | ||
|
||
@Test | ||
public void constructorTest() { | ||
Book b = new Book("Title", "Author"); | ||
assertFalse(b.isCheckedOut); | ||
b.checkOut(); | ||
assertTrue(b.isCheckedOut); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import org.junit.*; | ||
import java.util.*; | ||
import play.test.*; | ||
import controllers.*; | ||
import models.*; | ||
import jobs.*; | ||
|
||
public class BootstrapTest extends UnitTest { | ||
|
||
@Test | ||
public void doJobNoBooks() { | ||
Bootstrap job = new Bootstrap(); | ||
job.doJob(); | ||
} | ||
|
||
@Test | ||
public void doJobWithBooks() { | ||
Book b = new Book("Title", "Author"); | ||
b.save(); | ||
Bootstrap job = new Bootstrap(); | ||
job.doJob(); | ||
} | ||
|
||
} |