本文整理了Java中org.assertj.core.api.AbstractObjectArrayAssert.haveAtLeast()
方法的一些代码示例,展示了AbstractObjectArrayAssert.haveAtLeast()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AbstractObjectArrayAssert.haveAtLeast()
方法的具体详情如下:
包路径:org.assertj.core.api.AbstractObjectArrayAssert
类名称:AbstractObjectArrayAssert
方法名:haveAtLeast
[英]Verifies that there are at least n elements in the actual array satisfying the given condition.
Example :
int[] oneTwoThree = {1, 2, 3};
Condition<Integer> oddNumber = new Condition<>(value % 2 == 1, "odd number");
// assertion will pass
oneTwoThree.haveAtLeast(2, oddNumber);
// assertion will fail
oneTwoThree.haveAtLeast(3, oddNumber);
This method is an alias for #areAtLeast(int,Condition).
[中]验证实际数组中至少有n个元素满足给定条件。
例子:
int[] oneTwoThree = {1, 2, 3};
Condition<Integer> oddNumber = new Condition<>(value % 2 == 1, "odd number");
// assertion will pass
oneTwoThree.haveAtLeast(2, oddNumber);
// assertion will fail
oneTwoThree.haveAtLeast(3, oddNumber);
此方法是#AreatLast(int,Condition)的别名。
代码示例来源:origin: org.assertj/assertj-core
/**
* Verifies that there is <b>at least <i>one</i></b> element in the actual group satisfying the given condition.
* <p>
* This method is an alias for {@code haveAtLeast(1, condition)}.
* <p>
* Example:
* <pre><code class='java'> BasketBallPlayer[] bullsPlayers = {butler, rose};
*
* // potentialMvp is a Condition<BasketBallPlayer>
* assertThat(bullsPlayers).haveAtLeastOne(potentialMvp);</code></pre>
*
* @see #haveAtLeast(int, Condition)
*/
@Override
public SELF haveAtLeastOne(Condition<? super ELEMENT> condition) {
return haveAtLeast(1, condition);
}
代码示例来源:origin: joel-costigliola/assertj-core
/**
* Verifies that there is <b>at least <i>one</i></b> element in the actual array satisfying the given condition.
* <p>
* This method is an alias for {@code haveAtLeast(1, condition)}.
* <p>
* Example:
* <pre><code class='java'> BasketBallPlayer[] bullsPlayers = {butler, rose};
*
* // potentialMvp is a Condition<BasketBallPlayer>
* assertThat(bullsPlayers).haveAtLeastOne(potentialMvp);</code></pre>
*
* @see #haveAtLeast(int, Condition)
*/
@Override
public SELF haveAtLeastOne(Condition<? super ELEMENT> condition) {
return haveAtLeast(1, condition);
}
代码示例来源:origin: org.assertj/assertj-core-java8
/** {@inheritDoc} */
@Override
public S haveAtLeastOne(Condition<? super T> condition) {
return haveAtLeast(1, condition);
}
内容来源于网络,如有侵权,请联系作者删除!