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); } }
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); } }
public void FollowsStandardSettings_SmallBibleOneColumn() { m_div.NumColumns = 1; m_pub.PaperHeight = 11 * 72000; m_pub.PaperWidth = (int)(8.5 * 72000); m_pub.PageHeight = (int)(8.25 * 72000); m_pub.PageWidth = (int)(5.25 * 72000); m_pub.BaseFontSize = 11000; m_pub.BaseLineSpacing = -13000; m_pubPageInfo.RemoveAt(0); m_dlg = new DummyTePageSetupDlg(m_pgl, m_pub, m_div, true, m_pubPageInfo); m_dlg.PageSizeComboIndex = 0; m_dlg.AllowNonStandardChoices = false; // Should return true for standard pair allowed for one-column m_dlg.BaseCharSizeControlValue = 11; Assert.IsTrue(m_dlg.FollowsStandardSettings); // Should return false for base character sizes too small or too big m_dlg.AllowNonStandardChoices = true; m_dlg.BaseCharSizeControlValue = 10; m_dlg.BaseLineSpacingControlValue = 12; Assert.IsFalse(m_dlg.FollowsStandardSettings); m_dlg.BaseCharSizeControlValue = 12; m_dlg.BaseLineSpacingControlValue = 14; Assert.IsFalse(m_dlg.FollowsStandardSettings); // Should return false for mismatched font/line spacing values m_dlg.BaseCharSizeControlValue = 11; m_dlg.BaseLineSpacingControlValue = 12; Assert.IsFalse(m_dlg.FollowsStandardSettings); m_dlg.BaseLineSpacingControlValue = 14; Assert.IsFalse(m_dlg.FollowsStandardSettings); }
public void AllowNonStandardChoices_LineSpacing() { m_div.NumColumns = 2; m_dlg = new DummyTePageSetupDlg(m_pgl, m_pub, m_div, false, m_pubPageInfo); m_dlg.IsAllowNonStandardChecked = true; m_dlg.PubSizeComboIndex = kLargeBible; m_dlg.IsAllowNonStandardChecked = true; // Check base character size and line spacing. m_dlg.BaseCharSizeControlValue = 8; Assert.AreEqual(8000, m_dlg.BaseCharacterSize); m_dlg.LineSpacingControlValue = 7; Assert.AreEqual(7000, m_dlg.BaseCharacterSize); Assert.AreEqual(m_dlg.BaseCharacterSize, m_dlg.BaseLineSpacing, "Line spacing should not be smaller than base character size"); m_dlg.LineSpacingControlValue = 14; Assert.AreEqual(14000, m_dlg.BaseLineSpacing); // Line spacing is now twice the font size. If we change the base character size, we // expect this proportion to be maintained. m_dlg.BaseCharSizeControlValue = 14; Assert.AreEqual(14000, m_dlg.BaseCharacterSize); Assert.AreEqual(28000, m_dlg.BaseLineSpacing); // If we uncheck the "Allow non-standard choices", we should go back to the maximum base // character size and line spacing since 16 is above the maximum. m_dlg.IsAllowNonStandardChecked = false; Assert.AreEqual(11000, m_dlg.BaseCharacterSize); Assert.AreEqual(13000, m_dlg.BaseLineSpacing); }
public void ErrorStatus_PubPageTooBig() { m_div.NumColumns = 2; m_dlg = new DummyTePageSetupDlg(m_pgl, m_pub, m_div, false, m_pubPageInfo); m_dlg.PubSizeComboIndex = kLargeBible; m_dlg.IsAllowNonStandardChecked = true; // Set paper size to A5 which is too small to fit a "Large" Bible m_dlg.PaperSizeName = m_dlg.GetPaperSize("A5").PaperName; Assert.AreEqual(PageSetupErrorType.PubPageTooBig, m_dlg.CallValidateDialogSettings()); }
public void iPubSettings_SmallBible_OneColumn() { m_div.NumColumns = 1; m_dlg = new DummyTePageSetupDlg(m_pgl, m_pub, m_div, false, m_pubPageInfo); m_dlg.PubSizeCombo.SelectedIndex = kSmallBible; m_dlg.BaseCharSizeControlValue = 11; // Verify that the settings are according to iPub specs. Assert.AreEqual(50000, m_dlg.MarginTop); Assert.AreEqual(36000, m_dlg.MarginBottom); Assert.AreEqual(36000, m_dlg.MarginLeft); Assert.AreEqual(36000, m_dlg.MarginRight); Assert.AreEqual(13000, m_dlg.BaseLineSpacing); }
public void iPubSettings_LargeBible_OneColumn() { m_div.NumColumns = 1; m_dlg = new DummyTePageSetupDlg(m_pgl, m_pub, m_div, false, m_pubPageInfo); m_dlg.PubSizeCombo.SelectedIndex = kLargeBible; m_dlg.BaseCharSizeControlValue = 11; m_dlg.PaperSizeName = ResourceHelper.GetResourceString("kstidPaperSizeA4"); // Verify that the settings are according to iPub specs. Assert.AreEqual(53000, m_dlg.MarginTop); Assert.AreEqual(39400, m_dlg.MarginBottom); Assert.AreEqual(36000, m_dlg.MarginLeft); Assert.AreEqual(36000, m_dlg.MarginRight); Assert.AreEqual(13000, m_dlg.BaseLineSpacing); }
/// ------------------------------------------------------------------------------------ /// <summary> /// /// </summary> /// ------------------------------------------------------------------------------------ public override void TestTearDown() { try { if (m_dlg != null) { m_dlg.Dispose(); m_dlg = null; } if (m_pubPageInfo != null) { m_pubPageInfo.Clear(); m_pubPageInfo = null; } } finally { base.TestTearDown(); } }
public void ErrorStatus_HorizontalMarginsTooBig() { m_div.NumColumns = 2; m_dlg = new DummyTePageSetupDlg(m_pgl, m_pub, m_div, false, m_pubPageInfo); m_dlg.PubSizeComboIndex = kFullPage; m_dlg.IsAllowNonStandardChecked = true; // Set paper size to A5 which is too small to fit a Large Bible m_dlg.PaperSizeName = m_dlg.GetPaperSize("A4").PaperName; // Set left and right margins too big // Left and Right margins are set to half the height plus 1/2" m_dlg.MarginLeft = (m_dlg.GetPaperSize("A4").Width *DummyTePageSetupDlg.kCentiInchToMilliPoints) / 2; m_dlg.MarginRight = (m_dlg.GetPaperSize("A4").Width *DummyTePageSetupDlg.kCentiInchToMilliPoints) / 2; Assert.AreEqual(PageSetupErrorType.HorizontalMarginsTooBig, m_dlg.CallValidateDialogSettings()); m_dlg.MarginLeft = (m_dlg.GetPaperSize("A4").Width *DummyTePageSetupDlg.kCentiInchToMilliPoints); m_dlg.MarginRight = DummyTePageSetupDlg.kCentiInchToMilliPoints; Assert.AreEqual(PageSetupErrorType.HorizontalMarginsTooBig, m_dlg.CallValidateDialogSettings()); }
public override void Exit() { CheckDisposed(); try { if (m_dlg != null) { m_dlg.Dispose(); m_dlg = null; } if (m_pubPageInfo != null) { m_pubPageInfo.Clear(); m_pubPageInfo = null; } } finally { base.Exit(); } }
public void ErrorStatus_VerticalMarginsTooBig() { m_div.NumColumns = 2; m_dlg = new DummyTePageSetupDlg(m_wsUser, m_pgl, m_pub, m_div, MsrSysType.Point, false, m_pubPageInfo); m_dlg.PubSizeComboIndex = kFullPage; m_dlg.IsAllowNonStandardChecked = true; // Set paper size to A5 which is too small to fit a Large Bible m_dlg.PaperSizeName = m_dlg.GetPaperSize("A4").PaperName; // Set left and right margins to legal size m_dlg.MarginLeft = 50 * DummyTePageSetupDlg.kCentiInchToMilliPoints; // 1/2 inch m_dlg.MarginRight = 50 * DummyTePageSetupDlg.kCentiInchToMilliPoints; // 1/2 inch Assert.AreEqual(PageSetupErrorType.NoError, m_dlg.CallValidateDialogSettings()); // Set top and bottom margins too big // Left and Right margins are set to half the height plus 1/2" m_dlg.MarginTop = (m_dlg.GetPaperSize("A4").Height *DummyTePageSetupDlg.kCentiInchToMilliPoints) / 2; m_dlg.MarginBottom = (m_dlg.GetPaperSize("A4").Height *DummyTePageSetupDlg.kCentiInchToMilliPoints) / 2; Assert.AreEqual(PageSetupErrorType.VerticalMarginsTooBig, m_dlg.CallValidateDialogSettings()); }
public void ErrorStatus_PubPageTooBig() { m_div.NumColumns = 2; m_dlg = new DummyTePageSetupDlg( m_pgl, m_pub, m_div, false, m_pubPageInfo); m_dlg.PubSizeComboIndex = kLargeBible; m_dlg.IsAllowNonStandardChecked = true; // Set paper size to A5 which is too small to fit a "Large" Bible m_dlg.PaperSizeName = m_dlg.GetPaperSize("A5").PaperName; Assert.AreEqual(PageSetupErrorType.PubPageTooBig, m_dlg.CallValidateDialogSettings()); }
public override void Exit() { CheckDisposed(); try { if (m_dlg != null) { m_dlg.Dispose(); m_dlg = null; } if (m_pubPageInfo != null) { m_pubPageInfo.Clear(); m_pubPageInfo = null; } } finally { base.Exit(); } }
public void ErrorStatus_HorizontalMarginsTooBig() { m_div.NumColumns = 2; m_dlg = new DummyTePageSetupDlg(m_wsUser, m_pgl, m_pub, m_div, MsrSysType.Point, false, m_pubPageInfo); m_dlg.PubSizeComboIndex = kFullPage; m_dlg.IsAllowNonStandardChecked = true; // Set paper size to A5 which is too small to fit a Large Bible m_dlg.PaperSizeName = m_dlg.GetPaperSize("A4").PaperName; // Set left and right margins too big // Left and Right margins are set to half the height plus 1/2" m_dlg.MarginLeft = (m_dlg.GetPaperSize("A4").Width * DummyTePageSetupDlg.kCentiInchToMilliPoints) / 2; m_dlg.MarginRight = (m_dlg.GetPaperSize("A4").Width * DummyTePageSetupDlg.kCentiInchToMilliPoints) / 2; Assert.AreEqual(PageSetupErrorType.HorizontalMarginsTooBig, m_dlg.CallValidateDialogSettings()); m_dlg.MarginLeft = (m_dlg.GetPaperSize("A4").Width * DummyTePageSetupDlg.kCentiInchToMilliPoints); m_dlg.MarginRight = DummyTePageSetupDlg.kCentiInchToMilliPoints; Assert.AreEqual(PageSetupErrorType.HorizontalMarginsTooBig, m_dlg.CallValidateDialogSettings()); }
/// ------------------------------------------------------------------------------------ /// <summary> /// /// </summary> /// ------------------------------------------------------------------------------------ public override void TestTearDown() { try { if (m_dlg != null) { m_dlg.Dispose(); m_dlg = null; } if (m_pubPageInfo != null) { m_pubPageInfo.Clear(); m_pubPageInfo = null; } } finally { base.TestTearDown(); } }
public void iPubSettings_LargeBible_OneColumn() { m_div.NumColumns = 1; m_dlg = new DummyTePageSetupDlg( m_pgl, m_pub, m_div, false, m_pubPageInfo); m_dlg.PubSizeCombo.SelectedIndex = kLargeBible; m_dlg.BaseCharSizeControlValue = 11; m_dlg.PaperSizeName = ResourceHelper.GetResourceString("kstidPaperSizeA4"); // Verify that the settings are according to iPub specs. Assert.AreEqual(53000, m_dlg.MarginTop); Assert.AreEqual(39400, m_dlg.MarginBottom); Assert.AreEqual(36000, m_dlg.MarginLeft); Assert.AreEqual(36000, m_dlg.MarginRight); Assert.AreEqual(13000, m_dlg.BaseLineSpacing); }
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); } }
public void iPubSettings_SmallBible_OneColumn() { m_div.NumColumns = 1; m_dlg = new DummyTePageSetupDlg( m_pgl, m_pub, m_div, false, m_pubPageInfo); m_dlg.PubSizeCombo.SelectedIndex = kSmallBible; m_dlg.BaseCharSizeControlValue = 11; // Verify that the settings are according to iPub specs. Assert.AreEqual(50000, m_dlg.MarginTop); Assert.AreEqual(36000, m_dlg.MarginBottom); Assert.AreEqual(36000, m_dlg.MarginLeft); Assert.AreEqual(36000, m_dlg.MarginRight); Assert.AreEqual(13000, m_dlg.BaseLineSpacing); }
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); } }
public void FollowsStandardSettings_LargeBibleTwoColumn() { m_div.NumColumns = 2; m_pub.PaperHeight = 11 * 72000; m_pub.PaperWidth = (int)(8.5 * 72000); m_pub.PageHeight = (int)(8.7 * 72000); m_pub.PageWidth = (int)(5.8 * 72000); m_pub.BaseFontSize = 10000; m_pub.BaseLineSpacing = -12000; m_pubPageInfo.RemoveAt(0); m_dlg = new DummyTePageSetupDlg( m_pgl, m_pub, m_div, true, m_pubPageInfo); m_dlg.PageSizeComboIndex = 0; m_dlg.AllowNonStandardChoices = false; // Should return true for standard pairs allowed for two-column m_dlg.BaseCharSizeControlValue = 9; Assert.IsTrue(m_dlg.FollowsStandardSettings); m_dlg.BaseCharSizeControlValue = 10; Assert.IsTrue(m_dlg.FollowsStandardSettings); m_dlg.BaseCharSizeControlValue = 11; Assert.IsTrue(m_dlg.FollowsStandardSettings); // Should return false for base character sizes too small or too big m_dlg.AllowNonStandardChoices = true; m_dlg.BaseCharSizeControlValue = 8; m_dlg.BaseLineSpacingControlValue = 10; Assert.IsFalse(m_dlg.FollowsStandardSettings); m_dlg.BaseCharSizeControlValue = 12; m_dlg.BaseLineSpacingControlValue = 14; Assert.IsFalse(m_dlg.FollowsStandardSettings); // Should return false for mismatched font/line spacing values m_dlg.BaseCharSizeControlValue = 10; m_dlg.BaseLineSpacingControlValue = 11; Assert.IsFalse(m_dlg.FollowsStandardSettings); m_dlg.BaseLineSpacingControlValue = 13; Assert.IsFalse(m_dlg.FollowsStandardSettings); }
public void ErrorStatus_VerticalMarginsTooBig() { m_div.NumColumns = 2; m_dlg = new DummyTePageSetupDlg( m_pgl, m_pub, m_div, false, m_pubPageInfo); m_dlg.PubSizeComboIndex = kFullPage; m_dlg.IsAllowNonStandardChecked = true; // Set paper size to A5 which is too small to fit a Large Bible m_dlg.PaperSizeName = m_dlg.GetPaperSize("A4").PaperName; // Set left and right margins to legal size m_dlg.MarginLeft = 50 * DummyTePageSetupDlg.kCentiInchToMilliPoints; // 1/2 inch m_dlg.MarginRight = 50 * DummyTePageSetupDlg.kCentiInchToMilliPoints; // 1/2 inch Assert.AreEqual(PageSetupErrorType.NoError, m_dlg.CallValidateDialogSettings()); // Set top and bottom margins too big // Left and Right margins are set to half the height plus 1/2" m_dlg.MarginTop = (m_dlg.GetPaperSize("A4").Height * DummyTePageSetupDlg.kCentiInchToMilliPoints) / 2; m_dlg.MarginBottom = (m_dlg.GetPaperSize("A4").Height * DummyTePageSetupDlg.kCentiInchToMilliPoints) / 2; Assert.AreEqual(PageSetupErrorType.VerticalMarginsTooBig, m_dlg.CallValidateDialogSettings()); }
public void AllowNonStandardChoices_LineSpacing() { m_div.NumColumns = 2; m_dlg = new DummyTePageSetupDlg( m_pgl, m_pub, m_div, false, m_pubPageInfo); m_dlg.IsAllowNonStandardChecked = true; m_dlg.PubSizeComboIndex = kLargeBible; m_dlg.IsAllowNonStandardChecked = true; // Check base character size and line spacing. m_dlg.BaseCharSizeControlValue = 8; Assert.AreEqual(8000, m_dlg.BaseCharacterSize); m_dlg.LineSpacingControlValue = 7; Assert.AreEqual(7000, m_dlg.BaseCharacterSize); Assert.AreEqual(m_dlg.BaseCharacterSize, m_dlg.BaseLineSpacing, "Line spacing should not be smaller than base character size"); m_dlg.LineSpacingControlValue = 14; Assert.AreEqual(14000, m_dlg.BaseLineSpacing); // Line spacing is now twice the font size. If we change the base character size, we // expect this proportion to be maintained. m_dlg.BaseCharSizeControlValue = 14; Assert.AreEqual(14000, m_dlg.BaseCharacterSize); Assert.AreEqual(28000, m_dlg.BaseLineSpacing); // If we uncheck the "Allow non-standard choices", we should go back to the maximum base // character size and line spacing since 16 is above the maximum. m_dlg.IsAllowNonStandardChecked = false; Assert.AreEqual(11000, m_dlg.BaseCharacterSize); Assert.AreEqual(13000, m_dlg.BaseLineSpacing); }