@Test public void testSetNourishment() { final GiantModel model = new GiantModel(Health.HEALTHY, Fatigue.ALERT, Nourishment.SATURATED); assertEquals(Nourishment.SATURATED, model.getNourishment()); for (final Nourishment nourishment : Nourishment.values()) { model.setNourishment(nourishment); assertEquals(nourishment, model.getNourishment()); assertEquals("The giant looks healthy, alert and " + nourishment.toString() + ".", model.toString()); } }
public void setNourishment(Nourishment nourishment) { this.nourishment = nourishment; }
GiantModel { public void setNourishment(Nourishment nourishment) { this.nourishment = nourishment; } }
GiantModel { public void setNourishment(Nourishment nourishment) { this.nourishment = nourishment; } GiantModel(Health health, Fatigue fatigue, Nourishment nourishment); }
GiantModel { public void setNourishment(Nourishment nourishment) { this.nourishment = nourishment; } GiantModel(Health health, Fatigue fatigue, Nourishment nourishment); Health getHealth(); void setHealth(Health health); Fatigue getFatigue(); void setFatigue(Fatigue fatigue); Nourishment getNourishment(); void setNourishment(Nourishment nourishment); @Override String toString(); }
GiantModel { public void setNourishment(Nourishment nourishment) { this.nourishment = nourishment; } GiantModel(Health health, Fatigue fatigue, Nourishment nourishment); Health getHealth(); void setHealth(Health health); Fatigue getFatigue(); void setFatigue(Fatigue fatigue); Nourishment getNourishment(); void setNourishment(Nourishment nourishment); @Override String toString();  }