Esempio n. 1
0
        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));
        }
Esempio n. 2
0
        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);
        }