@Test
public void testIsSpaceAvailableSimple() {
    Model m = new Model(10,10,0,0,0);   // 10 by 10 pond with no obstacles, no fish, no plants
    Fish f = new Fish(1, 7, 100, Fish.UP);
    Plant p = new Plant(2, 8, 100);
    m.addFish(f);
    m.addPlant(p);
    assertFalse(m.isSpaceAvailable(1, 7));  // there is a fish there
    assertFalse(m.isSpaceAvailable(2, 8));  // there is a plant there
    assertFalse(m.isSpaceAvailable(0, 0));  // there is a rock there (on the edge of pond)
}

Web Accessibility