public void InitializeShouldLoadAndInitializeAllExtension() { var commonAssemblyLocation = typeof(TestPluginCacheTests).GetTypeInfo().Assembly.Location; TestPluginCacheTests.SetupMockExtensions( new string[] { commonAssemblyLocation }, () => { }); this.executionManager.Initialize(new List <string> { commonAssemblyLocation }); Assert.IsNotNull(TestPluginCache.Instance.TestExtensions); // Executors Assert.IsTrue(TestPluginCache.Instance.TestExtensions.TestExecutors.Count > 0); var allExecutors = TestExecutorExtensionManager.Create().TestExtensions; foreach (var executor in allExecutors) { Assert.IsTrue(executor.IsExtensionCreated); } // Settings Providers Assert.IsTrue(TestPluginCache.Instance.TestExtensions.TestSettingsProviders.Count > 0); var settingsProviders = SettingsProviderExtensionManager.Create().SettingsProvidersMap.Values; foreach (var provider in settingsProviders) { Assert.IsTrue(provider.IsExtensionCreated); } }
public void CreateShouldDiscoverExecutorExtensions() { TestPluginCacheHelper.SetupMockExtensions(typeof(TestExecutorExtensionManagerTests)); var extensionManager = TestExecutorExtensionManager.Create(); Assert.IsNotNull(extensionManager.TestExtensions); Assert.IsTrue(extensionManager.TestExtensions.Count() > 0); }
public void CreateShouldCacheDiscoveredExtensions() { TestPluginCacheTests.SetupMockExtensions(() => { }); var extensionManager = TestExecutorExtensionManager.Create(); TestExecutorExtensionManager.Create(); Assert.IsNotNull(extensionManager.TestExtensions); Assert.IsTrue(extensionManager.TestExtensions.Count() > 0); }
public void CreateShouldCacheDiscoveredExtensions() { TestPluginCacheHelper.SetupMockExtensions(typeof(TestExecutorExtensionManagerTests), () => { }); var extensionManager = TestExecutorExtensionManager.Create(); TestExecutorExtensionManager.Create(); Assert.IsNotNull(extensionManager.TestExtensions); Assert.IsTrue(extensionManager.TestExtensions.Any()); }
public void LoadAndInitializeShouldInitializeAllExtensions() { TestPluginCacheHelper.SetupMockExtensions(typeof(TestExecutorExtensionManagerTests)); TestExecutorExtensionManager.LoadAndInitializeAllExtensions(false); var allExecutors = TestExecutorExtensionManager.Create().TestExtensions; foreach (var executor in allExecutors) { Assert.IsTrue(executor.IsExtensionCreated); } }
public ArgumentProcessorResult Execute() { ConsoleOutput.Instance.WriteLine(CommandLineResources.AvailableExecutorsHeaderMessage, OutputLevel.Information); var testPlatform = TestPlatformFactory.GetTestPlatform(); var extensionManager = TestExecutorExtensionManager.Create(); foreach (var extension in extensionManager.TestExtensions) { ConsoleOutput.Instance.WriteLine(extension.Value.GetType().FullName, OutputLevel.Information); ConsoleOutput.Instance.WriteLine(string.Format(CultureInfo.CurrentCulture, CommandLineResources.AvailableExtensionsMetadataFormat, "Uri", extension.Metadata.ExtensionUri), OutputLevel.Information); } return(ArgumentProcessorResult.Success); }
private TestExecutorExtensionManager GetExecutorExtensionManager(string extensionAssembly) { try { if (string.IsNullOrEmpty(extensionAssembly) || string.Equals(extensionAssembly, Constants.UnspecifiedAdapterPath)) { // full execution. Since the extension manager is cached this can be created multiple times without harming performance. return(TestExecutorExtensionManager.Create()); } else { return(TestExecutorExtensionManager.GetExecutionExtensionManager(extensionAssembly)); } } catch (Exception ex) { EqtTrace.Error( "BaseRunTests: GetExecutorExtensionManager: Exception occurred while loading extensions {0}", ex); return(null); } }