コード例 #1
0
        public void RidedHorse()
        {
            var warrior = new Warrior(new CommonBag());
            var horse   = new Horse(new CommonBag());

            var ride = new EquipHorse(new HorsePower(), new ComputeWeigth());

            ride.EquipBy(horse, warrior);

            Assert.AreEqual(Math.Round(10.0f, 2), Math.Round(horse.Power, 2));
            Assert.AreEqual(Math.Round(10.0f, 2), Math.Round(horse.Speed, 2));
        }
コード例 #2
0
        public void HorseWithBaggage()
        {
            var horse = new Horse(new CommonBag());

            var equip = new EquipHorse(new HorsePower(), new ComputeWeigth());

            equip
            // todo horse !
            .EquipBy(horse, new Axe())
            .EquipBy(horse, new Axe());

            Assert.AreEqual(Math.Round(9.92f, 2), Math.Round(horse.Power, 2));
            Assert.AreEqual(Math.Round(9.92f, 2), Math.Round(horse.Speed, 2));
        }