コード例 #1
0
        public void UIControllerOnlyRegisterOnceExcptionIfMore()
        {
            //Arrange
            var mockedCtrl = Substitute.For<IViewController>();
            var register = new ModeTrackingController();

            //Act
            register.RegisterToUpdate(mockedCtrl);

            //Assert
            Assert.Throws(Is.TypeOf<UICtrlAlreadyRegisteredException>(), delegate { register.RegisterToUpdate(mockedCtrl); });
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }