use of android.support.test.filters.SmallTest in project AnyMemo by helloworld1.
the class OptionTest method testGetDictApp.
@SmallTest
@Test
public void testGetDictApp() {
Option option = new Option(getContext());
editor.putString(AMPrefKeys.DICT_APP_KEY, "COLORDICT");
editor.commit();
assertEquals(Option.DictApp.COLORDICT, option.getDictApp());
editor.putString(AMPrefKeys.DICT_APP_KEY, "FORA");
editor.commit();
assertEquals(Option.DictApp.FORA, option.getDictApp());
editor.putString(AMPrefKeys.DICT_APP_KEY, "BLUEDICT");
editor.commit();
assertEquals(Option.DictApp.BLUEDICT, option.getDictApp());
}
use of android.support.test.filters.SmallTest in project AnyMemo by helloworld1.
the class OptionTest method testGetButtonStyle.
@SmallTest
@Test
public void testGetButtonStyle() {
Option option = new Option(getContext());
editor.putString(AMPrefKeys.BUTTON_STYLE_KEY, "ANYMEMO");
editor.commit();
assertEquals(Option.ButtonStyle.ANYMEMO, option.getButtonStyle());
editor.putString(AMPrefKeys.BUTTON_STYLE_KEY, "MNEMOSYNE");
editor.commit();
assertEquals(Option.ButtonStyle.MNEMOSYNE, option.getButtonStyle());
editor.putString(AMPrefKeys.BUTTON_STYLE_KEY, "ANKI");
editor.commit();
assertEquals(Option.ButtonStyle.ANKI, option.getButtonStyle());
}
use of android.support.test.filters.SmallTest in project AnyMemo by helloworld1.
the class OptionTest method testGetSpeakingType.
@SmallTest
@Test
public void testGetSpeakingType() {
Option option = new Option(getContext());
editor.putString(AMPrefKeys.SPEECH_CONTROL_KEY, "TAP");
editor.commit();
assertEquals(Option.SpeakingType.TAP, option.getSpeakingType());
editor.putString(AMPrefKeys.SPEECH_CONTROL_KEY, "AUTO");
editor.commit();
assertEquals(Option.SpeakingType.AUTO, option.getSpeakingType());
editor.putString(AMPrefKeys.SPEECH_CONTROL_KEY, "MANUAL");
editor.commit();
assertEquals(Option.SpeakingType.MANUAL, option.getSpeakingType());
editor.putString(AMPrefKeys.SPEECH_CONTROL_KEY, "AUTOTAP");
editor.commit();
assertEquals(Option.SpeakingType.AUTOTAP, option.getSpeakingType());
}
use of android.support.test.filters.SmallTest in project AnyMemo by helloworld1.
the class CardProviderTest method testCardCount.
@SmallTest
@Test
public void testCardCount() {
ContentResolver cr = getContext().getContentResolver();
Cursor cursor = cr.query(Uri.parse("content://" + AUTHORITY + "/" + TestHelper.SAMPLE_DB_NAME + "/count"), null, null, null, null);
assertEquals(1, cursor.getCount());
assertTrue(cursor.moveToFirst());
assertEquals(28, cursor.getInt(0));
}
use of android.support.test.filters.SmallTest in project AnyMemo by helloworld1.
the class CardProviderTest method testGetCardWithStartOrdinalAndCount.
@SmallTest
@Test
public void testGetCardWithStartOrdinalAndCount() {
ContentResolver cr = getContext().getContentResolver();
Cursor cursor = cr.query(Uri.parse("content://" + AUTHORITY + "/" + TestHelper.SAMPLE_DB_NAME + "/start_ordinal/3/count/5"), null, null, null, null);
assertEquals(5, cursor.getCount());
assertTrue(cursor.moveToFirst());
assertEquals(3, cursor.getInt(cursor.getColumnIndex("ordinal")));
assertEquals("face", cursor.getString(cursor.getColumnIndex("question")));
assertEquals("le visage", cursor.getString(cursor.getColumnIndex("answer")));
assertTrue(cursor.moveToNext());
assertEquals(4, cursor.getInt(cursor.getColumnIndex("ordinal")));
}
Aggregations