Ejemplo n.º 1
0
 public void CardsAreEqual()
 {
     IComparable card1 = new Card(Rank.Ace, Suit.Clubs);
     IComparable card2 = new Card(Rank.Ace, Suit.Diamonds);
     var result = card1.CompareTo(card2);
     Assert.AreEqual(result, 0);
 }
Ejemplo n.º 2
0
 public void CardIsLessThan()
 {
     IComparable card1 = new Card(Rank.Ace, Suit.Clubs);
     IComparable card2 = new Card(Rank.Two, Suit.Diamonds);
     var result = card1.CompareTo(card2);
     Assert.IsTrue(result < 0);
 }
Ejemplo n.º 3
0
 public void CompareWithWrongTypeThrows()
 {
     IComparable card1 = new Card(Rank.Ace, Suit.Clubs);
     var result = card1.CompareTo(new object());
 }
Ejemplo n.º 4
0
 public void CompareToNullThrows()
 {
     IComparable card1 = new Card(Rank.Ace, Suit.Clubs);
     var result = card1.CompareTo(null);
 }