Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
io.flutter.plugin.editing.TextEditingDeltaTest Class Reference

Public Member Functions

void setUp ()
 
void testConstructorTextEditingDelta ()
 
void testNonTextUpdateConstructorTextEditingDelta ()
 

Detailed Description

Definition at line 14 of file TextEditingDeltaTest.java.

Member Function Documentation

◆ setUp()

void io.flutter.plugin.editing.TextEditingDeltaTest.setUp ( )
inline

Definition at line 16 of file TextEditingDeltaTest.java.

16 {
17 MockitoAnnotations.openMocks(this);
18 }

◆ testConstructorTextEditingDelta()

void io.flutter.plugin.editing.TextEditingDeltaTest.testConstructorTextEditingDelta ( )
inline

Definition at line 21 of file TextEditingDeltaTest.java.

21 {
22 final CharSequence oldText = "hell";
23 final CharSequence textAfterChange = "hello";
24
25 final int oldComposingStart = 0;
26 final int oldComposingEnd = 4;
27
28 final int startOfReplacementText = 0;
29 final int endOfReplacementText = textAfterChange.length();
30
31 final int newSelectionStart = 5;
32 final int newSelectionEnd = 5;
33 final int newComposingStart = 0;
34 final int newComposingEnd = 5;
35
36 final TextEditingDelta delta =
37 new TextEditingDelta(
38 oldText,
39 oldComposingStart,
40 oldComposingEnd,
41 textAfterChange,
42 newSelectionStart,
43 newSelectionEnd,
44 newComposingStart,
45 newComposingEnd);
46
47 assertEquals(oldText, delta.getOldText());
48 assertEquals(textAfterChange, delta.getDeltaText());
49 assertEquals(oldComposingStart, delta.getDeltaStart());
50 assertEquals(oldComposingEnd, delta.getDeltaEnd());
51 assertEquals(newSelectionStart, delta.getNewSelectionStart());
52 assertEquals(newSelectionEnd, delta.getNewSelectionEnd());
53 assertEquals(newComposingStart, delta.getNewComposingStart());
54 assertEquals(newComposingEnd, delta.getNewComposingEnd());
55 }

◆ testNonTextUpdateConstructorTextEditingDelta()

void io.flutter.plugin.editing.TextEditingDeltaTest.testNonTextUpdateConstructorTextEditingDelta ( )
inline

Definition at line 58 of file TextEditingDeltaTest.java.

58 {
59 final CharSequence oldText = "hello";
60
61 final int newSelectionStart = 3;
62 final int newSelectionEnd = 3;
63 final int newComposingStart = 0;
64 final int newComposingEnd = 5;
65
66 final TextEditingDelta delta =
67 new TextEditingDelta(
68 oldText, newSelectionStart, newSelectionEnd, newComposingStart, newComposingEnd);
69
70 assertEquals(oldText, delta.getOldText());
71 assertEquals("", delta.getDeltaText());
72 assertEquals(-1, delta.getDeltaStart());
73 assertEquals(-1, delta.getDeltaEnd());
74 assertEquals(newSelectionStart, delta.getNewSelectionStart());
75 assertEquals(newSelectionEnd, delta.getNewSelectionEnd());
76 assertEquals(newComposingStart, delta.getNewComposingStart());
77 assertEquals(newComposingEnd, delta.getNewComposingEnd());
78 }

The documentation for this class was generated from the following file: