Exemplo n.º 1
0
        public void LoadExporters_NoAssemblies_ExportersIsEmpty()
        {
            // Arrange
            var assemblies        = new Assembly[0];
            var pluginEnvironment = new TestPluginEnvironment(assemblies);

            // Act
            var pluginLoader = new PluginLoader(pluginEnvironment);
            var exporters    = pluginLoader.LoadExporters();

            // Assert
            Assert.That(exporters, Is.Empty);
        }
Exemplo n.º 2
0
        public void LoadExporters_OneAssemblyOneLoader_ExportersHasLoader()
        {
            // Arrange
            var assemblyMock      = FakeAssembly <TestPluginExporter>();
            var assemblies        = new[] { assemblyMock.Object };
            var pluginEnvironment = new TestPluginEnvironment(assemblies);

            // Act
            var pluginLoader = new PluginLoader(pluginEnvironment);
            var exporters    = pluginLoader.LoadExporters();

            // Assert
            var dataExportPlugins = exporters as IDataExportPlugin[] ?? exporters.ToArray();

            Assert.That(dataExportPlugins, Is.Not.Empty);
            Assert.True(dataExportPlugins.First() is TestPluginExporter);
        }