/// <summary> /// Returns a dictionary of provided (virtual) modules, and a /// ProvidesVersion indicating what provides them. /// </summary> // TODO: In the future it would be nice to cache this list, and mark it for rebuild // if our installed modules change. internal Dictionary <string, ProvidesModuleVersion> Provided() { var installed = new Dictionary <string, ProvidesModuleVersion>(); foreach (var modinfo in installed_modules) { CkanModule module = modinfo.Value.Module; // Skip if this module provides nothing. if (module.provides == null) { continue; } foreach (string provided in module.provides) { installed[provided] = new ProvidesModuleVersion(module.identifier, module.version.ToString()); } } return(installed); }
public void ProvidesVersion() { var v1 = new ProvidesModuleVersion("SomeModule", "1.0"); Assert.That(v1.ToString().Contains("provided")); }