Пример #1
0
        public void BaristaMaticBot_MakeDrink()
        {
            BaristaMaticBot barista = new BaristaMaticBot();

            Assert.Equal("Dispensing: Coffee", barista.MakeDrink("5"));

            // Make enough Caffe Americanos until we run out of espresso
            Assert.Equal("Dispensing: Caffe Americano", barista.MakeDrink("1"));
            Assert.Equal("Dispensing: Caffe Americano", barista.MakeDrink("1"));
            Assert.Equal("Dispensing: Caffe Americano", barista.MakeDrink("1"));
            Assert.Equal("Out of stock: Caffe Americano", barista.MakeDrink("1"));
        }
Пример #2
0
        public void BaristaMaticBot_RestockInventory()
        {
            BaristaMaticBot barista = new BaristaMaticBot();

            // Make enough Caffe Americanos until we run out of espresso
            barista.MakeDrink("1");
            barista.MakeDrink("1");
            barista.MakeDrink("1");
            Assert.Equal("Out of stock: Caffe Americano", barista.MakeDrink("1"));

            // Restock to make more Caffe Americanos
            barista.RestockInventory();

            Assert.Equal("Dispensing: Caffe Americano", barista.MakeDrink("1"));
        }