Exemplo n.º 1
0
        public void iPubSettings_SmallBible_TwoColumn()
        {
            m_div.NumColumns = 2;
            m_dlg            = new DummyTePageSetupDlg(m_pgl, m_pub, m_div, false, m_pubPageInfo);
            m_dlg.PubSizeCombo.SelectedIndex = kSmallBible;

            // Setup expected top and bottom margins for different base character sizes of
            // 9, 10 and 11. The left and right margins are always 36000 millipoints (1/2").
            Dictionary <int, ExpectedMarginType> ExpectedMargins =
                new Dictionary <int, ExpectedMarginType>(3);

            ExpectedMargins.Add(9, new ExpectedMarginType(49000, 38000));
            ExpectedMargins.Add(10, new ExpectedMarginType(51000, 38000));
            ExpectedMargins.Add(11, new ExpectedMarginType(50000, 36000));

            // Check the settings for the margins at different base character sizes.
            for (int baseCharSize = 9; baseCharSize <= 11; baseCharSize++)
            {
                m_dlg.BaseCharSizeControlValue = baseCharSize;

                // Verify that the settings are according to iPub specs.
                ExpectedMarginType expectedMargin = ExpectedMargins[baseCharSize];
                Assert.AreEqual(expectedMargin.TopMargin, m_dlg.MarginTop);
                Assert.AreEqual(expectedMargin.BottomMargin, m_dlg.MarginBottom);
                Assert.AreEqual(36000, m_dlg.MarginLeft);
                Assert.AreEqual(36000, m_dlg.MarginRight);
                Assert.AreEqual(baseCharSize + 2, m_dlg.BaseLineSpacing / 1000);
            }
        }
Exemplo n.º 2
0
        public void iPubSettings_LargeBible_TwoColumn()
        {
            m_div.NumColumns = 2;
            m_dlg            = new DummyTePageSetupDlg(m_pgl, m_pub, m_div, false, m_pubPageInfo);
            m_dlg.PubSizeCombo.SelectedIndex = kLargeBible;
            m_dlg.LineSpacingControlValue    = 11;

            // Setup expected top and bottom margins for different line spacing sizes of
            // 11, 12 and 13. The left and right margins are always 36000 millipoints (1/2").
            Dictionary <int, ExpectedMarginType> ExpectedMargins =
                new Dictionary <int, ExpectedMarginType>(3);

            ExpectedMargins.Add(11, new ExpectedMarginType(50000, 36400));
            ExpectedMargins.Add(12, new ExpectedMarginType(49000, 36400));
            ExpectedMargins.Add(13, new ExpectedMarginType(49000, 36400));

            // Check the settings for the margins at different line spacing sizes.
            for (int lineSpacingSize = 11; lineSpacingSize <= 13; lineSpacingSize++)
            {
                m_dlg.LineSpacingControlValue = lineSpacingSize;

                // Verify that the settings are according to iPub specs.
                ExpectedMarginType expectedMargin = ExpectedMargins[lineSpacingSize];
                Assert.AreEqual(expectedMargin.TopMargin, m_dlg.MarginTop);
                Assert.AreEqual(expectedMargin.BottomMargin, m_dlg.MarginBottom);
                Assert.AreEqual(36000, m_dlg.MarginLeft);
                Assert.AreEqual(36000, m_dlg.MarginRight);
                Assert.AreEqual(lineSpacingSize - 2, m_dlg.BaseCharacterSize / 1000);
            }
        }