public void ShouldRejectBeanOfSameSuit() { var cargo = new BeanCargo(); var existingBeans = new[] { new Bean(1, Suit.Blue), new Bean(2, Suit.Blue), }; cargo.AddBeans(existingBeans); var beanToAdd = new Bean(3, Suit.Green); Assert.IsFalse(cargo.CanAddBean(beanToAdd)); }
public void ShouldAllowBeanOfSameSuit() { var cargo = new BeanCargo(); var existingBeans = new[] { new Bean(1, Suit.Blue), }; cargo.AddBeans(existingBeans); var beanToAdd = new Bean(3, Suit.Blue); Assert.IsTrue(cargo.CanAddBean(beanToAdd)); }
public void ShouldAddBeans() { var cargo = new BeanCargo(); var existingBeans = new[] { new Bean(1, Suit.Blue), new Bean(2, Suit.Blue), }; cargo.AddBeans(existingBeans); var beansToAdd = new[] {new Bean(3, Suit.Blue)}; cargo.AddBeans(beansToAdd); CollectionAssert.AreEqual(existingBeans.Concat(beansToAdd), cargo); }
public IEnumerable<Bean> SellRevealedCollection() { Bean trophyCard; var collectionCount = revealedCollection.Count; // TODO: move to Collection? if(revealedCollection.TryFirst(c => c.Rank == collectionCount, out trophyCard)) { trophies.Add(trophyCard); } var discardedCards = revealedCollection.ToList(); discardedCards.Remove(trophyCard); revealedCollection = hiddenCollection; hiddenCollection = new BeanCargo(); return discardedCards; }
public void ShouldAllowBeanWhenEmpty() { var cargo = new BeanCargo(); var beanToAdd = new Bean(3, Suit.Blue); Assert.IsTrue(cargo.CanAddBean(beanToAdd)); }