public void Test_TurnOffUIThread()
        {
            ClearAll();
            var dispatcher = new CountingMockMainThreadDispatcher();

            Ioc.RegisterSingleton <IMvxMainThreadDispatcher>(dispatcher);

            var notified = new List <string>();
            var t        = new TestInpc();

            t.PropertyChanged += (sender, args) => notified.Add(args.PropertyName);
            t.ShouldAlwaysRaiseInpcOnUserInterfaceThread(false);
            t.RaisePropertyChanged(new PropertyChangedEventArgs("Foo"));

            Assert.That(dispatcher.Count == 0);
            Assert.That(notified.Count == 1);
            Assert.That(notified[0] == "Foo");

            t.ShouldAlwaysRaiseInpcOnUserInterfaceThread(true);
            t.RaisePropertyChanged(new PropertyChangedEventArgs("Foo"));

            Assert.AreEqual(1, dispatcher.Count);
            Assert.That(notified.Count == 1);
            Assert.That(notified[0] == "Foo");
        }
        public void Test_TurnOffUIThread()
        {
            ClearAll();
            var dispatcher = new CountingMockMainThreadDispatcher();
            Ioc.RegisterSingleton<IMvxMainThreadDispatcher>(dispatcher);

            var notified = new List<string>();
            var t = new TestInpc();
            t.PropertyChanged += (sender, args) => notified.Add(args.PropertyName);
            t.ShouldAlwaysRaiseInpcOnUserInterfaceThread(false);
            t.RaisePropertyChanged(new PropertyChangedEventArgs("Foo"));

            Assert.That(dispatcher.Count == 0);
            Assert.That(notified.Count == 1);
            Assert.That(notified[0] == "Foo");

            t.ShouldAlwaysRaiseInpcOnUserInterfaceThread(true);
            t.RaisePropertyChanged(new PropertyChangedEventArgs("Foo"));

            Assert.AreEqual(1, dispatcher.Count);
            Assert.That(notified.Count == 1);
            Assert.That(notified[0] == "Foo");
        }