예제 #1
0
        public StunnedEffect(EffectSettings effectSettings)
        {
            effectSettings.ValidateSettings();

            EffectHolder = effectSettings.EffectHolder;
            Name         = effectSettings.Name;
            MaxRound     = (int)effectSettings.MaxRound;
        }
예제 #2
0
        public FrozenEffect(EffectSettings effectSettings)
        {
            effectSettings.ValidateSettings();

            EffectHolder = effectSettings.EffectHolder;
            MaxRound     = (int)effectSettings.MaxRound;
            Name         = effectSettings.Name;
        }
예제 #3
0
        public void EffectSettingsWithAllSettingsDoesNotThrowException()
        {
            Player         player         = new Player("test", PlayerClassType.Mage);
            EffectSettings effectSettings = new EffectSettings {
                EffectHolder = player,
                MaxRound     = 3,
                Name         = "test"
            };

            Assert.DoesNotThrow(() => effectSettings.ValidateSettings());
        }
예제 #4
0
        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);
        }
예제 #5
0
        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);
        }