public void DetectorenFasenTabDetectorPropertyChanged_PropertyChangedWithMultipleDetectorsSelected_AllDetectorsChanged()
        {
            var model = ControllerCreator.GetSmallControllerWithDetection();
            var vm    = new DetectorenFasenTabViewModel {
                Controller = model
            };
            var controllermodifiermock = FakesCreator.CreateControllerModifier();

            TLCGenControllerModifier.OverrideDefault(controllermodifiermock);

            vm.OnSelected();
            vm.SelectedFaseNaam   = "02";
            vm.SelectedDetectoren = new List <DetectorViewModel>
            {
                vm.Detectoren[0],
                vm.Detectoren[1],
                vm.Detectoren[2]
            };
            vm.Detectoren[2].AanvraagDirect = true;

            Assert.AreEqual(true, vm.Detectoren[0].AanvraagDirect);
            Assert.AreEqual(true, vm.Detectoren[1].AanvraagDirect);
            Assert.AreEqual(true, vm.Detectoren[2].AanvraagDirect);
            Assert.AreEqual(true, model.Fasen[1].Detectoren[0].AanvraagDirect);
            Assert.AreEqual(true, model.Fasen[1].Detectoren[1].AanvraagDirect);
            Assert.AreEqual(true, model.Fasen[1].Detectoren[2].AanvraagDirect);
        }
        public void DetectorenFasenTabRemoveDetectorCommand_ExecutedWithSingleDetectorSelected_DetectorRemovedFromModel()
        {
            var model = ControllerCreator.GetSmallControllerWithDetection();
            var vm    = new DetectorenFasenTabViewModel {
                Controller = model
            };
            var controllermodifiermock = FakesCreator.CreateControllerModifier();

            TLCGenControllerModifier.OverrideDefault(controllermodifiermock);

            vm.OnSelected();
            vm.RemoveDetectorCommand.Execute(null);

            controllermodifiermock.Received().RemoveDetectorFromController("011");
        }
        public void RemoveFaseCommand_ExecutedWithFaseSelected_CallsRemoveSignalGroupFromController()
        {
            var model = new ControllerModel();
            var controllermodifiermock = FakesCreator.CreateControllerModifier();

            TLCGenControllerModifier.OverrideDefault(controllermodifiermock);
            model.Fasen.Add(new FaseCyclusModel()
            {
                Naam = "01"
            });
            FasenLijstTabViewModel vm = new FasenLijstTabViewModel();

            vm.Controller         = model;
            vm.SelectedFaseCyclus = vm.Fasen[0];

            vm.RemoveFaseCommand.Execute(null);

            controllermodifiermock.Received().RemoveSignalGroupFromController("01");
        }
        public void DetectorenFasenTabRemoveDetectorCommand_ExecutedWithMultipleDetectorsSelected_DetectorsRemovedFromModel()
        {
            var model = ControllerCreator.GetSmallControllerWithDetection();
            var vm    = new DetectorenFasenTabViewModel {
                Controller = model
            };
            var controllermodifiermock = FakesCreator.CreateControllerModifier();

            TLCGenControllerModifier.OverrideDefault(controllermodifiermock);

            vm.OnSelected();
            vm.SelectedFaseNaam   = "02";
            vm.SelectedDetectoren = new List <DetectorViewModel>
            {
                vm.Detectoren[0],
                vm.Detectoren[1],
                vm.Detectoren[2]
            };
            vm.RemoveDetectorCommand.Execute(null);

            controllermodifiermock.Received().RemoveDetectorFromController("021");
            controllermodifiermock.Received().RemoveDetectorFromController("022");
            controllermodifiermock.Received().RemoveDetectorFromController("023");
        }