示例#1
0
        public void WhenAnyValueIntTest()
        {
            var obj = new MvxReactiveViewEx();

            var list = obj.WhenAnyValue(vm => vm.IntFody)
                       .CreateCollection(ImmediateScheduler.Instance);

            Assert.True(list.Count == 1, "Should be 1");

            obj.IntFody = 1;

            Assert.True(list.Count == 2, "Should be 2");

            obj.IntFody = 2;

            Assert.True(list.Count == 3, "Should be 3");
        }
示例#2
0
        public void NotifyPropertyChangedTest()
        {
            var obj = new MvxReactiveViewEx();

            var list = new List <string>();

            obj.PropertyChanged += (sender, e) => list.Add(e.PropertyName);

            Assert.True(list.Count == 0, "Should be 0");

            obj.TextFody = "abc";

            Assert.True(list.Count == 1, "Should be 1");

            obj.TextFody = "";

            Assert.True(list.Count == 2, "Should be 2");
        }
示例#3
0
        public void SupressNotificationTest()
        {
            var obj = new MvxReactiveViewEx();

            var list = obj.WhenAnyValue(vm => vm.TextWithoutFody)
                       .CreateCollection(ImmediateScheduler.Instance);

            Assert.True(list.Count == 1, "Should be 1");

            obj.TextWithoutFody = "abc";

            using (obj.SuppressChangeNotifications())
            {
                obj.TextWithoutFody = "";
            }

            Assert.True(list.Count == 1, "Should be 1");

            obj.TextWithoutFody = "abc";

            Assert.True(list.Count == 2, "Should be 1");
        }