コード例 #1
0
ファイル: LayoutTest.cs プロジェクト: dotnet/wpf-test
        /// <summary>
        ///
        /// </summary>
        /// <param name="activeTest"></param>
        /// <param name="log"></param>
        void RunCodeTest(LayoutTest activeTest, TestLog log)
        {
            try
            {
                //create window
                ((CodeTest)activeTest).CreateWindow();
                CommonFunctionality.FlushDispatcher();

                //load test info..
                ((CodeTest)activeTest).WindowSetup();
                CommonFunctionality.FlushDispatcher();

                //call test actions..
                ((CodeTest)activeTest).TestActions();
                CommonFunctionality.FlushDispatcher();

                ////call verify..
                ((CodeTest)activeTest).TestVerify();
                CommonFunctionality.FlushDispatcher();

                ((CodeTest)activeTest).CloseWindow();
                CommonFunctionality.FlushDispatcher();
            }
            catch (Exception ex)
            {
                GlobalLog.LogEvidence(ex);
                activeTest.Result = false;
            }
        }
コード例 #2
0
ファイル: LayoutTest.cs プロジェクト: dotnet/wpf-test
        /// <summary>
        /// Execture test actions.
        /// </summary>
        /// <param name="activeTest"></param>
        /// <param name="log"></param>
        void ExecuteTestActions(LayoutTest activeTest, TestLog log)
        {
            GlobalLog.LogStatus("BEGIN LAYOUT TEST");

            try
            {
                if (activeTest is CodeTest)
                {
                    RunCodeTest(activeTest, log);
                }
                if (activeTest is PropertyDumpTest)
                {
                    RunPropertyDumpTest(activeTest, log);
                }
                if (activeTest is VisualScanTest)
                {
                    RunVisualScanTest(activeTest, log);
                }
            }
            catch (Exception ex)
            {
                GlobalLog.LogEvidence(ex);
            }

            GlobalLog.LogStatus("END LAYOUT TEST");
        }
コード例 #3
0
ファイル: LayoutTest.cs プロジェクト: dotnet/wpf-test
 /// <summary>
 /// Logs Test.
 /// </summary>
 /// <param name="activeTest"></param>
 /// <param name="log"></param>
 void LogTest(LayoutTest activeTest, TestLog log)
 {
     if (!activeTest.Result)
     {
         log.LogEvidence(string.Format("[ {0} ] Test Failed.", activeTest.GetType().Name));
         log.Result = TestResult.Fail;
     }
     else
     {
         log.LogEvidence(string.Format("[ {0} ] Test Passed.", activeTest.GetType().Name));
         log.Result = TestResult.Pass;
     }
 }
コード例 #4
0
ファイル: LayoutTest.cs プロジェクト: dotnet/wpf-test
        /// <summary>
        ///
        /// </summary>
        /// <param name="activeTest"></param>
        /// <param name="log"></param>
        void RunVisualScanTest(LayoutTest activeTest, TestLog log)
        {
            try
            {
                //create window
                ((VisualScanTest)activeTest).CreateWindow();
                CommonFunctionality.FlushDispatcher();

                ((VisualScanTest)activeTest).WindowSetup();
                CommonFunctionality.FlushDispatcher();

                ((VisualScanTest)activeTest).CaptureAndCompare();
                CommonFunctionality.FlushDispatcher();

                ((VisualScanTest)activeTest).CloseWindow();
                CommonFunctionality.FlushDispatcher();
            }
            catch (Exception ex)
            {
                GlobalLog.LogEvidence(ex);
                activeTest.Result = false;
            }
        }