Example #1
0
        public void SetValue()
        {
            // WindowsSettings only provides getters - trying SetValue throws
            WindowSettings ws = new WindowSettings();

            Assert.Throws <ArgumentException> (delegate {
                ws.SetValue(WindowSettings.HeightProperty, 0.0d);
            }, "HeightProperty");
            Assert.Throws <ArgumentException> (delegate {
                ws.SetValue(WindowSettings.LeftProperty, 0.0d);
            }, "LeftProperty");
            Assert.Throws <ArgumentException> (delegate {
                ws.SetValue(WindowSettings.TitleProperty, null);
            }, "TitleProperty");
            Assert.Throws <ArgumentException> (delegate {
                ws.SetValue(WindowSettings.TopProperty, 0.0d);
            }, "TopProperty");
            Assert.Throws <ArgumentException> (delegate {
                ws.SetValue(WindowSettings.WidthProperty, 0.0d);
            }, "WidthProperty");
            Assert.Throws <ArgumentException> (delegate {
                ws.SetValue(WindowSettings.WindowStartupLocationProperty, WindowStartupLocation.CenterScreen);
            }, "WindowStartupLocationProperty");
            Assert.Throws <ArgumentException> (delegate {
                ws.SetValue(WindowSettings.WindowStyleProperty, WindowStyle.BorderlessRoundCornersWindow);
            }, "WindowStyleProperty");
        }
Example #2
0
		public void SetValue ()
		{
			// WindowsSettings only provides getters - trying SetValue throws
			WindowSettings ws = new WindowSettings ();
			Assert.Throws<ArgumentException> (delegate {
				ws.SetValue (WindowSettings.HeightProperty, 0.0d);
			}, "HeightProperty");
			Assert.Throws<ArgumentException> (delegate {
				ws.SetValue (WindowSettings.LeftProperty, 0.0d);
			}, "LeftProperty");
			Assert.Throws<ArgumentException> (delegate {
				ws.SetValue (WindowSettings.TitleProperty, null);
			}, "TitleProperty");
			Assert.Throws<ArgumentException> (delegate {
				ws.SetValue (WindowSettings.TopProperty, 0.0d);
			}, "TopProperty");
			Assert.Throws<ArgumentException> (delegate {
				ws.SetValue (WindowSettings.WidthProperty, 0.0d);
			}, "WidthProperty");
			Assert.Throws<ArgumentException> (delegate {
				ws.SetValue (WindowSettings.WindowStartupLocationProperty, WindowStartupLocation.CenterScreen);
			}, "WindowStartupLocationProperty");
			Assert.Throws<ArgumentException> (delegate {
				ws.SetValue (WindowSettings.WindowStyleProperty, WindowStyle.BorderlessRoundCornersWindow);
			}, "WindowStyleProperty");
		}