use of android.test.suitebuilder.annotation.Smoke in project Etar-Calendar by Etar-Group.
the class EditEventHelperTest method testGetAddressesFromList.
@Smoke
@SmallTest
public void testGetAddressesFromList() {
mActivity = buildTestContext();
mHelper = new EditEventHelper(mActivity, null);
LinkedHashSet<Rfc822Token> expected = new LinkedHashSet<Rfc822Token>();
expected.add(new Rfc822Token(null, "ad1@email.com", ""));
expected.add(new Rfc822Token("First Last", "first@email.com", "comment"));
expected.add(new Rfc822Token(null, "one.two.three@email.grue", ""));
LinkedHashSet<Rfc822Token> actual = mHelper.getAddressesFromList(TEST_ADDRESSES, new Rfc822Validator(null));
assertEquals(expected, actual);
}
use of android.test.suitebuilder.annotation.Smoke in project Etar-Calendar by Etar-Group.
the class EditEventHelperTest method testIsFirstEventInSeries.
@Smoke
@SmallTest
public void testIsFirstEventInSeries() {
mModel1 = new CalendarEventModel();
mModel2 = new CalendarEventModel();
// It's considered the first event if the original start of the new model matches the
// start of the old model
mModel1.mOriginalStart = 100;
mModel1.mStart = 200;
mModel2.mOriginalStart = 100;
mModel2.mStart = 100;
assertTrue(EditEventHelper.isFirstEventInSeries(mModel1, mModel2));
mModel1.mOriginalStart = 80;
assertFalse(EditEventHelper.isFirstEventInSeries(mModel1, mModel2));
}
use of android.test.suitebuilder.annotation.Smoke in project Etar-Calendar by Etar-Group.
the class EditEventHelperTest method testGetContentValuesFromModel.
@Smoke
@SmallTest
public void testGetContentValuesFromModel() {
mActivity = buildTestContext();
mHelper = new EditEventHelper(mActivity, null);
mExpectedValues = buildTestValues();
mModel1 = buildTestModel();
ContentValues values = mHelper.getContentValuesFromModel(mModel1);
assertEquals(mExpectedValues, values);
mModel1.mRrule = null;
mModel1.mEnd = TEST_END;
mExpectedValues.put(Events.RRULE, (String) null);
mExpectedValues.put(Events.DURATION, (String) null);
// UTC time
mExpectedValues.put(Events.DTEND, TEST_END);
values = mHelper.getContentValuesFromModel(mModel1);
assertEquals(mExpectedValues, values);
mModel1.mAllDay = false;
mExpectedValues.put(Events.ALL_DAY, 0);
mExpectedValues.put(Events.DTSTART, TEST_START);
mExpectedValues.put(Events.DTEND, TEST_END);
// not an allday event so timezone isn't modified
mExpectedValues.put(Events.EVENT_TIMEZONE, "UTC");
values = mHelper.getContentValuesFromModel(mModel1);
assertEquals(mExpectedValues, values);
}
use of android.test.suitebuilder.annotation.Smoke in project Etar-Calendar by Etar-Group.
the class AsyncQueryServiceTest method testQuery.
@Smoke
@SmallTest
public void testQuery() throws Exception {
int index = 0;
final OperationInfo[] work = new OperationInfo[1];
work[index] = new OperationInfo();
work[index].op = Operation.EVENT_ARG_QUERY;
work[index].token = ++mId;
work[index].cookie = ++mId;
work[index].uri = Uri.parse(AUTHORITY_URI + "blah");
work[index].projection = TEST_PROJECTION;
work[index].selection = TEST_SELECTION;
work[index].selectionArgs = TEST_SELECTION_ARGS;
work[index].orderBy = "order";
work[index].delayMillis = 0;
work[index].result = new TestCursor();
TestAsyncQueryService aqs = new TestAsyncQueryService(buildTestContext(work), work);
aqs.startQuery(work[index].token, work[index].cookie, work[index].uri, work[index].projection, work[index].selection, work[index].selectionArgs, work[index].orderBy);
Log.d(TAG, "testQuery Waiting >>>>>>>>>>>");
assertEquals("Not all operations were executed.", work.length, aqs.waitForCompletion(BASE_TEST_WAIT_TIME));
Log.d(TAG, "testQuery Done <<<<<<<<<<<<<<");
}
Aggregations