Ejemplo n.º 1
0
        public void TestUpgradeDefensiveUnit_ArcherTower()
        {
            fakePlayer.bank = 100;
            fakeDefensiveUnit.defensiveLevel    = 1;
            fakeDefensiveUnit.nameDefensiveUnit = "ArcherTower";
            fakeDefensiveUnit.defensivePower    = 20;
            fakeDefensiveUnit.defenseType       = 1;
            fakeDefensiveUnit.defenseRange      = 1;
            fakeDefensiveUnit.upgradeCost       = 20;
            fakeDefensiveUnit.unitValue         = 20;

            _uut.UpgradeUnit(ref fakeDefensiveUnit, ref fakePlayer);//goblinkiller eller IDefensiveUnit

            Assert.That(fakeDefensiveUnit.defensiveLevel, Is.EqualTo(2));
            Assert.That(fakeDefensiveUnit.nameDefensiveUnit, Is.EqualTo("ArcherTower Level 2"));
            Assert.That(fakeDefensiveUnit.defensivePower, Is.EqualTo(22));
            Assert.That(fakeDefensiveUnit.defenseType, Is.EqualTo(1));
            Assert.That(fakeDefensiveUnit.defenseRange, Is.EqualTo(2));
            Assert.That(fakeDefensiveUnit.upgradeCost, Is.EqualTo(30));
            Assert.That(fakeDefensiveUnit.unitValue, Is.EqualTo(40));

            Assert.That(fakePlayer.bank, Is.EqualTo(80));
        }
Ejemplo n.º 2
0
        public void TestUpgradeDefensiveUnit_ArcherTower()
        {
            userPlayer.bank = 100;
            DefensiveUnitArcher.defensiveLevel    = 1;
            DefensiveUnitArcher.nameDefensiveUnit = "ArcherTower";
            DefensiveUnitArcher.defensivePower    = 20;
            DefensiveUnitArcher.defenseType       = 1;
            DefensiveUnitArcher.defenseRange      = 1;
            DefensiveUnitArcher.upgradeCost       = 20;
            DefensiveUnitArcher.unitValue         = 20;

            DefUtilities.UpgradeUnit(ref DefensiveUnitArcher, ref userPlayer);//goblinkiller eller IDefensiveUnit

            Assert.That(DefensiveUnitArcher.defensiveLevel, Is.EqualTo(2));
            Assert.That(DefensiveUnitArcher.nameDefensiveUnit, Is.EqualTo("ArcherTower Level 2"));
            Assert.That(DefensiveUnitArcher.defensivePower, Is.EqualTo(22));
            Assert.That(DefensiveUnitArcher.defenseType, Is.EqualTo(1));
            Assert.That(DefensiveUnitArcher.defenseRange, Is.EqualTo(2));
            Assert.That(DefensiveUnitArcher.upgradeCost, Is.EqualTo(30));
            Assert.That(DefensiveUnitArcher.unitValue, Is.EqualTo(40));

            Assert.That(userPlayer.bank, Is.EqualTo(80));
        }