Example #1
0
        public BuildingPresenter(IKernel kernel, IBuildingView view, IBuildingService service)
        {
            _kernel  = kernel;
            _view    = view;
            _service = service;

            _view.SetUp        += SetUp;
            _view.CallElevator += CallElevator;
        }
        public BuildingController(IBuildingModel model, IBuildingView view)
        {
            buildingModel = model;
            buildingView  = view;

            model.OnNumberOfFloorsChanged += Model_OnNumberOfFloorsChanged;
            view.OnAddFloorClicked        += View_OnAddFloorClicked;
            view.OnRemoveFloorClicked     += View_OnRemoveFloorClicked;
        }
Example #3
0
        public void SetUp()
        {
            _kernel = new NSubstituteMockingKernel();

            _view    = Substitute.For <IBuildingView>();
            _service = Substitute.For <IBuildingService>();
            _service.NumberOfFloors.Returns(5);

            var presenter = new BuildingPresenter(_kernel, _view, _service);

            presenter.Run();
        }
Example #4
0
 public BuildingPresenter(IKernel container, IBuildingView view, IElevatorService service)
 {
     _container                   = container;
     _service                     = service;
     _view                        = view;
     _view.AddNewPassenger       += (currentFloor) => AddNewPassenger(currentFloor);
     _view.StartSimulation       += StartSimulation;
     _view.StopSimulation        += StopSimulation;
     _service.TimeWasUpdated     += UpdateTime;
     _service.DisableWeightAlert += DisableWeightAlert;
     _service.ElevatorMove       += MoveElevator;
     _service.PassengerDeleted   += DeletePassenger;
     _service.FloorButtonPressed += PressFloorButton;
     _service.PassengerGotIn     += PassengerGotIn;
     _service.PassengerGotOut    += PassengeGotOut;
 }
Example #5
0
 /// <summary>
 /// addes a view to the ViewList array
 /// </summary>
 /// <param name="aView"></param>
 public void AddView(IBuildingView aView)
 {
     ViewList.Add(aView);
 }