예제 #1
0
        public ModuleLoaderContext()
        {
            kernelMock = new Mock<IKernel>();
            fooPluginMock = new Mock<IModuleLoaderPlugin>();
            barPluginMock = new Mock<IModuleLoaderPlugin>();
            moduleLoader = new ModuleLoader(kernelMock.Object, new[] { fooPluginMock.Object, barPluginMock.Object });

            fooPluginMock.SetupGet(x => x.SupportedExtensions).Returns(new[] { ".foo" });
            barPluginMock.SetupGet(x => x.SupportedExtensions).Returns(new[] { ".bar" });
        }
예제 #2
0
        public ModuleLoaderContext()
        {
            kernelMock = new Mock<IKernel>();
            componentsMock = new Mock<IComponentContainer>();
            fooPluginMock = new Mock<IModuleLoaderPlugin>();
            barPluginMock = new Mock<IModuleLoaderPlugin>();
            moduleLoader = new ModuleLoader(kernelMock.Object);

            var plugins = new[] { fooPluginMock.Object, barPluginMock.Object };

            kernelMock.SetupGet(x => x.Components).Returns(componentsMock.Object);
            componentsMock.Setup(x => x.GetAll<IModuleLoaderPlugin>()).Returns(plugins);
            fooPluginMock.SetupGet(x => x.SupportedExtensions).Returns(new[] { ".foo" });
            barPluginMock.SetupGet(x => x.SupportedExtensions).Returns(new[] { ".bar" });
        }