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


Java PowerMockito.verifyNoMoreInteractions方法代码示例

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


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

示例1: getTypeFaceFromAssetsTest

import org.powermock.api.mockito.PowerMockito; //导入方法依赖的package包/类
@Test
public void getTypeFaceFromAssetsTest() throws Exception {
    PowerMockito.mockStatic(Typeface.class);
    when(mMockContext.getAssets()).thenReturn(mMockedAssetManager);
    when(Typeface.createFromAsset(mMockedAssetManager, ASSET_PATH)).thenReturn(mMockedTypeFace);

    Typeface typeface = mTypeFaceProvider.getTypeFaceFromAssets(ASSET_PATH);
    PowerMockito.verifyStatic(times(1));
    assert (typeface == mMockedTypeFace);
    PowerMockito.verifyNoMoreInteractions();
}
 
开发者ID:myntra,项目名称:CoachMarks,代码行数:12,代码来源:DefaultTypeFaceProviderTest.java

示例2: getTypeFaceFromAssetsFailTest

import org.powermock.api.mockito.PowerMockito; //导入方法依赖的package包/类
@Test
public void getTypeFaceFromAssetsFailTest() throws Exception {
    PowerMockito.mockStatic(Typeface.class);
    PowerMockito.mockStatic(Log.class);
    when(mMockContext.getAssets()).thenReturn(mMockedAssetManager);
    when(Typeface.createFromAsset(mMockedAssetManager, ASSET_PATH)).thenThrow(new RuntimeException());
    when(Log.e(anyString(), anyString())).thenReturn(1);

    Typeface typeface = mTypeFaceProvider.getTypeFaceFromAssets(ASSET_PATH);
    PowerMockito.verifyStatic(times(2));
    assert (typeface == null);
    PowerMockito.verifyNoMoreInteractions();
}
 
开发者ID:myntra,项目名称:CoachMarks,代码行数:14,代码来源:DefaultTypeFaceProviderTest.java

示例3: noMoreInteractions

import org.powermock.api.mockito.PowerMockito; //导入方法依赖的package包/类
@Before public void noMoreInteractions() {
  PowerMockito.verifyNoMoreInteractions(Thread.class);
}
 
开发者ID:google,项目名称:mug,代码行数:4,代码来源:RetryerBlockingTest.java


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