public GetProductPartsQueryHandlerTest() { productPartRepo = new Mock <IProductPartRepo>(); mapper = new Mock <IMapper>(); query = new GetProductPartsQuery(reference); queryHandler = new GetProductPartsQueryHandler(productPartRepo.Object, mapper.Object); parts = new List <Part> { new Part(), new Part() }; productPartsDto = new List <GetProductPartsDto> { new GetProductPartsDto(), new GetProductPartsDto() }; }
public async Task <List <GetProductPartsDto> > Handle(GetProductPartsQuery request, CancellationToken cancellationToken) { var productParts = await productPartRepo.GetProductParts(request.Reference); return(mapper.Map <List <GetProductPartsDto> >(productParts)); }