Exemple #1
0
 public void ListCardDistinctFiveReturnException()
 {
     var poker = new Poker();
       var listCard = new List<Card> {new Card(CardNumber.Ace, CardColor.Diamonds)};
       var exception = Assert.Throws<ArgumentException>(() => poker.HandVerifier(listCard));
       Assert.That(exception, Has.Message.EqualTo("numero de cartas incorrecto"));
 }
Exemple #2
0
 public void ResultDoblesParejas()
 {
     var poker = new Poker();
       var listCard = new List<Card>
     {
       new Card(CardNumber.K, CardColor.Clover),
       new Card(CardNumber.K, CardColor.Diamonds),
       new Card(CardNumber.J, CardColor.Spades),
       new Card(CardNumber.Five, CardColor.Hearts),
       new Card(CardNumber.Five, CardColor.Spades)
     };
       Assert.AreEqual(Poker.Result.DoblesParejas, poker.HandVerifier(listCard));
 }
Exemple #3
0
 public void ResultColor()
 {
     var poker = new Poker();
       var listCard = new List<Card>
     {
       new Card(CardNumber.Two, CardColor.Hearts),
       new Card(CardNumber.Nine, CardColor.Hearts),
       new Card(CardNumber.K, CardColor.Hearts),
       new Card(CardNumber.J, CardColor.Hearts),
       new Card(CardNumber.Seven, CardColor.Hearts)
     };
       Assert.AreEqual(Poker.Result.Color, poker.HandVerifier(listCard));
 }
Exemple #4
0
 public void ListWithFiveCardsButTwoOrMoreCardsEqualsReturnException()
 {
     var poker = new Poker();
       var listCard = new List<Card>
     {
       new Card(CardNumber.Ace, CardColor.Diamonds),
       new Card(CardNumber.Ace, CardColor.Diamonds),
       new Card(CardNumber.Ace, CardColor.Diamonds),
       new Card(CardNumber.Ace, CardColor.Diamonds),
       new Card(CardNumber.Ace, CardColor.Diamonds)
     };
       var exception = Assert.Throws<ArgumentException>(() => poker.HandVerifier(listCard));
       Assert.That(exception, Has.Message.EqualTo("dos o más cartas iguales"));
 }
Exemple #5
0
 public void ResultEscaleraColor()
 {
     var poker = new Poker();
       var listCard = new List<Card>
     {
       new Card(CardNumber.Two, CardColor.Clover),
       new Card(CardNumber.Three, CardColor.Clover),
       new Card(CardNumber.Four, CardColor.Clover),
       new Card(CardNumber.Five, CardColor.Clover),
       new Card(CardNumber.Six, CardColor.Clover)
     };
       Assert.AreEqual(Poker.Result.EscaleraColor, poker.HandVerifier(listCard));
 }
Exemple #6
0
 public void ResultPoker()
 {
     var poker = new Poker();
       var listCard = new List<Card>
     {
       new Card(CardNumber.Two, CardColor.Clover),
       new Card(CardNumber.Two, CardColor.Diamonds),
       new Card(CardNumber.Two, CardColor.Hearts),
       new Card(CardNumber.Two, CardColor.Spades),
       new Card(CardNumber.Six, CardColor.Clover)
     };
       Assert.AreEqual(Poker.Result.Poker, poker.HandVerifier(listCard));
 }