Exemplo n.º 1
0
		public void InitRunner(List<ITestComponent> tests)
		{
			Application.RegisterLogCallback(LogHandler);
			var testComponents = ParseListForGroups (tests).ToList ();
			testToRun = testComponents.Select (component => new TestResult (component.gameObject)).ToList ();
			testsProvider = new IntegrationTestsProvider (testToRun.Select (result => result.TestComponent as ITestComponent));
			readyToRun = true;
		}
Exemplo n.º 2
0
        public void InitRunner(List<TestComponent> tests, List<string> dynamicTestsToRun)
        {
            Application.logMessageReceived += LogHandler;

            // Init dynamic tests
            foreach (var typeName in dynamicTestsToRun)
            {
                var t = Type.GetType(typeName);
                if (t == null) continue;
                var scriptComponents = Resources.FindObjectsOfTypeAll(t) as MonoBehaviour[];
                if (scriptComponents.Length == 0)
                {
                    Debug.LogWarning(t + " not found. Skipping.");
                    continue;
                }
                if (scriptComponents.Length > 1) Debug.LogWarning("Multiple GameObjects refer to " + typeName);
                tests.Add(scriptComponents.First().GetComponent<TestComponent>());
            }
            // create test structure
            m_TestComponents = ParseListForGroups(tests).ToList();
            // create results for tests
            m_ResultList = m_TestComponents.Select(component => new TestResult(component)).ToList();
            // init test provider
            m_TestsProvider = new IntegrationTestsProvider(m_ResultList.Select(result => result.TestComponent as ITestComponent));
            m_ReadyToRun = true;
        }