예제 #1
0
 public void Initialize()
 {
     TestPluginCacheTests.SetupMockExtensions();
     messageLogger = TestSessionMessageLogger.Instance;
     TestPluginManager.Instance.GetSpecificTestExtensions <TestLoggerPluginInformation, ITestLogger, ITestLoggerCapabilities, TestLoggerMetadata>
         (TestPlatformConstants.TestLoggerRegexPattern, out unfilteredTestExtensions, out filteredTestExtensions);
 }
예제 #2
0
        public void GetTestExtensionsShouldDiscoverExtensionsOnlyOnce()
        {
            var discoveryCount = 0;

            TestPluginCacheTests.SetupMockExtensions(() => { discoveryCount++; });

            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);

            // Call this again to verify that discovery is not called again.
            TestPluginManager.Instance.GetSpecificTestExtensions <TestDiscovererPluginInformation, ITestDiscoverer, ITestDiscovererCapabilities, TestDiscovererMetadata>(
                TestPlatformConstants.TestAdapterEndsWithPattern,
                out unfilteredTestExtensions,
                out testExtensions);

            Assert.IsNotNull(testExtensions);
            Assert.IsTrue(testExtensions.Any());

            Assert.AreEqual(2, discoveryCount);
        }
예제 #3
0
 public void Initialize()
 {
     TestPluginCacheTests.SetupMockExtensions();
     messageLogger = TestSessionMessageLogger.Instance;
     TestPluginManager.Instance.GetTestExtensions <ITestLogger, ITestLoggerCapabilities, TestLoggerMetadata>
         (out unfilteredTestExtensions, out filteredTestExtensions);
 }
예제 #4
0
        public void CreateShouldDiscoverExecutorExtensions()
        {
            TestPluginCacheTests.SetupMockExtensions();

            var extensionManager = TestExecutorExtensionManager.Create();

            Assert.IsNotNull(extensionManager.TestExtensions);
            Assert.IsTrue(extensionManager.TestExtensions.Count() > 0);
        }
        public void CreateShouldCacheDiscoveredExtensions()
        {
            TestPluginCacheTests.SetupMockExtensions(() => { });

            var extensionManager = TestDiscoveryExtensionManager.Create();

            TestDiscoveryExtensionManager.Create();

            Assert.IsNotNull(extensionManager.Discoverers);
            Assert.IsTrue(extensionManager.Discoverers.Count() > 0);
        }
예제 #6
0
        public void LoadAndInitializeShouldInitializeAllExtensions()
        {
            TestPluginCacheTests.SetupMockExtensions();

            TestExecutorExtensionManager.LoadAndInitializeAllExtensions(false);

            var allExecutors = TestExecutorExtensionManager.Create().TestExtensions;

            foreach (var executor in allExecutors)
            {
                Assert.IsTrue(executor.IsExtensionCreated);
            }
        }
        public void LoadAndInitializeShouldInitializeAllExtensions()
        {
            TestPluginCacheTests.SetupMockExtensions();

            TestDiscoveryExtensionManager.LoadAndInitializeAllExtensions(false);

            var allDiscoverers = TestDiscoveryExtensionManager.Create().Discoverers;

            foreach (var discoverer in allDiscoverers)
            {
                Assert.IsTrue(discoverer.IsExtensionCreated);
            }
        }
예제 #8
0
        public void CreateShouldCacheDiscoveredExtensions()
        {
            var discoveryCount = 0;

            TestPluginCacheTests.SetupMockExtensions(() => { discoveryCount++; });

            var extensionManager = TestExecutorExtensionManager.Create();

            TestExecutorExtensionManager.Create();

            Assert.IsNotNull(extensionManager.TestExtensions);
            Assert.IsTrue(extensionManager.TestExtensions.Count() > 0);
            Assert.AreEqual(1, discoveryCount);
        }
예제 #9
0
        public void GetTestExtensionsShouldReturnTestDiscovererExtensions()
        {
            TestPluginCacheTests.SetupMockExtensions();

            IEnumerable <LazyExtension <ITestDiscoverer, Dictionary <string, object> > > unfilteredTestExtensions;
            IEnumerable <LazyExtension <ITestDiscoverer, ITestDiscovererCapabilities> >  testExtensions;

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

            Assert.IsNotNull(unfilteredTestExtensions);
            Assert.IsNotNull(testExtensions);
            Assert.IsTrue(testExtensions.Count() > 0);
        }
예제 #10
0
        public void GetTestExtensionsShouldDiscoverExtensionsOnlyOnce()
        {
            var discoveryCount = 0;

            TestPluginCacheTests.SetupMockExtensions(() => { discoveryCount++; });

            IEnumerable <LazyExtension <ITestDiscoverer, Dictionary <string, object> > > unfilteredTestExtensions;
            IEnumerable <LazyExtension <ITestDiscoverer, ITestDiscovererCapabilities> >  testExtensions;

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

            // Call this again to verify that discovery is not called again.
            TestPluginManager.Instance.GetTestExtensions <ITestDiscoverer, ITestDiscovererCapabilities, TestDiscovererMetadata>(
                out unfilteredTestExtensions,
                out testExtensions);

            Assert.IsNotNull(testExtensions);
            Assert.IsTrue(testExtensions.Count() > 0);
            Assert.AreEqual(1, discoveryCount);
        }
예제 #11
0
 public void Initialize()
 {
     TestPluginCacheTests.SetupMockExtensions();
 }