public void DealMultipleCard_DealsTenTimes_ReturnsValidState() { // Assert ETSDealer dealer = new ETSDealer(9975, "Nijat", new Deck(), DateTime.Now); List <Card> ret = dealer.DealCard(10); // Act int cardleftInDeck = 42; int numberOfCardReturned = 10; // Assert Assert.IsNotNull(ret); foreach (Card c in ret) { Assert.IsNotNull(c); } Assert.AreEqual(cardleftInDeck, dealer.Deck.CardsLeft); Assert.AreEqual(numberOfCardReturned, ret.Count); }
public void DealMultipleCard_DealsAllCards_ReturnsNull() { // Assert ETSDealer dealer = new ETSDealer(9975, "Nijat", new Deck(), DateTime.Now); List <Card> ret = dealer.DealCard(52); // Act int cardleftInDeck = 0; // Assert Assert.IsNotNull(ret); foreach (Card c in ret) { Assert.IsNotNull(c); } Assert.AreEqual(cardleftInDeck, dealer.Deck.CardsLeft); // since all the card has been used // calling DealOneCard should return null Assert.IsNull(dealer.DealOneCard()); }