public async Task IdNotEmpty()
        {
            var command = new DeleteResultCommand("1");
            var handler = new DeleteResultHandler(_mock.Object);

            var result = await handler.Handle(command, CancellationToken.None);

            Assert.IsTrue(result);
        }
        public async Task InvalidId_False(string id)
        {
            var command = new DeleteResultCommand(id);
            var handler = new DeleteResultHandler(_mock.Object);

            var result = await handler.Handle(command, CancellationToken.None);

            Assert.IsFalse(result);
        }
예제 #3
0
        public async Task <IActionResult> DeleteResult(string id)
        {
            var command = new DeleteResultCommand(id);
            var result  = await _mediator.Send(command);

            if (result)
            {
                return(Ok());
            }

            return(NotFound());
        }