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); }); }
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); }