public void When_I_clear_it()
 {
     foreach (var contact in ContactBook.Contacts.ToArray())
     {
         ContactBook.Remove(contact.Name);
     }
     StepExecution.Current.Bypass("Contact book clearing is not implemented yet. Contacts are removed one by one.");
 }
 public void When_I_remove_one_contact()
 {
     RemovedContacts = ContactBook.Contacts.Take(1).ToArray();
     foreach (var contact in RemovedContacts)
     {
         ContactBook.Remove(contact.Name);
     }
 }
示例#3
0
        public static void Show(ContactBook book)
        {
            var contact = ContactSelectorMenu.Show(book);

            if (contact == null)
            {
                return;
            }

            PromptE.Menu($"[name: {contact.DisplayName} | email: {contact.Email} | cell: {contact.CellphoneNumber}]")
            .Action(new UpdateContactAction(book, contact))
            .Action("Delete", () => book.Remove(contact))
            .Action("[Cancel]", null)
            .Show();
        }
示例#4
0
 private void RemoveContact(Contact contact)
 {
     _removedContacts.Add(contact);
     _contactBook.Remove(contact.Email);
 }