示例#1
0
        public void SpeedCamelAnswerTest()
        {
            var magicCarpet     = new MagicCarpet();
            var mortar          = new Mortar();
            var broom           = new Broom();
            var camel           = new BactrianCamel();
            var speedCamel      = new SpeedCamel();
            var centaur         = new Centaur();
            var allTerrainBoots = new AllTerrainBoots();

            var vehicles = new List <Vehicle>
            {
                magicCarpet,
                mortar,
                broom,
                camel,
                speedCamel,
                centaur,
                allTerrainBoots
            };

            var race   = new Race <Vehicle>(1000, vehicles);
            var winner = race.RunRace();

            Assert.AreEqual("SpeedCamel", winner.GetType().Name);
        }
示例#2
0
        static void Main(string[] args)
        {
            AllTerrainBoots atb       = new AllTerrainBoots();
            FastCamel       fc        = new FastCamel();
            TwoHumpedCamel  thc       = new TwoHumpedCamel();
            Broom           b         = new Broom();
            FlyingCarpert   fl        = new FlyingCarpert();
            MultiRace       multiRace = new MultiRace(1000);

            multiRace.AddVehile(atb);
            multiRace.AddVehile(fc);
            multiRace.AddVehile(thc);
            multiRace.AddVehile(b);
            multiRace.AddVehile(fl);
            Vehicle v = multiRace.RunRace();

            Console.WriteLine(v.Speed);
        }
示例#3
0
        public void AllTerrainBoots_Test(Double distance, Double time)
        {
            var boots = new AllTerrainBoots();

            Assert.That(boots.Ride(distance), Is.EqualTo(time));
        }