Exemplo n.º 1
0
        public void DecreaseStockCount_By_One_Stock_Is_Empty()
        {
            // Arrange
            Drug drug = new Drug("Ibuprophen");
            Fakes.FakeStockProvider stockProvider = new Fakes.FakeStockProvider(0);

            Stock stock = new Stock(stockProvider);

            // Act
            stock.DecreaseStock(drug, 1);
        }
Exemplo n.º 2
0
        public void DecreaseStockCount_By_Five_Stock_Is_Too_Low()
        {
            // Arrange
            Drug drug = new Drug("Ibuprophen");
            Fakes.FakeStockProvider stockProvider = new Fakes.FakeStockProvider(4);

            Stock stock = new Stock(stockProvider);

            // Act
            stock.DecreaseStock(drug, 5);
        }
Exemplo n.º 3
0
        public void IsDrugInStock_True()
        {
            // Arrange
            Drug drug = new Drug("Ibuprophen");
            Fakes.FakeStockProvider stockProvider = new Fakes.FakeStockProvider(1);

            Stock stock = new Stock(stockProvider);

            // Act
            bool isDrugInStock = stock.IsDrugInStock(drug);

            // Assert
            Assert.That(isDrugInStock, Is.True);
        }
Exemplo n.º 4
0
        public void DecreaseStockCount_By_One_Stock_Is_Not_Empty()
        {
            // Arrange
            Drug drug = new Drug("Ibuprophen");
            Fakes.FakeStockProvider stockProvider = new Fakes.FakeStockProvider(10);

            Stock stock = new Stock(stockProvider);

            Assert.That(stock.StockCount(drug), Is.EqualTo(10));

            // Act
            stock.DecreaseStock(drug, 1);

            // Assert
            Assert.That(stock.StockCount(drug), Is.EqualTo(9));
        }