package testBlackJack;


import kodaLoss.Card;
import kodaLoss.Player;
import kodaLoss.Rank;
import kodaLoss.Suite;

import org.testng.Assert;
import org.testng.annotations.Test;

import junit.framework.TestCase;

public class testBJPlayerAndCard extends TestCase {

  
  @Test
  public void testCardValue(){
    Card card = new Card( Suite.CLUBS , Rank.JACK);
    Assert.assertTrue(card.getValue() == 10);
  }
  
  @Test
  public void testAddCardToHand(){
    
    Player player = new Player();
    Card card1 = new Card( Suite.CLUBS , Rank.JACK);
    
    for (int i = 0 ; i < 10 ; i++){
      player.addCardToHand(card1);
    }
    
    Assert.assertTrue(player.getPlayerHandsSize() == 10);
  }
  
  @Test
  public void testClearPlayersHand(){
    Player player = new Player();
    Card card1 = new Card( Suite.CLUBS , Rank.JACK);
    
    for (int i = 0 ; i < 10 ; i++){
      player.addCardToHand(card1);
    }
    if (player.getPlayerHandsSize() < 1 ){
      fail("Adding cards to hand failed!");
    }
    player.clearPlayersHand();
    Assert.assertTrue( player.getPlayerHandsSize() == 0 );
  }
  
  public void testIsBusted(){
    Player p = new Player();
    if (p.isBusted()){
      fail("Player initialized as isBusted!");
    }
    p.setBusted(true);
    Assert.assertTrue(p.isBusted());
  }

  public void testPlayerGetName(){
    Player p1 = new Player();
    Player p2 = new Player("TESTNAME");
    Assert.assertTrue(p1.getName().equals("Anonymous"));
    Assert.assertTrue(p2.getName().equals("TESTNAME"));
  }
  
}

@@ -44,16 +44,66 @@
 .Card;%0D%0A
+import kodaLoss.CardShoe;%0D%0Aimport kodaLoss.Deck;%0D%0A
 import k
@@ -1640,11 +1640,251 @@
  %7D%0D%0A  %0D%0A
+  public void testCardShoe()%7B%0D%0A%09  CardShoe cS = new CardShoe();%0D%0A%09  Assert.assertTrue(cS.getCardShoe().size() == 208);%0D%0A  %7D%0D%0A  %0D%0A  public void testDeck()%7B%0D%0A%09  %0D%0A%09  Assert.assertTrue(Deck.getDeck().size()==52);%0D%0A  %7D%0D%0A  %0D%0A  %0D%0A  %0D%0A  %0D%0A  %0D%0A  %0D%0A
 %7D%0D%0A

test hej.