コード例 #1
0
        public void CompareEntitiesByScoreEqualReturns0()
        {
            ScoredEntity e1     = new ScoredEntity();;
            ScoredEntity e2     = new ScoredEntity();;
            int          result = ScoredEntity.CompareEntitiesByScore(e1, e2);

            Assert.AreEqual(result, 0);
        }
コード例 #2
0
        public void CompareEntitiesByScoreSecondNullReturns1()
        {
            ScoredEntity e1     = new ScoredEntity();
            ScoredEntity e2     = null;
            int          result = ScoredEntity.CompareEntitiesByScore(e1, e2);

            Assert.AreEqual(result, 1);
        }
コード例 #3
0
        public void CompareEntitiesByScoreFirstNullReturnsMinus1()
        {
            ScoredEntity e1     = null;
            ScoredEntity e2     = new ScoredEntity();
            int          result = ScoredEntity.CompareEntitiesByScore(e1, e2);

            Assert.AreEqual(result, -1);
        }
コード例 #4
0
        public void CompareEntitiesByScoreBothNullReturns0()
        {
            ScoredEntity e1     = null;
            ScoredEntity e2     = null;
            int          result = ScoredEntity.CompareEntitiesByScore(e1, e2);

            Assert.AreEqual(result, 0);
        }
コード例 #5
0
        public void CompareEntitiesByScoreSecondGreaterReturnsMinus1()
        {
            ScoredEntity e1 = new ScoredEntity();

            e1.score = 1;
            ScoredEntity e2 = new ScoredEntity();

            e2.score = 2;
            int result = ScoredEntity.CompareEntitiesByScore(e1, e2);

            Assert.AreEqual(result, -1);
        }
コード例 #6
0
        public void CompareEntitiesByScoreFirstGreaterReturns1()
        {
            ScoredEntity e1 = new ScoredEntity();

            e1.score = 2;
            ScoredEntity e2 = new ScoredEntity();

            e2.score = 1;
            int result = ScoredEntity.CompareEntitiesByScore(e1, e2);

            Assert.AreEqual(result, 1);
        }