public void Save(IProductStock product) { if (product.Id == 0) { Context.ProductsStock.Add(product); } }
public void Setup() { product = new Mock <IProduct>(); product.SetupGet(x => x.Label).Returns("Nuts"); product.SetupGet(x => x.Price).Returns(2m); product.SetupGet(x => x.Quantity).Returns(1); productStock = new ProductStock(); }
public void SetUp() { this.product = new Mock <IProduct>(); this.product.SetupGet(x => x.Label).Returns("Jack Daniels"); this.product.SetupGet(x => x.Price).Returns(45.55m); this.product.SetupGet(x => x.Quantity).Returns(1); this.productStock = new ProductStock(); }
public VendingMachine(ICoinOperator coinOperator, IProductDispenser productDispenser, IReturnCoinFromSale returnCoinFromSale, IProductStock productStock, ICoinBank coinBank) { _coinOperator = coinOperator; _productDispenser = productDispenser; _returnCoinFromSale = returnCoinFromSale; _productStock = productStock; _coinBank = coinBank; }
public void CreateTestObject() { productStock = new ProductStock(); productStock.Add(new Product() { Label = "MyProduct", Quantity = 1, Price = 100m }); }
public void SetUp() { this.productStock = new ProductStock(); this.firstProduct = new Product("Skittles", 5.00m, 10); this.secondProduct = new Product("Zagorka", 10.00m, 20); this.thirdProduct = new Product("Astika", 10.00m, 30); this.forthProduct = new Product("Mastika", 15.00m, 30); this.fifthProduct = new Product("Homemade Rakia", 30.00m, 5); this.sixthProduct = new Product("Slanina", 30.00m, 10); }
public void Add(IProductStock product) { if (product is ProductStock) { base.Add((ProductStock)product); } else { var mapped = Mapper.Map <ProductStock>(product); base.Add(mapped); } }
public void Edit(IProductStock product) { var copy = _Current .FirstOrDefault(x => x.Id == product.Id); copy.BookingId = product.BookingId; base.Edit((ProductStock)copy); //base.Edit(copy); //if (product is ProductStock) //{ // Edit((ProductStock)product); //} //else //{ // var mapped = Mapper.Map<ProductStock>(product); // Edit(mapped); //} }
public void SetUp() { productStock = new ProductStock(); product = new Product("Product", 10, 1); }
public void SetUp() { this.productStock = new ProductStock(); this.dummyProduct = new Product("SSD", 12.34m, 4); }
public void Init() { productStock = new ProductStock(); product = new Product("bira", 1.20M, 2); }
public void SetUp() { this.productStock = new ProductStock(); this.firstProduct = new Product("Test one", 5, 5); this.secondProduct = new Product("Test two", 10, 10); }
public void SetUp() { this.productStock = new ProductStock(); this.product = new Product("SDD", 12.34M, 4); }
public void DestroyObjects() { this.productStock = null; }
public void SetUp() { this.productStock = new ProductStock(); }
public void SetUp() { this.productStock = new ProductStock(); this.product = new Product("SSD", 89.76m, 2); }
public void SetUp() { this.productStock = new ProductStock(); this.product = new Product(Label, Price, Quantity); }
public void Edit(IProductStock worker) { throw new System.NotImplementedException(); }