Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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);
        }