Package ingsw.proj.cluedo.junittests

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

package ingsw.proj.cluedo.junittests;

import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import ingsw.proj.cluedo.componenti.ArmiEnum;
import ingsw.proj.cluedo.componenti.Carta;
import ingsw.proj.cluedo.componenti.CartaArma;

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

public class CartaArmaTest {

  private CartaArma carta;
  private ArmiEnum nome;

  @Before
  public void setUp() throws Exception {
    nome = ArmiEnum.ASCIA;
    carta = new CartaArma(nome);
  }

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

  @Test
  public void testCartaArma() {
    assertTrue(carta instanceof CartaArma);
    assertTrue(carta instanceof Carta);
    assertNotNull(carta);
  }

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

}
TOP

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

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.