Ejemplo n.º 1
0
        public void CheckExistFromContact()
        {
            SQLiteRepository con = new SQLiteRepository();

            con.CreateDatabase();
            MessageRepository messageRepository = new MessageRepository(con);
            ContactRepository contactRepository = new ContactRepository(con);
            Contact           contact           = new Contact
            {
                Id        = 1,
                FirstName = "Pablo",
                LastName  = "Corral",
                Phone     = "34676681420"
            };
            Chat m = new Chat
            {
                Mensaje = "hola",
                FromTo  = "34676681420",
                Send    = true,
                Created = DateTime.Now,
                Seen    = true
            };

            using (var connection = con.GetConnection())
            {
                contactRepository.InsertContact(contact);
                messageRepository.InsertMessage(m);
                var result = messageRepository.CheckExistFromContact("34666666666");
                Assert.IsFalse(result);
            }
        }