private void DeleteContact()
        {
            var contactToDelete = viewModel.SelectedContact;

            root.RemoveContact(contactToDelete);
            logService.Message("Delete contact", true);
            addressBookService.ContactDeleted(GetDto(contactToDelete));
        }
Example #2
0
        public void AddAndRemoveContacts()
        {
            var root = new AddressBookRoot();

            Assert.IsFalse(root.Contacts.Any());

            var contact1 = root.AddNewContact();

            Assert.IsTrue(root.Contacts.SequenceEqual(new[] { contact1 }));

            var contact2 = new Contact();

            root.AddContact(contact2);
            Assert.IsTrue(root.Contacts.SequenceEqual(new[] { contact1, contact2 }));

            root.RemoveContact(contact1);
            Assert.IsTrue(root.Contacts.SequenceEqual(new[] { contact2 }));
        }