public void Measure_Should_Not_Set_VisualOffset()
        {
            UIElementTest target = new UIElementTest();

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

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

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

            Assert.AreEqual(new Size(), target.RenderSize);
        }
        public void Measure_Result_Should_Be_Saved_In_DesiredSize()
        {
            UIElementTest target = new UIElementTest();

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

            Assert.AreEqual(new Size(12, 34), target.DesiredSize);
        }
        public void Measure_Should_Set_IsMeasureValid_To_True_And_IsArrange_Valid_To_False()
        {
            UIElementTest target = new UIElementTest();

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

            Assert.IsTrue(target.IsMeasureValid);
            Assert.IsFalse(target.IsArrangeValid);
        }
        public void Measure_Result_Should_Be_Saved_In_DesiredSize()
        {
            UIElementTest target = new UIElementTest();

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

            Assert.AreEqual(new Size(12, 34), target.DesiredSize);
        }
        public void Measure_Should_Set_IsMeasureValid_To_True_And_IsArrange_Valid_To_False()
        {
            UIElementTest target = new UIElementTest();

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

            Assert.IsTrue(target.IsMeasureValid);
            Assert.IsFalse(target.IsArrangeValid);
        }
        public void Measure_Parameters_Should_Be_Passed_To_MeasureCore()
        {
            UIElementTest target = new UIElementTest();
            Size          size   = new Size(123, 456);

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

            Assert.AreEqual(size, target.MeasureInput);
        }
        public void Measure_Parameters_Should_Be_Passed_To_MeasureCore()
        {
            UIElementTest target = new UIElementTest();
            Size size = new Size(123, 456);

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

            Assert.AreEqual(size, target.MeasureInput);
        }
        public void Arrange_Should_Not_Call_Measure_When_Already_Run()
        {
            UIElementTest target = new UIElementTest();

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

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

            Assert.IsNull(target.MeasureInput);
        }
        public void Arrange_Size_Should_Be_Passed_To_ArrangeCore()
        {
            UIElementTest target = new UIElementTest();

            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 Rect(new Point(56, 67), new Size(78, 89)), target.ArrangeInput);
        }
        public void Arrange_Should_Call_Measure_When_Not_IsMeasureValid_With_Previous_Constraint()
        {
            UIElementTest target = new UIElementTest();

            target.MeasureOutput = new Size(78, 89);
            target.Measure(new Size(12, 23));
            target.InvalidateMeasure();

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

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

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

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

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

            Assert.AreEqual(new Size(), target.RenderSize);
        }
        public void Arrange_Size_Should_Be_Passed_To_ArrangeCore()
        {
            UIElementTest target = new UIElementTest();

            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 Rect(new Point(56, 67), new Size(78, 89)), target.ArrangeInput);
        }
        public void Arrange_Should_Call_Measure_When_Not_IsMeasureValid_With_Previous_Constraint()
        {
            UIElementTest target = new UIElementTest();

            target.MeasureOutput = new Size(78, 89);
            target.Measure(new Size(12, 23));
            target.InvalidateMeasure();

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

            Assert.AreEqual(new Size(12, 23), target.MeasureInput);
        }
        public void Arrange_Should_Not_Call_Measure_When_Already_Run()
        {
            UIElementTest target = new UIElementTest();

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

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

            Assert.IsNull(target.MeasureInput);
        }