public void InsideComma()
        {
            //Arrange
            string chat_entry = "live:kant,Immanuel Kant,live:kant,Immanuel Kant,\"-- ? T::Z\",1519850227436,Look, that is deep water.";
            var    parser     = new ChatHistoryModule.ChatRecordParser();

            //Act
            var record = parser.Parse(chat_entry);

            //Assert
            Assert.IsNotNull(record);
            Assert.AreEqual <string>("Look, that is deep water.", record.ContentXml);
        }
        public void EnclosingQuotesAndNewLine()
        {
            //Arrange
            string chat_entry = "live:kant,Immanuel Kant,live:kant,Immanuel Kant,\"-- ? T::Z\",1516850226436,\"For sure. \r\nShoot!\"";
            var    parser     = new ChatHistoryModule.ChatRecordParser();

            //Act
            var record = parser.Parse(chat_entry);

            //Assert
            Assert.IsNotNull(record);
            Assert.AreEqual <string>("For sure. \r\nShoot!", record.ContentXml);
        }
        public void InsideQuotes()
        {
            //Arrange
            string chat_entry = "live:kant,Immanuel Kant,live:hume,David Hume,\"-- ? T::Z\",1516850227436,What is \"truth\"?";
            var    parser     = new ChatHistoryModule.ChatRecordParser();

            //Act
            var record = parser.Parse(chat_entry);

            //Assert
            Assert.IsNotNull(record);
            Assert.AreEqual <string>("What is \"truth\"?", record.ContentXml);
        }
        public void Image()
        {
            //Arrange
            string chat_entry = "live:kant,Immanuel Kant,live:hume,David Hume,\"--?T::Z\",1516952436904,\"<URIObject type=\"\"Picture.1\"\" uri=\"\"https://api.asm.skype.com/v1/objects/0-cus-d3-2e526243d3918ed444a18835755c3635\"\" url_thumbnail=\"\"https://api.asm.skype.com/v1/objects/0-cus-d3-2e526243d3918ed444a18835755c3635/views/imgt1\"\"><Title/> <Description/> <a href=\"\"https://login.skype.com/login/sso?go=xmmfallback?pic=0-cus-d3-2e526243d3918ed444a18835755c3635\"\">https://login.skype.com/login/sso?go=xmmfallback?pic=0-cus-d3-2e526243d3918ed444a18835755c3635</a><OriginalName v=\"\"C:\\Users\\Hume\\AppData\\Local\\Packages\\Microsoft.SkypeApp_kzf8qxf38zg5c\\LocalState\\44840ec5-a5ee-4d31-9e64-abaa85bc3a1c.jpg\"\"/><meta type=\"\"photo\"\" originalName=\"\"C:\\Users\\Hume\\AppData\\Local\\Packages\\Microsoft.SkypeApp_kzf8qxf38zg5c\\LocalState\\44840ec5-a5ee-4d31-9e64-abaa85bc3a1c.jpg\"\"/></URIObject>\"";
            var    parser     = new ChatHistoryModule.ChatRecordParser();

            //Act
            var record = parser.Parse(chat_entry);

            //Assert
            Assert.IsNotNull(record);
            Assert.AreEqual <string>("<URIObject type=\"\"Picture.1\"\" uri=\"\"https://api.asm.skype.com/v1/objects/0-cus-d3-2e526243d3918ed444a18835755c3635\"\" url_thumbnail=\"\"https://api.asm.skype.com/v1/objects/0-cus-d3-2e526243d3918ed444a18835755c3635/views/imgt1\"\"><Title/> <Description/> <a href=\"\"https://login.skype.com/login/sso?go=xmmfallback?pic=0-cus-d3-2e526243d3918ed444a18835755c3635\"\">https://login.skype.com/login/sso?go=xmmfallback?pic=0-cus-d3-2e526243d3918ed444a18835755c3635</a><OriginalName v=\"\"C:\\Users\\Hume\\AppData\\Local\\Packages\\Microsoft.SkypeApp_kzf8qxf38zg5c\\LocalState\\44840ec5-a5ee-4d31-9e64-abaa85bc3a1c.jpg\"\"/><meta type=\"\"photo\"\" originalName=\"\"C:\\Users\\Hume\\AppData\\Local\\Packages\\Microsoft.SkypeApp_kzf8qxf38zg5c\\LocalState\\44840ec5-a5ee-4d31-9e64-abaa85bc3a1c.jpg\"\"/></URIObject>", record.ContentXml);
        }
        public void EnclosingQuotes()
        {
            //Arrange
            string chat_entry = "live:kant,Immanuel Kant,live:hume,David Hume,\"-- ? T::Z\",1516850226436,\"May I ask you a simple question?\"";
            var    parser     = new ChatHistoryModule.ChatRecordParser();

            //Act
            var record = parser.Parse(chat_entry);

            //Assert
            Assert.IsNotNull(record);
            Assert.AreEqual <string>("May I ask you a simple question?", record.ContentXml);
        }
        public void Anchor()
        {
            //Arrange
            string chat_entry = "live:kant,Immanuel Kant,live:hume,David Hume,\"--?T::Z\",1516852436904,\"And all that, in Spanish, here <a href=\"\"http://www.filosofia.org/filomat/index.htm\"\">http://www.filosofia.org/filomat/index.htm</a>\"";
            var    parser     = new ChatHistoryModule.ChatRecordParser();

            //Act
            var record = parser.Parse(chat_entry);

            //Assert
            Assert.IsNotNull(record);
            Assert.AreEqual <string>("And all that, in Spanish, here <a href=\"\"http://www.filosofia.org/filomat/index.htm\"\">http://www.filosofia.org/filomat/index.htm</a>", record.ContentXml);
        }
        public void CharacterEntity()
        {
            //Arrange
            string chat_entry = "live:kant,Immanuel Kant,live:hume,David Hume,\"--?T::Z\",1516952436904,But, is &quot;truth&quot; directly related to &quot;freedom&quot;?";
            var    parser     = new ChatHistoryModule.ChatRecordParser();

            //Act
            var record = parser.Parse(chat_entry);

            //Assert
            Assert.IsNotNull(record);
            Assert.AreEqual <string>("But, is &quot;truth&quot; directly related to &quot;freedom&quot;?", record.ContentXml);
        }
        public void AnchorAndNewline()
        {
            //Arrange
            string chat_entry = "live:kant,Immanuel Kant,live:kant,Immanuel Kant,\"--?T::Z\",1529850327436,\"Ok. Let us read, for example, this:\r\n<a href=\"\"https://plato.stanford.edu/entries/truth/\"\">https://plato.stanford.edu/entries/truth/</a>\"";
            var    parser     = new ChatHistoryModule.ChatRecordParser();

            //Act
            var record = parser.Parse(chat_entry);

            //Assert
            Assert.IsNotNull(record);
            Assert.AreEqual <string>("Ok. Let us read, for example, this:\r\n<a href=\"\"https://plato.stanford.edu/entries/truth/\"\">https://plato.stanford.edu/entries/truth/</a>", record.ContentXml);
        }
        public void Smile()
        {
            //Arrange
            string chat_entry = "live:kant,Immanuel Kant,live:hume,David Hume,\"-- ? T::Z\",1529850227436,\"I know, there is reason, razón in Spanish, <ss type=\"\"smile\"\">:)</ss>\"";
            var    parser     = new ChatHistoryModule.ChatRecordParser();

            //Act
            var record = parser.Parse(chat_entry);

            //Assert
            Assert.IsNotNull(record);
            Assert.AreEqual <string>("I know, there is reason, razón in Spanish, <ss type=\"\"smile\"\">:)</ss>", record.ContentXml);
        }
        public void Surprised()
        {
            //Arrange
            string chat_entry = "live:kant,Immanuel Kant,live:hume,David Hume,\"-- ? T::Z\",1529850227436,\"<ss type=\"\"surprised\"\">:O</ss>\"";
            var    parser     = new ChatHistoryModule.ChatRecordParser();

            //Act
            var record = parser.Parse(chat_entry);

            //Assert
            Assert.IsNotNull(record);
            Assert.AreEqual <string>("<ss type=\"\"surprised\"\">:O</ss>", record.ContentXml);
        }
        public void Plain()
        {
            //Arrange
            string chat_entry = "live:kant,Immanuel Kant,live:hume,David Hume,\"--?T::Z\",1517455101016,Hello!";
            var    parser     = new ChatHistoryModule.ChatRecordParser();

            //Act
            var record = parser.Parse(chat_entry);

            //Assert
            Assert.IsNotNull(record);
            Assert.AreEqual <string>("Hello!", record.ContentXml);
        }
Ejemplo n.º 12
0
        public void Timestamp()
        {
            //Arrange
            string chat_entry = "live:kant,Immanuel Kant,live:hume,David Hume,\"--?T::Z\",1517447422643,Cheers!";
            var    parser     = new ChatHistoryModule.ChatRecordParser();

            //Act
            var record = parser.Parse(chat_entry);

            //Assert
            Assert.IsNotNull(record);
            Assert.AreEqual <ulong>(1517447422643UL, record.TimestampMs);
            Assert.AreEqual <DateTime>(DateTime.Parse("2018-01-31 19:10:22.643"), record.When);
        }