IEnumerable <TestMethod> ITestBuilder.BuildFrom(IMethodInfo method, Test suite)
        {
            List <TestMethod> results = new List <TestMethod>();

            IGraphicsTestCaseProvider provider = Provider;

            try
            {
                foreach (var testCase in provider.GetTestCases())
                {
                    var test = new TestMethod(method, suite)
                    {
                        parms = new TestCaseParameters(new object[] { testCase })
                    };
                    test.parms.ApplyToTest(test);
                    test.Name = System.IO.Path.GetFileNameWithoutExtension(testCase.ScenePath);

                    results.Add(test);
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("Failed to generate graphics testcases!");
                Debug.LogException(ex);
                throw;
            }

            suite.Properties.Set("ColorSpace", provider.ColorSpace);
            suite.Properties.Set("RuntimePlatform", provider.Platform);
            suite.Properties.Set("GraphicsDevice", provider.GraphicsDevice);

            Console.WriteLine("Generated {0} graphics test cases.", results.Count);
            return(results);
        }
예제 #2
0
        IEnumerable <TestMethod> ITestBuilder.BuildFrom(IMethodInfo method, Test suite)
        {
            List <TestMethod> results = new List <TestMethod>();

            IGraphicsTestCaseProvider provider = Provider;

            try
            {
                foreach (var testCase in provider.GetTestCases())
                {
                    TestCaseData data = new TestCaseData(new object[] { testCase });

                    data.SetName(System.IO.Path.GetFileNameWithoutExtension(testCase.ScenePath));
                    data.ExpectedResult    = new Object();
                    data.HasExpectedResult = true;

                    TestMethod test = this._builder.BuildTestMethod(method, suite, data);
                    if (test.parms != null)
                    {
                        test.parms.HasExpectedResult = false;
                    }

                    test.Name = System.IO.Path.GetFileNameWithoutExtension(testCase.ScenePath);

                    results.Add(test);
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("Failed to generate graphics testcases!");
                Debug.LogException(ex);
                throw;
            }

            suite.Properties.Set("ColorSpace", ColorSpace);
            suite.Properties.Set("RuntimePlatform", Platform);
            suite.Properties.Set("GraphicsDevice", GraphicsDevice);
            suite.Properties.Set("LoadedXRDevice", LoadedXRDevice);

            Console.WriteLine("Generated {0} graphics test cases.", results.Count);
            return(results);
        }