public void PlayersShouldHaveTokens() { var noThanks = new NoThanksGame(); var players = noThanks.Components.OfType<Player>(); var tokenCounts = players.Select(p => p.Components.OfType<Token>().Count()); tokenCounts.Any(c => c != 11).ShouldBeFalse(); }
public void ShouldHaveOneAndOnlyOneDeck() { var noThanks = new NoThanksGame(); var decks = noThanks.Components.OfType<CardDeck>(); decks.Count().ShouldEqual(1); }
public void ShouldHaveCards2To34() { var expectedRange = Enumerable.Range(2, 33).ToList(); var noThanks = new NoThanksGame(); var deck = noThanks.Components.OfType<CardDeck>().Single(); var actualRange = deck.Cards.Select(c => c.NumericValue).OrderBy(i => i); expectedRange.Except(actualRange).Count().ShouldEqual(0); actualRange.Except(expectedRange).Count().ShouldEqual(0); }
public void StartingAGame() { var noThanks = new NoThanksGame(); noThanks.Start(); var deck = noThanks.Components.OfType<CardDeck>().Single(); var card = deck.ActiveCard; card.ShouldNotBeNull(); }
public void ShouldHavePlayers() { var noThanks = new NoThanksGame(); var players = noThanks.Components.OfType<Player>(); players.Count().ShouldBeInRange(2, 5); }