コード例 #1
0
        public void FasenTimersTabMultipleSelectionEdit_TGLChangedOnOnePhase_ChangesAllSelected()
        {
            var model = new ControllerModel();

            Messenger.OverrideDefault(new Messenger());
            TemplatesProvider.OverrideDefault(FakesCreator.CreateTemplatesProvider());
            model.Fasen.Add(new FaseCyclusModel {
                Naam = "01", TGL = 30
            });
            model.Fasen.Add(new FaseCyclusModel {
                Naam = "02", TGL = 30
            });
            model.Fasen.Add(new FaseCyclusModel {
                Naam = "03", TGL = 30
            });
            model.Fasen.Add(new FaseCyclusModel {
                Naam = "04", TGL = 30
            });
            model.Fasen.Add(new FaseCyclusModel {
                Naam = "05", TGL = 30
            });
            TLCGenModelManager.OverrideDefault(new TLCGenModelManager {
                Controller = model
            });
            TLCGenControllerDataProvider.OverrideDefault(FakesCreator.CreateControllerDataProvider(model));
            ControllerAccessProvider.OverrideDefault(FakesCreator.CreateControllerAccessProvider(model));
            var vm = new FasenLijstTimersTabViewModel {
                Controller = model
            };

            vm.OnSelected();
            vm.SelectedItems = new List <FaseCyclusViewModel> {
                vm.Fasen[1], vm.Fasen[2], vm.Fasen[3]
            };
            vm.Fasen[3].TGL = 50;

            Assert.AreEqual(30, vm.Fasen[0].TGL);
            Assert.AreEqual(50, vm.Fasen[1].TGL);
            Assert.AreEqual(50, vm.Fasen[2].TGL);
            Assert.AreEqual(50, vm.Fasen[3].TGL);
            Assert.AreEqual(30, vm.Fasen[4].TGL);
        }