public Marine(string id) : base(id) { var weaponarySkil = new WeaponrySkill(); this.AddSupplement(weaponarySkil); }
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; } }
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); }
public void ThrowNotImplementedException_WhenReactToIsCalled() { var weaponarySkill = new WeaponrySkill(); Assert.Throws <NotImplementedException>(() => weaponarySkill.ReactTo(new Weapon())); }