/// <summary>
        /// Tests the specified LayoutTransformer scenario.
        /// </summary>
        /// <param name="scenario">Scenario to test.</param>
        /// <param name="controlsToTest">Stream of controls to test.</param>
        private void TestScenario(LayoutTransformerScenario scenario, IEnumerable <ContentControl> controlsToTest)
        {
            LayoutTestPanel panel = new LayoutTestPanel(scenario.MeasureSize, scenario.ArrangeSize);

            foreach (ContentControl control in controlsToTest)
            {
                LayoutTransformer layoutTransformer = control as LayoutTransformer;
                if (null != layoutTransformer)
                {
                    layoutTransformer.LayoutTransform = scenario.Transform;
                }
#if !SILVERLIGHT
                else
                {
                    control.LayoutTransform = scenario.Transform;
                }
#endif
                control.Content = scenario.Child;
                panel.Children.Add(control);
            }
            TestAsync(
                panel,
                () =>
            {
                foreach (ContentControl control in controlsToTest)
                {
                    FrameworkElement child = control.Content as FrameworkElement;
#if !SILVERLIGHT
                    control.Measure(scenario.MeasureSize);
#endif
                    AssertAreEqual(scenario.DesiredSize, child.DesiredSize, control, "Measure");
#if !SILVERLIGHT
                    control.Arrange(new Rect(new Point(), scenario.ArrangeSize));
#endif
                    AssertAreEqual(scenario.RenderSize, child.RenderSize, control, "Arrange");
                }
            });
        }
        /// <summary>
        /// Tests the specified LayoutTransformer scenario.
        /// </summary>
        /// <param name="scenario">Scenario to test.</param>
        /// <param name="controlsToTest">Stream of controls to test.</param>
        private void TestScenario(LayoutTransformerScenario scenario, IEnumerable<ContentControl> controlsToTest)
        {
            LayoutTestPanel panel = new LayoutTestPanel(scenario.MeasureSize, scenario.ArrangeSize);
            foreach (ContentControl control in controlsToTest)
            {
                LayoutTransformer layoutTransformer = control as LayoutTransformer;
                if (null != layoutTransformer)
                {
                    layoutTransformer.LayoutTransform = scenario.Transform;
                }
#if !SILVERLIGHT
                else
                {
                    control.LayoutTransform = scenario.Transform;
                }
#endif
                control.Content = scenario.Child;
                panel.Children.Add(control);
            }
            TestAsync(
                panel,
                () =>
                {
                    foreach (ContentControl control in controlsToTest)
                    {
                        FrameworkElement child = control.Content as FrameworkElement;
#if !SILVERLIGHT
                        control.Measure(scenario.MeasureSize);
#endif
                        AssertAreEqual(scenario.DesiredSize, child.DesiredSize, control, "Measure");
#if !SILVERLIGHT
                        control.Arrange(new Rect(new Point(), scenario.ArrangeSize));
#endif
                        AssertAreEqual(scenario.RenderSize, child.RenderSize, control, "Arrange");
                    }
                });
        }
 /// <summary>
 /// Tests the specified LayoutTransformer scenario.
 /// </summary>
 /// <param name="scenario">Scenario to test.</param>
 private void TestScenario(LayoutTransformerScenario scenario)
 {
     TestScenario(scenario, new List<ContentControl>(ControlsToTest));
 }
 /// <summary>
 /// Tests the specified LayoutTransformer scenario.
 /// </summary>
 /// <param name="scenario">Scenario to test.</param>
 private void TestScenario(LayoutTransformerScenario scenario)
 {
     TestScenario(scenario, new List <ContentControl>(ControlsToTest));
 }