示例#1
0
        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();
            });
        }
示例#2
0
        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());
        }
示例#3
0
 public IActionResult Delete(int id)
 {
     personAppService.Delete(id);
     return(Response());
 }
示例#4
0
 public ActionResult Delete(string id)
 {
     _appService.Delete(Guid.Parse(id));
     return(Ok());
 }
 public IActionResult DeleteConfirmed(int id)
 {
     _personAppService.Delete(id);
     return(RedirectToAction("Index"));
 }
示例#6
0
        public IActionResult Delete(int id)
        {
            _personAppService.Delete(id);

            return(CreateResponseOnDelete <PersonDto>(PERSON_NAME));
        }