public async Task Get_Component_Inexistent_ShouldReturn_RestException() { var mockedContext = new EletronicPartsCatalogContextMock().GetMockedContextWithData(); var sut = new Details.QueryHandler(mockedContext); var message = new Details.Query("slug"); await Assert.ThrowsAsync <RestException>(() => sut.Handle(message, CancellationToken.None)); }
public async Task Get_User_Inexistent_ShouldReturn_RestException() { var mockedContext = new EletronicPartsCatalogContextMock().GetMockedContextWithData(); var mockedMapper = new Mock <IMapper>(); var sut = new Details.QueryHandler(mockedContext, mockedMapper.Object); var message = new Details.Query { Username = "******" }; await Assert.ThrowsAsync <RestException>(() => sut.Handle(message, CancellationToken.None)); }
public async Task Get_Profile_Inexistent_ShouldReturn_NoResult() { var mockedProfileReader = new Mock <IProfileReader>(); var sut = new Details.QueryHandler(mockedProfileReader.Object); var message = new Details.Query { Username = "******" }; var result = await sut.Handle(message, CancellationToken.None); Assert.Null(result); }