예제 #1
0
        public void RunScoreDive()
        {
            Assert.LessOrEqual(_divers[0].Dives[0].Score, 30);

            Diver tDiver = new Diver(-1, "Greger");
            Dive tDive = new Dive(-1, tDiver, 1, _contest);
            tDiver.AddDive(tDive);
            tDive.AddScore(new Score(0, tDive, _judges[0], 1));
            tDive.AddScore(new Score(0, tDive, _judges[1], 5));
            tDive.AddScore(new Score(0, tDive, _judges[2], 5));
            tDive.AddScore(new Score(0, tDive, _judges[3], 5));
            tDive.AddScore(new Score(0, tDive, _judges[4], 10));

            Assert.AreEqual(tDive.Score, 15);
        }
예제 #2
0
        public void RunScoreGreaterThanMax()
        {
            Assert.AreEqual(1, 1);
            return;

            Diver tDiver = new Diver(-1, "Gregers kompis");
            Dive tDive = new Dive(-1, tDiver, 1, _contest);
            tDiver.AddDive(tDive);
            tDive.AddScore(new Score(0, tDive, _judges[0], 11));
            tDive.AddScore(new Score(0, tDive, _judges[1], 11));
            tDive.AddScore(new Score(0, tDive, _judges[2], 11));
            tDive.AddScore(new Score(0, tDive, _judges[3], 11));
            tDive.AddScore(new Score(0, tDive, _judges[4], 11));

            //Assert.AreEqual(tDive.Score, 30);
        }
예제 #3
0
        public void SetUp()
        {
            _judges = new List<Judge>();
            _divers = new List<Diver>();
            _contest = new Contest(0, "Nunit Test Contest", "2015-02-02", "Badhuset", 1, 1, 1, 5);

            _judges.Add(new Judge(0, "Mr. Test"));
            _judges.Add(new Judge(1, "Mrs. Fest"));
            _judges.Add(new Judge(2, "Konstapel Kuk"));
            _judges.Add(new Judge(3, "Domherre"));
            _judges.Add(new Judge(4, "McFlash"));

            _divers.Add(new Diver(0, "Kalle"));
            _divers.Add(new Diver(1, "Greger"));
            _divers.Add(new Diver(2, "Skitunge"));

            _contest.AddDivers(_divers);
            _contest.AddJudges(_judges);

            for (int i = 0; i < 3; i++)
            {
                for (int j = 0; j < 5; j++)
                {
                    Dive dive = new Dive(0, null, j + 1, _contest);
                    _contest.Divers[i].AddDive(dive);

                    for (int k = 0; k < 5; k++)
                    {
                        Score s = new Score(0, null, _judges[k], (k + j)%11);
                        dive.AddScore(s);
                    }
                }
            }
        }