diff options
author | Andrew Lee <anwlee@google.com> | 2015-09-15 12:56:14 -0700 |
---|---|---|
committer | Andrew Lee <anwlee@google.com> | 2015-09-15 12:57:19 -0700 |
commit | b64e0936146393d55398f008d09c06b8ddf7ae7f (patch) | |
tree | a1f5527f95949aa50ac1527a759d241bb2256e5c | |
parent | 411dd7401997a83a876446261bdf70b3e2c9c4de (diff) |
Fix GroupBuilder Tests.
There was a change in assumptions where groups are added for
standalone elements, but missed updating the unit tests for the
GroupBuilder to reflect those changes.
Bug: 23640774
Change-Id: I89576bd003119ce1da675181adbf557e7b996057
-rw-r--r-- | tests/src/com/android/dialer/calllog/CallLogGroupBuilderTest.java | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/tests/src/com/android/dialer/calllog/CallLogGroupBuilderTest.java b/tests/src/com/android/dialer/calllog/CallLogGroupBuilderTest.java index 95558bcf6..9bdcd40c0 100644 --- a/tests/src/com/android/dialer/calllog/CallLogGroupBuilderTest.java +++ b/tests/src/com/android/dialer/calllog/CallLogGroupBuilderTest.java @@ -66,14 +66,14 @@ public class CallLogGroupBuilderTest extends AndroidTestCase { public void testAddGroups_OneCall() { addCallLogEntry(TEST_NUMBER1, Calls.INCOMING_TYPE); mBuilder.addGroups(mCursor); - assertEquals(0, mFakeGroupCreator.groups.size()); + assertEquals(1, mFakeGroupCreator.groups.size()); } public void testAddGroups_TwoCallsNotMatching() { addCallLogEntry(TEST_NUMBER1, Calls.INCOMING_TYPE); addCallLogEntry(TEST_NUMBER2, Calls.INCOMING_TYPE); mBuilder.addGroups(mCursor); - assertEquals(0, mFakeGroupCreator.groups.size()); + assertEquals(2, mFakeGroupCreator.groups.size()); } public void testAddGroups_ThreeCallsMatching() { @@ -136,21 +136,25 @@ public class CallLogGroupBuilderTest extends AndroidTestCase { public void testAddGroups_Mixed() { addMultipleCallLogEntries(TEST_NUMBER1, - Calls.VOICEMAIL_TYPE, // Stand-alone - Calls.INCOMING_TYPE, // Group 1: 1-4 + Calls.VOICEMAIL_TYPE, // Group 1:Stand-alone + Calls.INCOMING_TYPE, // Group 2: 1-4 Calls.OUTGOING_TYPE, Calls.MISSED_TYPE, Calls.MISSED_TYPE, - Calls.VOICEMAIL_TYPE, // Stand-alone - Calls.INCOMING_TYPE, // Stand-alone - Calls.VOICEMAIL_TYPE, // Stand-alone - Calls.MISSED_TYPE, // Group 2: 8-10 + Calls.VOICEMAIL_TYPE, // Group 3: Stand-alone + Calls.INCOMING_TYPE, // Group 4: Stand-alone + Calls.VOICEMAIL_TYPE, // Group 5: Stand-alone + Calls.MISSED_TYPE, // Group 6: 8-10 Calls.MISSED_TYPE, Calls.OUTGOING_TYPE); mBuilder.addGroups(mCursor); - assertEquals(2, mFakeGroupCreator.groups.size()); - assertGroupIs(1, 4, mFakeGroupCreator.groups.get(0)); - assertGroupIs(8, 3, mFakeGroupCreator.groups.get(1)); + assertEquals(6, mFakeGroupCreator.groups.size()); + assertGroupIs(0, 1, mFakeGroupCreator.groups.get(0)); + assertGroupIs(1, 4, mFakeGroupCreator.groups.get(1)); + assertGroupIs(5, 1, mFakeGroupCreator.groups.get(2)); + assertGroupIs(6, 1, mFakeGroupCreator.groups.get(3)); + assertGroupIs(7, 1, mFakeGroupCreator.groups.get(4)); + assertGroupIs(8, 3, mFakeGroupCreator.groups.get(5)); } public void testEqualPhoneNumbers() { @@ -237,7 +241,7 @@ public class CallLogGroupBuilderTest extends AndroidTestCase { clearFakeGroupCreator(); addMultipleCallLogEntries(TEST_NUMBER1, types); mBuilder.addGroups(mCursor); - assertEquals(0, mFakeGroupCreator.groups.size()); + assertEquals(types.length, mFakeGroupCreator.groups.size()); } /** Adds a set of calls with the given types, all from the same number, in the old section. */ |