Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import junit.framework.TestCase;
- public class ContinuousChange extends TestCase {
- public static int f(final int value) {
- if (value <= 10) {
- return value * 7;
- } else {
- return value * 9 - 20;
- }
- }
- public void test() {
- assertEquals(0, f(0));
- assertEquals(56, f(8));
- assertEquals(63, f(9));
- //
- assertEquals(70, f(10));
- //
- assertEquals(79, f(11));
- assertEquals(88, f(12));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement