示例#1
0
        public void ReadMadridMmsMessageFromDatabaseTest()
        {
            //
            // Madrid MMS messages contain a leading unicode object replacement character as
            // placeholder for the image.
            //

            const string messageContentsInput     = "\uFFFCCheck out this awesome pic";
            string       messageContentsExpected  = messageContentsInput.Substring(1);
            const string phoneNumberValueExpected = "+13545552344";

            MockTextDatabaseReader2 mockDatabase = new MockTextDatabaseReader2();

            mockDatabase.AddMadridRow(6,
                                      347059294,
                                      0,
                                      347059296,
                                      messageContentsInput,
                                      null,
                                      phoneNumberValueExpected,
                                      36869);

            TextMessage messageActual = SingleMessageFromDatabase(mockDatabase);

            Assert.AreEqual(phoneNumberValueExpected, messageActual.Address);
            Assert.AreEqual(messageContentsExpected, messageActual.MessageContents);
            Assert.IsTrue(messageActual.IsOutgoing);

            DateTime timestampExpected = new DateTime(2011, 12, 30, 16, 21, 34);

            Assert.AreEqual(timestampExpected, messageActual.Timestamp);
        }
示例#2
0
        public void ReadMadridMessageFromDatabaseTest()
        {
            const string messageContentsExpected  = "What's up. The iMessage just came out!";
            const string phoneNumberValueExpected = "+19245558928";

            MockTextDatabaseReader2 mockDatabase = new MockTextDatabaseReader2();

            mockDatabase.AddMadridRow(5,
                                      347059294,
                                      347059298,
                                      0,
                                      messageContentsExpected,
                                      null,
                                      phoneNumberValueExpected,
                                      12289);

            TextMessage messageActual = SingleMessageFromDatabase(mockDatabase);

            Assert.AreEqual(phoneNumberValueExpected, messageActual.Address);
            Assert.AreEqual(messageContentsExpected, messageActual.MessageContents);
            Assert.IsFalse(messageActual.IsOutgoing);
            Assert.IsNull(messageActual.ChatId);

            DateTime timestampExpected = new DateTime(2011, 12, 30, 16, 21, 38);

            Assert.AreEqual(timestampExpected, messageActual.Timestamp);
        }
示例#3
0
        public void ReadChatMessageFromDatabaseTest()
        {
            const string messageContentsExpected = "Hey, what a great chat room!";
            const string roomNameExpected        = "chat901258305184729544";

            MockTextDatabaseReader2 mockDatabase = new MockTextDatabaseReader2();

            mockDatabase.AddMadridRow(5,
                                      347059428,
                                      0,
                                      0,
                                      messageContentsExpected,
                                      roomNameExpected,
                                      null,
                                      12289);

            TextMessage messageActual = SingleMessageFromDatabase(mockDatabase);

            Assert.IsNull(messageActual.Address);
            Assert.AreEqual(messageContentsExpected, messageActual.MessageContents);
            Assert.IsFalse(messageActual.IsOutgoing);
            Assert.AreEqual(roomNameExpected, messageActual.ChatId);

            DateTime timestampExpected = new DateTime(2011, 12, 30, 16, 23, 48);

            Assert.AreEqual(timestampExpected, messageActual.Timestamp);
        }