Пример #1
0
        public void RetrieveTestList(TestMode testMode, Action <ITestAdaptor> callback)
        {
            if (callback == null)
            {
                throw new ArgumentNullException(nameof(callback));
            }

            var platform               = ParseTestMode(testMode);
            var testAssemblyProvider   = new EditorLoadedTestAssemblyProvider(new EditorCompilationInterfaceProxy(), new EditorAssembliesProxy());
            var testAdaptorFactory     = new TestAdaptorFactory();
            var testListCache          = new TestListCache(testAdaptorFactory, new RemoteTestResultDataFactory(), TestListCacheData.instance);
            var testListProvider       = new TestListProvider(testAssemblyProvider, new UnityTestAssemblyBuilder());
            var cachedTestListProvider = new CachingTestListProvider(testListProvider, testListCache, testAdaptorFactory);

            var job = new TestListJob(cachedTestListProvider, platform, (testRoot) =>
            {
                callback(testRoot);
            });

            job.Start();
        }
        public void RetrieveTestList(ExecutionSettings executionSettings, Action <ITestAdaptor> callback)
        {
            if (executionSettings == null)
            {
                throw new ArgumentException("Filter for execution is undefined.");
            }

            if (callback == null)
            {
                throw new ArgumentException("Callback is undefined.");
            }

            var platform               = ParseTestMode(executionSettings.filter.testMode);
            var testAssemblyProvider   = new EditorLoadedTestAssemblyProvider(new EditorCompilationInterfaceProxy(), new EditorAssembliesProxy());
            var testAdaptorFactory     = new TestAdaptorFactory();
            var testListCache          = new TestListCache(testAdaptorFactory, new RemoteTestResultDataFactory(), TestListCacheData.instance);
            var testListProvider       = new TestListProvider(testAssemblyProvider, new UnityTestAssemblyBuilder());
            var cachedTestListProvider = new CachingTestListProvider(testListProvider, testListCache, testAdaptorFactory);

            var job = new TestListJob(cachedTestListProvider, platform, callback);

            job.Start();
        }