public async Task GetTaskItem_NotFound_Test() { var sut = new GetTaskItemQueryHandler(_context, _mapper); var command = new GetTaskItemQuery { TaskItemId = invalidTaskId }; await Assert.ThrowsAsync <NotFoundException>(() => sut.Handle(command, CancellationToken.None)); }
public async Task GetTaskItem_Found_Test() { var sut = new GetTaskItemQueryHandler(_context, _mapper); var result = await sut.Handle(new GetTaskItemQuery { TaskItemId = validTaskId } , CancellationToken.None); result.ShouldBeOfType <TaskItemModel>(); result.Id.ShouldBe(validTaskId); }