本文整理汇总了Java中android.test.MoreAsserts.assertContentsInOrder方法的典型用法代码示例。如果您正苦于以下问题:Java MoreAsserts.assertContentsInOrder方法的具体用法?Java MoreAsserts.assertContentsInOrder怎么用?Java MoreAsserts.assertContentsInOrder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.test.MoreAsserts
的用法示例。
在下文中一共展示了MoreAsserts.assertContentsInOrder方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testGetConflictingSchedules_conflict2
import android.test.MoreAsserts; //导入方法依赖的package包/类
public void testGetConflictingSchedules_conflict2() {
// The case when there is a long schedule.
long priority = 0;
long channelId = 0;
List<ScheduledRecording> schedules = new ArrayList<>();
ScheduledRecording r1 = RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(
++channelId, ++priority, 0L, 1000L);
schedules.add(r1);
MoreAsserts.assertEmpty(DvrScheduleManager.getConflictingSchedules(schedules, 1));
ScheduledRecording r2 = RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(
++channelId, ++priority, 0L, 100L);
schedules.add(r2);
MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedules(schedules, 1),
r1);
MoreAsserts.assertEmpty(DvrScheduleManager.getConflictingSchedules(schedules, 2));
ScheduledRecording r3 = RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(
++channelId, ++priority, 100L, 200L);
schedules.add(r3);
MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedules(schedules, 1),
r1);
MoreAsserts.assertEmpty(DvrScheduleManager.getConflictingSchedules(schedules, 2));
}
示例2: testGetConflictingSchedules_period1
import android.test.MoreAsserts; //导入方法依赖的package包/类
public void testGetConflictingSchedules_period1() {
long priority = 0;
long channelId = 0;
List<ScheduledRecording> schedules = new ArrayList<>();
ScheduledRecording r1 = RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(
++channelId, ++priority, 0L, 200L);
schedules.add(r1);
ScheduledRecording r2 = RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(
++channelId, ++priority, 0L, 100L);
schedules.add(r2);
MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedules(schedules, 1,
Collections.singletonList(new Range<>(10L, 20L))), r1);
MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedules(schedules, 1,
Collections.singletonList(new Range<>(110L, 120L))), r1);
}
示例3: testGetConflictingSchedules_period2
import android.test.MoreAsserts; //导入方法依赖的package包/类
public void testGetConflictingSchedules_period2() {
long priority = 0;
long channelId = 0;
List<ScheduledRecording> schedules = new ArrayList<>();
ScheduledRecording r1 = RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(
++channelId, ++priority, 0L, 200L);
schedules.add(r1);
ScheduledRecording r2 = RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(
++channelId, ++priority, 100L, 200L);
schedules.add(r2);
MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedules(schedules, 1,
Collections.singletonList(new Range<>(10L, 20L))), r1);
MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedules(schedules, 1,
Collections.singletonList(new Range<>(110L, 120L))), r1);
}
示例4: testGetChannelSortKey_recommendFewChannels
import android.test.MoreAsserts; //导入方法依赖的package包/类
public void testGetChannelSortKey_recommendFewChannels() {
// Test with recommending 3 channels.
createRecommender(true, START_DATAMANAGER_RUNNABLE_ADD_FOUR_CHANNELS);
setChannelScores_scoreIncreasesAsChannelIdIncreases();
List<Channel> expectedChannelList = mRecommender.recommendChannels(3);
// A channel which is not recommended by the recommender has to get an invalid sort key.
assertEquals(Recommender.INVALID_CHANNEL_SORT_KEY,
mRecommender.getChannelSortKey(mChannel_1.getId()));
List<Channel> channelList = Arrays.asList(mChannel_2, mChannel_3, mChannel_4);
Collections.sort(channelList, CHANNEL_SORT_KEY_COMPARATOR);
MoreAsserts.assertContentsInOrder(channelList, expectedChannelList.toArray());
assertSortKeyNotInvalid(channelList);
}
示例5: testGetConflictingSchedules_addSchedules1
import android.test.MoreAsserts; //导入方法依赖的package包/类
public void testGetConflictingSchedules_addSchedules1() {
long priority = 0;
long channelId = 0;
List<ScheduledRecording> schedules = new ArrayList<>();
ScheduledRecording r1 = RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(
++channelId, ++priority, 0L, 200L);
schedules.add(r1);
ScheduledRecording r2 = RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(
++channelId, ++priority, 0L, 100L);
schedules.add(r2);
MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedules(
Collections.singletonList(
ScheduledRecording.builder(INPUT_ID, ++channelId, 10L, 20L)
.setPriority(++priority).build()),
schedules, 1), r2, r1);
MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedules(
Collections.singletonList(
ScheduledRecording.builder(INPUT_ID, ++channelId, 110L, 120L)
.setPriority(++priority).build()),
schedules, 1), r1);
}
示例6: testGetConflictingSchedules_addSchedules2
import android.test.MoreAsserts; //导入方法依赖的package包/类
public void testGetConflictingSchedules_addSchedules2() {
long priority = 0;
long channelId = 0;
List<ScheduledRecording> schedules = new ArrayList<>();
ScheduledRecording r1 = RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(
++channelId, ++priority, 0L, 200L);
schedules.add(r1);
ScheduledRecording r2 = RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(
++channelId, ++priority, 100L, 200L);
schedules.add(r2);
MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedules(
Collections.singletonList(
ScheduledRecording.builder(INPUT_ID, ++channelId, 10L, 20L)
.setPriority(++priority).build()),
schedules, 1), r1);
MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedules(
Collections.singletonList(
ScheduledRecording.builder(INPUT_ID, ++channelId, 110L, 120L)
.setPriority(++priority).build()),
schedules, 1), r2, r1);
}
示例7: testGetConflictingSchedules_addLowestPriority
import android.test.MoreAsserts; //导入方法依赖的package包/类
public void testGetConflictingSchedules_addLowestPriority() {
long priority = 0;
long channelId = 0;
List<ScheduledRecording> schedules = new ArrayList<>();
ScheduledRecording r1 = RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(
++channelId, ++priority, 0L, 400L);
schedules.add(r1);
ScheduledRecording r2 = RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(
++channelId, ++priority, 100L, 200L);
schedules.add(r2);
// Returning r1 even though r1 has the higher priority than the new one. That's because r1
// starts at 0 and stops at 100, and the new one will be recorded successfully.
MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedules(
Collections.singletonList(
ScheduledRecording.builder(INPUT_ID, ++channelId, 200L, 300L)
.setPriority(0).build()),
schedules, 1), r1);
}
示例8: testGetConflictingSchedule_startEarlyAndFail
import android.test.MoreAsserts; //导入方法依赖的package包/类
public void testGetConflictingSchedule_startEarlyAndFail() {
long priority = 0;
long channelId = 0;
List<ScheduledRecording> schedules = new ArrayList<>();
ScheduledRecording r1 = RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(
++channelId, ++priority, 200L, 300L);
schedules.add(r1);
ScheduledRecording r2 = RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(
++channelId, ++priority, 0L, 400L);
schedules.add(r2);
ScheduledRecording r3 = RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(
++channelId, ++priority, 100L, 200L);
schedules.add(r3);
// r2 starts recording and fails when r3 starts. r1 is recorded successfully.
MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedules(schedules, 1),
r2);
}
示例9: testRecommendChannels_notIncludeRecommendedOnly_allChannelsHaveScore
import android.test.MoreAsserts; //导入方法依赖的package包/类
public void testRecommendChannels_notIncludeRecommendedOnly_allChannelsHaveScore() {
createRecommender(false, START_DATAMANAGER_RUNNABLE_ADD_FOUR_CHANNELS);
setChannelScores_scoreIncreasesAsChannelIdIncreases();
// recommendChannels must be sorted by score in decreasing order.
// (i.e. sorted by channel ID in decreasing order in this case)
MoreAsserts.assertContentsInOrder(mRecommender.recommendChannels(),
mChannel_4, mChannel_3, mChannel_2, mChannel_1);
assertEquals(0, mRecommender.recommendChannels(-5).size());
assertEquals(0, mRecommender.recommendChannels(0).size());
MoreAsserts.assertContentsInOrder(mRecommender.recommendChannels(3),
mChannel_4, mChannel_3, mChannel_2);
MoreAsserts.assertContentsInOrder(mRecommender.recommendChannels(4),
mChannel_4, mChannel_3, mChannel_2, mChannel_1);
MoreAsserts.assertContentsInOrder(mRecommender.recommendChannels(5),
mChannel_4, mChannel_3, mChannel_2, mChannel_1);
}
示例10: testRecommendChannels_includeRecommendedOnly_allChannelsHaveScore
import android.test.MoreAsserts; //导入方法依赖的package包/类
public void testRecommendChannels_includeRecommendedOnly_allChannelsHaveScore() {
createRecommender(true, START_DATAMANAGER_RUNNABLE_ADD_FOUR_CHANNELS);
setChannelScores_scoreIncreasesAsChannelIdIncreases();
// recommendChannels must be sorted by score in decreasing order.
// (i.e. sorted by channel ID in decreasing order in this case)
MoreAsserts.assertContentsInOrder(mRecommender.recommendChannels(),
mChannel_4, mChannel_3, mChannel_2, mChannel_1);
assertEquals(0, mRecommender.recommendChannels(-5).size());
assertEquals(0, mRecommender.recommendChannels(0).size());
MoreAsserts.assertContentsInOrder(mRecommender.recommendChannels(3),
mChannel_4, mChannel_3, mChannel_2);
MoreAsserts.assertContentsInOrder(mRecommender.recommendChannels(4),
mChannel_4, mChannel_3, mChannel_2, mChannel_1);
MoreAsserts.assertContentsInOrder(mRecommender.recommendChannels(5),
mChannel_4, mChannel_3, mChannel_2, mChannel_1);
}
示例11: testGetConflictingSchedulesForWatching_sameChannel1
import android.test.MoreAsserts; //导入方法依赖的package包/类
public void testGetConflictingSchedulesForWatching_sameChannel1() {
long priority = 0;
long channelToWatch = 1;
long channelId = 1;
List<ScheduledRecording> schedules = new ArrayList<>();
ScheduledRecording r1 = RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(
channelToWatch, ++priority, 0L, 200L);
schedules.add(r1);
ScheduledRecording r2 = RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(
++channelId, ++priority, 0L, 200L);
schedules.add(r2);
MoreAsserts.assertEmpty(DvrScheduleManager.getConflictingSchedulesForWatching(
INPUT_ID, channelToWatch, 0L, ++priority, schedules, 2));
MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedulesForWatching(
INPUT_ID, channelToWatch, 0L, ++priority, schedules, 1), r2);
}
示例12: testGetConflictingSchedulesForWatching_sameChannel2
import android.test.MoreAsserts; //导入方法依赖的package包/类
public void testGetConflictingSchedulesForWatching_sameChannel2() {
long priority = 0;
long channelToWatch = 1;
long channelId = 1;
List<ScheduledRecording> schedules = new ArrayList<>();
ScheduledRecording r1 = RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(
++channelId, ++priority, 0L, 200L);
schedules.add(r1);
ScheduledRecording r2 = RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(
channelToWatch, ++priority, 0L, 200L);
schedules.add(r2);
MoreAsserts.assertEmpty(DvrScheduleManager.getConflictingSchedulesForWatching(
INPUT_ID, channelToWatch, 0L, ++priority, schedules, 2));
MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedulesForWatching(
INPUT_ID, channelToWatch, 0L, ++priority, schedules, 1), r1);
}
示例13: testGetConflictingSchedulesForWatching_sameChannelConflict1
import android.test.MoreAsserts; //导入方法依赖的package包/类
public void testGetConflictingSchedulesForWatching_sameChannelConflict1() {
long priority = 0;
long channelToWatch = 1;
long channelId = 1;
List<ScheduledRecording> schedules = new ArrayList<>();
ScheduledRecording r1 = RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(
++channelId, ++priority, 0L, 200L);
schedules.add(r1);
ScheduledRecording r2 = RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(
channelToWatch, ++priority, 0L, 200L);
schedules.add(r2);
ScheduledRecording r3 = RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(
channelToWatch, ++priority, 0L, 200L);
schedules.add(r3);
MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedulesForWatching(
INPUT_ID, channelToWatch, 0L, ++priority, schedules, 3), r2);
MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedulesForWatching(
INPUT_ID, channelToWatch, 0L, ++priority, schedules, 2), r2);
MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedulesForWatching(
INPUT_ID, channelToWatch, 0L, ++priority, schedules, 1), r2, r1);
}
示例14: testGetConflictingSchedulesForWatching_sameChannelConflict2
import android.test.MoreAsserts; //导入方法依赖的package包/类
public void testGetConflictingSchedulesForWatching_sameChannelConflict2() {
long priority = 0;
long channelToWatch = 1;
long channelId = 1;
List<ScheduledRecording> schedules = new ArrayList<>();
ScheduledRecording r1 = RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(
channelToWatch, ++priority, 0L, 200L);
schedules.add(r1);
ScheduledRecording r2 = RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(
channelToWatch, ++priority, 0L, 200L);
schedules.add(r2);
ScheduledRecording r3 = RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(
++channelId, ++priority, 0L, 200L);
schedules.add(r3);
MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedulesForWatching(
INPUT_ID, channelToWatch, 0L, ++priority, schedules, 3), r1);
MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedulesForWatching(
INPUT_ID, channelToWatch, 0L, ++priority, schedules, 2), r1);
MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedulesForWatching(
INPUT_ID, channelToWatch, 0L, ++priority, schedules, 1), r3, r1);
}
示例15: checkCorrectEntry
import android.test.MoreAsserts; //导入方法依赖的package包/类
private void checkCorrectEntry(AccountDb.OtpType type) {
// enter account name
assertEquals("[email protected]",
TestUtilities.setText(mInstr, mAccountName, "[email protected]"));
// enter key
assertEquals("7777777777777777",
TestUtilities.setText(mInstr, mKeyEntryField, "7777777777777777"));
// select TOTP/HOTP type
assertEquals(mActivity.getResources().getStringArray(R.array.type)[type.value],
TestUtilities.selectSpinnerItem(mInstr, mType, type.value));
assertFalse(mActivity.isFinishing());
// save
TestUtilities.clickView(mInstr, mSubmitButton);
// check activity's resulting update of database.
assertEquals(1, mAccountDb.getNames(result));
MoreAsserts.assertContentsInOrder(result, "[email protected]");
assertEquals(type, mAccountDb.getType("[email protected]"));
assertEquals(0, mAccountDb.getCounter("[email protected]").intValue());
assertTrue(mActivity.isFinishing());
}