Example #1
0
        public void GetBestMedSpeed()
        {
            var steve       = new Cyclist("steve", 1, new double[] { 23, 26, 27 });
            var harvey      = new Cyclist("Harvey", 1.2, new double[] { 25, 26, 21 });
            var john        = new Cyclist("John", 1.5, new double[] { 24, 26, 29 });
            var cyclingTeam = new Cyclist[] { steve, harvey, john };

            Assert.AreEqual(26.33, FindBestAverageSpeed(cyclingTeam), 2);
        }
Example #2
0
        public void GetDistance()
        {
            var steve       = new Cyclist("steve", 1, new double[] { 23, 26, 27 });
            var harvey      = new Cyclist("Harvey", 1.2, new double[] { 25, 26, 21 });
            var john        = new Cyclist("John", 1.5, new double[] { 24, 26, 29 });
            var cyclingTeam = new Cyclist[] { steve, harvey, john };

            Assert.AreEqual(882.026, CalculateDistance(cyclingTeam), 3);
        }
Example #3
0
        public void GetFastestCyclist()
        {
            var steve             = new Cyclist("steve", 1, new double[] { 23, 26, 27 });
            var harvey            = new Cyclist("Harvey", 1.2, new double[] { 25, 26, 21 });
            var john              = new Cyclist("John", 1.5, new double[] { 24, 26, 29 });
            var cyclingTeam       = new Cyclist[] { steve, harvey, john };
            var theFastestCyclist = new FastestCyclist();

            theFastestCyclist = FindFastestCyclist(cyclingTeam);
            Assert.AreEqual(new FastestCyclist(2, "John"), theFastestCyclist);
        }