本文整理汇总了Java中org.hamcrest.collection.IsArrayWithSize类的典型用法代码示例。如果您正苦于以下问题:Java IsArrayWithSize类的具体用法?Java IsArrayWithSize怎么用?Java IsArrayWithSize使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IsArrayWithSize类属于org.hamcrest.collection包,在下文中一共展示了IsArrayWithSize类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: shouldGetEmptyArrayIfNullValue
import org.hamcrest.collection.IsArrayWithSize; //导入依赖的package包/类
@Test
public void shouldGetEmptyArrayIfNullValue() throws Exception {
JsonElement value = gson.toJsonTree(null);
ClaimImpl claim = new ClaimImpl(value);
assertThat(claim.asArray(String.class), is(notNullValue()));
assertThat(claim.asArray(String.class), is(IsArrayWithSize.<String>emptyArray()));
}
示例2: shouldGetEmptyArrayIfNonArrayValue
import org.hamcrest.collection.IsArrayWithSize; //导入依赖的package包/类
@Test
public void shouldGetEmptyArrayIfNonArrayValue() throws Exception {
JsonElement value = gson.toJsonTree(1);
ClaimImpl claim = new ClaimImpl(value);
assertThat(claim.asArray(String.class), is(notNullValue()));
assertThat(claim.asArray(String.class), is(IsArrayWithSize.<String>emptyArray()));
}
示例3: canAssignIsArrayWithSizeMatcher
import org.hamcrest.collection.IsArrayWithSize; //导入依赖的package包/类
@Test
public void canAssignIsArrayWithSizeMatcher() {
Matcher<Phone[]> withTwoElements = IsArrayWithSize.arrayWithSize(2);
assertThat(bob, is(aPersonThat().hasPhones(withTwoElements)));
Matcher<Phone[]> empty = IsArrayWithSize.emptyArray();
assertThat(bill, is(aPersonThat().hasPhones(empty)));
}
示例4: isNull
import org.hamcrest.collection.IsArrayWithSize; //导入依赖的package包/类
@Test
public void isNull() throws Exception {
mWhere.isNull("test");
Assert.assertThat(mWhere.toString(), IsEqual.equalTo(" WHERE test IS NULL"));
Assert.assertThat(mWhere.getValues(), IsArrayWithSize.emptyArray());
}
示例5: notNull
import org.hamcrest.collection.IsArrayWithSize; //导入依赖的package包/类
@Test
public void notNull() throws Exception {
mWhere.notNull("test");
Assert.assertThat(mWhere.toString(), IsEqual.equalTo(" WHERE test NOT NULL"));
Assert.assertThat(mWhere.getValues(), IsArrayWithSize.emptyArray());
}
示例6: sortByAsc
import org.hamcrest.collection.IsArrayWithSize; //导入依赖的package包/类
@Test
public void sortByAsc() throws Exception {
mWhere.sortBy("test", SortBy.Order.ASC);
Assert.assertThat(mWhere.toString(), IsEqual.equalTo(" ORDER BY test ASC"));
Assert.assertThat(mWhere.getValues(), IsArrayWithSize.emptyArray());
}
示例7: sortByDesc
import org.hamcrest.collection.IsArrayWithSize; //导入依赖的package包/类
@Test
public void sortByDesc() throws Exception {
mWhere.sortBy("test", SortBy.Order.DESC);
Assert.assertThat(mWhere.toString(), IsEqual.equalTo(" ORDER BY test DESC"));
Assert.assertThat(mWhere.getValues(), IsArrayWithSize.emptyArray());
}
示例8: shouldNotRequireAndroidPermissions
import org.hamcrest.collection.IsArrayWithSize; //导入依赖的package包/类
@Test
public void shouldNotRequireAndroidPermissions() throws Exception {
assertThat(provider.getRequiredAndroidPermissions(), is(notNullValue()));
assertThat(provider.getRequiredAndroidPermissions(), is(IsArrayWithSize.<String>emptyArray()));
}