示例#1
0
        public void ShouldSaveUserConfigurationAfterUserChooseSaveSettings()
        {
            var state = new ConfigurationState();

            factory.Stub(x => x.CreateSettingsView()).Return(view);
            view.Stub(x => x.ShowView()).Return(true);
            config.Stub(x => x.LoadConfiguration()).Repeat.Once().Return(state);
            config.Stub(x => x.SaveConfigurate(state)).Repeat.Once();
            mocks.ReplayAll();

            var controller = new SettingsController(factory);

            Assert.AreEqual(true, controller.Show());
        }
示例#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();
        }