Search in sources :

Example 6 with TypeMappingFinder

use of com.pushtorefresh.storio3.TypeMappingFinder in project storio by pushtorefresh.

the class DefaultStorIOContentResolverTest method shouldUseSpecifiedTypeMappingFinder.

@Test
public void shouldUseSpecifiedTypeMappingFinder() throws NoSuchFieldException, IllegalAccessException {
    TypeMappingFinder typeMappingFinder = mock(TypeMappingFinder.class);
    DefaultStorIOContentResolver storIOContentResolver = DefaultStorIOContentResolver.builder().contentResolver(mock(ContentResolver.class)).typeMappingFinder(typeMappingFinder).build();
    assertThat(getTypeMappingFinder(storIOContentResolver)).isEqualTo(typeMappingFinder);
}
Also used : TypeMappingFinder(com.pushtorefresh.storio3.TypeMappingFinder) StorIOContentResolver(com.pushtorefresh.storio3.contentresolver.StorIOContentResolver) ContentResolver(android.content.ContentResolver) Test(org.junit.Test)

Example 7 with TypeMappingFinder

use of com.pushtorefresh.storio3.TypeMappingFinder in project storio by pushtorefresh.

the class DefaultStorIOContentResolverTest method deprecatedInternalImplShouldReturnSentToConstructorTypeMapping.

@Test
public void deprecatedInternalImplShouldReturnSentToConstructorTypeMapping() throws NoSuchFieldException, IllegalAccessException {
    ContentResolver contentResolver = mock(ContentResolver.class);
    TypeMappingFinder typeMappingFinder = mock(TypeMappingFinder.class);
    TestDefaultStorIOContentResolver storIOContentResolver = new TestDefaultStorIOContentResolver(contentResolver, mock(Handler.class), typeMappingFinder);
    assertThat(storIOContentResolver.typeMappingFinder()).isSameAs(typeMappingFinder);
}
Also used : TypeMappingFinder(com.pushtorefresh.storio3.TypeMappingFinder) Handler(android.os.Handler) StorIOContentResolver(com.pushtorefresh.storio3.contentresolver.StorIOContentResolver) ContentResolver(android.content.ContentResolver) Test(org.junit.Test)

Example 8 with TypeMappingFinder

use of com.pushtorefresh.storio3.TypeMappingFinder in project storio by pushtorefresh.

the class DefaultStorIOSQLiteTest method shouldUseSpecifiedTypeMappingFinder.

@Test
public void shouldUseSpecifiedTypeMappingFinder() throws NoSuchFieldException, IllegalAccessException {
    TypeMappingFinder typeMappingFinder = mock(TypeMappingFinder.class);
    DefaultStorIOSQLite storIOSQLite = DefaultStorIOSQLite.builder().sqliteOpenHelper(sqLiteOpenHelper).typeMappingFinder(typeMappingFinder).build();
    assertThat(getTypeMappingFinder(storIOSQLite)).isEqualTo(typeMappingFinder);
}
Also used : TypeMappingFinder(com.pushtorefresh.storio3.TypeMappingFinder) Test(org.junit.Test)

Example 9 with TypeMappingFinder

use of com.pushtorefresh.storio3.TypeMappingFinder in project storio by pushtorefresh.

the class DefaultStorIOSQLiteTest method deprecatedInternalImplShouldReturnSentToConstructorTypeMapping.

@Test
public void deprecatedInternalImplShouldReturnSentToConstructorTypeMapping() throws NoSuchFieldException, IllegalAccessException {
    TypeMappingFinder typeMappingFinder = mock(TypeMappingFinder.class);
    TestDefaultStorIOSQLite storIOSQLite = new TestDefaultStorIOSQLite(sqLiteOpenHelper, typeMappingFinder);
    assertThat(storIOSQLite.typeMappingFinder()).isSameAs(typeMappingFinder);
}
Also used : TypeMappingFinder(com.pushtorefresh.storio3.TypeMappingFinder) Test(org.junit.Test)

Aggregations

TypeMappingFinder (com.pushtorefresh.storio3.TypeMappingFinder)9 Test (org.junit.Test)7 StorIOContentResolver (com.pushtorefresh.storio3.contentresolver.StorIOContentResolver)4 ContentResolver (android.content.ContentResolver)3 TypeMappingFinderImpl (com.pushtorefresh.storio3.internal.TypeMappingFinderImpl)3 Nullable (android.support.annotation.Nullable)2 GetResolver (com.pushtorefresh.storio3.contentresolver.operations.get.GetResolver)2 Field (java.lang.reflect.Field)2 Handler (android.os.Handler)1 GetResolver (com.pushtorefresh.storio3.sqlite.operations.get.GetResolver)1