Created
September 30, 2014 04:36
-
-
Save neodaoist/d0706028c91b2c92d6db to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TextViewAssertTest extends AndroidTestCase { | |
private TextView textView; | |
@Override | |
public void setUp() throws Exception { | |
super.setUp(); | |
textView = new TextView(getContext()); | |
} | |
public void testHasText_charSequence() { | |
CharSequence expected = "expected"; | |
textView.setText(expected); | |
assertThat(textView).hasText(expected); | |
} | |
public void testHasText_int() { | |
int expected = R.string.text_view_text; | |
textView.setText(expected); | |
assertThat(textView).hasText(expected); | |
} | |
public void testHasTextString_string() { | |
String expected = "expected"; | |
textView.setText(expected); | |
assertThat(textView).hasTextString(expected); | |
} | |
public void testHasTextString_int() { | |
int expected = R.string.text_view_text; | |
textView.setText(expected); | |
assertThat(textView).hasTextString(expected); | |
} | |
public void testIsEmpty() { | |
assertThat(textView).isEmpty(); | |
} | |
public void testIsNotEmpty() { | |
textView.setText(" "); | |
assertThat(textView).isNotEmpty(); | |
} | |
// TODO ... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment