コード例 #1
0
  @Test
  public void testSetsTextReplacement() {
    TextReplacementData data = mock(TextReplacementData.class);
    when(data.getId()).thenReturn("r42");

    decorator.setTextReplacement(data);

    verify(text).setData(TEXT_REPLACEMENT.getKey(), "r42");
  }
コード例 #2
0
  @Test
  public void testDoesNotSetTextReplacementWithWebClient() {
    environment.setClient(mock(WebClient.class));
    TextReplacementData data = mock(TextReplacementData.class);
    when(data.getId()).thenReturn("r42");

    decorator.setTextReplacement(data);

    verify(text, never()).setData(TEXT_REPLACEMENT.getKey(), "r42");
  }
コード例 #3
0
  @Test
  public void testUseUrlKeyboard() {
    decorator.useUrlKeyboard();

    verify(text).setData(KEYBOARD.getKey(), "url");
  }
コード例 #4
0
  @Test
  public void testUseNumbersAndPunctuationKeyboard() {
    decorator.useNumbersAndPunctuationKeyboard();

    verify(text).setData(KEYBOARD.getKey(), "numbersAndPunctuation");
  }
コード例 #5
0
  @Test
  public void testUseAsciiKeyboard() {
    decorator.useAsciiKeyboard();

    verify(text).setData(KEYBOARD.getKey(), "ascii");
  }
コード例 #6
0
  @Test
  public void testUseHintText() {
    decorator.useHintText("test");

    verify(text).setMessage(eq("test"));
  }
コード例 #7
0
  @Test
  public void testSetAutoCapitalizeDisabled() {
    decorator.setAutoCapitalizationEnabled(false);

    verify(text).setData(AUTO_CAPITALIZE.getKey(), Boolean.valueOf(false));
  }
コード例 #8
0
  @Test
  public void testSetAutoCorrectDisabled() {
    decorator.setAutoCorrectionEnabled(false);

    verify(text).setData(AUTO_CORRECT.getKey(), Boolean.valueOf(false));
  }
コード例 #9
0
 @Test(expected = IllegalArgumentException.class)
 public void testSetTextReplacementFailsWithNullData() {
   decorator.setTextReplacement(null);
 }
コード例 #10
0
  @Test
  public void testUsePhoneKeyboard() {
    decorator.usePhoneKeyboard();

    verify(text).setData(KEYBOARD.getKey(), "phone");
  }