示例#1
0
        public ActionResult DeleteExistingBeer([FromRoute] DeleteExistingBeerRequest request)
        {
            var useCase = new DeleteExistingBeer(_catalog);

            var presenter = new ApiDeleteExistingBeerPresenter();

            useCase.Execute(request, presenter);

            return(NoContent());
        }
示例#2
0
        public void ItShouldReturnNotFoundedIfTheIdIsNotFound()
        {
            var catalogMock = new Mock <IBeerCatalog>();

            catalogMock.Setup(c => c.FindOneBeerByGuid(It.IsAny <Guid>())).Returns((Guid id) => null);

            var request = new DeleteExistingBeerRequest
            {
                Id = Guid.NewGuid()
            };

            var deleteExistingBeerUseCase = new DeleteExistingBeer(catalogMock.Object);

            deleteExistingBeerUseCase.Execute(request, this);

            Assert.False(Response.Founded);
        }