public void DeleteContact_WithExistingContact_ShouldReturnTrue() { // Arrange var mockContactRepository = new Mock <IContactRepository>(); mockContactRepository.Setup(contactRepository => contactRepository.DeleteContact(It.IsAny <Contact>())).Returns(true); var contactManager = new ContactManager(mockContactRepository.Object); // Create a fake contact var contact = new Contact { FirstName = "TestUserFirstName", LastName = "TestUserLastName", EmailAddress = "*****@*****.**", Birthday = DateTime.Now }; // Act var wasDeleted = contactManager.DeleteContact(contact); // Assert Assert.True(wasDeleted); }
public ActionResult Delete(int id) { manager.DeleteContact(id); return(RedirectToAction("Index")); }
//Delete Contact public string DeleteContact(int _Id) { return(_ContactManager.DeleteContact(_Id).ToString()); }
public static void DeleteContactDto(int id) { ContactManager.DeleteContact(id); }