Exemplo n.º 1
0
        public void button_up_task_enabled_execute()
        {
            var task = new TcoMomentaryTask(new MockRootObject(), string.Empty, string.Empty);

            task._isServiceable.Synchron = true;
            task._enabled.Synchron       = true;
            var vm = new TcoMomentaryTaskViewModel()
            {
                Model = task
            };

            vm.ButtonUp.Execute(null);

            Assert.IsFalse(vm.TcoMomentaryTask._setOnRequest.Synchron);
        }
Exemplo n.º 2
0
        public void TcoMomentaryTaskViewModelTest()
        {
            var task = new TcoMomentaryTask(new MockRootObject(), string.Empty, string.Empty);
            var vm   = new TcoMomentaryTaskViewModel()
            {
                Model = task
            };

            Assert.IsNotNull(vm);
            Assert.IsNotNull(vm.TcoMomentaryTask);
            Assert.IsNotNull(vm.Model);

            Assert.IsInstanceOf <TcoMomentaryTask>(vm.TcoMomentaryTask);
            Assert.IsInstanceOf <TcoMomentaryTask>(vm.Model);
        }
Exemplo n.º 3
0
        public void get_caption()
        {
            var task = new TcoMomentaryTask(new MockRootObject(), string.Empty, string.Empty);

            task.GetConnector().BuildAndStart();

            task._isServiceable.Synchron = true;
            task._enabled.Synchron       = true;
            task.AttributeName           = "momentary task button";
            task.AttributeStateOffDesc   = "is off";
            task.AttributeStateOnDesc    = "is on";
            var vm = new TcoMomentaryTaskViewModel()
            {
                Model = task
            };

            Assert.AreEqual("momentary task button : is off", vm.Caption);

            task._state.Synchron = true;

            vm.UpdateCaption();

            Assert.AreEqual("momentary task button : is on", vm.Caption);
        }