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


Java IsArrayWithSize类代码示例

本文整理汇总了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()));
}
 
开发者ID:auth0,项目名称:JWTDecode.Android,代码行数:9,代码来源:ClaimImplTest.java

示例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()));
}
 
开发者ID:auth0,项目名称:JWTDecode.Android,代码行数:9,代码来源:ClaimImplTest.java

示例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)));
}
 
开发者ID:mistraltechnologies,项目名称:smog,代码行数:9,代码来源:ArraysTest.java

示例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());
}
 
开发者ID:DanielSerdyukov,项目名称:alchemy,代码行数:7,代码来源:WhereTest.java

示例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());
}
 
开发者ID:DanielSerdyukov,项目名称:alchemy,代码行数:7,代码来源:WhereTest.java

示例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());
}
 
开发者ID:DanielSerdyukov,项目名称:alchemy,代码行数:7,代码来源:WhereTest.java

示例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());
}
 
开发者ID:DanielSerdyukov,项目名称:alchemy,代码行数:7,代码来源:WhereTest.java

示例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()));
}
 
开发者ID:auth0,项目名称:Lock-Facebook.Android,代码行数:6,代码来源:FacebookAuthProviderTest.java


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