コード例 #1
0
        public void ClippingCanvasTest_notree()
        {
            var mine = new UserControlPoker()
            {
                Width = 30, Height = 30
            };
            var content = new Canvas()
            {
                Width = 50, Height = 50
            };

            mine.SetContent(content);

            mine.Measure(new Size(Double.PositiveInfinity, Double.PositiveInfinity));

            Assert.AreEqual(new Size(30, 30), mine.MeasureArg, "MeasureArg");
            Assert.AreEqual(new Size(30, 30), mine.MeasureResult, "MeasureResult");
            Assert.AreEqual(new Size(30, 30), mine.DesiredSize, "poker Desired");
            Assert.AreEqual(new Size(30, 30), content.DesiredSize, "canvas desired");

            mine.Arrange(new Rect(0, 0, mine.DesiredSize.Width, mine.DesiredSize.Height));

            Assert.AreEqual(new Size(30, 30), mine.ArrangeArg, "ArrangeArg");
            Assert.AreEqual(new Size(30, 30), mine.ArrangeResult, "ArrangeResult");
            Assert.AreEqual(new Size(50, 50), new Size(content.ActualWidth, content.ActualHeight), "content actual");
            Assert.AreEqual(new Size(50, 50), content.RenderSize, "content rendersize");
            Assert.AreEqual(new Rect(0, 0, 30, 30), LayoutInformation.GetLayoutSlot(content), "content slot");
            Assert.IsNull(LayoutInformation.GetLayoutClip(content), "clip");
        }
コード例 #2
0
        public void ChildlessMarginMeasureTest()
        {
            UserControlPoker p = new UserControlPoker();

            p.Margin = new Thickness(10);

            p.Measure(new Size(10, 10));

            Assert.AreEqual(new Size(10, 10), p.DesiredSize, "DesiredSize");
        }
コード例 #3
0
        public void ChildlessMeasureTest()
        {
            UserControlPoker p = new UserControlPoker();

            Size s = new Size(10, 10);

            p.Measure(s);

            Assert.AreEqual(new Size(0, 0), p.DesiredSize, "DesiredSize");
        }
コード例 #4
0
        public void ChildlessMinHeightMeasureTest2()
        {
            UserControlPoker p = new UserControlPoker();

            p.MinHeight = 5;

            Size s = new Size(10, 10);

            p.Measure(s);

            Assert.AreEqual(5, p.DesiredSize.Height);
        }
コード例 #5
0
        public void ChildlessMinWidthMeasureTest1()
        {
            UserControlPoker p = new UserControlPoker();

            p.MinWidth = 50;

            Size s = new Size(10, 10);

            p.Measure(s);

            Assert.AreEqual(10, p.DesiredSize.Width);
        }
コード例 #6
0
        public void ChildMeasureTest2()
        {
            UserControlPoker p = new UserControlPoker();
            Rectangle        r = new Rectangle();

            p.SetContent(r);

            r.Width  = 50;
            r.Height = 50;

            p.Measure(new Size(100, 100));

            Assert.AreEqual(new Size(50, 50), p.DesiredSize);
        }
コード例 #7
0
        public void ChildThicknessMeasureTest1()
        {
            UserControlPoker p = new UserControlPoker();
            Rectangle        r = new Rectangle();

            p.Margin = new Thickness(5);
            p.SetContent(r);

            r.Width  = 50;
            r.Height = 50;

            p.Measure(new Size(10, 10));

            Assert.AreEqual(new Size(10, 10), p.DesiredSize);
        }
コード例 #8
0
ファイル: UserControlTest.cs プロジェクト: dfr0/moon
		public void ChildMeasureTest1 ()
		{
			UserControlPoker p = new UserControlPoker ();
			Rectangle r = new Rectangle ();

			p.SetContent (r);

			r.Width = 50;
			r.Height = 50;

			p.Measure (new Size (10, 10));

			Assert.AreEqual (new Size (10, 10), p.DesiredSize);
		}
コード例 #9
0
ファイル: UserControlTest.cs プロジェクト: dfr0/moon
		public void ChildThicknessMeasureTest2 ()
		{
			UserControlPoker p = new UserControlPoker ();
			Rectangle r = new Rectangle ();

			p.Margin = new Thickness (5);
			p.SetContent (r);

			r.Width = 50;
			r.Height = 50;

			p.Measure (new Size (100, 100));

			Assert.AreEqual (new Size (60, 60), p.DesiredSize);
		}
コード例 #10
0
ファイル: UserControlTest.cs プロジェクト: dfr0/moon
		public void ChildlessMinHeightMeasureTest2 ()
		{
			UserControlPoker p = new UserControlPoker ();

			p.MinHeight = 5;

			Size s = new Size (10, 10);

			p.Measure (s);

			Assert.AreEqual (5, p.DesiredSize.Height);
		}
コード例 #11
0
ファイル: UserControlTest.cs プロジェクト: dfr0/moon
		public void ChildlessMinWidthMeasureTest1 ()
		{
			UserControlPoker p = new UserControlPoker ();

			p.MinWidth = 50;

			Size s = new Size (10, 10);

			p.Measure (s);

			Assert.AreEqual (10, p.DesiredSize.Width);
		}
コード例 #12
0
ファイル: UserControlTest.cs プロジェクト: dfr0/moon
		public void ChildlessMarginMeasureTest ()
		{
			UserControlPoker p = new UserControlPoker ();

			p.Margin = new Thickness (10);

			p.Measure (new Size (10, 10));

			Assert.AreEqual (new Size (10, 10), p.DesiredSize, "DesiredSize");
		}
コード例 #13
0
ファイル: UserControlTest.cs プロジェクト: dfr0/moon
		public void ChildlessMeasureTest ()
		{
			UserControlPoker p = new UserControlPoker ();

			Size s = new Size (10, 10);

			p.Measure (s);

			Assert.AreEqual (new Size (0, 0), p.DesiredSize, "DesiredSize");
		}
コード例 #14
0
ファイル: UserControlTest.cs プロジェクト: dfr0/moon
		public void ClippingCanvasTest_notree ()
		{
			var mine = new UserControlPoker () { Width = 30, Height = 30 };
			var content = new Canvas () { Width = 50, Height = 50 };
			
			mine.SetContent (content);

			mine.Measure (new Size (Double.PositiveInfinity, Double.PositiveInfinity));

			Assert.AreEqual (new Size (30, 30), mine.MeasureArg, "MeasureArg");
			Assert.AreEqual (new Size (30, 30), mine.MeasureResult, "MeasureResult");
			Assert.AreEqual (new Size (30, 30), mine.DesiredSize, "poker Desired");
			Assert.AreEqual (new Size (30, 30), content.DesiredSize, "canvas desired");

			mine.Arrange (new Rect (0,0, mine.DesiredSize.Width, mine.DesiredSize.Height));

			Assert.AreEqual (new Size (30, 30), mine.ArrangeArg, "ArrangeArg");
			Assert.AreEqual (new Size (30, 30), mine.ArrangeResult, "ArrangeResult");
			Assert.AreEqual (new Size (50, 50), new Size (content.ActualWidth, content.ActualHeight), "content actual");
			Assert.AreEqual (new Size (50, 50), content.RenderSize, "content rendersize");
			Assert.AreEqual (new Rect (0,0,30,30), LayoutInformation.GetLayoutSlot (content), "content slot");
			Assert.IsNull (LayoutInformation.GetLayoutClip (content), "clip");
		}