use of com.codeslap.persistence.PreferencesAdapter in project persistence by casidiablo.
the class PrefRetrieveTest method shouldReturnNullWhenRetrievingImpossibleBean.
@Test
public void shouldReturnNullWhenRetrievingImpossibleBean() {
PreferencesAdapter adapter = Persistence.getPreferenceAdapter(new Activity());
PrefImpossibleBean retrieve = adapter.retrieve(PrefImpossibleBean.class);
assertNull(retrieve);
}
use of com.codeslap.persistence.PreferencesAdapter in project persistence by casidiablo.
the class PrefRetrieveTest method shouldReturnFullObjectWhenUsingAnnotations.
@Test
public void shouldReturnFullObjectWhenUsingAnnotations() {
PreferencesAdapter adapter = Persistence.getPreferenceAdapter(new Activity());
PrefWithAnnotations retrieve = adapter.retrieve(PrefWithAnnotations.class);
assertEquals(Integer.MIN_VALUE, retrieve.number);
assertEquals(Float.MIN_VALUE, retrieve.decimal, 0);
assertEquals(Long.MIN_VALUE, retrieve.veryLong, 0);
assertEquals("foo bar", retrieve.name);
assertTrue(retrieve.bool);
}
Aggregations