public void Create_Post_PutsValidWithoutError()
        {
            InMemoryContactRepository repository = new InMemoryContactRepository();
            HomeController controller = GetHomeController(repository);

            Contact contact = GetContact(5, "First5", "Last5");
            controller.Create(contact);

            IEnumerable<Contact> contacts = repository.GetAllContacts();
            Assert.IsTrue(contacts.Contains(contact));
        }
 public void Delete_Post_DeleteContactById()
 {
     InMemoryContactRepository repository = new InMemoryContactRepository();
     Contact contact = GetContact();
     repository.Add(contact);
     HomeController controller = GetHomeController(repository);
     Assert.AreEqual(1, repository.GetAllContacts().Count());
     ViewResult result = (ViewResult)controller.Delete(contact.Id, GetFormCollection(contact, ""));
     Assert.AreEqual(0,repository.GetAllContacts().Count());
 }