Пример #1
0
        public void Multiple_Property_Changes_Should_Be_Grouped_Inside_Action()
        {
            var p1 = new PropertyHelper <int>(1)
            {
                Value = 1
            };
            var p2 = new PropertyHelper <int>(2)
            {
                Value = 1
            };
            var seq = new List <int>();

            Observe.Autorun(() =>
            {
                seq.Add(p1.Value);
                seq.Add(p2.Value);
            });
            Observe.RunInAction(() =>
            {
                p1.Value = 2;
                p2.Value = 2;
            });
            Observe.RunInAction(() =>
            {
                p1.Value = 3;
                p1.Value = 4;
            });
            Assert.True(seq.SequenceEqual(new []
            {
                1, 1,
                2, 2,
                4, 2
            }));
        }