Пример #1
0
        public void RobotCollapsedStoneDrop()
        {
            var robot = CreateWorkerRobot();

            Stone stone = new ValuableStone(Convert.ToDouble(10));

            stone = new CollapseStone(1, stone);
            var res = robot.AddStone(stone);

            Assert.AreEqual(res, stone.GetInfo() + "\r\n Succesfully added");
            Assert.AreEqual(robot.Baggage.Count, 1);
            Assert.AreEqual(robot.GetBaggageInfo(), "Total weight: " + 10 + ", total cost: " + 15 + ", free space: " + 190);

            res = robot.Turn();
            Assert.AreEqual(res, "Battery charge: " + 98 + ", battery lost: " + 2 + ", " + "Was droped(collapse destroy it). " + stone.GetInfo());
            Assert.AreEqual(robot.Baggage.Count, 0);
            Assert.AreEqual(robot.GetBaggageInfo(), "Total weight: " + 0 + ", total cost: " + 0 + ", free space: " + 200);
        }
Пример #2
0
        public void CollapseStoneTest()
        {
            Stone stone = new ValuableStone(5);

            stone = new CollapseStone(5, stone);

            Assert.AreEqual(stone.GetInfo(), "Cost: " + 7.5 + ", weight: " + 5 + ", description: Valuable stone, will destroy on every turn, stone health: " + 5);
            Assert.AreEqual(stone.Weight, 5);
            Assert.AreEqual(stone.StoneHealth, 5);
            Assert.AreEqual(stone.Collapses, true);
            Assert.AreEqual(stone.Decryption, false);
            Assert.AreEqual(stone.GetCost(), stone.Weight * 1.5);
            Assert.AreEqual(stone.Damage, 0);
            Assert.AreEqual(stone.Description, "Valuable stone, will destroy on every turn");

            stone.DecreaseHealth();

            Assert.AreEqual(stone.StoneHealth, 4);
        }
Пример #3
0
        public void PoisonedCollapsedStoneTest()
        {
            Stone stone = new ValuableStone(5);

            stone = new PoisonedStone(5, stone);
            stone = new CollapseStone(5, stone);

            Assert.AreEqual(stone.GetInfo(), "Cost: " + 15 + ", weight: " + 5 + ", description: Valuable stone" +
                            ", will harm on every turn (ciborgs only), will destroy on every turn, stone health: " + 5 + ", damage: " + 5);
            Assert.AreEqual(stone.Weight, 5);
            Assert.AreEqual(stone.StoneHealth, 5);
            Assert.AreEqual(stone.Collapses, true);
            Assert.AreEqual(stone.Decryption, false);
            Assert.AreEqual(stone.GetCost(), stone.Weight * 3);
            Assert.AreEqual(stone.Damage, 5);
            Assert.AreEqual(stone.Description, "Valuable stone, will harm on every turn (ciborgs only), will destroy on every turn");

            stone.DecreaseHealth();

            Assert.AreEqual(stone.StoneHealth, 4);
        }