Ejemplo n.º 1
0
        public async Task Handle_NoMatchingId_ThrowsNotFoundException()
        {
            var query = new GetCasefileQuery {
                Id = 99
            };

            var handler = new GetCasefileQuery.GetCasefileQueryHandler(_context, _mapper);

            Func <Task> action = () => handler.Handle(query, CancellationToken.None);

            await action.Should().ThrowExactlyAsync <NotFoundException>();
        }
Ejemplo n.º 2
0
        public async Task Handle_ReturnsCorrectVmAndCasefile()
        {
            var query = new GetCasefileQuery {
                Id = 1
            };

            var handler = new GetCasefileQuery.GetCasefileQueryHandler(_context, _mapper);

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

            result.Should().BeOfType <GetCasefileVm>();
            result.Id.Should().Be(1);
            result.Name.Should().Be("Lower Back Injury");
        }