Пример #1
0
        public void ShouldSetWrappedWindowTitleWhenSettingTitle()
        {
            TestableFloatableWindowAdapter window = this.CreateTestableAdapter();

            Assert.IsNull(window.WrappedWindow.Title);

            window.Title = "Window";

            Assert.AreEqual("Window", window.Title);
            Assert.AreEqual("Window", window.WrappedWindow.Title);
        }
Пример #2
0
        public void ShouldSetContentWhenSetContentIsCalled()
        {
            TestableFloatableWindowAdapter window = this.CreateTestableAdapter();

            TextBlock t = new TextBlock {
                Text = "TestText"
            };

            window.Content = t;

            Assert.AreSame(t, window.WrappedWindow.Content);
        }
Пример #3
0
        public void ShouldSetWrappedWindowStyleWhenSettingStyle()
        {
            TestableFloatableWindowAdapter window = this.CreateTestableAdapter();

            Assert.IsNull(window.WrappedWindow.Style);

            Style windowStyle = new Style(typeof(FloatableWindow));

            window.Style = windowStyle;

            Assert.AreSame(window.Style, window.WrappedWindow.Style);
            Assert.AreSame(windowStyle, window.Style);
        }
Пример #4
0
        public void ShouldUpdateCanvasLeftPropertyWhenSettingLeftInNonModalWindow()
        {
            TestableFloatableWindowAdapter window = this.CreateTestableAdapter();

            double left = (double)window.WrappedWindow.GetValue(Canvas.LeftProperty);

            Assert.AreEqual(0, left);
            Assert.AreEqual(0, window.Left);

            window.Left = 15;

            window.Show(this.rootPanel);

            left = (double)window.WrappedWindow.GetValue(Canvas.LeftProperty);

            Assert.AreEqual(15, left);
        }
Пример #5
0
        public void ShouldUpdateCanvasTopPropertyWhenSettingTopInNonModalWindow()
        {
            TestableFloatableWindowAdapter window = this.CreateTestableAdapter();

            double top = (double)window.WrappedWindow.GetValue(Canvas.TopProperty);

            Assert.AreEqual(0, top);
            Assert.AreEqual(0, window.Top);

            window.Top = 15;

            window.Show(this.rootPanel);

            top = (double)window.WrappedWindow.GetValue(Canvas.TopProperty);

            Assert.AreEqual(15, top);
        }