示例#1
0
        public void TestCloseUnopenedWindow()
        {
            WindowControl window = new WindowControl();

            window.Close();
            // No exception means success
        }
示例#2
0
        public void TestOpenCloseWindow()
        {
            Screen        screen = new Screen(100, 100);
            WindowControl window = new WindowControl();

            // A window not in a screen's control hierarchy is considered closed
            Assert.IsFalse(window.IsOpen);

            // Once the window is added to a screen, meaning it will be drawn and
            // can be interacted with by the user, it is considered open
            screen.Desktop.Children.Add(window);
            Assert.IsTrue(window.IsOpen);

            // Close the window. Essentially just syntactic sugar for removing
            // the window from the control hierarchy
            window.Close();
            Assert.IsFalse(window.IsOpen);
        }
    public void TestOpenCloseWindow() {
      Screen screen = new Screen(100, 100);
      WindowControl window = new WindowControl();

      // A window not in a screen's control hierarchy is considered closed
      Assert.IsFalse(window.IsOpen);

      // Once the window is added to a screen, meaning it will be drawn and
      // can be interacted with by the user, it is considered open
      screen.Desktop.Children.Add(window);
      Assert.IsTrue(window.IsOpen);

      // Close the window. Essentially just syntactic sugar for removing
      // the window from the control hierarchy
      window.Close();
      Assert.IsFalse(window.IsOpen);
    }
 public void TestCloseUnopenedWindow() {
   WindowControl window = new WindowControl();
   window.Close();
   // No exception means success
 }