public void ModuleNeedsRetrievalReturnsTrueWhenModulesAreNotImported()
        {
            TestableMefModuleManager moduleManager = new TestableMefModuleManager();
            bool result = moduleManager.CallModuleNeedsRetrieval(new ModuleInfo("name", "type"));

            Assert.IsTrue(result);
        }
예제 #2
0
        public void ModuleNeedsRetrievalReturnsTrueWhenModulesAreNotImported()
        {
            TestableMefModuleManager moduleManager = new TestableMefModuleManager();
            bool result = moduleManager.CallModuleNeedsRetrieval(new ModuleInfo("name", "type"));

            Assert.IsTrue(result);
        }
        public void ModuleNeedsRetrievalReturnsFalseWhenModuleIsFound()
        {
            TestableMefModuleManager moduleManager = new TestableMefModuleManager
            {
                Modules = new List<Lazy<IModule, IModuleExport>>() { new Lazy<IModule, IModuleExport>(() => new TestModule(), new TestModuleMetadata()) }
            };

            bool result = moduleManager.CallModuleNeedsRetrieval(new ModuleInfo("TestModule", "Microsoft.Practices.Prism.MefExtensions.Tests.MefModuleManagerFixture.TestModule"));

            Assert.IsFalse(result);
        }
        public void ModuleNeedsRetrievalReturnsTrueWhenModuleNotFound()
        {
            TestableMefModuleManager moduleManager = new TestableMefModuleManager
            {
                Modules = new List<Lazy<IModule, IModuleExport>>() { new Lazy<IModule, IModuleExport>(() => new TestModule(), new TestModuleMetadata()) }
            };

            bool result = moduleManager.CallModuleNeedsRetrieval(new ModuleInfo("name", "type"));

            Assert.IsTrue(result);
        }
        public void ModuleNeedsRetrievalReturnsTrueWhenNoModulesAreAvailable()
        {
            TestableMefModuleManager moduleManager = new TestableMefModuleManager
                                                         {
                                                             Modules = (IEnumerable<Lazy<IModule, IModuleExport>>) new List<Lazy<IModule,  IModuleExport>>()
                                                         };

            bool result = moduleManager.CallModuleNeedsRetrieval(new ModuleInfo("name", "type"));

            Assert.IsTrue(result);
        }
예제 #6
0
        public void ModuleNeedsRetrievalReturnsTrueWhenNoModulesAreAvailable()
        {
            TestableMefModuleManager moduleManager = new TestableMefModuleManager
            {
                Modules = (IEnumerable <Lazy <IModule, IModuleExport> >) new List <Lazy <IModule, IModuleExport> >()
            };

            bool result = moduleManager.CallModuleNeedsRetrieval(new ModuleInfo("name", "type"));

            Assert.IsTrue(result);
        }
예제 #7
0
        public void ModuleNeedsRetrievalReturnsFalseWhenModuleIsFound()
        {
            TestableMefModuleManager moduleManager = new TestableMefModuleManager
            {
                Modules = new List <Lazy <IModule, IModuleExport> >()
                {
                    new Lazy <IModule, IModuleExport>(() => new TestModule(), new TestModuleMetadata())
                }
            };

            bool result = moduleManager.CallModuleNeedsRetrieval(new ModuleInfo("TestModule", "Microsoft.Practices.Prism.MefExtensions.Tests.MefModuleManagerFixture.TestModule"));

            Assert.IsFalse(result);
        }
예제 #8
0
        public void ModuleNeedsRetrievalReturnsTrueWhenModuleNotFound()
        {
            TestableMefModuleManager moduleManager = new TestableMefModuleManager
            {
                Modules = new List <Lazy <IModule, IModuleExport> >()
                {
                    new Lazy <IModule, IModuleExport>(() => new TestModule(), new TestModuleMetadata())
                }
            };

            bool result = moduleManager.CallModuleNeedsRetrieval(new ModuleInfo("name", "type"));

            Assert.IsTrue(result);
        }