Package test.main

Source Code of test.main.NullPlayingCardTest

package test.main;
import net.sf.nebulacards.main.PlayingCard;
import net.sf.nebulacards.main.NullPlayingCard;
import junit.framework.*;

public class NullPlayingCardTest
  extends TestCase
{
  PlayingCard npc;

  public NullPlayingCardTest(String s) { super(s); }

  public void setUp()
  {
    npc = NullPlayingCard.getInstance();
  }

  public void testTrivial()
  {
    assertTrue(npc.isNull());
  }

  public void testComparison()
  {
    // try to trick the equals function
    PlayingCard c = new PlayingCard(npc.getVal(), npc.getSuit());
    assertFalse(npc.equals(c));
    assertFalse(c.equals(npc));
  }

  public void testToString()
  {
    assertEquals(npc, PlayingCard.fromString(npc.toString()));
  }
}
TOP

Related Classes of test.main.NullPlayingCardTest

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.