public void WriteConversationContentsTest() { IConversation conversation = DummyConversationDataGenerator.GetSingleConversation(DummyPhoneNumberId.ObamaCell); string exportedConversationExpected = "Tuesday, Nov 4, 2008\r\n" + "Me (\u200E10:18:05 PM\u202C): Congrats, buddy!\r\n" + "Barack Obama (\u200E10:18:40 PM\u202C): Thanks. Couldn't have done it without you!\r\n" + "Me (\u200E10:25:58 PM\u202C): np\r\n" + "\r\n" + "Sunday, May 1, 2011\r\n" + "Me (\u200E8:47:27 AM\u202C): Yo, I think I know where Osama Bin Laden is hiding?\r\n" + "Barack Obama (\u200E8:50:52 AM\u202C): o rly?\r\n" + "Me (\u200E8:51:21 AM\u202C): Yeah, dude. Abottabad, Pakistan. Huge compound. Can't miss it.\r\n" + "Barack Obama (\u200E8:51:46 AM\u202C): Sweet. I'll send some navy seals."; ConversationExporterPlaintext_Accessor conversationExporter = new ConversationExporterPlaintext_Accessor(new MockFileSystem()); MemoryStream outputStream = new MemoryStream(); StreamWriter sw = new StreamWriter(outputStream); conversationExporter.WriteConversationContents(sw, conversation, new MockDisplayOptions(), new AttachmentExportLocator(null)); sw.Flush(); outputStream.Seek(0, SeekOrigin.Begin); StreamReader sr = new StreamReader(outputStream); string exportedConversationActual = sr.ReadToEnd(); Assert.AreEqual(exportedConversationExpected, exportedConversationActual); }
private void VerifyConversationHeaderMatches(IConversation conversation, string headerExpected) { ConversationExporterPlaintext_Accessor exporter = new ConversationExporterPlaintext_Accessor(new MockFileSystem()); string headerActual = exporter.CreateHeaderConversationLine(conversation); Assert.AreEqual(headerExpected, headerActual); }
public void CreateHeaderSoftwareLineTest() { ConversationExporterBase_Accessor exporter = new ConversationExporterPlaintext_Accessor(new MockFileSystem()); Assert.IsTrue(exporter.CreateHeaderSoftwareLine().StartsWith("Exported by AllYourTexts v.")); }