Beispiel #1
0
        public void SetEnabled_IsEnabled()
        {
            var vm = new ObjectVM();

            vm.SetEnabled("Test", false);
            Assert.IsFalse(vm.IsEnabled);
            vm.SetEnabled("Test1", false);
            Assert.IsFalse(vm.IsEnabled);
            vm.SetEnabled("Test", true);
            Assert.IsFalse(vm.IsEnabled);
            vm.SetEnabled("Test1", true);
            Assert.IsTrue(vm.IsEnabled);
        }
Beispiel #2
0
        public void PropertyChangedEvent()
        {
            var vm = new ObjectVM();

            var count = 0;

            vm.PropertyChangedEvent.Register(this, "{D9FCCC5F-79B6-4DC2-B4EC-EC734EA2EC11}", (sender, args) => count++);
            vm.SetEnabled("test", false); vm.SetEnabled("test", true);
            Assert.AreEqual(2, count);

            vm.PropertyChangedEvent.Release(this, "{D9FCCC5F-79B6-4DC2-B4EC-EC734EA2EC11}");
            count = 0;
            vm.SetEnabled("test", false); vm.SetEnabled("test", true);
            Assert.AreEqual(0, count);
        }