예제 #1
0
        public void StockChangeTest()
        {
            // 8 chips were bought, 50 were there at the start
            IStockData stock = (IStockData)sut.Stock;

            Assert.Equal(42, stock.GetProductQuantity("chips"));
        }
예제 #2
0
        public void NotifyingTest()
        {
            // Test of the notifying : stock was at 42, 35 are sold, 40 are ordered
            IStockData stock = (IStockData)sut.Stock;

            sut.SellProduct(john, new Order(ProductGenerator.chips, 35));

            Assert.Equal(47, stock.GetProductQuantity("chips"));
        }
예제 #3
0
        public void OrderingIntoStockTest()
        {
            IStockBehaviour stock      = office.Stock;
            Commercial      commercial = office._commercial;

            stock.AddToStock(commercial.OrderedProduct("chips", 5));
            IStockData stockData = (IStockData)stock;

            Assert.Equal(55, stockData.GetProductQuantity("chips"));
        }
예제 #4
0
 public void GetTheRightQuantity()
 {
     Assert.Equal(50, sut.GetProductQuantity("chips"));
 }