public void Should_Soft_Delete_Person() { var existingPersonId = 1; var initialPeopleCount = GetPeopleCount(); _personAppService.Delete(new DeletePersonInput { PersonId = existingPersonId }); UsingDbContext(context => { //Filters are disabled inside UsingDbContext methods context.People.Count().ShouldBe(initialPeopleCount, "Soft delete is enabled, person should not be really deleted"); context.People.First(p => p.Id == existingPersonId).IsDeleted.ShouldBeTrue(); }); }
public void Should_Delete_Person_With_Success() { //Arrange var personDto = new PersonDto { Id = 2, Name = "John Doe" }; //Act var result = _personAppService.Create(personDto); //Assert Assert.False(LocalNotification.HasNotification()); result.Id.ShouldBe(2); //Act _personAppService.Delete(2); //Assert Assert.False(LocalNotification.HasNotification()); }
public IActionResult Delete(int id) { personAppService.Delete(id); return(Response()); }
public ActionResult Delete(string id) { _appService.Delete(Guid.Parse(id)); return(Ok()); }
public IActionResult DeleteConfirmed(int id) { _personAppService.Delete(id); return(RedirectToAction("Index")); }
public IActionResult Delete(int id) { _personAppService.Delete(id); return(CreateResponseOnDelete <PersonDto>(PERSON_NAME)); }