Пример #1
0
        private ProjectNugetifier CreateProjectNugetifier(IVsProject projectAdapter)
        {
            var projectFileSystem = new PhysicalFileSystem(projectAdapter.ProjectDirectory.ToString());
            var repository        = AggregateRepositoryHelper.CreateAggregateRepositoryFromSources(RepositoryFactory, SourceProvider, Source);

            repository.Logger = Console;
            var hintPathGenerator = new HintPathGenerator(!ExcludeVersion);

            return(new ProjectNugetifier(projectAdapter, repository, projectFileSystem, Console, hintPathGenerator));
        }
        public void HintPathGeneratedWithExcludeVersionDoesNotContainVersion()
        {
            var hpg = new HintPathGenerator(false);
            var solutionDirectory = "c:\\solutionDirectoryWithoutTrailingSlash";
            var projectDirName    = "projectDirectoryWithoutTrailingSlash";
            var solutionDirInfo   = new DirectoryInfo(solutionDirectory);
            var projectDirInfo    = new DirectoryInfo(solutionDirectory + string.Format("\\{0}", projectDirName));
            var package           = PackageUtility.CreatePackage("any", "0.0.0", assemblyReferences: new[] { "any.dll" });

            var hintpath = hpg.ForAssembly(solutionDirInfo, projectDirInfo, package, "any.dll");

            Assert.That(hintpath, Is.EqualTo("..\\packages\\any\\any.dll"));
        }