/// <summary> /// The configure module catalog. /// </summary> protected override void ConfigureModuleCatalog() { var moduleCatalog = new NuGetBasedModuleCatalog { AllowPrereleaseVersions = true, }; // Module A is defined from NuGet. moduleCatalog.AddModule(new ModuleInfo("ModuleA", "ModularityWithCatel.Desktop.ModuleA, ModularityWithCatel.Desktop.ModuleA") { Ref = "ModularityWithCatel.Desktop.ModuleA" }); // Module C is defined from NuGet. moduleCatalog.AddModule(new ModuleInfo("ModuleC", "ModularityWithCatel.Desktop.ModuleC, ModularityWithCatel.Desktop.ModuleC") { Ref = "ModularityWithCatel.Desktop.ModuleC", InitializationMode = InitializationMode.OnDemand }); ModuleCatalog.Add(moduleCatalog); // Module B and Module D are copied to a directory as part of a post-build step. // These modules are not referenced in the project and are discovered by inspecting a directory. // Both projects have a post-build step to copy themselves into that directory. var directoryCatalog = new DirectoryModuleCatalog { ModulePath = @".\DirectoryModules" }; ModuleCatalog.Add(directoryCatalog); // Module E and Module F are defined in configuration. var configurationCatalog = new ConfigurationModuleCatalog(); ModuleCatalog.Add(configurationCatalog); }
public void Returns_Null_If_The_PackageSource_Has_Incorrect_Format() { var nuGetBasedModuleCatalog = new NuGetBasedModuleCatalog { PackageSource = "2344:2345982345:" }; var packageRepository = nuGetBasedModuleCatalog.GetPackageRepositories().First(); Assert.IsNull(packageRepository); }
public void Returns_Null_If_The_PackageSource_Is_Empty() { var nuGetBasedModuleCatalog = new NuGetBasedModuleCatalog { PackageSource = string.Empty }; var packageRepository = nuGetBasedModuleCatalog.GetPackageRepositories().First(); Assert.IsNull(packageRepository); }