Exemple #1
0
        public void MergedConversationWithExactDuplicatesTest()
        {
            MockLoadingProgressCallback progressCallback = new MockLoadingProgressCallback();

            DummyContactId[]     dummyContactIds     = { DummyContactId.Davola, DummyContactId.Davola };
            DummyPhoneNumberId[] DummyPhoneNumberIds = { DummyPhoneNumberId.DavolaCell, DummyPhoneNumberId.DavolaiPhone };

            MergingConversationManager mergingConversationManager = CreateMergingConversationManager(dummyContactIds, DummyPhoneNumberIds, progressCallback);

            Assert.AreEqual(1, mergingConversationManager.ConversationCount);
            ConversationManagerTest.VerifySuccessfulCompletion(progressCallback);
        }
Exemple #2
0
        public void EmptyMergedConversationTest()
        {
            MockLoadingProgressCallback progressCallback = new MockLoadingProgressCallback();

            DummyContactId[]     dummyContactIds     = { DummyContactId.NeverTexter };
            DummyPhoneNumberId[] DummyPhoneNumberIds = { };

            MergingConversationManager mergingConversationManager = CreateMergingConversationManager(dummyContactIds, DummyPhoneNumberIds, progressCallback);

            Assert.AreEqual(1, mergingConversationManager.ConversationCount);

            int expectedProgressMax = (DummyConversationDataGenerator.GetPhoneNumberCount(dummyContactIds) * 2) +
                                      DummyConversationDataGenerator.GetMessageCount(DummyPhoneNumberIds);

            Assert.AreEqual(expectedProgressMax, progressCallback.Maximum);
            ConversationManagerTest.VerifySuccessfulCompletion(progressCallback);
        }
Exemple #3
0
        public void ConversationWithNumberDuplicatesTest()
        {
            MockLoadingProgressCallback progressCallback = new MockLoadingProgressCallback();

            DummyContactId[]     dummyContactIds     = { DummyContactId.Davola, DummyContactId.DavolaNumberDuplicate };
            DummyPhoneNumberId[] DummyPhoneNumberIds = { DummyPhoneNumberId.DavolaCell, DummyPhoneNumberId.DavolaiPhone };

            MergingConversationManager conversationManagerMerged = CreateMergingConversationManager(dummyContactIds, DummyPhoneNumberIds, progressCallback);

            Assert.AreEqual(1, conversationManagerMerged.ConversationCount);

            IConversation conversation = conversationManagerMerged.GetConversation(0);

            Assert.AreEqual(1, conversation.AssociatedContacts.Count);
            Assert.AreEqual((long)DummyContactId.Davola, conversation.AssociatedContacts[0].ContactId);

            ConversationManagerTest.VerifySuccessfulCompletion(progressCallback);
        }