示例#1
0
 public void TestAddDiveList()
 {
     var testDiver = new Diver();
     var testDiveList = new List<Dive>
     {
         new Dive(1, 3.3f, 0, 1, testDiver.DiverId),
         new Dive(2, 4.4f, 0, 2, testDiver.DiverId)
     };
     testDiver.AddDiveList(testDiveList);
     Assert.AreEqual(testDiver.ListDive[0].Type.Difficulty, 3.3f);
     Assert.AreNotEqual(testDiver.ListDive[1].Type.Difficulty, 5.5f);
 }
示例#2
0
        public void TestDiverTotalScore()
        {
            var diver = new Diver(1, "Fred", "S", 23, "M", 23);
            Assert.IsTrue(diver.CompetitionScore.Value == 0f);

            var dives = new List<Dive>
            {
                new Dive(1, 1.5f, 5.0f, 1, 23),
                new Dive(2, 1.5f, 6.0f, 2, 23),
                new Dive(3, 1.5f, 7.0f, 3, 23),
                new Dive(4, 1.5f, 8.0f, 4, 23)
            };

            diver.AddDiveList(dives);
            Assert.AreEqual(diver.SummarizeDivePoints().Value, diver.CompetitionScore.Value);

            Assert.AreEqual(26f, diver.CompetitionScore.Value);
        }