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


Java Robolectric.setupActivity方法代码示例

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


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

示例1: setUp

import org.robolectric.Robolectric; //导入方法依赖的package包/类
@Before
public void setUp() {
	MockitoAnnotations.initMocks(this);
	setupActivity = Robolectric.setupActivity(TestSetupActivity.class);
	nicknameEntryWrapper = (TextInputLayout) setupActivity
			.findViewById(R.id.nickname_entry_wrapper);
	passwordConfirmationWrapper = (TextInputLayout) setupActivity
			.findViewById(R.id.password_confirm_wrapper);
	nicknameEntry =
			(EditText) setupActivity.findViewById(R.id.nickname_entry);
	passwordEntry =
			(EditText) setupActivity.findViewById(R.id.password_entry);
	passwordConfirmation =
			(EditText) setupActivity.findViewById(R.id.password_confirm);
	strengthMeter =
			(StrengthMeter) setupActivity.findViewById(R.id.strength_meter);
	createAccountButton =
			(Button) setupActivity.findViewById(R.id.create_account);
}
 
开发者ID:rafjordao,项目名称:Nird2,代码行数:20,代码来源:SetupActivityTest.java

示例2: shouldChangeTextAfterClick

import org.robolectric.Robolectric; //导入方法依赖的package包/类
@Test
public void shouldChangeTextAfterClick() {
    // given
    MainActivity mainActivity = Robolectric.setupActivity(MainActivity.class);

    // when
    mainActivity.findViewById(R.id.button_msg).performClick();

    // then
    assertTrue(mainActivity.isTextHelloWorld());
}
 
开发者ID:brunogabriel,项目名称:TestCoverageReport-Android,代码行数:12,代码来源:MainActivityUnitTest.java

示例3: setUp

import org.robolectric.Robolectric; //导入方法依赖的package包/类
@Before
public void setUp()
{
    // Output logs emitted during tests so they may be accessed
    ShadowLog.stream = System.out;

    Activity activity = Robolectric.setupActivity(PropertiesListActivity.class);
    db = new DBHelper(activity);
}
 
开发者ID:brarcher,项目名称:rental-calc,代码行数:10,代码来源:DatabaseTest.java

示例4: setUp

import org.robolectric.Robolectric; //导入方法依赖的package包/类
@Before
public void setUp() {
    super.setUp();
    final AppCompatActivity activity = Robolectric.setupActivity(AppCompatActivity.class);

    loaderManager = spy(new RxLoaderManager(activity.getSupportLoaderManager()));
    commandStarter = mock(CommandStarter.class);
    repository = mock(GeraltWomenRepository.class);
    loader = new GeraltWomenLoader(activity, repository);
    messageFactory = mock(MessageFactory.class);
    router = mock(Router.class);

    view = mock(GeraltWomenView.class);
    state = mock(GeraltWomenView$$State.class);
}
 
开发者ID:dmitrikudrenko,项目名称:MDRXL,代码行数:16,代码来源:GeraltWomenPresenterTest.java

示例5: setUp

import org.robolectric.Robolectric; //导入方法依赖的package包/类
@Before
public void setUp() {
    super.setUp();
    activity = Robolectric.setupActivity(AppCompatForTestActivity.class);
    final SharedPreferences sharedPreferences = RuntimeEnvironment.application
            .getSharedPreferences("filename", Context.MODE_PRIVATE);
    repository = new NetworkSettingsRepository(sharedPreferences);
    loader = new SettingsLoader(activity, repository);
}
 
开发者ID:dmitrikudrenko,项目名称:MDRXL,代码行数:10,代码来源:SettingsLoaderTest.java

示例6: setUp

import org.robolectric.Robolectric; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {
  Activity activity = Robolectric.setupActivity(TestActivity.class);
  view = new WXWebView(activity);
  webView = (WebView)((ViewGroup)view.getView()).getChildAt(0);//first child
  shadow = Shadows.shadowOf(webView);
}
 
开发者ID:amap-demo,项目名称:weex-3d-map,代码行数:8,代码来源:WXWebViewTest.java

示例7: setUp

import org.robolectric.Robolectric; //导入方法依赖的package包/类
@Before
public void setUp() {
    super.setUp();
    activity = Robolectric.setupActivity(Activity.class);

    localRepository = setupLocalRepository();
    remoteRepository = setupRemoteRepository();
}
 
开发者ID:dmitrikudrenko,项目名称:MDRXL,代码行数:9,代码来源:CommandTest.java

示例8: setUp

import org.robolectric.Robolectric; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {
  component = WXDivTest.create();
  ComponentTest.create(component);

  component.addEvent(WXGestureType.LowLevelGesture.ACTION_CANCEL.toString());
  component.addEvent(WXGestureType.LowLevelGesture.ACTION_DOWN.toString());
  component.addEvent(WXGestureType.LowLevelGesture.ACTION_MOVE.toString());
  component.addEvent(WXGestureType.LowLevelGesture.ACTION_UP.toString());

  TestActivity activity = Robolectric.setupActivity(TestActivity.class);
  mGesture = new WXGesture(component, activity);

}
 
开发者ID:weexext,项目名称:ucar-weex-core,代码行数:15,代码来源:WXGestureTest.java

示例9: setUp

import org.robolectric.Robolectric; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {
  Activity activity = Robolectric.setupActivity(TestActivity.class);
  view = new WXScrollView(activity);
  View child = new View(activity);
  view.addView(child);
}
 
开发者ID:weexext,项目名称:ucar-weex-core,代码行数:8,代码来源:WXScrollViewTest.java

示例10: setUp

import org.robolectric.Robolectric; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {
    activity = Robolectric.setupActivity(LoginActivity.class);

    assertNotNull(activity);
}
 
开发者ID:mirhoseini,项目名称:bcg,代码行数:7,代码来源:LoginActivityRobolectricTest.java

示例11: setup

import org.robolectric.Robolectric; //导入方法依赖的package包/类
@Before
public void setup() {
    mActivity = Robolectric.setupActivity(TestActivity.class);
    mWebView = new MockWebView(mActivity);
    mPopupBridge = PopupBridge.newInstance(mActivity, mWebView);
}
 
开发者ID:braintree,项目名称:popup-bridge-android,代码行数:7,代码来源:PopupBridgeTest.java

示例12: setUpOnClickListener

import org.robolectric.Robolectric; //导入方法依赖的package包/类
private void setUpOnClickListener() {
    postsActivity = Robolectric.setupActivity(PostsActivity.class);
    onPostViewClickListener = new OnPostViewClickListener(postsActivity);
}
 
开发者ID:ParaskP7,项目名称:sample-code-posts,代码行数:5,代码来源:OnPostViewClickListenerTest.java

示例13: setUpActivity

import org.robolectric.Robolectric; //导入方法依赖的package包/类
private void setUpActivity() {
    postsActivity = Robolectric.setupActivity(PostsActivity.class);
}
 
开发者ID:ParaskP7,项目名称:sample-code-posts,代码行数:4,代码来源:PostsActivityTest.java

示例14: setup

import org.robolectric.Robolectric; //导入方法依赖的package包/类
@Before
public void setup() {
    activity = Robolectric.setupActivity(Activity.class);
}
 
开发者ID:bangarharshit,项目名称:Oleaster,代码行数:5,代码来源:ActivityTestNormal.java

示例15: setup

import org.robolectric.Robolectric; //导入方法依赖的package包/类
@Before
public void setup() {
    mTagEditTextTestActivity = Robolectric.setupActivity(TagEditTextTestActivity.class);
    addTagEditTextToActivity();
}
 
开发者ID:RyPope,项目名称:TagEditText,代码行数:6,代码来源:TagEditTextTest.java


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