public async Task Test() { var keyboard = new MathKeyboard <TestFont, TGlyph>(TestTypesettingContexts.Instance, new TestFont()) { InsertionPositionHighlighted = true }; Assert.True(keyboard.ShouldDrawCaret); keyboard.StopBlinking(); await Task.Delay((int)MathKeyboard <TestFont, TGlyph> .DefaultBlinkMilliseconds + CaretBlinks.MillisecondBuffer); Assert.True(keyboard.ShouldDrawCaret); keyboard.StartBlinking(); await Task.Delay((int)MathKeyboard <TestFont, TGlyph> .DefaultBlinkMilliseconds + CaretBlinks.MillisecondBuffer); Assert.False(keyboard.ShouldDrawCaret); keyboard.StopBlinking(); await Task.Delay((int)MathKeyboard <TestFont, TGlyph> .DefaultBlinkMilliseconds + CaretBlinks.MillisecondBuffer); Assert.False(keyboard.ShouldDrawCaret); keyboard.StartBlinking(); await Task.Delay((int)MathKeyboard <TestFont, TGlyph> .DefaultBlinkMilliseconds + CaretBlinks.MillisecondBuffer); Assert.True(keyboard.ShouldDrawCaret); }
public async Task Test() { var keyboard = new MathKeyboard <TestFont, char>(TestTypesettingContexts.Instance, new TestFont()) { CaretState = MathKeyboardCaretState.Shown }; Assert.Equal(MathKeyboardCaretState.Shown, keyboard.CaretState); keyboard.StopBlinking(); await Task.Delay((int)MathKeyboard <TestFont, char> .DefaultBlinkMilliseconds + CaretBlinks.MillisecondBuffer); Assert.Equal(MathKeyboardCaretState.Shown, keyboard.CaretState); keyboard.StartBlinking(); await Task.Delay((int)MathKeyboard <TestFont, char> .DefaultBlinkMilliseconds + CaretBlinks.MillisecondBuffer); Assert.Equal(MathKeyboardCaretState.TemporarilyHidden, keyboard.CaretState); keyboard.StopBlinking(); await Task.Delay((int)MathKeyboard <TestFont, char> .DefaultBlinkMilliseconds + CaretBlinks.MillisecondBuffer); Assert.Equal(MathKeyboardCaretState.TemporarilyHidden, keyboard.CaretState); keyboard.StartBlinking(); await Task.Delay((int)MathKeyboard <TestFont, char> .DefaultBlinkMilliseconds + CaretBlinks.MillisecondBuffer); Assert.Equal(MathKeyboardCaretState.Shown, keyboard.CaretState); }
public void Test() { var keyboard = new MathKeyboard <TestFont, TGlyph>(TestTypesettingContexts.Instance, new TestFont()) { InsertionPositionHighlighted = false }; keyboard.StopBlinking(); Assert.False(keyboard.InsertionPositionHighlighted); keyboard.KeyPress(MathKeyboardInput.Power); Assert.True(keyboard.InsertionPositionHighlighted); }