@Test @Points("85.2") public void test5() { int odotettu = pekka.getWeight() + 1; feed(ref, pekka); assertEquals( "Feeding should increase the weight by one kilo. Check code: \n" + "ref = Reformatory(); " + "h = new Person(\"Pekka\", 33, 175, 78); " + "ref.feed(h); " + "System.out.println( h.getWeight() )", odotettu, pekka.getWeight()); assertEquals( "Feeding should increase the weight by one kilo. Check code: \n" + "ref = Reformatory(); " + "h = new Person(\"Pekka\", 33, 175, 78); " + "ref.feed(h); " + "System.out.println( ref.getWeight(h) )", odotettu, ref.weight(pekka)); feed(ref, pekka); feed(ref, pekka); feed(ref, pekka); feed(ref, pekka); assertEquals( "Feeding should increase the weight by one kilo. Check code: \n" + "ref = Reformatory(); " + "pekka = new Person(\"Pekka\", 33, 175, 78); " + "ref.feed(pekka); " + "ref.feed(pekka); " + "ref.feed(pekka); " + "ref.feed(pekka); " + "ref.feed(pekka); " + "System.out.println( pekka.getWeight() )", odotettu + 4, pekka.getWeight()); }
@Test @Points("85.1") public void test2() { assertEquals( "check code: ref = Reformatory(); " + "h = new Person(\"Pekka\", 33, 175, 78); " + "System.out.println( ref.weight(h) )", pekka.getWeight(), ref.weight(pekka)); for (int i = 0; i < 5; i++) { int paino = 60 + arpa.nextInt(60); Person mikko = new Person("Mikko", 45, 181, paino); assertEquals( "check code: ref = Reformatory(); " + "h = new Person(\"Mikko\", 45, 181, " + paino + "); " + "System.out.println( ref.weight(h) )", mikko.getWeight(), ref.weight(mikko)); } }