public void Compare_SecondCardNull_SortsHigh() { var card = new Card(null, null); var comparer = new TrumpHandSorter(new Suit(' ', SuitEnum.Diamonds, SuitEnum.Hearts), true, true); var result = comparer.Compare(card, null); Assert.Equal(1, result); }
public void Compare_FirstCardNull_SortsLow() { var card = new Card(null, null); var comparer = new TrumpHandSorter(new Suit(' ', SuitEnum.Diamonds, SuitEnum.Hearts), true, true); var result = comparer.Compare(null, card); Assert.Equal(-1, result); }
public void Compare_AscendingSuitAscendingRank(SuitEnum card1Suit, RankEnum card1Rank, SuitEnum card2Suit, RankEnum card2Rank, SuitEnum trumpSuit, int expectedCompareValue) { var card1 = new Card( new Rank(card1Rank, null), FromFactory(card1Suit) ); var card2 = new Card( new Rank(card2Rank, null), FromFactory(card2Suit) ); var comparer = new TrumpHandSorter(FromFactory(trumpSuit), true, true); var comparison = comparer.Compare(card1, card2); Assert.Equal(expectedCompareValue, comparison); }