public void MakeBest_AnchorAtEndOfLine() { CheckDisposed(); // Set anchor at end of line (E < A) m_SelectionHelper = new DummySelectionHelper(null, m_basicView); SetSelection(1, 1, 1, 0, 0, DummyBasicView.kSecondParaEng.Length, 2, true); IVwSelection vwsel = m_SelectionHelper.MakeBest(true); SelectionHelper newSel = SelectionHelper.Create(m_basicView); Assert.IsNotNull(vwsel, "No selection made"); Assert.AreEqual(DummyBasicView.kSecondParaEng.Length, newSel.IchAnchor); Assert.AreEqual(2, newSel.IchEnd); }
public void MultiSection_AnchorAfterEndAtEOT() { CheckDisposed(); // A exists, E at absolute end of text ( E < A ) m_SelectionHelper = new DummySelectionHelper(null, m_basicView); SetSelection(1, 1, 1, 0, 0, 1, 1, true); SetSelection(0, 1, 1, 0, 0, DummyBasicView.kSecondParaEng.Length, DummyBasicView.kSecondParaEng.Length, false); IVwSelection vwsel = m_SelectionHelper.MakeBest(true); SelectionHelper newSel = SelectionHelper.Create(m_basicView); Assert.IsNotNull(vwsel, "No selection made"); CheckSelectionHelperValues(SelectionHelper.SelLimitType.Anchor, newSel, 0, 0, 1, 0, true, 2, m_flidContainingTexts, 1, 1, (int)StText.StTextTags.kflidParagraphs, 1, 0); CheckSelectionHelperValues(SelectionHelper.SelLimitType.End, newSel, 0, 0, DummyBasicView.kSecondParaEng.Length, 0, false, 2, m_flidContainingTexts, 0, 1, (int)StText.StTextTags.kflidParagraphs, 1, 0); }
public void MultiSection_EndBeforeAnchor() { CheckDisposed(); // Both A and E exist (E < A); should select range m_SelectionHelper = new DummySelectionHelper(null, m_basicView); SetSelection(1, 1, 1, 0, 0, 2, 2, true); SetSelection(0, 1, 1, 0, 0, 6, 6, false); IVwSelection vwsel = m_SelectionHelper.MakeBest(true); SelectionHelper newSel = SelectionHelper.Create(m_basicView); Assert.IsNotNull(vwsel, "No selection made"); CheckSelectionHelperValues(SelectionHelper.SelLimitType.Anchor, newSel, 0, 0, 2, 0, true, 2, m_flidContainingTexts, 1, 1, (int)StText.StTextTags.kflidParagraphs, 1, 0); CheckSelectionHelperValues(SelectionHelper.SelLimitType.End, newSel, 0, 0, 6, 0, false, 2, m_flidContainingTexts, 0, 1, (int)StText.StTextTags.kflidParagraphs, 1, 0); }
public void MultiSection_AnchorAfterNonExistingEnd() { CheckDisposed(); // A does exist, E doesn't ( E < A ); should set E to end of paragraph m_SelectionHelper = new DummySelectionHelper(null, m_basicView); SetSelection(1, 1, 1, 0, 0, 1, 1, true); SetSelection(0, 1, 1, 0, 0, 77, 77, false); IVwSelection vwsel = m_SelectionHelper.MakeBest(true); SelectionHelper newSel = SelectionHelper.Create(m_basicView); Assert.IsNotNull(vwsel, "No selection made"); CheckSelectionHelperValues(SelectionHelper.SelLimitType.Anchor, newSel, 0, 0, 1, 0, true, 2, m_flidContainingTexts, 1, 1, (int)StText.StTextTags.kflidParagraphs, 1, 0); CheckSelectionHelperValues(SelectionHelper.SelLimitType.End, newSel, 0, 0, DummyBasicView.kSecondParaEng.Length, 0, false, 2, m_flidContainingTexts, 0, 1, (int)StText.StTextTags.kflidParagraphs, 1, 0); }
public void ExistingEndBeforeAnchor() { CheckDisposed(); // Set selection somewhere (E < A); should make selection m_SelectionHelper = new DummySelectionHelper(null, m_basicView); SetSelection(1, 0, 1, 0, 0, 5, 4, true); IVwSelection vwsel = m_SelectionHelper.MakeBest(true); SelectionHelper newSel = SelectionHelper.Create(m_basicView); Assert.IsNotNull(vwsel, "No selection made"); Assert.AreEqual(5, newSel.IchAnchor); Assert.AreEqual(4, newSel.IchEnd); }
public void EndpointAfterEndOfLine() { CheckDisposed(); // Set endpoint after end of line (A < E); should set to end of line m_SelectionHelper = new DummySelectionHelper(null, m_basicView); SetSelection(0, 1, 1, 0, 0, 3, 99, true); IVwSelection vwsel = m_SelectionHelper.MakeBest(true); SelectionHelper newSel = SelectionHelper.Create(m_basicView); Assert.IsNotNull(vwsel, "No selection made"); Assert.AreEqual(3, newSel.IchAnchor); Assert.AreEqual(DummyBasicView.kSecondParaEng.Length, newSel.IchEnd); }
public void EmptyLine() { CheckDisposed(); // Set selection somewhere on an empty line (A == E); should set to position 0 m_SelectionHelper = new DummySelectionHelper(null, m_basicView); SetSelection(0, 2, 0, 0, 0, 5, 5, true); IVwSelection vwsel = m_SelectionHelper.MakeBest(true); SelectionHelper newSel = SelectionHelper.Create(m_basicView); Assert.IsNotNull(vwsel, "No selection made"); Assert.AreEqual(0, newSel.IchAnchor); Assert.AreEqual(0, newSel.IchEnd); }
public void AfterEndOfLine() { CheckDisposed(); // Set selection after end of line (A == E); should set to last character m_SelectionHelper = new DummySelectionHelper(null, m_basicView); SetSelection(1, 1, 1, 0, 0, 99, 99, true); IVwSelection vwsel = m_SelectionHelper.MakeBest(true); SelectionHelper newSel = SelectionHelper.Create(m_basicView); int nExpected = DummyBasicView.kSecondParaEng.Length; Assert.IsNotNull(vwsel, "No selection made"); Assert.AreEqual(nExpected, newSel.IchAnchor); Assert.AreEqual(nExpected, newSel.IchEnd); }
public void ExistingIPPos() { CheckDisposed(); // Set selection somewhere (A == E); should set to same position m_SelectionHelper = new DummySelectionHelper(null, m_basicView); SetSelection(0, 1, 1, 0, 0, 2, 2, true); IVwSelection vwsel = m_SelectionHelper.MakeBest(true); SelectionHelper newSel = SelectionHelper.Create(m_basicView); Assert.IsNotNull(vwsel, "No selection made"); Assert.AreEqual(2, newSel.IchAnchor); Assert.AreEqual(2, newSel.IchEnd); }