public CachingSolutionLoader(FileInfo solutionFile, IDictionary<string, string> globalMsBuildProperties, IConsole console)
 {
     _solutionFile = solutionFile;
     _console = console;
     _projectLoader = new CachingProjectLoader(globalMsBuildProperties, console);
     _projectsInSolution = new Lazy<ICollection<IVsProject>>(LoadProjectsInSolutionByGuid);
 }
 public CachingSolutionLoader(FileInfo solutionFile, IDictionary <string, string> globalMsBuildProperties, IConsole console)
 {
     _solutionFile       = solutionFile;
     _console            = console;
     _projectLoader      = new CachingProjectLoader(globalMsBuildProperties, console);
     _projectsInSolution = new Lazy <ICollection <IVsProject> >(LoadProjectsInSolutionByGuid);
 }
        public void PassingWrongGuidAndNonCanonicalPathGetsSameReference()
        {
            using (var projectLoader = new CachingProjectLoader(new Dictionary<string, string>(), _console.Object))
            {
                var loadedWithCorrectGuid = projectLoader.GetProject(ProjectReferenceTestData.ProjectWithDependenciesGuid, Paths.ProjectWithDependencies);
                var nonCanonicalPath = Path.Combine(loadedWithCorrectGuid.ProjectDirectory.FullName.ToLower(), "randomFolder", "..", loadedWithCorrectGuid.ProjectName.ToUpper() + ".csproj");

                var loadedByNonCanonPath = projectLoader.GetProject(Guid.Empty, nonCanonicalPath);

                Assert.That(ReferenceEquals(loadedWithCorrectGuid, loadedByNonCanonPath), Is.True);
            }
        }
 public void PassingWrongGuidGetsProjectByPath()
 {
     var anyProject = _solutionProjectLoader.GetProjects().First();
     using (var projectLoader = new CachingProjectLoader(new Dictionary<string, string>(), _console.Object))
     {
         var loadedByPathOnly = projectLoader.GetProject(Guid.Empty, Path.Combine(anyProject.ProjectDirectory.FullName, anyProject.ProjectName + ".csproj"));
         Assert.That(anyProject.ProjectName, Is.EqualTo(loadedByPathOnly.ProjectName));
     }
 }
 private IVsProject LoadProjectWithDependenciesFromDisk()
 {
     var newProjectLoader = new CachingProjectLoader(new Dictionary<string, string>(), _console.Object);
     return newProjectLoader.GetProject(Guid.Empty, _projectWithDependenciesFile.FullName);
 }