Ejemplo n.º 1
0
        public void SubscribeToEvent_SetGameTimeShouldFireEvent()
        {
            //Arrange
            EventMediator.GetEventMediator().ClockChange += ClockControllerTests_ClockChange;

            //Act
            clockController.SetGameTime(new GameTime());

            //Assert
            Assert.IsTrue(methodWasCalled);
        }
        public void SubscribeToEvent_MethodShouldBeCalled()
        {
            //Arrange
            EventMediator.GetEventMediator().PossessionChange += PossessionControllerTests_PossessionChange;

            //Act
            _possessionController.ChangePossession();

            //Assert
            Assert.IsTrue(methodWasCalled);
        }
Ejemplo n.º 3
0
        public void SubscribeToEvent_DecrementShouldFireEvent()
        {
            //Arrange
            EventMediator.GetEventMediator().ClockChange += ClockControllerTests_ClockChange;

            //Act
            clockController.DecrementGameTimeByTenth();

            //Assert
            Assert.IsTrue(methodWasCalled);
        }
Ejemplo n.º 4
0
        public void SubscribeToEvent_SetGameScoreShouldFire()
        {
            //Arrange
            EventMediator.GetEventMediator().ScoreChange += ScoreControllerTests_ScoreChange;

            //Act
            scoreController.SetGameScore(new GameScore());

            //Assert
            Assert.IsTrue(methodWasCalled);
        }
Ejemplo n.º 5
0
        private void SubscribeToEvents()
        {
            EventMediator mediator = EventMediator.GetEventMediator();

            mediator.ClockChange      += ControllerForm_ClockChange;
            mediator.FoulsChange      += ControllerForm_FoulsChange;
            mediator.ScoreChange      += ControllerForm_ScoreChange;
            mediator.TimeoutChange    += ControllerForm_TimeoutChange;
            mediator.PossessionChange += ControllerForm_PossessionChange;
            mediator.PeriodChange     += ControllerForm_PeriodChange;
        }
Ejemplo n.º 6
0
        public void SubscribeToEvent_ScoreEventShouldFire()
        {
            //Arrange
            EventMediator.GetEventMediator().ScoreChange += ScoreControllerTests_ScoreChange;

            //Act
            scoreController.ScoreEvent(Team.Away, 0);

            //Assert
            Assert.IsTrue(methodWasCalled);
        }
Ejemplo n.º 7
0
        public void SubscribeToEvent_IncrementShouldFireEvent()
        {
            //Arrange
            EventMediator.GetEventMediator().FoulsChange += FoulControllerTests_FoulsChanged;

            //Act
            _foulController.IncrementFouls(Team.Away);

            //Assert
            Assert.IsTrue(methodWasCalled);
        }
Ejemplo n.º 8
0
        public void SubscribeToEvent_ResetShouldFireEvent()
        {
            //Arrange
            EventMediator.GetEventMediator().FoulsChange += FoulControllerTests_FoulsChanged;

            //Act
            _foulController.ResetAllFouls();

            //Assert
            Assert.IsTrue(methodWasCalled);
        }
Ejemplo n.º 9
0
        public void SubscribeToEvent_SetGameTimeShouldFireEvent()
        {
            //Arrange
            EventMediator.GetEventMediator().TimeoutChange += TimeoutControllerTests_ClockChange;

            //Act
            timeoutController.DecrementTimeout();

            //Assert
            Assert.IsTrue(methodWasCalled);
        }
Ejemplo n.º 10
0
        private void SubscribeToEvents()
        {
            EventMediator mediator = EventMediator.GetEventMediator();

            mediator.ClockChange        += ControllerForm_ClockChange;
            mediator.FoulsChange        += ControllerForm_FoulsChange;
            mediator.ScoreChange        += ControllerForm_ScoreChange;
            mediator.TimeoutChange      += ControllerForm_TimeoutChange;
            mediator.PossessionChange   += ControllerForm_PossessionChange;
            mediator.PeriodChange       += ControllerForm_PeriodChange;
            mediator.GameClockExpire    += ControllerForm_GameClockExpire;
            mediator.TimeoutClockExpire += ControllerForm_TimeoutClockExpire;
            mediator.GameClockSounding  += ControllerForm_GameClockSounding;
            mediator.GameClockSounded   += ControllerForm_GameClockSounded;
        }
Ejemplo n.º 11
0
 private static void FireScoreChangedEventHandler()
 {
     EventMediator.GetEventMediator().OnScoreChange(_CurrentScore);
 }