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); }
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); }
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 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 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_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); }
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_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); }