public void IsValidPlay_UsingEqualSingleLowerSuit_Fail() { RuleHandler sut = new RuleHandler(); List <Card> cards = new List <Card>(); sut.FreeTurn(); cards.Add(new Card("J", 8, "Clubs", 1)); sut.IsValidPlay(cards, null); var cards1 = new List <Card> { new Card("J", 8, "Spades", 0) }; bool result = sut.IsValidPlay(cards1, cards); Assert.IsFalse(result); }
public void IsValidPlay_UsingHigherSingle_Success() { RuleHandler sut = new RuleHandler(); List <Card> cards = new List <Card> { new Card("3", 0, "Spades", 0) }; sut.IsValidPlay(cards, null); var cards1 = new List <Card> { new Card("4", 1, "Spades", 0) }; bool result = sut.IsValidPlay(cards1, cards); Assert.IsTrue(result); }
public void IsValidPlay_UsingLowerSingle_Fail() { RuleHandler sut = new RuleHandler(); List <Card> cards = new List <Card> { new Card("3", 0, "Spades", 0) }; sut.IsValidPlay(cards, null); var pile = new List <Card> { new Card("4", 1, "Spades", 0) }; bool result = sut.IsValidPlay(cards, pile); Assert.IsFalse(result); }
public void IsValidPlay_UsingInvalidValidSingleOnFirstPlay_Fail() { RuleHandler sut = new RuleHandler(); List <Card> cards = new List <Card> { new Card("4", 1, "Spades", 0) }; bool result = sut.IsValidPlay(cards, null); Assert.IsFalse(result); }
public void IsValidPlay_UsingTripleOnSingleAce_Success() { RuleHandler sut = new RuleHandler(); sut.FreeTurn(); List <Card> cards = new List <Card> { new Card("A", 11, "Spades", 0) }; sut.IsValidPlay(cards, null); var cards1 = new List <Card> { new Card("4", 1, "Clubs", 1), new Card("4", 1, "Spades", 0), new Card("4", 1, "Diamonds", 2) }; bool result = sut.IsValidPlay(cards1, cards); Assert.IsTrue(result); }
public void IsValidPlay_UsingValidSingleOnFirstPlay_Success() { RuleHandler sut = new RuleHandler(); List <Card> cards = new List <Card> { new Card("3", 0, "Spades", 0) }; bool result = sut.IsValidPlay(cards, null); Assert.IsTrue(result); Assert.AreEqual(RuleHandler.Category.Single, sut.CurrentCategory); }
public void IsValidPlay_UsingDifferentLengthStraightFlushOnStraight_Fail() { RuleHandler sut = new RuleHandler(); List <Card> cards = new List <Card> { new Card("3", 0, "Spades", 0), new Card("4", 1, "Clubs", 1), new Card("5", 2, "Spades", 0) }; sut.IsValidPlay(cards, null); var cards1 = new List <Card> { new Card("4", 1, "Clubs", 1), new Card("5", 2, "Clubs", 1), new Card("6", 3, "Clubs", 1), new Card("7", 4, "Clubs", 1) }; bool result = sut.IsValidPlay(cards1, cards); Assert.IsFalse(result); }
public void IsValidPlay_UsingStraightFlush_Success() { RuleHandler sut = new RuleHandler(); List <Card> cards = new List <Card> { new Card("3", 0, "Spades", 0), new Card("4", 1, "Clubs", 1), new Card("5", 2, "Spades", 0) }; sut.IsValidPlay(cards, null); var cards1 = new List <Card> { new Card("4", 1, "Clubs", 1), new Card("5", 2, "Clubs", 1), new Card("6", 3, "Clubs", 1) }; bool result = sut.IsValidPlay(cards1, cards); Assert.IsTrue(result); Assert.AreEqual(RuleHandler.Category.StraightFlush, sut.CurrentCategory); }
public void IsValidPlay_Using4OfAKindBomb_Success() { RuleHandler sut = new RuleHandler(); List <Card> cards = new List <Card> { new Card("3", 0, "Spades", 0), new Card("3", 0, "Clubs", 1), new Card("3", 0, "Diamonds", 2), new Card("3", 0, "Hearts", 3) }; bool result = sut.IsValidPlay(cards, null); Assert.IsTrue(result); Assert.AreEqual(RuleHandler.Category.Bomb, sut.CurrentCategory); }