private static void InitPhoneNumberUnknown(DummyPhoneNumberId phoneNumberId, string phoneNumber)
        {
            Contact contactUnknown = new Contact(Contact.UnknownContactId, null, null, null, new PhoneNumber(phoneNumber));

            InitPhoneNumberDual(phoneNumberId, phoneNumber, PhoneNumber.Strip(new PhoneNumber(phoneNumber)));

            _DummyContacts[(int)phoneNumberId] = contactUnknown;
        }
        private void VerifyRenderedConversationMatchesExpected(DummyPhoneNumberId phoneNumberId, string renderedConversationExpected)
        {
            IConversation conversation = DummyConversationDataGenerator.GetSingleConversation(phoneNumberId);

            ConversationRendererPlaintext renderer = new ConversationRendererPlaintext(new MockDisplayOptions(), conversation);

            string renderedConversationActual = renderer.RenderMessagesAsString(ConversationRendererBase.RenderAllMessages);
            Assert.AreEqual(renderedConversationExpected, renderedConversationActual);
        }
        private void VerifyRenderedMessagesMatchExpected(DummyPhoneNumberId phoneNumberId, string renderedExpected)
        {
            IDisplayOptionsReadOnly displayOptions = new MockDisplayOptions();
            IConversation           conversation   = DummyConversationDataGenerator.GetSingleConversation(phoneNumberId);
            IConversationRenderer   renderer       = new ConversationRendererHtml(displayOptions, conversation, new AttachmentExportLocator(null));

            string renderedActual = renderer.RenderMessagesAsString(ConversationRendererBase.RenderAllMessages);

            Assert.AreEqual(renderedExpected, renderedActual);
        }
        private void VerifyRenderedMessagesMatchExpected(DummyPhoneNumberId phoneNumberId, string renderedExpected)
        {
            IDisplayOptionsReadOnly displayOptions = new MockDisplayOptions();
            IConversation conversation = DummyConversationDataGenerator.GetSingleConversation(phoneNumberId);
            IConversationRenderer renderer = new ConversationRendererHtml(displayOptions, conversation, new AttachmentExportLocator(null));

            string renderedActual = renderer.RenderMessagesAsString(ConversationRendererBase.RenderAllMessages);
            Assert.AreEqual(renderedExpected, renderedActual);
        }
 private void VerifyExportErrorString(DummyPhoneNumberId phoneNumberId, Exception ex, string descriptionExpected)
 {
     IConversation conversation = DummyConversationDataGenerator.GetSingleConversation(phoneNumberId);
     VerifyExportErrorString(conversation, ex, descriptionExpected);
 }
 private static void InitPhoneNumberStripped(DummyPhoneNumberId phoneNumberId, string phoneNumberStripped)
 {
     InitPhoneNumberDual(phoneNumberId, phoneNumberStripped, phoneNumberStripped);
 }
 private static void InitPhoneNumberDual(DummyPhoneNumberId phoneNumberId, string phoneNumber, string phoneNumberStripped)
 {
     int phoneNumberIdInt = (int)phoneNumberId;
     _DummyPhoneNumbers[phoneNumberIdInt] = phoneNumber;
     _DummyPhoneNumbersStripped[phoneNumberIdInt] = phoneNumberStripped;
 }
 private static Contact GetAssociatedContact(DummyPhoneNumberId phoneNumberId)
 {
     return _DummyContacts[(int)phoneNumberId];
 }
 public static string GetPhoneNumberStripped(DummyPhoneNumberId phoneNumberId)
 {
     return _DummyPhoneNumbersStripped[(int)phoneNumberId];
 }
 public static List<TextMessage> GetMessageSet(DummyPhoneNumberId setId)
 {
     string phoneNumberStripped = GetPhoneNumberStripped(setId);
     return _DummyMessageSets[phoneNumberStripped].MessageList;
 }
 private ConversationManager CreateConversationManager(DummyContactId[] contactIds, DummyPhoneNumberId[] messageSetIds, ILoadingProgressCallback progressCallback)
 {
     DummyChatRoomId[] chatRoomIds = { };
     return CreateConversationManager(contactIds, messageSetIds, chatRoomIds, progressCallback);
 }
        private ConversationManager CreateConversationManager(DummyContactId[] contactIds, DummyPhoneNumberId[] messageSetIds, DummyChatRoomId[] chatRoomIds, ILoadingProgressCallback progressCallback)
        {
            if (progressCallback != null)
            {
                int messageCount = DummyConversationDataGenerator.GetMessageCount(messageSetIds);
                int workEstimate = ConversationManager.GetWorkEstimate(contactIds.Length, messageCount, chatRoomIds.Length, 0);
                progressCallback.Begin(workEstimate);
            }

            ConversationManager conversationManager = DummyConversationDataGenerator.GetConversationManager(contactIds, messageSetIds, chatRoomIds, progressCallback);

            if (progressCallback != null)
            {
                progressCallback.End();
            }

            return conversationManager;
        }
        private void VerifyConversationDescription(DummyPhoneNumberId phoneNumberId, string descriptionExpected)
        {
            IConversation conversation = DummyConversationDataGenerator.GetSingleConversation(phoneNumberId);

            VerifyConversationDescription(conversation, descriptionExpected);
        }
        private void VerifyExportErrorString(DummyPhoneNumberId phoneNumberId, Exception ex, string descriptionExpected)
        {
            IConversation conversation = DummyConversationDataGenerator.GetSingleConversation(phoneNumberId);

            VerifyExportErrorString(conversation, ex, descriptionExpected);
        }
 public static IContact GetContact(DummyPhoneNumberId phoneNumberId)
 {
     return _DummyContacts[(int)phoneNumberId];
 }
 public static int GetMessageCount(DummyPhoneNumberId setId)
 {
     string phoneNumberStripped = GetPhoneNumberStripped(setId);
     return _DummyMessageSets[phoneNumberStripped].Count;
 }
 public static string GetPhoneNumber(DummyPhoneNumberId phoneNumberId)
 {
     return(_DummyPhoneNumbers[(int)phoneNumberId]);
 }
 public static string GetPhoneNumber(DummyPhoneNumberId phoneNumberId)
 {
     return _DummyPhoneNumbers[(int)phoneNumberId];
 }
 public static string GetPhoneNumberStripped(DummyPhoneNumberId phoneNumberId)
 {
     return(_DummyPhoneNumbersStripped[(int)phoneNumberId]);
 }
        public static IConversation GetSingleConversation(DummyPhoneNumberId messageSetId)
        {
            Contact contact = GetAssociatedContact(messageSetId);
            List<Contact> contacts = new List<Contact>(1);
            if (contact != null)
            {
                contacts.Add(contact);
            }
            List<TextMessage> messages = DummyConversationDataGenerator.GetMessageSet(messageSetId);
            List<ChatRoomInformation> chatInfoItems = new List<ChatRoomInformation>();
            List<MessageAttachment> attachments = new List<MessageAttachment>();

            ConversationManager conversationManager = new ConversationManager(contacts, messages, chatInfoItems, attachments, null);

            return conversationManager.GetConversation(0);
        }
 public List<ITextGraphData> GetConversationGraphData(DummyPhoneNumberId DummyPhoneNumberId, GraphTimeUnit timeUnit)
 {
     IConversation conversation = DummyConversationDataGenerator.GetSingleConversation(DummyPhoneNumberId);
     GraphDataGenerator generator = new GraphDataGenerator();
     return new List<ITextGraphData>(generator.MessageCountPerUnitTime(conversation, timeUnit));
 }
        private static void InitPhoneNumber(DummyContactId contactId, DummyPhoneNumberId phoneNumberId, string firstName, string lastName, string phoneNumberValue, string phoneNumberValueStripped)
        {
            IPhoneNumber phoneNumber = new PhoneNumber(phoneNumberValue);
            Contact contact = new Contact((long)contactId, firstName, null, lastName, phoneNumber);

            InitPhoneNumberDual(phoneNumberId, phoneNumberValue, phoneNumberValueStripped);

            _DummyContacts[(int)phoneNumberId] = contact;
        }
 public List<ITextGraphData> GetAggregateConversationGraphData(DummyPhoneNumberId DummyPhoneNumberId, GraphAggregateType aggregateType)
 {
     IConversation conversation = DummyConversationDataGenerator.GetSingleConversation(DummyPhoneNumberId);
     GraphDataGenerator generator = new GraphDataGenerator();
     return new List<ITextGraphData>(generator.MessageCountAggregate(conversation, aggregateType));
 }
 private static void InitPhoneNumberFormatted(DummyPhoneNumberId phoneNumberId, string phoneNumberFormatted)
 {
     InitPhoneNumberDual(phoneNumberId, phoneNumberFormatted, null);
 }
 private void VerifyConversationDescription(DummyPhoneNumberId phoneNumberId, string descriptionExpected)
 {
     IConversation conversation = DummyConversationDataGenerator.GetSingleConversation(phoneNumberId);
     VerifyConversationDescription(conversation, descriptionExpected);
 }
        private static void InitPhoneNumberUnknown(DummyPhoneNumberId phoneNumberId, string phoneNumber)
        {
            Contact contactUnknown = new Contact(Contact.UnknownContactId, null, null, null, new PhoneNumber(phoneNumber));

            InitPhoneNumberDual(phoneNumberId, phoneNumber, PhoneNumber.Strip(new PhoneNumber(phoneNumber)));

            _DummyContacts[(int)phoneNumberId] = contactUnknown;
        }
        private MergingConversationManager CreateMergingConversationManager(DummyContactId[] contactIds, DummyPhoneNumberId[] messageSetIds, ILoadingProgressCallback progressCallback)
        {
            if (progressCallback != null)
            {
                int workEstimate = ConversationManager.GetWorkEstimate(contactIds.Length, messageSetIds.Length, 0, 0) +
                                   MergingConversationManager.GetWorkEstimateByContacts(contactIds.Length);
                progressCallback.Begin(workEstimate);
            }

            ConversationManager conversationManager = DummyConversationDataGenerator.GetConversationManager(contactIds, messageSetIds, progressCallback);

            if (progressCallback != null)
            {
                progressCallback.UpdateRemaining(MergingConversationManager.GetWorkEstimate(conversationManager.ConversationCount));
            }

            MergingConversationManager mergingConversationManager = new MergingConversationManager(conversationManager, progressCallback);

            if (progressCallback != null)
            {
                progressCallback.End();
            }

            return mergingConversationManager;
        }