Exemplo n.º 1
0
        public void ShouldSaveUserSettings()
        {
            var state = new ConfigurationState();

            InitForSucces(state);
            config.Stub(x => x.SaveConfigurate(state)).Repeat.Once();
            mocks.ReplayAll();

            var controller = new WelcomeController(factory);

            controller.TryShow();
        }
Exemplo n.º 2
0
        public void ShouldNotShowViewIfShowWelcomeIsDisabled()
        {
            var state = new ConfigurationState {
                ShowWelcome = false
            };

            factory.Stub(x => x.CreateWelcomeView()).Return(view);
            config.Stub(x => x.LoadConfiguration()).Repeat.Once().Return(state);
            view.Stub(x => x.ShowView()).Repeat.Never();
            mocks.ReplayAll();

            var controller = new WelcomeController(factory);

            controller.TryShow();
        }
Exemplo n.º 3
0
        public void ShouldReactToChangeLanguageEvent()
        {
            var state = new ConfigurationState();

            InitForSucces(state);

            config.Stub(x => x.SaveConfigurate(state)).Repeat.Twice();
            view.LanguageChanged += null;
            LastCall.Constraints(Is.NotNull());
            IEventRaiser changeLangRaiser = LastCall.GetEventRaiser();

            view.Stub(x => x.ResetLanguage()).Repeat.Once();
            mocks.ReplayAll();

            var controller = new WelcomeController(factory);

            controller.TryShow();
            changeLangRaiser.Raise(null, null);
        }