public async Task GetItemDetails_Should_Return_CorrectEntityAndModel() { var handler = new GetItemDetailsQueryHandler(this.context, this.mapper); var result = await handler.Handle(new GetItemDetailsQuery(DataConstants.SampleItemId), CancellationToken.None); result .Should() .BeOfType <Response <ItemDetailsResponseModel> >(); result .Data .Id .Should() .Be(DataConstants.SampleItemId); }
public async Task GetItemDetails_Given_InvalidId_Should_Throw_NotFoundException(string id) { var handler = new GetItemDetailsQueryHandler(this.context, this.mapper); await Assert.ThrowsAsync <NotFoundException>(() => handler.Handle(new GetItemDetailsQuery(Guid.Parse(id)), CancellationToken.None)); }