public void ShouldLocateStandardDotNetReferences() { var locator = new StandardReferencesLocator(); var paths = locator.GetStandardReferences(); Assert.AreNotEqual(0, paths.Count()); }
public ReferencesViewModel(IEnumerable<AssemblyReference> loadedReferences, IEnumerable<string> recentReferenceLocations) { Log.Info(() => string.Format("Loaded references: {0}", string.Join(", ", loadedReferences))); var standardReferences = new StandardReferencesLocator().GetStandardReferences().ToArray(); var recentReferences = (recentReferenceLocations ?? Enumerable.Empty<string>()).Where(File.Exists).Select(x => new AssemblyReference(x) { IsRecent = true }).ToArray(); var allReferences = loadedReferences.Union(standardReferences).Union(recentReferences).ToArray(); StandardReferences = new SearchableReferencesViewModel(standardReferences); StandardReferences.References.ItemPropertyChanged += StandardReferences_ListChanged; RecentReferences = new SearchableReferencesViewModel(recentReferences); RecentReferences.References.ItemPropertyChanged += RecentReferences_ListChanged; InstalledReferences = new SearchableReferencesViewModel(allReferences.Where(r => r.IsInstalled)); }