Exemple #1
0
        public void MultiDayConversationTest()
        {
            IConversation   conversation   = GetMultiDayConversation();
            IDisplayOptions displayOptions = new MockDisplayOptions();

            ConversationRendererRichText_Accessor renderer = new ConversationRendererRichText_Accessor(displayOptions, conversation);

            List <Paragraph> paragraphsActual = renderer.RenderMessagesAsParagraphs(ConversationRendererRichText.RenderAllMessages);

            List <Paragraph> paragraphsExpected = GetMultiDayConversationRenderingExpected(conversation, renderer);

            VerifyParagraphListsEqual(paragraphsExpected, paragraphsActual);

            paragraphsActual = renderer.RenderMessagesAsParagraphs(ConversationRendererRichText.RenderAllMessages);
            Assert.AreEqual(0, paragraphsActual.Count);
        }
        public void MultiDayConversationTest()
        {
            IConversation conversation = GetMultiDayConversation();
            IDisplayOptions displayOptions = new MockDisplayOptions();

            ConversationRendererRichText_Accessor renderer = new ConversationRendererRichText_Accessor(displayOptions, conversation);

            List<Paragraph> paragraphsActual = renderer.RenderMessagesAsParagraphs(ConversationRendererRichText.RenderAllMessages);

            List<Paragraph> paragraphsExpected = GetMultiDayConversationRenderingExpected(conversation, renderer);

            VerifyParagraphListsEqual(paragraphsExpected, paragraphsActual);

            paragraphsActual = renderer.RenderMessagesAsParagraphs(ConversationRendererRichText.RenderAllMessages);
            Assert.AreEqual(0, paragraphsActual.Count);
        }
Exemple #3
0
        public void SingleMessageConversationTest()
        {
            IConversation   conversation   = DummyConversationDataGenerator.GetSingleConversation(DummyPhoneNumberId.UnknownEagle);
            IDisplayOptions displayOptions = new MockDisplayOptions();

            ConversationRendererRichText_Accessor renderer = new ConversationRendererRichText_Accessor(displayOptions, conversation);

            List <Paragraph> paragraphsActual = renderer.RenderMessagesAsParagraphs(ConversationRendererRichText.RenderAllMessages);

            Assert.AreEqual(1, paragraphsActual.Count);

            IConversationMessage message = conversation.GetMessage(0);

            Paragraph paragraphExpected = new Paragraph();

            paragraphExpected.Inlines.Add(ConversationRendererRichText_Accessor.DateAsInline(message.Timestamp));
            paragraphExpected.Inlines.Add(new LineBreak());
            paragraphExpected.Inlines.AddRange(renderer.ConversationMessageToInlines(message));

            VerifyParagraphsEqual(paragraphExpected, paragraphsActual[0]);

            paragraphsActual = renderer.RenderMessagesAsParagraphs(ConversationRendererRichText.RenderAllMessages);
            Assert.AreEqual(0, paragraphsActual.Count);
        }
Exemple #4
0
        public void RenderIncrementallyTest()
        {
            IConversation   conversation   = GetMultiDayConversation();
            IDisplayOptions displayOptions = new MockDisplayOptions();

            ConversationRendererRichText_Accessor renderer = new ConversationRendererRichText_Accessor(displayOptions, conversation);

            List <Paragraph> paragraphsActual = new List <Paragraph>();

            const int MessageRenderSize = 1;

            List <Paragraph> paragraphsCurrent;

            while (renderer.HasUnprocessedMessages)
            {
                paragraphsCurrent = renderer.RenderMessagesAsParagraphs(MessageRenderSize);
                paragraphsActual.AddRange(paragraphsCurrent);
            }

            List <Paragraph> paragraphsExpected = GetMultiDayConversationRenderingExpected(conversation, renderer);

            VerifyParagraphListsEqual(paragraphsExpected, paragraphsActual);
        }
        public void SingleMessageConversationTest()
        {
            IConversation conversation = DummyConversationDataGenerator.GetSingleConversation(DummyPhoneNumberId.UnknownEagle);
            IDisplayOptions displayOptions = new MockDisplayOptions();

            ConversationRendererRichText_Accessor renderer = new ConversationRendererRichText_Accessor(displayOptions, conversation);

            List<Paragraph> paragraphsActual = renderer.RenderMessagesAsParagraphs(ConversationRendererRichText.RenderAllMessages);
            Assert.AreEqual(1, paragraphsActual.Count);

            IConversationMessage message = conversation.GetMessage(0);

            Paragraph paragraphExpected = new Paragraph();
            paragraphExpected.Inlines.Add(ConversationRendererRichText_Accessor.DateAsInline(message.Timestamp));
            paragraphExpected.Inlines.Add(new LineBreak());
            paragraphExpected.Inlines.AddRange(renderer.ConversationMessageToInlines(message));

            VerifyParagraphsEqual(paragraphExpected, paragraphsActual[0]);

            paragraphsActual = renderer.RenderMessagesAsParagraphs(ConversationRendererRichText.RenderAllMessages);
            Assert.AreEqual(0, paragraphsActual.Count);
        }
        public void RenderIncrementallyTest()
        {
            IConversation conversation = GetMultiDayConversation();
            IDisplayOptions displayOptions = new MockDisplayOptions();

            ConversationRendererRichText_Accessor renderer = new ConversationRendererRichText_Accessor(displayOptions, conversation);

            List<Paragraph> paragraphsActual = new List<Paragraph>();

            const int MessageRenderSize = 1;

            List<Paragraph> paragraphsCurrent;
            while (renderer.HasUnprocessedMessages)
            {
                paragraphsCurrent = renderer.RenderMessagesAsParagraphs(MessageRenderSize);
                paragraphsActual.AddRange(paragraphsCurrent);
            }

            List<Paragraph> paragraphsExpected = GetMultiDayConversationRenderingExpected(conversation, renderer);

            VerifyParagraphListsEqual(paragraphsExpected, paragraphsActual);
        }