public void SetUp()
 {
     api = new CoffeeMakerStub();
     ui  = new M4UserInterface(api);
     hws = new M4HotWaterSource(api);
     cv  = new M4ContainmentVessel(api);
     ui.Init(hws, cv);
     hws.Init(ui, cv);
     cv.Init(ui, hws);
 }
Exemple #2
0
        public static void Start()
        {
            var api = new M4CoffeeMakerApi();
            var ui  = new M4UserInterface(api);
            var hws = new M4HotWaterSource(api);
            var cv  = new M4ContainmentVessel(api);

            ui.Init(hws, cv);
            hws.Init(ui, cv);
            cv.Init(ui, hws);

            for (; ;)
            {
                ui.Poll();
                hws.Poll();
                cv.Poll();
            }
        }
        private static void Main(string[] args)
        {
            CoffeeMakerAPI      api = new M4CoffeeMakerAPI();
            M4UserInterface     ui  = new M4UserInterface(api);
            M4HotWaterSource    hws = new M4HotWaterSource(api);
            M4ContainmentVessel cv  = new M4ContainmentVessel(api);

            ui.Init(hws, cv);
            hws.Init(ui, cv);
            cv.Init(ui, hws);

            while (true)
            {
                ui.Poll();
                hws.Poll();
                cv.Poll();
            }
        }