Exemplo n.º 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();
            });
        }
Exemplo n.º 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());
        }
Exemplo n.º 3
0
 public IActionResult Delete(int id)
 {
     personAppService.Delete(id);
     return(Response());
 }
Exemplo n.º 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"));
 }
Exemplo n.º 6
0
        public IActionResult Delete(int id)
        {
            _personAppService.Delete(id);

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