/external/robolectric/src/test/java/com/xtremelabs/robolectric/shadows/ |
ListPreferenceTest.java | 17 import static org.junit.Assert.assertThat; 33 assertThat(shadow, instanceOf(ShadowDialogPreference.class)); 40 assertThat(listPreference.getEntries(), nullValue()); 42 assertThat(listPreference.getEntries(), sameInstance(entries)); 47 assertThat(listPreference.getEntries(), nullValue()); 49 assertThat(listPreference.getEntries(), notNullValue()); 56 assertThat(listPreference.getEntryValues(), nullValue()); 58 assertThat(listPreference.getEntryValues(), sameInstance(entryValues)); 63 assertThat(listPreference.getEntryValues(), nullValue()); 65 assertThat(listPreference.getEntryValues(), notNullValue()); [all...] |
PhoneNumberUtilTest.java | 9 import static org.hamcrest.MatcherAssert.assertThat; 15 assertThat(PhoneNumberUtils.formatNumber("12345678901"), equalTo("12345678901-formatted")); 20 assertThat(PhoneNumberUtils.stripSeparators("12345678901"), equalTo("12345678901-stripped"));
|
CameraTest.java | 23 import static org.junit.Assert.assertThat; 44 assertThat(camera, notNullValue()); 49 assertThat(shadowCamera.isLocked(), equalTo(true)); 51 assertThat(shadowCamera.isLocked(), equalTo(false)); 57 assertThat(shadowCamera.isLocked(), equalTo(false)); 59 assertThat(shadowCamera.isLocked(), equalTo(true)); 65 assertThat(parameters, notNullValue()); 66 assertThat(parameters.getSupportedPreviewFormats(), notNullValue()); 67 assertThat(parameters.getSupportedPreviewFormats().size(), not(equalTo(0))); 73 assertThat(parameters.getPreviewFormat(), equalTo(ImageFormat.NV21)) [all...] |
WebViewTest.java | 19 import static org.junit.Assert.assertThat; 36 assertThat(shadowOf(webView).getLastLoadedUrl(), equalTo("http://example.com")); 43 assertThat(lastLoadData.data, equalTo("<html><body><h1>Hi</h1></body></html>")); 44 assertThat(lastLoadData.mimeType, equalTo("text/html")); 45 assertThat(lastLoadData.encoding, equalTo("utf-8")); 52 assertThat(lastLoadData.baseUrl, equalTo("base/url")); 53 assertThat(lastLoadData.data, equalTo("<html><body><h1>Hi</h1></body></html>")); 54 assertThat(lastLoadData.mimeType, equalTo("text/html")); 55 assertThat(lastLoadData.encoding, equalTo("utf-8")); 56 assertThat(lastLoadData.historyUrl, equalTo("history/url")) [all...] |
PreferenceGroupTest.java | 6 import static org.junit.Assert.assertThat; 50 assertThat(shadow, instanceOf(ShadowPreference.class)); 55 assertThat( group.getPreferenceCount(), equalTo(0)); 58 assertThat( group.addPreference(pref1), equalTo(true)); 59 assertThat( group.getPreferenceCount(), equalTo(1)); 62 assertThat( group.addPreference(pref1), equalTo(true)); 63 assertThat( group.getPreferenceCount(), equalTo(1)); 66 assertThat( group.addPreference(pref2), equalTo(true)); 67 assertThat( group.getPreferenceCount(), equalTo(2)); 72 assertThat( group.getPreferenceCount(), equalTo(0)) [all...] |
CursorLoaderTest.java | 11 import static org.junit.Assert.assertThat; 29 assertThat(cursorLoader.getUri(), equalTo(uri)); 30 assertThat(cursorLoader.getProjection(), equalTo(projection)); 31 assertThat(cursorLoader.getSelection(), equalTo(selection)); 32 assertThat(cursorLoader.getSelectionArgs(), equalTo(selectionArgs)); 33 assertThat(cursorLoader.getSortOrder(), equalTo(sortOrder)); 50 assertThat(cursorLoader.getUri(), equalTo(uri)); 51 assertThat(cursorLoader.getProjection(), equalTo(projection)); 52 assertThat(cursorLoader.getSelection(), equalTo(selection)); 53 assertThat(cursorLoader.getSelectionArgs(), equalTo(selectionArgs)) [all...] |
ViewGroupTest.java | 25 import static org.hamcrest.MatcherAssert.assertThat; 71 assertThat(root.getLayoutAnimationListener(), nullValue()); 85 assertThat(root.getLayoutAnimationListener(), sameInstance(animationListener)); 92 assertThat(root.getChildCount(), equalTo(2)); 93 assertThat(root.getChildAt(0), sameInstance(child1)); 94 assertThat(root.getChildAt(1), sameInstance((View) child3)); 96 assertThat(child2.getParent(), nullValue()); 105 assertThat(root.getChildAt(0), sameInstance(child1)); 106 assertThat(root.getChildAt(1), sameInstance((View) child3)); 107 assertThat(root.getChildAt(2), sameInstance(child2)) [all...] |
MatrixCursorTest.java | 7 import static org.junit.Assert.assertThat; 35 assertThat(cursor.getCount(), equalTo(2)); 39 assertThat(cursor.getString(0), equalTo("foo")); 40 assertThat(cursor.getLong(1), equalTo(10L)); 41 assertThat(cursor.getFloat(2), equalTo(0.1f)); 45 assertThat(cursor.getString(0), equalTo("baz")); 46 assertThat(cursor.getLong(1), equalTo(20L)); 56 assertThat(cursor.getColumnCount(), equalTo(3)); 58 assertThat(cursor.getColumnName(0), equalTo("a")); 59 assertThat(cursor.getColumnName(1), equalTo("b")) [all...] |
SQLiteStatementTest.java | 17 import static org.junit.Assert.assertThat; 49 assertThat(pkeyOne, equalTo(1L)); 50 assertThat(pkeyTwo, equalTo(2L)); 54 assertThat(resultSet.next(), equalTo(true)); 55 assertThat(resultSet.getInt(1), equalTo(2)); 59 assertThat(resultSet.next(), equalTo(true)); 60 assertThat(resultSet.getInt(1), equalTo(1)); 61 assertThat(resultSet.getString(2), equalTo("Leg Press")); 62 assertThat(resultSet.getInt(3), equalTo(0)); 63 assertThat(resultSet.next(), equalTo(true)) [all...] |
SpannableStringBuilderTest.java | 9 import static org.junit.Assert.assertThat; 18 assertThat(builder.toString(), equalTo("abcdef")); 24 assertThat(builder.length(), equalTo(3)); 30 assertThat(builder.replace(2, 3, "").toString(), equalTo("ab")); 31 assertThat(builder.replace(0, 2, "xyz").toString(), equalTo("xyz")); 37 assertThat(builder.insert(1, "xy").toString(), equalTo("axybc")); 43 assertThat(builder.length(), equalTo(3)); 45 assertThat( builder.length(), equalTo(0));
|
DatabaseTestBase.java | 95 assertThat(cursor.moveToFirst(), equalTo(true)); 100 assertThat(stringValueFromDatabase, equalTo(stringColumnValue)); 101 assertThat(byteValueFromDatabase, equalTo(byteColumnValue)); 118 assertThat(cursor.moveToFirst(), equalTo(true)); 123 assertThat(stringValueFromDatabase, equalTo(stringColumnValue)); 124 assertThat(byteValueFromDatabase, equalTo(byteColumnValue)); 143 assertThat(cursor.moveToFirst(), equalTo(true)); 146 assertThat(stringValueFromDatabase, equalTo(stringColumnValue)); 147 assertThat(byteValueFromDatabase, equalTo(byteColumnValue)); 163 assertThat(cursor.getCount(), equalTo(1)) [all...] |
SQLiteQueryBuilderTest.java | 11 import static org.junit.Assert.assertThat; 30 assertThat(sql, equalTo("SELECT DISTINCT id, name FROM table_name")); 41 assertThat(sql, equalTo("SELECT id FROM table_name")); 51 assertThat(sql, equalTo("SELECT id, name FROM table_name")); 60 assertThat(sql, equalTo("SELECT * FROM table_name")); 70 assertThat(sql, equalTo("SELECT person, department, division FROM table_name WHERE (id = 2 AND name = 'Chuck')")); 80 assertThat(sql, equalTo("SELECT person, department, division FROM table_name GROUP BY person")); 90 assertThat(sql, equalTo("SELECT person, department, division FROM table_name WHERE (id = 2 AND name = 'Chuck') GROUP BY person")); 100 assertThat(sql, equalTo("SELECT person, department, division FROM table_name WHERE (id = 2 AND name = 'Chuck') HAVING SUM(hours) < 20")); 110 assertThat(sql, equalTo("SELECT person, department, division FROM table_name WHERE (id = 2 AND name = 'Chuck' (…) [all...] |
TypedValueTest.java | 10 import static org.junit.Assert.assertThat; 20 assertThat(convertedValue, equalTo(50f)); 28 assertThat(booleanFalseString, equalTo("false")); 29 assertThat(booleanTrueString, equalTo("true")); 36 assertThat(nullString, equalTo(null)); 43 assertThat(intString, equalTo("37")); 50 assertThat(hexString, equalTo("0xcafebabe")); 57 assertThat(colorString, equalTo("#cafebabe")); 73 assertThat(expectedValue.assetCookie, equalTo(actualValue.assetCookie)); 74 assertThat(expectedValue.data, equalTo(actualValue.data)) [all...] |
CheckBoxTest.java | 9 import static org.junit.Assert.assertThat; 16 assertThat(checkBox.isChecked(), equalTo(false)); 19 assertThat(checkBox.isChecked(), equalTo(true)); 22 assertThat(checkBox.isChecked(), equalTo(false)); 25 assertThat(checkBox.isChecked(), equalTo(true));
|
ContentProviderOperationTest.java | 5 import static org.junit.Assert.assertThat; 28 assertThat(operation.getUri(), equalTo(URI)); 29 assertThat(shadowOperation.isInsert(), is(true)); 30 assertThat(shadowOperation.isUpdate(), is(false)); 31 assertThat(shadowOperation.isDelete(), is(false)); 32 assertThat(shadowOperation.getValues().size(), is(2)); 33 assertThat(shadowOperation.getValues().get("stringValue").toString(), equalTo("bar")); 34 assertThat(Integer.parseInt(shadowOperation.getValues().get("intValue").toString()), is(5)); 45 assertThat(shadowBuilder.getWithValueBackReference("my_id"), is(0)); 46 assertThat(shadowOperation.getWithValueBackReference("my_id"), is(0)) [all...] |
MediaStoreTest.java | 10 import static org.junit.Assert.assertThat; 16 assertThat(Images.Media.EXTERNAL_CONTENT_URI.toString(), equalTo("content://media/external/images/media")); 17 assertThat(Images.Media.INTERNAL_CONTENT_URI.toString(), equalTo("content://media/internal/images/media")); 18 assertThat(Video.Media.EXTERNAL_CONTENT_URI.toString(), equalTo("content://media/external/video/media")); 19 assertThat(Video.Media.INTERNAL_CONTENT_URI.toString(), equalTo("content://media/internal/video/media"));
|
ResolveInfoTest.java | 4 import static org.junit.Assert.assertThat; 30 assertThat("test", equalTo(mResolveInfo.loadLabel(null))); 35 assertThat(mResolveInfo.loadLabel(null).toString(), equalTo("name")); 36 assertThat(mResolveInfo.activityInfo.packageName, equalTo("package")); 37 assertThat(mResolveInfo.activityInfo.name, equalTo("activity"));
|
MessageTest.java | 28 assertThat(m.getData(), equalTo(b)); 38 assertThat(m.peekData(), equalTo(b)); 46 assertThat(m.getTarget(), equalTo(h)); 62 assertThat(m2.arg1, equalTo(m.arg1)); 63 assertThat(m2.arg2, equalTo(m.arg2)); 64 assertThat(m2.obj, equalTo(m.obj)); 65 assertThat(m2.what, equalTo(m.what)); 66 assertThat(m2.getData(), equalTo(m.getData())); 80 assertThat(m.getTarget(), equalTo(h)); 89 assertThat(m.getTarget(), equalTo(h)) [all...] |
ContentProviderOperationBuilderTest.java | 6 import static org.junit.Assert.assertThat; 39 assertThat(values.size(), is(3)); 40 assertThat(values.get("stringTest").toString(), equalTo("bar")); 41 assertThat(Integer.parseInt(values.get("intTest").toString()), equalTo(5)); 42 assertThat(Long.parseLong(values.get("longTest").toString()), equalTo(10L)); 52 assertThat(selections.size(), is(2)); 53 assertThat(selections.get("first"), equalTo(new String[] { "a", "b" })); 54 assertThat(selections.get("second"), equalTo(new String[] { "c", "d" })); 62 assertThat(backReference, is(5)); 68 assertThat(operation, notNullValue()) [all...] |
UriMatcherTest.java | 14 import static org.junit.Assert.assertThat; 33 assertThat(root.code, is(NO_MATCH)); 34 assertThat(root.map.isEmpty(), is(true)); 35 assertThat(root.number, is(nullValue())); 36 assertThat(root.text, is(nullValue())); 44 assertThat(node.map.keySet(), hasItem(AUTH)); 47 assertThat(node.map.keySet(), hasItem("bar")); 50 assertThat(node.map.keySet(), hasItem("cat")); 53 assertThat(node.code, is(1)); 61 assertThat(node.number.code, is(1)) [all...] |
HandlerTest.java | 18 import static org.junit.Assert.assertThat; 103 assertThat(scratchRunnable.wasRun, equalTo(true)); 110 assertThat(scratchRunnable.wasRun, equalTo(false)); 117 assertThat(scratchRunnable.wasRun, equalTo(true)); 130 assertThat(scratchRunnable.wasRun, equalTo(false)); 137 assertThat(scratchRunnable.wasRun, equalTo(true)); 149 assertThat(task1.wasRun, equalTo(true)); 150 assertThat(task2.wasRun, equalTo(true)); 162 assertThat(task1.wasRun, equalTo(true)); 163 assertThat(task2.wasRun, equalTo(false)) [all...] |
/external/robolectric/src/test/java/com/xtremelabs/robolectric/util/ |
DatabaseConfigTest.java | 13 import static org.junit.Assert.assertThat; 25 assertThat(DatabaseConfig.getDatabaseMap().getClass().getName(), equalTo(H2Map.class.getName())); 26 assertThat(DatabaseConfig.isMapLoaded(), equalTo(false)); 28 assertThat(DatabaseConfig.isMapLoaded(), equalTo(true)); 29 assertThat(DatabaseConfig.getResultSetType(), equalTo(ResultSet.TYPE_SCROLL_INSENSITIVE)); 33 assertThat(DatabaseConfig.isMapLoaded(), equalTo(false)); 34 assertThat(DatabaseConfig.getDatabaseMap(), equalTo((DatabaseMap) ForwardOnlyMap)); 36 assertThat(DatabaseConfig.isMapLoaded(), equalTo(true)); 37 assertThat(DatabaseConfig.getDatabaseMap().getClass().getName(), equalTo(H2Map_TypeForwardOnly.class.getName())); 38 assertThat(DatabaseConfig.getResultSetType(), equalTo(ResultSet.TYPE_FORWARD_ONLY)) [all...] |
/external/robolectric/src/test/java/com/xtremelabs/robolectric/tester/android/content/ |
TestSharedPreferencesTest.java | 46 assertThat(anotherSharedPreferences.getFloat("float", 666f), equalTo(1.1f)); 47 assertThat(anotherSharedPreferences.getInt("int", 666), equalTo(2)); 48 assertThat(anotherSharedPreferences.getLong("long", 666l), equalTo(3l)); 49 assertThat(anotherSharedPreferences.getString("string", "wacka wa"), equalTo("foobar")); 56 assertThat(all.size(), equalTo(5)); 57 assertThat((Integer) all.get("int"), equalTo(2)); 74 assertThat(anotherSharedPreferences.getFloat("float", 666f), equalTo(1.1f)); 75 assertThat(anotherSharedPreferences.getInt("int", 666), equalTo(2)); 76 assertThat(anotherSharedPreferences.getLong("long", 666l), equalTo(3l)); 77 assertThat(anotherSharedPreferences.getString("string", "wacka wa"), equalTo("foobar")) [all...] |
/external/robolectric/src/test/java/com/xtremelabs/robolectric/tester/android/database/ |
SimpleTestCursorTest.java | 16 import static org.junit.Assert.assertThat; 40 assertThat(cursor.uri, equalTo(uri)); 41 assertThat(cursor.projection[0], equalTo("projection")); 42 assertThat(cursor.selection, equalTo("selection")); 43 assertThat(cursor.selectionArgs[0], equalTo("selection")); 44 assertThat(cursor.sortOrder, equalTo("sortOrder")); 50 assertThat(cursor.moveToNext(), equalTo(true)); 51 assertThat(cursor.getString(cursor.getColumnIndex("stringColumn")), equalTo("aString")); 52 assertThat(cursor.getLong(cursor.getColumnIndex("longColumn")), equalTo(1234L)); 58 assertThat(cursor.moveToNext(), equalTo(true)) [all...] |
/external/robolectric/src/test/java/com/xtremelabs/robolectric/res/ |
ResourceExtractorTest.java | 9 import static org.junit.Assert.assertThat; 23 assertThat(resourceExtractor.getLocalResourceId("id/textStyle"), equalTo(R.id.textStyle)); 24 assertThat(resourceExtractor.getLocalResourceId("styleable/TitleBar_textStyle"), CoreMatchers.<Object>nullValue()); 29 assertThat(resourceExtractor.getResourceId("android:id/text1"), equalTo(android.R.id.text1)); 34 assertThat(resourceExtractor.getLocalResourceId("@null"), equalTo(0));
|