public void TestDeletePerson() { Mock <IPersonDataAccess> personDataAccess = new Mock <IPersonDataAccess>(); personDataAccess.Setup(x => x.Delete(It.IsAny <PersonIdentityModel>())); var deleteService = new PersonDeleteService(personDataAccess.Object); deleteService.DeletePerson(new PersonIdentityModel(1)); personDataAccess.Verify(x => x.Delete(It.IsAny <PersonIdentityModel>()), Times.Once()); }
public void DeletePerson(int id) { var identityModel = new PersonIdentityModel(id); PersonDeleteService.DeletePerson(identityModel); }