Ejemplo n.º 1
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);
        }
Ejemplo n.º 2
0
 public void Initialize()
 {
     TestPluginCacheTests.SetupMockExtensions();
 }