Inheritance: ReactiveUI.ReactiveObject
Ejemplo n.º 1
0
        public void ToPropertyShouldSubscribeOnlyOnce()
        {
            using (ProductionMode.Set()) {
                var f = new RaceConditionFixture();
                // This line is important because it triggers connect to
                // be called recursively thus cause the subscription
                // to be called twice. Not sure if this is a reactive UI
                // or RX bug.
                f.PropertyChanged += (e, s) => Debug.WriteLine(f.A);

                // Trigger subscription to the underlying observable.
                Assert.Equal(true, f.A);

                Assert.Equal(1, f.Count);
            }
        }
        public void ToPropertyShouldSubscribeOnlyOnce()
        {
            using (ProductionMode.Set()) {
                var f = new RaceConditionFixture();
                // This line is important because it triggers connect to
                // be called recursively thus cause the subscription
                // to be called twice. Not sure if this is a reactive UI
                // or RX bug.
                f.PropertyChanged += (e, s) => Console.WriteLine(f.A);

                // Trigger subscription to the underlying observable.
                Assert.Equal(true, f.A);

                Assert.Equal(1, f.Count);
            }
        }