Example #1
0
        public void TestCastSpell()
        {
            // Arrange
            Cleric cleric = new Cleric()
            {
                CharacterLevel = 7
            };
            int spellCycle = 1;

            int[] SpellsPerDayAfterUser = new int[] { 6, 3, 3, 2, 1, 0, 0, 0, 0, 0 };
            try
            {
                // Act
                cleric.CurrentDailySpells = _spellsRepository.GetSpellsSlots(cleric.ClassName, cleric.CharacterLevel, "DailySpells");
                cleric.CastSpell(spellCycle);

                // Assert
                Assert.Equal(SpellsPerDayAfterUser, cleric.CurrentDailySpells);
            }
            catch { }
        }
Example #2
0
        public void TestCastSpell()
        {
            // Arrange
            Cleric cleric = new Cleric("cleric");

            int[,] SpellsPerDayAfterUser = new int[20, 10] {
                { 3, 1, 0, 0, 0, 0, 0, 0, 0, 0 },
                { 4, 2, 0, 0, 0, 0, 0, 0, 0, 0 },
                { 4, 2, 1, 0, 0, 0, 0, 0, 0, 0 },
                { 5, 3, 2, 0, 0, 0, 0, 0, 0, 0 },
                { 5, 3, 2, 1, 0, 0, 0, 0, 0, 0 },
                { 5, 3, 3, 2, 0, 0, 0, 0, 0, 0 },
                { 6, 3, 3, 2, 1, 0, 0, 0, 0, 0 },                                  // <--
                { 6, 4, 3, 3, 2, 0, 0, 0, 0, 0 },
                { 6, 4, 4, 3, 2, 1, 0, 0, 0, 0 },
                { 6, 4, 4, 3, 2, 2, 0, 0, 0, 0 },
                { 6, 5, 4, 4, 3, 2, 1, 0, 0, 0 },
                { 6, 5, 4, 4, 3, 3, 2, 0, 0, 0 },
                { 6, 5, 5, 4, 4, 3, 2, 1, 0, 0 },
                { 6, 5, 5, 4, 4, 3, 3, 2, 0, 0 },
                { 6, 5, 5, 5, 4, 4, 3, 2, 1, 0 },
                { 6, 5, 5, 5, 4, 4, 3, 3, 2, 0 },
                { 6, 5, 5, 5, 5, 4, 4, 3, 2, 1 },
                { 6, 5, 5, 5, 5, 4, 4, 3, 3, 2 },
                { 6, 5, 5, 5, 5, 5, 4, 4, 3, 3 },
                { 6, 5, 5, 5, 5, 5, 4, 4, 4, 4 }
            };
            try
            {
                // Act
                cleric.UpdateSpellsPerDay();
                cleric.CastSpell(7, 1);

                // Assert
                Assert.Equal(SpellsPerDayAfterUser, cleric.DailySpells);
            }
            catch { }
        }