コード例 #1
0
        public void Activation_For_View_Fetcher_Should_Support_Windows()
        {
            using (UnitTestApplication.Start(TestServices.MockWindowingPlatform))
            {
                var window = new TestWindowWithWhenActivated();
                Assert.False(window.Active);

                window.Show();
                Assert.True(window.Active);

                window.Close();
                Assert.False(window.Active);
            }
        }
コード例 #2
0
        public void Activation_For_View_Fetcher_Should_Support_Windows()
        {
            Locator.CurrentMutable.RegisterConstant(
                new AvaloniaActivationForViewFetcher(),
                typeof(IActivationForViewFetcher));

            using (var application = UnitTestApplication.Start(TestServices.MockWindowingPlatform))
            {
                var window = new TestWindowWithWhenActivated();
                Assert.False(window.Active);

                window.Show();
                Assert.True(window.Active);

                window.Close();
                Assert.False(window.Active);
            }
        }