public void CanAddAndRemoveContacts() { var repo = new AccountRepositoryADO(); repo.AddContact("11111111-1111-1111-1111-111111111111", 5); var contacts = repo.GetContacts(Guid.Empty.ToString()); Assert.AreEqual(3, contacts.Count()); repo.RemoveContact("11111111-1111-1111-1111-111111111111", 3); contacts = repo.GetContacts(Guid.Empty.ToString()); Assert.AreEqual(2, contacts.Count()); }
public IHttpActionResult RemoveContact(string userId, int listingId) { var repo = new AccountRepositoryADO(); try { repo.RemoveContact(userId, listingId); return(Ok()); } catch (Exception ex) { return(BadRequest(ex.Message)); } }