public void GetsNotifiedonFuelPriceChange()
        {
            //Arrange
            PricingManager manager  = new PricingManager();
            Terminal       terminal = new Terminal(manager);

            manager.AddObserver(terminal);
            //Act
            manager.UpdateFuelPrice(1.78);
            //Assert
            Assert.AreEqual(1.78, terminal.FuelPrice);
        }
Beispiel #2
0
        public void GetsNotifiedonFuelPriceChange()
        {
            //Arrange
            PricingManager   manager = new PricingManager();
            FuelPriceDisplay display = new FuelPriceDisplay(manager);

            manager.AddObserver(display);
            //Act
            manager.UpdateFuelPrice(1.78);
            //Assert
            Assert.AreEqual(1.78, display.FuelPrice);
        }