/// <summary>
        /// Gets an instance of the Test Discovery Extension Manager.
        /// </summary>
        /// <returns>
        /// Instance of the Test Discovery Extension Manager
        /// </returns>
        /// <remarks>
        /// This would provide a discovery extension manager where extensions in
        /// all the extension assemblies are discovered. This is cached.
        /// </remarks>
        public static TestDiscoveryExtensionManager Create()
        {
            if (testDiscoveryExtensionManager == null)
            {
                TestPluginManager.Instance
                .GetSpecificTestExtensions <TestDiscovererPluginInformation, ITestDiscoverer, ITestDiscovererCapabilities, TestDiscovererMetadata>(
                    TestPlatformConstants.TestAdapterEndsWithPattern,
                    out var unfilteredTestExtensions,
                    out var testExtensions);

                testDiscoveryExtensionManager = new TestDiscoveryExtensionManager(
                    testExtensions,
                    unfilteredTestExtensions);
            }

            return(testDiscoveryExtensionManager);
        }
Esempio n. 2
0
        /// <summary>
        /// Gets an instance of the Test Discovery Extension Manager.
        /// </summary>
        /// <returns>
        /// Instance of the Test Discovery Extension Manager
        /// </returns>
        /// <remarks>
        /// This would provide a discovery extension manager where extensions in
        /// all the extension assemblies are discovered. This is cached.
        /// </remarks>
        public static TestDiscoveryExtensionManager Create()
        {
            if (testDiscoveryExtensionManager == null)
            {
                IEnumerable <LazyExtension <ITestDiscoverer, Dictionary <string, object> > > unfilteredTestExtensions;
                IEnumerable <LazyExtension <ITestDiscoverer, ITestDiscovererCapabilities> >  testExtensions;

                TestPluginManager.Instance
                .GetTestExtensions <ITestDiscoverer, ITestDiscovererCapabilities, TestDiscovererMetadata>(
                    out unfilteredTestExtensions,
                    out testExtensions);

                testDiscoveryExtensionManager = new TestDiscoveryExtensionManager(
                    testExtensions,
                    unfilteredTestExtensions);
            }

            return(testDiscoveryExtensionManager);
        }
        /// <summary>
        /// Gets an instance of the Test Discovery Extension Manager.
        /// </summary>
        /// <returns>
        /// Instance of the Test Discovery Extension Manager
        /// </returns>
        /// <remarks>
        /// This would provide a discovery extension manager where extensions in
        /// all the extension assemblies are discovered. This is cached.
        /// </remarks>
        public static TestDiscoveryExtensionManager Create()
        {
            if (testDiscoveryExtensionManager == null)
            {
                IEnumerable <LazyExtension <ITestDiscoverer, Dictionary <string, object> > > unfilteredTestExtensions;
                IEnumerable <LazyExtension <ITestDiscoverer, ITestDiscovererCapabilities> >  testExtensions;

                TestPluginManager.Instance
                .GetSpecificTestExtensions <TestDiscovererPluginInformation, ITestDiscoverer, ITestDiscovererCapabilities, TestDiscovererMetadata>(
                    TestPlatformConstants.TestAdapterEndsWithPattern,
                    out unfilteredTestExtensions,
                    out testExtensions);

                testDiscoveryExtensionManager = new TestDiscoveryExtensionManager(
                    testExtensions,
                    unfilteredTestExtensions);
            }

            return(testDiscoveryExtensionManager);
        }
 /// <summary>
 /// Destroys the cache.
 /// </summary>
 internal static void Destroy()
 {
     testDiscoveryExtensionManager = null;
 }