public void UnRegisteredUICtrlCannotChangeModeException()
        {
            //Arrange
            var mockedCtrl = Substitute.For <IViewController>();
            var register   = new ModeTrackingController();

            //Assert
            Assert.Throws(Is.TypeOf <UICtrlNotRegisteredException>(), delegate { register.ChangeActiveMode(Modes.Execute, mockedCtrl); });
        }
        public void UnRegisteredViewCtrlCannotChangeStatusException()
        {
            //Arrange
            var mockedCtrl = Substitute.For <IView>();
            var register   = new ModeTrackingController();

            //Assert
            Assert.Throws(Is.TypeOf <ViewCtrlNotRegisteredException>(), delegate { register.ChangeActiveModeStatus(ExecutionStatus.Canceled, mockedCtrl); });
        }
        public void ViewControllerOnlyRegisterOnceExcptionIfMore()
        {
            //Arrange
            var mockedCtrl = Substitute.For <IView>();
            var register   = new ModeTrackingController();

            //Act
            register.RegisterToUpdate(mockedCtrl);

            //Assert
            Assert.Throws(Is.TypeOf <ViewCtrlAlreadyRegisteredException>(), delegate { register.RegisterToUpdate(mockedCtrl); });
        }
        public void RegisteredViewCtrlCanChangeStatus()
        {
            //Arrange
            var mockedCtrl = Substitute.For <IView>();
            var register   = new ModeTrackingController();

            //Act
            register.RegisterToUpdate(mockedCtrl);
            register.ChangeActiveModeStatus(ExecutionStatus.Running, mockedCtrl);

            //Assert
            Assert.AreEqual(ExecutionStatus.Running, register.Status);
        }
        public void RegisteredUICtrlCanChangeMode()
        {
            //Arrange
            var mockedCtrl = Substitute.For <IViewController>();
            var register   = new ModeTrackingController();

            //Act
            register.RegisterToUpdate(mockedCtrl);
            register.ChangeActiveMode(Modes.Initialise, mockedCtrl);

            //Assert
            Assert.AreEqual(Modes.Initialise, register.ActiveMode);
        }