Ejemplo n.º 1
0
  @Test
  public void testReveal() {
    // TODO: test for setRevealed() return value?
    assertFalse("Square should not be revealed by default", s.isRevealed());

    s.setRevealed(true);
    assertTrue("Square should be revealed after calling setRevealed", s.isRevealed());
  }
Ejemplo n.º 2
0
  @Test
  public void testObservable() {
    TestObserver observer = new TestObserver();

    s.addObserver(observer);
    s.setRevealed(true);

    assertTrue("Square should update observers after revealing", observer.updated);
  }