Esempio n. 1
0
        public void UpdateTest()
        {
            ContactService service = new ContactService();
            var all = service.GetAll();

            if (service.GetAll().Count <= 0)
            {
                AddTest();
                all = service.GetAll();
            }

            var contact = all[0];
            contact.Email = "*****@*****.**";

            service.Update(contact);

            var updatedAll = service.GetAll();
            var actual = updatedAll.Find(c => c.Id == contact.Id);
            Assert.AreEqual(contact.Email, actual.Email);
        }
Esempio n. 2
0
        public void UpdateTest()
        {
            ContactService service = new ContactService();
            var all = service.GetAll();

            if (service.GetAll().Count <= 0)
            {
                AddTest();
                all = service.GetAll();
            }

            var contact = all[0];
            contact.emails = new List<string>() { "*****@*****.**" };

            service.Update(contact);

            var updatedAll = service.GetAll();
            var actual = updatedAll.Find(c => c.id == contact.id);
            Assert.AreEqual(contact.emails[0], actual.emails[0]);
        }