Example usage for android.test MoreAsserts assertContentsInOrder

List of usage examples for android.test MoreAsserts assertContentsInOrder

Introduction

In this page you can find the example usage for android.test MoreAsserts assertContentsInOrder.

Prototype

public static void assertContentsInOrder(String message, Iterable<?> actual, Object... expected) 

Source Link

Document

Asserts that actual contains precisely the elements expected , and in the same order.

Usage

From source file:com.android.quicksearchbox.ShortcutRepositoryTest.java

void assertCorpusRanking(String message, Corpus... expected) {
    String[] expectedNames = new String[expected.length];
    for (int i = 0; i < expected.length; i++) {
        expectedNames[i] = expected[i].getName();
    }/* w ww  .ja v  a2 s. c  o  m*/
    Map<String, Integer> scores = getCorpusScores();
    List<String> observed = sortByValues(scores);
    // Highest scores should come first
    Collections.reverse(observed);
    Log.d(TAG, "scores=" + scores);
    MoreAsserts.assertContentsInOrder(message, observed, (Object[]) expectedNames);
}

From source file:com.android.quicksearchbox.ShortcutRepositoryTest.java

static void assertContentsInOrder(Iterable<?> actual, Object... expected) {
    MoreAsserts.assertContentsInOrder(null, actual, expected);
}