“>Developing Hash CodesAdding tests and code for equality in the Card class in part 2 ofthis series allowed us to simplify the code written for our Deckcreation test. The test method, testCreate, is easy to read (seeListing 1) and succinctly describes the state for a new Deck.Listing 1 testCreate method in DeckTest.public void testCreate() { Deck deck = new Deck(); assertEquals(Deck.SIZE, deck.cardsRemaining()); for (Suit suit: Suit.values()) for (Rank rank: Rank.values()
continue >>
Author:
Time:
Friday, February 8th, 2008 at 11:04 pm
Category:
Comments:
You can leave a response, or trackback from your own site.
RSS:
You can follow any responses to this entry through the RSS 2.0 feed.
Navigation: