Package belotetime.tests

Source Code of belotetime.tests.TestCard

package belotetime.tests;

import static org.junit.Assert.*;

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

import belotetime.application.game.Card;

public class TestCard
{
  private Card asTrefle;
  Card dixTrefle;
  Card jackTrefle;
  Card septCarreau;
  Card neufPique;

  @Before
  public void initCards()
  {
    asTrefle = new Card("As", "Tr�fle", 11);
    dixTrefle = new Card("Dix", "Tr�fle", 10);
    jackTrefle = new Card("Valet", "Tr�fle", 2);
    septCarreau = new Card("Sept", "Carreau", 0);
    neufPique = new Card("Neuf", "Pique", 0);
  }

  @Test
  public void testMax()
  {
    assertTrue(asTrefle == Card.max(asTrefle, dixTrefle));
    assertTrue(asTrefle == Card.max(asTrefle, jackTrefle));
    jackTrefle.setValue(20);
    jackTrefle.setTrump(true);
    assertFalse(asTrefle == Card.max(asTrefle, jackTrefle));
    assertTrue(septCarreau == Card.max(septCarreau, asTrefle));
    assertTrue(jackTrefle == Card.max(septCarreau, jackTrefle));
    septCarreau.setTrump(true);
    dixTrefle.setTrump(true);
    assertTrue(jackTrefle == Card.max(dixTrefle, jackTrefle));
    assertTrue(septCarreau == Card.max(asTrefle, septCarreau));
  }

}
TOP

Related Classes of belotetime.tests.TestCard

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.