public ProductController( IUnitOfWork unitOfWork, IProductRepository ProductRepository, ProductAssembler ProductAssembler ) { _unitOfWork = unitOfWork; _ProductRepository = ProductRepository; _ProductAssembler = ProductAssembler; responseHandler = new ResponseHandler(); }
public Product Get(string name, Action <ProductAssembler> product) { _currentProductId++; var productObj = TestProducts.Product(_currentProductId, name); var productAssembler = new ProductAssembler(); product(productAssembler); _mocks.PriceService.GetPrice(productObj.Info.Id).Returns(productAssembler.Price); return(productObj); }
public ProductsTable AddOrUpdate(string name, Action <ProductAssembler> product) { _currentProductId++; var productObj = TestProducts.Product(_currentProductId, name); var productAssembler = new ProductAssembler(); product(productAssembler); if (_products.ContainsKey(name)) { _products.Remove(name); } _products.Add(name, productObj); _mocks.PriceService.GetPrice(productObj.Info.Id).Returns(productAssembler.Price); return(this); }
public ProductRepository(ApiContext context) { _context = context; _assembler = new ProductAssembler(); _restrictionAssembler = new RestrictionAssembler(); }