Wage { public int getHappiness() { int difference = currentWage - expectedWage; Double happiness = 0.0001 * Math.pow(difference, 2) + 0.05 * difference + 5; if (lastDay != -1 && (WorldManager.getInstance().getWorld(). getTimeManager().getDays() - lastDay) < 7) { happiness += 2; } if (happiness > 10) { happiness = 10.0; } if (happiness < 1) { happiness = 1.0; } return happiness.intValue(); } Wage(int startingWage, int skillLevel);  Wage(String fullAmount, String hireTime, int skillLevel); int getWage(); int getHappiness(); boolean changeWage(int newWage); void updateLevel(int skillLevel); void setDayOfLeggy();  }
@Test public void testConstructorHappiness() { assertEquals("wage1 happiness unchanged level 1 happy:5", 5, testWage1.getHappiness()); assertEquals("out of bound don't equal the same as 5", testWage2.getHappiness(), testWage3.getHappiness()); assertEquals("out of bound don't equal the same as 5", testWage2.getHappiness(), testWage4.getHappiness()); assertEquals("wage2 happiness != 1", 1, testWage2.getHappiness()); assertEquals("wage1b happiness != 5", 5, testWage1b.getHappiness()); assertEquals("wage2b happiness != 5", 5, testWage2b.getHappiness()); assertEquals("wage3b happiness != 5", 5, testWage3b.getHappiness()); assertEquals("wage4b happiness != 5", 5, testWage4b.getHappiness()); }