Package ingsw.proj.cluedo.junittests

Source Code of ingsw.proj.cluedo.junittests.CartaSospettoTest

package ingsw.proj.cluedo.junittests;

import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
import ingsw.proj.cluedo.componenti.Carta;
import ingsw.proj.cluedo.componenti.CartaSospetto;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

public class CartaSospettoTest {

  private CartaSospetto x;
  private String nome;

  @Before
  public void setUp() throws Exception {
    x = new CartaSospetto("TEST");
  }

  @After
  public void tearDown() throws Exception {
    x = null;
    nome = null;
    System.gc();
  }

  @Test
  public void testCarta() {
    assertTrue(x instanceof Carta);
    assertNotNull(x);
  }

  @Test(expected = NullPointerException.class)
  public void testCartaNull() {
    new CartaSospetto(null);
  }

  @Test
  public void testGetNome() {
    nome = "TEST";
    assertSame(nome, x.getNome());
  }

}
TOP

Related Classes of ingsw.proj.cluedo.junittests.CartaSospettoTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.