Package org.fest.swing.util

Examples of org.fest.swing.util.TextMatcher


* @author Alex Ruiz
*/
public class JListMatchingItemQuery_matchingItemIndex_Test extends JListMatchingItemQuery_TestCase {
  @Test
  public void should_return_index_of_matching_item() {
    TextMatcher matcher = mockTextMatcher();
    when(matcher.isMatching("Yoda")).thenReturn(false);
    when(matcher.isMatching("Luke")).thenReturn(true);
    assertThat(matchingItemIndex(matcher)).isEqualTo(1);
  }
View Full Code Here


    assertThat(matchingItemIndex(matcher)).isEqualTo(1);
  }

  @Test
  public void should_return_negative_one_if_matching_item_not_found() {
    TextMatcher matcher = mockTextMatcher();
    when(matcher.isMatching("Yoda")).thenReturn(false);
    when(matcher.isMatching("Luke")).thenReturn(false);
    assertThat(matchingItemIndex(matcher)).isEqualTo(-1);
  }
View Full Code Here

* @author Alex Ruiz
*/
public class JListMatchingItemQuery_matchingItemIndices_Test extends JListMatchingItemQuery_TestCase {
  @Test
  public void should_return_indices_of_matching_items() {
    TextMatcher matcher = mockTextMatcher();
    when(matcher.isMatching("Yoda")).thenReturn(false);
    when(matcher.isMatching("Luke")).thenReturn(true);
    List<Integer> indices = JListMatchingItemQuery.matchingItemIndices(list, matcher, cellReader);
    assertThat(indices).hasSize(1).containsOnly(1);
  }
View Full Code Here

    assertThat(indices).hasSize(1).containsOnly(1);
  }

  @Test
  public void should_return_empty_list_if_matching_indices_not_found() {
    TextMatcher matcher = mockTextMatcher();
    when(matcher.isMatching("Yoda")).thenReturn(false);
    when(matcher.isMatching("Luke")).thenReturn(false);
    List<Integer> indices = JListMatchingItemQuery.matchingItemIndices(list, matcher, cellReader);
    assertThat(indices).isEmpty();
  }
View Full Code Here

* @author Alex Ruiz
*/
public class JListMatchingItemQuery_matchingItemValues_Test extends JListMatchingItemQuery_TestCase {
  @Test
  public void should_return_values_of_matching_items() {
    TextMatcher matcher = mockTextMatcher();
    when(matcher.isMatching("Yoda")).thenReturn(false);
    when(matcher.isMatching("Luke")).thenReturn(true);
    List<String> values = JListMatchingItemQuery.matchingItemValues(list, matcher, cellReader);
    assertThat(values).hasSize(1).containsOnly("Luke");
  }
View Full Code Here

    assertThat(values).hasSize(1).containsOnly("Luke");
  }

  @Test
  public void should_return_empty_list_if_matching_values_not_found() {
    TextMatcher matcher = mockTextMatcher();
    when(matcher.isMatching("Yoda")).thenReturn(false);
    when(matcher.isMatching("Luke")).thenReturn(false);
    List<String> values = JListMatchingItemQuery.matchingItemValues(list, matcher, cellReader);
    assertThat(values).isEmpty();
  }
View Full Code Here

TOP

Related Classes of org.fest.swing.util.TextMatcher

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.