org.assertj.core.api.AbstractLongArrayAssert.hasSize()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(2.7k)|赞(0)|评价(0)|浏览(164)

本文整理了Java中org.assertj.core.api.AbstractLongArrayAssert.hasSize()方法的一些代码示例,展示了AbstractLongArrayAssert.hasSize()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AbstractLongArrayAssert.hasSize()方法的具体详情如下:
包路径:org.assertj.core.api.AbstractLongArrayAssert
类名称:AbstractLongArrayAssert
方法名:hasSize

AbstractLongArrayAssert.hasSize介绍

暂无

代码示例

代码示例来源:origin: apache/geode

@Test
 public void getThreadIds() {
  executorServiceRule.submit(() -> terminateLatch.await(TIMEOUT_MILLIS, MILLISECONDS));
  executorServiceRule.submit(() -> terminateLatch.await(TIMEOUT_MILLIS, MILLISECONDS));

  long[] threadIds = executorServiceRule.getThreadIds();

  assertThat(threadIds).hasSize(2);

  Set<Thread> threads = executorServiceRule.getThreads();
  for (Thread thread : threads) {
   assertThat(threadIds).contains(thread.getId());
  }
 }
}

代码示例来源:origin: hidroh/materialistic

assertThat(item.getDisplayedTime(RuntimeEnvironment.application))
    .isNotEmpty();
assertThat(item.getKids()).hasSize(1);
assertEquals(1, item.getKidItems()[0].getLevel());

代码示例来源:origin: facebook/litho

@Test
public void measureBeforeBeingAttached() {
 mLithoView.measure(
   makeMeasureSpec(0, UNSPECIFIED),
   makeMeasureSpec(0, UNSPECIFIED));
 mLithoView.layout(
   0,
   0,
   mLithoView.getMeasuredWidth(),
   mLithoView.getMeasuredHeight());
 // View got measured.
 assertThat(mLithoView.getMeasuredWidth()).isGreaterThan(0);
 assertThat(mLithoView.getMeasuredHeight()).isGreaterThan(0);
 // Attaching will automatically mount since we already have a layout fitting our size.
 ShadowView shadow = shadowOf(mLithoView);
 shadow.callOnAttachedToWindow();
 assertThat(getInternalMountItems(mLithoView)).hasSize(2);
}

代码示例来源:origin: facebook/litho

/** This verifies that the width is correct with at most layout params. */
@Test
public void measureWithAtMostLayoutParams() {
 final Component component =
   new InlineLayoutSpec() {
    @Override
    protected Component onCreateLayout(ComponentContext c) {
     return TestDrawableComponent.create(c).widthPercent(50).heightPercent(10).build();
    }
   };
 mLithoView = new LithoView(RuntimeEnvironment.application);
 mLithoView.setComponent(component);
 mLithoView.setLayoutParams(
   new RecyclerViewLayoutManagerOverrideParams(
     SizeSpec.makeSizeSpec(100, SizeSpec.AT_MOST),
     SizeSpec.makeSizeSpec(200, SizeSpec.AT_MOST)));
 mLithoView.measure(makeMeasureSpec(0, UNSPECIFIED), makeMeasureSpec(0, UNSPECIFIED));
 mLithoView.layout(0, 0, mLithoView.getMeasuredWidth(), mLithoView.getMeasuredHeight());
 // View got measured.
 assertThat(mLithoView.getMeasuredWidth()).isEqualTo(50);
 assertThat(mLithoView.getMeasuredHeight()).isEqualTo(20);
 // Attaching will automatically mount since we already have a layout fitting our size.
 ShadowView shadow = shadowOf(mLithoView);
 shadow.callOnAttachedToWindow();
 assertThat(getInternalMountItems(mLithoView)).hasSize(2);
}

相关文章