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));
            }
        }
        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);
            }
        }
        private IVsProject LoadProjectWithDependenciesFromDisk()
        {
            var newProjectLoader = new CachingProjectLoader(new Dictionary <string, string>(), _console.Object);

            return(newProjectLoader.GetProject(Guid.Empty, _projectWithDependenciesFile.FullName));
        }