public StunnedEffect(EffectSettings effectSettings) { effectSettings.ValidateSettings(); EffectHolder = effectSettings.EffectHolder; Name = effectSettings.Name; MaxRound = (int)effectSettings.MaxRound; }
public FrozenEffect(EffectSettings effectSettings) { effectSettings.ValidateSettings(); EffectHolder = effectSettings.EffectHolder; MaxRound = (int)effectSettings.MaxRound; Name = effectSettings.Name; }
public void EffectSettingsWithAllSettingsDoesNotThrowException() { Player player = new Player("test", PlayerClassType.Mage); EffectSettings effectSettings = new EffectSettings { EffectHolder = player, MaxRound = 3, Name = "test" }; Assert.DoesNotThrow(() => effectSettings.ValidateSettings()); }
public void EffectSettingsMissingEffectHolderThrowsException() { EffectSettings effectSettings = new EffectSettings { MaxRound = 3, Name = "test" }; const string expectedErrorMessage = "EffectSettings: EffectHolder has not been set."; Exception exception = Assert.Throws <Exception>(() => effectSettings.ValidateSettings()); Assert.AreEqual(expectedErrorMessage, exception.Message); }
public void EffectSettingsMissingNameThrowsException() { Player player = new Player("test", PlayerClassType.Mage); EffectSettings effectSettings = new EffectSettings { EffectHolder = player, MaxRound = 3 }; const string expectedErrorMessage = "EffectSettings: Name has not been set."; Exception exception = Assert.Throws <Exception>(() => effectSettings.ValidateSettings()); Assert.AreEqual(expectedErrorMessage, exception.Message); }