Пример #1
0
        public void TestDeleteContact()
        {
            Guid    id         = Guid.NewGuid();
            Contact newContact = new Contact(id, "Milivoj", "Milani", "+385989059120", new ContactAddress("Tonžino 7b", "Rijeka", "51000", "Croatia"));

            _contactOrganizerSqlRepository.CreateNewContact(newContact);
            newContact.UpdateDetails("Jovilim", "Inalim", "+385989059120", new ContactAddress("Tonžino 7a", "Rijeka", "51000", "Croatia"));
            Contact contactFromDb = _contactOrganizerSqlRepository.GetContactById(id);

            _contactOrganizerSqlRepository.DeleteContact(contactFromDb.Id);
            Assert.ThrowsException <InvalidOperationException>(() => _contactOrganizerSqlRepository.GetContactById(id));
        }
Пример #2
0
 /// <summary>
 /// Deletes the contact from external data store.
 /// </summary>
 /// <param name="contactId">Contact unique identifier.</param>
 public void DeleteContact(Guid contactId)
 {
     _contactOrganizerRepository.DeleteContact(contactId);
 }