コード例 #1
0
        [Test] public void TestCompareToWinsFirst()
        {
            var wonScore   = new Score(new PlayerScore(PlayerScore.WinPoints - 5), new PlayerScore(PlayerScore.WinPoints));
            var won        = new PlayInfo(false, wonScore, Fix.None, Fix.None);
            var otherScore = new Score(new PlayerScore(PlayerScore.WinPoints - 5), new PlayerScore(PlayerScore.WinPoints - 1));
            var other      = new PlayInfo(false, otherScore, Fix.None, Fix.None);

            Assert.Less(0, won.CompareTo(other));
            Assert.Greater(0, other.CompareTo(won));
        }
コード例 #2
0
        [Test] public void TestCompareToSame([Values(false, true)] bool vortex,
                                             [Values(PlayerScore.WinPoints - 2, PlayerScore.WinPoints - 1)] int p1,
                                             [Values(0, 1)] int s1,
                                             [Values(PlayerScore.WinPoints - 1, PlayerScore.WinPoints)] int p2,
                                             [Values(0, 1)] int s2,
                                             [Values(Fix.None, Fix.Prefix)] Fix oneFixes,
                                             [Values(Fix.None, Fix.Suffix)] Fix twoMoreFixes)
        {
            var score = new Score(new PlayerScore(p1, s1), new PlayerScore(p2, s2));
            var info  = new PlayInfo(vortex, score, oneFixes, twoMoreFixes);

            Assert.AreEqual(0, info.CompareTo(info));
        }