Ejemplo n.º 1
0
        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); });
        }
Ejemplo n.º 2
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);
        }