public void FormTitle_SetSameValue_DoesNotFirePropertyChangedValue()
        {
            GlobalWizardViewModel model = new GlobalWizardViewModel("Suffix");
            model.FormTitle = "Suffix";

            model.ShouldNotNotifyOn(s => s.FormTitle).When(s => s.FormTitle = "Suffix");
        }
        public void FormTitle_SetValue_ReturnsSetValueWithSuffix()
        {
            GlobalWizardViewModel model = new GlobalWizardViewModel("Suffix");

            model.FormTitle = "Value";

            Assert.AreEqual("ValueSuffix", model.FormTitle);
        }
        public Step2ViewModel(GlobalWizardViewModel globalModel, ISettingsService settingsService)
        {
            if (globalModel == null) throw new ArgumentNullException("globalModel");
            if (settingsService == null) throw new ArgumentNullException("settingsService");

            _globalModel = globalModel;
            _settingsService = settingsService;

            Initialize();
        }
        public RandomizationProcessViewModel(GlobalWizardViewModel globalModel)
        {
            if (globalModel == null) throw new ArgumentNullException("globalModel");

            _globalModel = globalModel;
        }
        public void FormTitle_SetValue_FiresPropertyChangedValue()
        {
            GlobalWizardViewModel model = new GlobalWizardViewModel(It.IsAny<string>());

            model.ShouldNotifyOn(s => s.FormTitle).When(s => s.FormTitle = "Some new value");
        }
        public void FormTitle_DoNotSetValue_ReturnsExpectedSuffix()
        {
            GlobalWizardViewModel model = new GlobalWizardViewModel("Suffix");

            Assert.AreEqual("Suffix", model.FormTitle);
        }
        public void Constructor_CreatesRandomizerSettingsModel()
        {
            GlobalWizardViewModel model = new GlobalWizardViewModel(It.IsAny<string>());

            Assert.IsNotNull(model.RandomizerWorkerSettings);
        }
Exemplo n.º 8
0
        public void Initialize(GlobalWizardViewModel model)
        {
            if (model == null)
            {
                AlertErrorMessage("Model is null");
                return;
            }

            InitializeComponent();

            DataBindings.Add("Text", model, "FormTitle", false, DataSourceUpdateMode.OnPropertyChanged);

            Show();
        }