コード例 #1
0
        public void CommitOrReset(IBusAttrUnderline underline,
                                  bool expectedRetVal, string expectedText, int expectedSelStart, int expectedSelLenth)
        {
            // Setup
            m_TextBox.Text            = string.Empty;
            m_TextBox.SelectionStart  = 0;
            m_TextBox.SelectionLength = 0;
            m_Handler.OnUpdatePreeditText(new IBusText("a",
                                                       new [] { new IBusUnderlineAttribute(underline, 0, 1) }), 1);

            // Exercise
            var ret = m_Handler.CommitOrReset();

            // Verify
            Assert.That(ret, Is.EqualTo(expectedRetVal));
            Assert.That(m_TextBox.Text, Is.EqualTo(expectedText));
            Assert.That(m_TextBox.SelectionStart, Is.EqualTo(expectedSelStart), "SelectionStart");
            Assert.That(m_TextBox.SelectionLength, Is.EqualTo(expectedSelLenth), "SelectionLength");
        }
コード例 #2
0
        public void CommitOrReset(IBusAttrUnderline underline,
                                  bool expectedRetVal, string expectedText, int expectedSelStart, int expectedSelEnd)
        {
            // Setup
            var hvoPara = SetupInitialText("a");

            SetSelection(1, 1);
            m_Handler.OnUpdatePreeditText(new IBusText("b",
                                                       new [] { new IBusUnderlineAttribute(underline, 0, 1) }), 1);

            // Exercise
            var ret = m_Handler.CommitOrReset();

            // Verify
            Assert.That(ret, Is.EqualTo(expectedRetVal));
            var selHelper = m_basicView.EditingHelper.CurrentSelection;

            Assert.That(GetTextFromView(hvoPara), Is.EqualTo(expectedText));
            Assert.That(selHelper.IchAnchor, Is.EqualTo(expectedSelStart), "SelectionStart");
            Assert.That(selHelper.IchEnd, Is.EqualTo(expectedSelEnd), "SelectionEnd");
        }
コード例 #3
0
		public void CommitOrReset(IBusAttrUnderline underline,
			bool expectedRetVal, string expectedText, int expectedSelStart, int expectedSelLenth)
		{
			// Setup
			m_TextBox.Text = string.Empty;
			m_TextBox.SelectionStart = 0;
			m_TextBox.SelectionLength = 0;
			m_Handler.OnUpdatePreeditText(new IBusText("a",
				new [] { new IBusUnderlineAttribute(underline, 0, 1)}), 1);

			// Exercise
			var ret = m_Handler.CommitOrReset();

			// Verify
			Assert.That(ret, Is.EqualTo(expectedRetVal));
			Assert.That(m_TextBox.Text, Is.EqualTo(expectedText));
			Assert.That(m_TextBox.SelectionStart, Is.EqualTo(expectedSelStart), "SelectionStart");
			Assert.That(m_TextBox.SelectionLength, Is.EqualTo(expectedSelLenth), "SelectionLength");
		}