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;
/*www.java2s.com*/importstatic com.nikhaldimann.viewselector.ViewSelectorAssertions.assertThatSelection;
import android.content.Intent;
import android.test.ActivityUnitTestCase;
import com.nikhaldimann.viewselector.test.HelloWorldExampleActivity;
/**
* Example unit test for a simple activity. The layout of the activity has a single
* TextView with id "hello_world" and text "Hello world!".
*
* Keep this example self-contained so it can be referenced from documentation.
*/publicclass HelloWorldExampleActivityTest extends ActivityUnitTestCase<HelloWorldExampleActivity> {
public HelloWorldExampleActivityTest() {
super(HelloWorldExampleActivity.class);
}
private HelloWorldExampleActivity activity;
publicvoid testHelloWorld() {
activity = startActivity(new Intent(getInstrumentation().getTargetContext(),
HelloWorldExampleActivity.class), null, null);
assertThatSelection("TextView#hello_world", activity)
.hasSize(1)
.hasAttributeEqualTo("text", "Hello world!");
}
}