Copyright (c) 2013 Nik Haldimann
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Soft...
If you think the Android project android-view-selector listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
Java Source Code
package com.nikhaldimann.viewselector.android.activities;
//fromwww.java2s.comimportstatic com.nikhaldimann.viewselector.ViewSelectorAssertions.assertThatSelection;
import android.content.Intent;
import android.test.ActivityUnitTestCase;
import com.nikhaldimann.viewselector.test.HelloWorldExampleFragmentActivity;
/**
* Example unit test for a simple activity. The layout of the activity has a single
* TextView with id "hello_world" and text "Hello world!".
*
* This is equivalent to {@link HelloWorldExampleActivityTest} but uses a
* {@code FragmentActivity}.
*
* Keep this example self-contained so it can be referenced from documentation.
*/publicclass HelloWorldExampleFragmentActivityTest extends ActivityUnitTestCase<HelloWorldExampleFragmentActivity> {
public HelloWorldExampleFragmentActivityTest() {
super(HelloWorldExampleFragmentActivity.class);
}
private HelloWorldExampleFragmentActivity activity;
publicvoid testHelloWorld() {
activity = startActivity(new Intent(getInstrumentation().getTargetContext(),
HelloWorldExampleFragmentActivity.class), null, null);
assertThatSelection("TextView#hello_world", activity)
.hasSize(1)
.hasAttributeEqualTo("text", "Hello world!");
}
}