public void ShouldThrowOnConstructorIfCardDrawingServiceNull() { var cds = default(CardDrawingService); var css = new CardScoringService(); var ex = Assert.Throws <ArgumentNullException>(() => new GamePlayingService(cds, css)); Assert.That(ex.ParamName, Is.EqualTo("drawingService")); }
public void ShouldThrowOnGetScoredCardsIfCardsNull() { var css = new CardScoringService(); var scoredCards = css.GetScoredCards(null, null); var ex = Assert.Throws <ArgumentNullException>(() => scoredCards.ToArray()); Assert.That(ex.ParamName, Is.EqualTo("cards")); }
public void ShouldGetScoredCardsIfWildcardNull( [Values(Suits.Any, Suits.Clubs, Suits.Diamonds, Suits.Hearts, Suits.Spades)] Suits suit) { var css = new CardScoringService(); var cards = GetSuitOfCards(suit); var scoredCards = css.GetScoredCards(cards); foreach (var scoredCard in scoredCards) { Assert.That((Suits)scoredCard.Suit, Is.EqualTo(suit)); var expectedPoints = GetPointsForKind((Kinds)scoredCard.Kind); Assert.That(scoredCard.Points, Is.EqualTo(expectedPoints)); } }