public async Task ShouldThrowErrorWhenInValidInformation()
        {
            var tagDetailQuery = new GetTagDetailQuery(_adminUserId, _tagId + 1, _tenantId);

            await Assert.ThrowsAsync <NotFoundException>(async() =>
                                                         await _getTagDetailQueryHandler.Handle(tagDetailQuery, CancellationToken.None));
        }
示例#2
0
        public async Task <ActionResult <TagDetailVm> > GetTagById(string id)
        {
            var getTagDetailQuery = new GetTagDetailQuery()
            {
                Id = id
            };

            return(this.Ok(await this._mediator.Send(getTagDetailQuery)));
        }
        public async Task ShouldGetModelForValidInformation()
        {
            var tagDetailQuery = new GetTagDetailQuery(_adminUserId, _tagId, _tenantId);

            var tagDetailResponseModel = await _getTagDetailQueryHandler.Handle(tagDetailQuery, CancellationToken.None);

            Assert.Null(tagDetailResponseModel.Errors);
            Assert.Equal(expected: _context.Tags.First().Name, actual: tagDetailResponseModel.Items.First().Name, ignoreCase: true);
        }