package com.skraylabs.poker.model;

import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.MatcherAssert.assertThat;

import org.junit.Test;

public class CardTest {

  @Test
  public void testGetRank() {
    // Set up
    Card card = new Card(Rank.Ace, Suit.Clubs);
    // Exercise
    Rank rank = card.getRank();
    // Verify
    Rank expectedRank = Rank.Ace;
    assertThat(rank, equalTo(expectedRank));
  }

  @Test
  public void testGetSuit() {
    // Set up
    Card card = new Card(Rank.Eight, Suit.Diamonds);
    // Exercise
    Suit suit = card.getSuit();
    // Verify
    Suit expectedSuit = Suit.Diamonds;
    assertThat(suit, equalTo(expectedSuit));
  }
  
}

@@ -132,16 +132,41 @@
 tThat;%0A%0A
+import org.junit.Before;%0A
 import o
@@ -212,105 +212,342 @@
 %0A%0A  
-@Test%0A  public void testGetRank() %7B%0A    // Set up%0A    Card card = new Card(Rank.Ace, Suit.Clubs);
+/**%0A   * Test fixture card.%0A   */%0A  Card fixedCard;%0A%0A  /**%0A   * Test fixture rank.%0A   */%0A  final Rank fixedRank = Rank.Ace;%0A%0A  /**%0A   * Test fixture suit.%0A   */%0A  Suit fixedSuit = Suit.Clubs;%0A%0A  @Before%0A  public void setUp() throws Exception %7B%0A    fixedCard = new Card(fixedRank, fixedSuit);%0A  %7D%0A%0A  @Test%0A  public void testGetRank() %7B
 %0A   
@@ -575,17 +575,22 @@
  rank = 
-c
+fixedC
 ard.getR
@@ -614,42 +614,8 @@
 ify%0A
-    Rank expectedRank = Rank.Ace;%0A
     
@@ -639,22 +639,19 @@
 equalTo(
-expect
+fix
 edRank))
@@ -699,75 +699,8 @@
 ) %7B%0A
-    // Set up%0A    Card card = new Card(Rank.Eight, Suit.Diamonds);%0A
     
@@ -727,17 +727,22 @@
  suit = 
-c
+fixedC
 ard.getS
@@ -766,47 +766,8 @@
 ify%0A
-    Suit expectedSuit = Suit.Diamonds;%0A
     
@@ -795,14 +795,11 @@
 lTo(
-expect
+fix
 edSu

use a shared test fixture.