Example #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"));
 }
Example #2
0
 public void ResultEscalera()
 {
     var poker = new Poker();
       var listCard = new List<Card>
     {
       new Card(CardNumber.Two, CardColor.Clover),
       new Card(CardNumber.Three, CardColor.Diamonds),
       new Card(CardNumber.Four, CardColor.Clover),
       new Card(CardNumber.Five, CardColor.Hearts),
       new Card(CardNumber.Six, CardColor.Spades)
     };
       Assert.AreEqual(Poker.Result.Escalera, poker.HandVerifier(listCard));
 }
Example #3
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));
 }
Example #4
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));
 }
Example #5
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"));
 }
Example #6
0
 public void ResultFull()
 {
     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.Six, CardColor.Spades),
       new Card(CardNumber.Six, CardColor.Clover)
     };
       Assert.AreEqual(Poker.Result.Full, poker.HandVerifier(listCard));
 }
Example #7
0
 public void ResultEscaleraReal()
 {
     var poker = new Poker();
       var listCard = new List<Card>
     {
       new Card(CardNumber.Ace, CardColor.Clover),
       new Card(CardNumber.Two, CardColor.Clover),
       new Card(CardNumber.Three, CardColor.Clover),
       new Card(CardNumber.Four, CardColor.Clover),
       new Card(CardNumber.Five, CardColor.Clover)
     };
       Assert.AreEqual(Poker.Result.EscaleraReal , poker.HandVerifier(listCard));
 }