コード例 #1
0
        public void DamageController_ElementalCalculatorsParseSuccessfully()
        {
            // Test Data
            Dictionary <string, decimal> testDamageData = new Dictionary <string, decimal>()
            {
                { "BaseHealth", 100 },
                { "Fire", 50 },
                { "Ice", 200 }
            };

            // Run the damage effects, and compare the results to those expected.
            DamageController <DamageUnitTest> testController = new DamageController <DamageUnitTest>();
            var numCalc = testController.CalculateDamageTypeEffects(ref testDamageData);

            // Assert our expectations.
            Assert.AreEqual(2, numCalc);
            Assert.AreEqual(100, testDamageData["BaseHealth"]);
            Assert.AreEqual(150, testDamageData["Fire"]);
            Assert.AreEqual(50, testDamageData["Ice"]);
        }