Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Should every possible branch in a method have a separate junit?
- if (x == 5) {
- c = 1;
- } else {
- if (z != 2) {
- b = 6;
- } else {
- a = 3;
- }
- void testMethod() {
- // x is 5
- test/assert code;
- // x not 5, z not 2
- test/assert code;
- // x not 5, z is 2
- test/assert code
- // etc
- }
Add Comment
Please, Sign In to add comment