예제 #1
0
        public Marine(string id)
            : base(id)
        {
            var weaponarySkil = new WeaponrySkill();

            this.AddSupplement(weaponarySkil);
        }
예제 #2
0
 protected virtual void ExecuteAddSupplementCommand(string[] commandWords)
 {
     var unit = this.GetUnit(commandWords[2]); ;
     switch (commandWords[1])
     {
         case "PowerCatalyst":
             var powerCatalyst = new PowerCatalyst();
             unit.AddSupplement(powerCatalyst);
             break;
         case "HealthCatalyst":
             var healthCatalyst = new HealthCatalyst();
             unit.AddSupplement(healthCatalyst);
             break;
         case "AggressionCatalyst":
             var aggressionCatalyst = new AggressionCatalyst();
             unit.AddSupplement(aggressionCatalyst);
             break;
         case "WeaponrySkill":
             var weaponrySkill = new WeaponrySkill();
             unit.AddSupplement(weaponrySkill);
             break;
         case "Weapon":
             var weapon = new Weapon();
             unit.AddSupplement(weapon);
             break;
         default:
             break;
     }
 }
예제 #3
0
        public void ReturnCorrectAggressionValue_WeaponSupplementReactToWeaponarySkillSupplement()
        {
            var unit = new Tank("Panzer");

            var weaponrySkill = new WeaponrySkill();
            var weaponMock    = new Mock <Weapon>();

            weaponMock.Setup(x => x.ReactTo(It.IsAny <ISupplement>()));

            unit.AddSupplement(weaponrySkill);
            unit.AddSupplement(weaponMock.Object);

            weaponMock.Verify(x => x.ReactTo(It.IsAny <ISupplement>()), Times.Once);
        }
예제 #4
0
        public void ThrowNotImplementedException_WhenReactToIsCalled()
        {
            var weaponarySkill = new WeaponrySkill();

            Assert.Throws <NotImplementedException>(() => weaponarySkill.ReactTo(new Weapon()));
        }