public HealingEffect(EffectOverTimeSettings effectOverTimeSettings) { effectOverTimeSettings.ValidateSettings(); EffectHolder = effectOverTimeSettings.EffectHolder; Name = effectOverTimeSettings.Name; MaxRound = (int)effectOverTimeSettings.MaxRound; HealOverTimeAmount = (int)effectOverTimeSettings.AmountOverTime; }
public BleedingEffect(EffectOverTimeSettings effectSettings) { effectSettings.ValidateSettings(); BleedDamageOverTime = (int)effectSettings.AmountOverTime; EffectHolder = effectSettings.EffectHolder; MaxRound = (int)effectSettings.MaxRound; Name = effectSettings.Name; }
public BurningEffect(EffectOverTimeSettings effectOverTimeSettings) { effectOverTimeSettings.ValidateSettings(); EffectHolder = effectOverTimeSettings.EffectHolder; FireDamageOverTime = (int)effectOverTimeSettings.AmountOverTime; MaxRound = (int)effectOverTimeSettings.MaxRound; Name = effectOverTimeSettings.Name; }
public void EffectOverTimeSettingsWithAllSettingsDoesNotThrowException() { Player player = new Player("test", PlayerClassType.Mage); EffectOverTimeSettings effectOverTimeSettings = new EffectOverTimeSettings { AmountOverTime = 5, EffectHolder = player, MaxRound = 3, Name = "test" }; Assert.DoesNotThrow(() => effectOverTimeSettings.ValidateSettings()); }
public void EffectOverTimeSettingsMissingEffectHolderThrowsException() { EffectOverTimeSettings effectOverTimeSettings = new EffectOverTimeSettings { AmountOverTime = 5, MaxRound = 3, Name = "test" }; const string expectedErrorMessage = "EffectOverTimeSettings: EffectHolder has not been set."; Exception exception = Assert.Throws <Exception>(() => effectOverTimeSettings.ValidateSettings()); Assert.AreEqual(expectedErrorMessage, exception.Message); }
public void EffectOverTimeSettingsMissingAmountOverTimeThrowsException() { Player player = new Player("test", PlayerClassType.Mage); EffectOverTimeSettings effectOverTimeSettings = new EffectOverTimeSettings { EffectHolder = player, MaxRound = 3, Name = "test" }; const string expectedErrorMessage = "EffectOverTimeSettings: AmountOverTime has not been set."; Exception exception = Assert.Throws <Exception>(() => effectOverTimeSettings.ValidateSettings()); Assert.AreEqual(expectedErrorMessage, exception.Message); }