public void TestProviderModel_DynamicManager_WithoutDynamicProvider() { var manager = new Sample.TestExt.Thingy.DynamicThingyProviderManager(); var names = manager.FoundProvidersNames.ToArray(); Assert.AreEqual(1, names.Length, message: "found names length"); CollectionAssert.Contains(names, "basic", message: "found names contains 'basic'"); }
public void TestProviderModel_DynamicManager_WithDynamicProvider_SearchAssembly() { var asmPath = Path.GetFullPath(AUX_TEST_LIB_PATH + "/Sample.TestExt.DynamicThingy.dll"); var asm = TugDSC.Ext.Util.MefExtensions.LoadFromAssembly(asmPath); var manager = new Sample.TestExt.Thingy.DynamicThingyProviderManager( // resetBuiltIns: true, resetSearchAssemblies: true, searchAssemblies: new[] { asm }); var names = manager.FoundProvidersNames.ToArray(); Assert.AreEqual(2, names.Length, message: "found names length"); CollectionAssert.Contains(names, "basic", message: "found names contains 'basic'"); CollectionAssert.Contains(names, "dynaThingy", message: "found names contains 'dynaThingy'"); }
public void TestProviderModel_DynamicManager_WithDynamicProvider_SearchPath() { var path = Path.GetFullPath(AUX_TEST_LIB_PATH); var manager = new Sample.TestExt.Thingy.DynamicThingyProviderManager( searchPaths: new[] { path }); var names = manager.FoundProvidersNames.ToArray(); Console.WriteLine("*** Found Provider Names:"); foreach (var n in names) { Console.WriteLine("*** * " + n); } Assert.AreEqual(2, names.Length, message: "found names length"); CollectionAssert.Contains(names, "basic", message: "found names contains 'basic'"); CollectionAssert.Contains(names, "dynaThingy", message: "found names contains 'dynaThingy'"); }