public void UtilityToCalculateMinimumCastSizesForAcholi_ThisIsNotARealUnitTest(string bookCode, int initialGuess)
        {
            foreach (var book in m_project.AvailableBooks)
            {
                book.IncludeInScript = book.Code == bookCode;
            }
            m_project.ClearCharacterStatistics();

            CastSizeRowValues validCast = new CastSizeRowValues(initialGuess + 2, 2, 1);
            var currentCast             = new CastSizeRowValues(initialGuess + 1, 2, 1);
            List <CharacterGroup> groups;

            do
            {
                var gen = new CharacterGroupGenerator(m_project, currentCast);

                groups = gen.GenerateCharacterGroups(true);
                if (groups != null)
                {
                    validCast.Male = currentCast.Male;
                }
                currentCast.Male--;
            } while (groups != null && currentCast.Male >= 2);
            Assert.IsTrue(validCast.Male <= initialGuess + 1);
            m_results[bookCode] = validCast;
        }
        public void SetRowValues(CastSizeOption row, CastSizeRowValues values)
        {
            if (row == CastSizeOption.NotSet)
            {
                return;
            }

            var rowIndex = (int)row;

            SetControlValue(m_tableLayout.GetControlFromPosition(2, rowIndex), values.Male);
            SetControlValue(m_tableLayout.GetControlFromPosition(3, rowIndex), values.Female);
            SetControlValue(m_tableLayout.GetControlFromPosition(4, rowIndex), values.Child);
            SetControlValue(m_tableLayout.GetControlFromPosition(5, rowIndex), values.Total);
        }
        public void UtilityToCalculateMinimumCastSizesForKuna_ThisIsNotARealUnitTest(string bookCode, int initialGuess)
        {
            if (bookCode == "SNG")
            {
                // Song of Solomon is special because all the speech is "Implicit" (which we don't handle properly yet)
                m_results[bookCode] = new CastSizeRowValues(4, 2, 0);
                return;
            }

            foreach (var book in m_project.AvailableBooks)
            {
                book.IncludeInScript = book.Code == bookCode;
            }
            m_project.IncludedBooks.Single().SingleVoice = false;

            m_project.ClearCharacterStatistics();

            var women = (bookCode == "RUT") ? 4 : 2;

            if (bookCode == "GEN" || bookCode == "EXO")
            {
                women = 3;
            }
            CastSizeRowValues validCast  = new CastSizeRowValues(initialGuess + 2, women, 1);
            var currentCast              = new CastSizeRowValues(initialGuess + 1, women, 1);
            List <CharacterGroup> groups = null;

            do
            {
                var gen = new CharacterGroupGenerator(m_project, currentCast);

                groups = gen.GenerateCharacterGroups(true);
                if (groups != null)
                {
                    validCast.Male = currentCast.Male;
                }
                currentCast.Male--;
            } while (groups != null && currentCast.Male >= 2);
            Assert.IsTrue(validCast.Male <= initialGuess + 1);
            m_results[bookCode] = validCast;
        }