Ejemplo n.º 1
0
        public void Measure_Should_Not_Set_VisualOffset()
        {
            FrameworkElementTest target = new FrameworkElementTest();

            target.Measure(new Size(12, 34));

            Assert.AreEqual(new Vector(), target.VisualOffset);
        }
        public void Measure_Should_Set_IsMeasureValid_To_True()
        {
            FrameworkElementTest target = new FrameworkElementTest();

            target.Measure(new Size(12, 23));

            Assert.IsTrue(target.IsMeasureValid);
            Assert.IsFalse(target.IsArrangeValid);
        }
Ejemplo n.º 3
0
        public void Measure_Should_Set_IsMeasureValid_To_True()
        {
            FrameworkElementTest target = new FrameworkElementTest();

            target.Measure(new Size(12, 23));

            Assert.IsTrue(target.IsMeasureValid);
            Assert.IsFalse(target.IsArrangeValid);
        }
Ejemplo n.º 4
0
        public void Measure_Result_Should_Be_Saved_In_DesiredSize()
        {
            FrameworkElementTest target = new FrameworkElementTest();

            target.MeasureOutput = new Size(12, 34);
            target.Measure(new Size(56, 78));

            Assert.AreEqual(new Size(12, 34), target.DesiredSize);
        }
        public void Measure_Parameters_Should_Be_Passed_To_MeasureOverride()
        {
            FrameworkElementTest target = new FrameworkElementTest();
            Size size = new Size(123, 456);

            target.RecordInputs = true;
            target.Measure(size);

            Assert.AreEqual(size, target.MeasureInput);
        }
Ejemplo n.º 6
0
        public void Measure_Should_Not_Set_Actual_Or_Render_Size()
        {
            FrameworkElementTest target = new FrameworkElementTest();

            target.Measure(new Size(12, 23));

            Assert.AreEqual(0, target.ActualWidth);
            Assert.AreEqual(0, target.ActualHeight);
            Assert.AreEqual(new Size(), target.RenderSize);
        }
Ejemplo n.º 7
0
        public void Measure_Parameters_Should_Be_Passed_To_MeasureOverride()
        {
            FrameworkElementTest target = new FrameworkElementTest();
            Size size = new Size(123, 456);

            target.RecordInputs = true;
            target.Measure(size);

            Assert.AreEqual(size, target.MeasureInput);
        }
Ejemplo n.º 8
0
        public void Measure_Parameters_Should_Be_Passed_To_MeasureOverride_Minus_Margins()
        {
            FrameworkElementTest target = new FrameworkElementTest();
            Size size = new Size(123, 456);

            target.Margin       = new Thickness(10, 26, 13, 30);
            target.RecordInputs = true;
            target.Measure(size);

            Assert.AreEqual(new Size(100, 400), target.MeasureInput);
        }
        public void Measure_Parameters_Should_Be_Passed_To_MeasureOverride_Minus_Margins()
        {
            FrameworkElementTest target = new FrameworkElementTest();
            Size size = new Size(123, 456);

            target.Margin = new Thickness(10, 26, 13, 30);
            target.RecordInputs = true;
            target.Measure(size);

            Assert.AreEqual(new Size(100, 400), target.MeasureInput);
        }
Ejemplo n.º 10
0
        public void Arrange_Size_Should_Be_Passed_To_ArrangeOverride_For_Stretch_Alignment()
        {
            FrameworkElementTest target = new FrameworkElementTest();

            target.MeasureOutput = new Size(12, 23);
            target.Measure(new Size(34, 45));

            target.RecordInputs = true;
            target.Arrange(new Rect(new Point(56, 67), new Size(78, 89)));

            Assert.AreEqual(new Size(78, 89), target.ArrangeInput);
        }
Ejemplo n.º 11
0
        public void Measure_Height_Should_Be_Passed_To_ArrangeOverride_For_Bottom_Alignment()
        {
            FrameworkElementTest target = new FrameworkElementTest();

            target.VerticalAlignment = VerticalAlignment.Bottom;
            target.MeasureOutput     = new Size(12, 23);
            target.Measure(new Size(34, 45));

            target.RecordInputs = true;
            target.Arrange(new Rect(new Point(56, 67), new Size(78, 89)));

            Assert.AreEqual(new Size(78, 23), target.ArrangeInput);
        }
Ejemplo n.º 12
0
        public void Measure_Width_Should_Be_Passed_To_ArrangeOverride_For_Right_Alignment()
        {
            FrameworkElementTest target = new FrameworkElementTest();

            target.HorizontalAlignment = HorizontalAlignment.Center;
            target.MeasureOutput       = new Size(12, 23);
            target.Measure(new Size(34, 45));

            target.RecordInputs = true;
            target.Arrange(new Rect(new Point(56, 67), new Size(78, 89)));

            Assert.AreEqual(new Size(12, 89), target.ArrangeInput);
        }
        public void Measure_Should_Not_Set_Actual_Or_Render_Size()
        {
            FrameworkElementTest target = new FrameworkElementTest();

            target.Measure(new Size(12, 23));

            Assert.AreEqual(0, target.ActualWidth);
            Assert.AreEqual(0, target.ActualHeight);
            Assert.AreEqual(new Size(), target.RenderSize);
        }
        public void Arrange_Size_Should_Be_Passed_To_ArrangeOverride_For_Stretch_Alignment()
        {
            FrameworkElementTest target = new FrameworkElementTest();

            target.MeasureOutput = new Size(12, 23);
            target.Measure(new Size(34, 45));

            target.RecordInputs = true;
            target.Arrange(new Rect(new Point(56, 67), new Size(78, 89)));

            Assert.AreEqual(new Size(78, 89), target.ArrangeInput);
        }
        public void Measure_Width_Height_Should_Be_Passed_To_ArrangeOverride_For_TopLeft_Alignment()
        {
            FrameworkElementTest target = new FrameworkElementTest();

            target.VerticalAlignment = VerticalAlignment.Top;
            target.HorizontalAlignment = HorizontalAlignment.Left;
            target.MeasureOutput = new Size(12, 23);
            target.Measure(new Size(34, 45));

            target.RecordInputs = true;
            target.Arrange(new Rect(new Point(56, 67), new Size(78, 89)));

            Assert.AreEqual(new Size(12, 23), target.ArrangeInput);
        }
        public void Measure_Should_Not_Set_VisualOffset()
        {
            FrameworkElementTest target = new FrameworkElementTest();

            target.Measure(new Size(12, 34));

            Assert.AreEqual(new Vector(), target.VisualOffset);
        }
        public void Measure_Result_Should_Be_Saved_In_DesiredSize()
        {
            FrameworkElementTest target = new FrameworkElementTest();

            target.MeasureOutput = new Size(12, 34);
            target.Measure(new Size(56, 78));

            Assert.AreEqual(new Size(12, 34), target.DesiredSize);
        }