当前位置: 首页>>代码示例>>Java>>正文


Java MoreAsserts.assertEmpty方法代码示例

本文整理汇总了Java中android.test.MoreAsserts.assertEmpty方法的典型用法代码示例。如果您正苦于以下问题:Java MoreAsserts.assertEmpty方法的具体用法?Java MoreAsserts.assertEmpty怎么用?Java MoreAsserts.assertEmpty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.test.MoreAsserts的用法示例。


在下文中一共展示了MoreAsserts.assertEmpty方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testGetConflictingSchedules_noConflict

import android.test.MoreAsserts; //导入方法依赖的package包/类
public void testGetConflictingSchedules_noConflict() {
    long priority = 0;
    long channelId = 0;
    List<ScheduledRecording> schedules = new ArrayList<>();

    schedules.add(RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(++channelId,
            ++priority, 0L, 200L));
    MoreAsserts.assertEmpty(DvrScheduleManager.getConflictingSchedules(schedules, 1));

    schedules.add(RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(++channelId,
            ++priority, 0L, 100L));
    MoreAsserts.assertEmpty(DvrScheduleManager.getConflictingSchedules(schedules, 2));

    schedules.add(RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(++channelId,
            ++priority, 100L, 200L));
    MoreAsserts.assertEmpty(DvrScheduleManager.getConflictingSchedules(schedules, 2));

    schedules.add(RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(++channelId,
            ++priority, 0L, 100L));
    MoreAsserts.assertEmpty(DvrScheduleManager.getConflictingSchedules(schedules, 3));

    schedules.add(RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(++channelId,
            ++priority, 100L, 200L));
    MoreAsserts.assertEmpty(DvrScheduleManager.getConflictingSchedules(schedules, 3));
}
 
开发者ID:trevd,项目名称:android_packages_apps_tv,代码行数:26,代码来源:DvrScheduleManagerTest.java

示例2: 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));
}
 
开发者ID:trevd,项目名称:android_packages_apps_tv,代码行数:26,代码来源:DvrScheduleManagerTest.java

示例3: testGetConflictingSchedulesForWatching_otherChannels

import android.test.MoreAsserts; //导入方法依赖的package包/类
public void testGetConflictingSchedulesForWatching_otherChannels() {
    // The other channels are to be recorded.
    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(
            ++channelId, ++priority, 0L, 200L);
    schedules.add(r2);
    MoreAsserts.assertEmpty(DvrScheduleManager.getConflictingSchedulesForWatching(
            INPUT_ID, channelToWatch, 0L, ++priority, schedules, 3));
    MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedulesForWatching(
            INPUT_ID, channelToWatch, 0L, ++priority, schedules, 2), r1);
}
 
开发者ID:trevd,项目名称:android_packages_apps_tv,代码行数:18,代码来源:DvrScheduleManagerTest.java

示例4: 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);
}
 
开发者ID:trevd,项目名称:android_packages_apps_tv,代码行数:17,代码来源:DvrScheduleManagerTest.java

示例5: 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);
}
 
开发者ID:trevd,项目名称:android_packages_apps_tv,代码行数:17,代码来源:DvrScheduleManagerTest.java

示例6: testGetConflictingSchedules_noTuner

import android.test.MoreAsserts; //导入方法依赖的package包/类
public void testGetConflictingSchedules_noTuner() {
    long priority = 0;
    long channelId = 0;
    List<ScheduledRecording> schedules = new ArrayList<>();
    MoreAsserts.assertEmpty(DvrScheduleManager.getConflictingSchedules(schedules, 0));

    schedules.add(RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(++channelId,
            ++priority, 0L, 200L));
    assertEquals(schedules, DvrScheduleManager.getConflictingSchedules(schedules, 0));
    schedules.add(0, RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(++channelId,
            ++priority, 0L, 100L));
    assertEquals(schedules, DvrScheduleManager.getConflictingSchedules(schedules, 0));
}
 
开发者ID:trevd,项目名称:android_packages_apps_tv,代码行数:14,代码来源:DvrScheduleManagerTest.java

示例7: testGetConflictingSchedules_sameChannel

import android.test.MoreAsserts; //导入方法依赖的package包/类
public void testGetConflictingSchedules_sameChannel() {
    long priority = 0;
    long channelId = 1;
    List<ScheduledRecording> schedules = new ArrayList<>();
    schedules.add(RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(channelId,
            ++priority, 0L, 200L));
    schedules.add(RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(channelId,
            ++priority, 0L, 200L));
    MoreAsserts.assertEmpty(DvrScheduleManager.getConflictingSchedules(schedules, 3));
}
 
开发者ID:trevd,项目名称:android_packages_apps_tv,代码行数:11,代码来源:DvrScheduleManagerTest.java

示例8: testGetConflictingSchedulesForTune_canTune

import android.test.MoreAsserts; //导入方法依赖的package包/类
public void testGetConflictingSchedulesForTune_canTune() {
    // Can tune to the recorded channel if tuner count is 1.
    long priority = 0;
    long channelId = 1;
    List<ScheduledRecording> schedules = new ArrayList<>();
    schedules.add(RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(channelId,
            ++priority, 0L, 200L));
    MoreAsserts.assertEmpty(DvrScheduleManager.getConflictingSchedulesForTune(INPUT_ID,
            channelId, 0L, priority + 1, schedules, 1));
}
 
开发者ID:trevd,项目名称:android_packages_apps_tv,代码行数:11,代码来源:DvrScheduleManagerTest.java

示例9: testRequest

import android.test.MoreAsserts; //导入方法依赖的package包/类
public void testRequest() throws Exception {
  withHttpRequestThrowing(new IOException("arbitrary"));
  try {
    mProvider.getNetworkTime();
  } catch (Exception expected) {}

  ArgumentCaptor<HttpUriRequest> requestCaptor = ArgumentCaptor.forClass(HttpUriRequest.class);
  verify(mMockHttpClient).execute(requestCaptor.capture());

  HttpUriRequest request = requestCaptor.getValue();
  assertEquals("HEAD", request.getMethod());
  assertEquals("https://www.google.com", request.getURI().toString());
  MoreAsserts.assertEmpty(Arrays.asList(request.getAllHeaders()));
}
 
开发者ID:ocdtrekkie,项目名称:authenticator,代码行数:15,代码来源:NetworkTimeProviderTest.java

示例10: checkBadAccountSetup

import android.test.MoreAsserts; //导入方法依赖的package包/类
private void checkBadAccountSetup(String uri, int dialogId) throws Throwable {
  getActivity();

  callOnActivityResultOnUiThreadWithScannedUri(uri);

  List<String> accountNames = new ArrayList<String>();
  mAccountDb.getNames(accountNames);
  MoreAsserts.assertEmpty(accountNames);
  TestUtilities.assertDialogWasDisplayed(getActivity(), dialogId);
  assertFalse(getActivity().isFinishing()); // AuthenticatorActivity should continue
}
 
开发者ID:ocdtrekkie,项目名称:authenticator,代码行数:12,代码来源:AuthenticatorActivityPart2Test.java

示例11: testAccountSetup_withNullIntent

import android.test.MoreAsserts; //导入方法依赖的package包/类
public void testAccountSetup_withNullIntent() throws Throwable {
  getActivity();

  callOnActivityResultOnUiThread(AuthenticatorActivity.SCAN_REQUEST, Activity.RESULT_OK, null);

  List<String> accountNames = new ArrayList<String>();
  mAccountDb.getNames(accountNames);
  MoreAsserts.assertEmpty(accountNames);
  TestUtilities.assertDialogWasDisplayed(getActivity(), Utilities.INVALID_QR_CODE);
  assertFalse(getActivity().isFinishing()); // AuthenticatorActivity should continue
}
 
开发者ID:ocdtrekkie,项目名称:authenticator,代码行数:12,代码来源:AuthenticatorActivityPart2Test.java

示例12: testGetConflictingSchedules_emptySchedule

import android.test.MoreAsserts; //导入方法依赖的package包/类
public void testGetConflictingSchedules_emptySchedule() {
    List<ScheduledRecording> schedules = new ArrayList<>();
    MoreAsserts.assertEmpty(DvrScheduleManager.getConflictingSchedules(schedules, 1));
}
 
开发者ID:trevd,项目名称:android_packages_apps_tv,代码行数:5,代码来源:DvrScheduleManagerTest.java

示例13: testGetConflictingSchedules_conflict

import android.test.MoreAsserts; //导入方法依赖的package包/类
public void testGetConflictingSchedules_conflict() {
    long priority = 0;
    long channelId = 0;
    List<ScheduledRecording> schedules = new ArrayList<>();

    ScheduledRecording r1 = RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(
            ++channelId, ++priority, 0L, 200L);
    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));

    ScheduledRecording r4 = RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(
            ++channelId, ++priority, 0L, 100L);
    schedules.add(r4);
    MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedules(schedules, 1),
            r2, r1);
    MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedules(schedules, 2),
            r1);
    MoreAsserts.assertEmpty(DvrScheduleManager.getConflictingSchedules(schedules, 3));

    ScheduledRecording r5 = RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(
            ++channelId, ++priority, 100L, 200L);
    schedules.add(r5);
    MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedules(schedules, 1),
            r3, r2, r1);
    MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedules(schedules, 2),
            r1);
    MoreAsserts.assertEmpty(DvrScheduleManager.getConflictingSchedules(schedules, 3));

    ScheduledRecording r6 = RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(
            ++channelId, ++priority, 10L, 90L);
    schedules.add(r6);
    MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedules(schedules, 1),
            r4, r3, r2, r1);
    MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedules(schedules, 2),
            r2, r1);
    MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedules(schedules, 3),
            r1);
    MoreAsserts.assertEmpty(DvrScheduleManager.getConflictingSchedules(schedules, 4));

    ScheduledRecording r7 = RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(
            ++channelId, ++priority, 110L, 190L);
    schedules.add(r7);
    MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedules(schedules, 1),
            r5, r4, r3, r2, r1);
    MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedules(schedules, 2),
            r3, r2, r1);
    MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedules(schedules, 3),
            r1);
    MoreAsserts.assertEmpty(DvrScheduleManager.getConflictingSchedules(schedules, 4));

    ScheduledRecording r8 = RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(
            ++channelId, ++priority, 50L, 150L);
    schedules.add(r8);
    MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedules(schedules, 1),
            r7, r6, r5, r4, r3, r2, r1);
    MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedules(schedules, 2),
            r5, r4, r3, r2, r1);
    MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedules(schedules, 3),
            r3, r2, r1);
    MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedules(schedules, 4),
            r1);
    MoreAsserts.assertEmpty(DvrScheduleManager.getConflictingSchedules(schedules, 5));
}
 
开发者ID:trevd,项目名称:android_packages_apps_tv,代码行数:78,代码来源:DvrScheduleManagerTest.java

示例14: testGetConflictingSchedules_reverseOrder

import android.test.MoreAsserts; //导入方法依赖的package包/类
public void testGetConflictingSchedules_reverseOrder() {
    long priority = 0;
    long channelId = 0;
    List<ScheduledRecording> schedules = new ArrayList<>();

    ScheduledRecording r1 = RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(
            ++channelId, ++priority, 0L, 200L);
    schedules.add(0, r1);
    MoreAsserts.assertEmpty(DvrScheduleManager.getConflictingSchedules(schedules, 1));

    ScheduledRecording r2 = RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(
            ++channelId, ++priority, 0L, 100L);
    schedules.add(0, r2);
    MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedules(schedules, 1),
            r1);
    MoreAsserts.assertEmpty(DvrScheduleManager.getConflictingSchedules(schedules, 2));

    ScheduledRecording r3 = RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(
            ++channelId, ++priority, 100L, 200L);
    schedules.add(0, r3);
    MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedules(schedules, 1),
            r1);
    MoreAsserts.assertEmpty(DvrScheduleManager.getConflictingSchedules(schedules, 2));

    ScheduledRecording r4 = RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(
            ++channelId, ++priority, 0L, 100L);
    schedules.add(0, r4);
    MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedules(schedules, 1),
            r2, r1);
    MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedules(schedules, 2),
            r1);
    MoreAsserts.assertEmpty(DvrScheduleManager.getConflictingSchedules(schedules, 3));

    ScheduledRecording r5 = RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(
            ++channelId, ++priority, 100L, 200L);
    schedules.add(0, r5);
    MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedules(schedules, 1),
            r3, r2, r1);
    MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedules(schedules, 2),
            r1);
    MoreAsserts.assertEmpty(DvrScheduleManager.getConflictingSchedules(schedules, 3));

    ScheduledRecording r6 = RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(
            ++channelId, ++priority, 10L, 90L);
    schedules.add(0, r6);
    MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedules(schedules, 1),
            r4, r3, r2, r1);
    MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedules(schedules, 2),
            r2, r1);
    MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedules(schedules, 3),
            r1);
    MoreAsserts.assertEmpty(DvrScheduleManager.getConflictingSchedules(schedules, 4));

    ScheduledRecording r7 = RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(
            ++channelId, ++priority, 110L, 190L);
    schedules.add(0, r7);
    MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedules(schedules, 1),
            r5, r4, r3, r2, r1);
    MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedules(schedules, 2),
            r3, r2, r1);
    MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedules(schedules, 3),
            r1);
    MoreAsserts.assertEmpty(DvrScheduleManager.getConflictingSchedules(schedules, 4));

    ScheduledRecording r8 = RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(
            ++channelId, ++priority, 50L, 150L);
    schedules.add(0, r8);
    MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedules(schedules, 1),
            r7, r6, r5, r4, r3, r2, r1);
    MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedules(schedules, 2),
            r5, r4, r3, r2, r1);
    MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedules(schedules, 3),
            r3, r2, r1);
    MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedules(schedules, 4),
            r1);
    MoreAsserts.assertEmpty(DvrScheduleManager.getConflictingSchedules(schedules, 5));
}
 
开发者ID:trevd,项目名称:android_packages_apps_tv,代码行数:78,代码来源:DvrScheduleManagerTest.java

示例15: testEnumerateAccountsNoRecords

import android.test.MoreAsserts; //导入方法依赖的package包/类
public void testEnumerateAccountsNoRecords() throws Exception {
  assertEquals(0, otpProvider.enumerateAccounts(result));
  MoreAsserts.assertEmpty(result);
}
 
开发者ID:ocdtrekkie,项目名称:authenticator,代码行数:5,代码来源:OtpProviderTest.java


注:本文中的android.test.MoreAsserts.assertEmpty方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。