public void GetPathTest() { PackagesFolderResolver target = new PackagesFolderResolver(); var result = target.GetPath(@".\TestData\packages"); Assert.IsNotNull(result); }
private string GetPathForTool() { IPathResolutionService resolver = null; string root = Path.GetDirectoryName(this.Solution); string packagesFolder = Path.Combine(root, "packages"); if (Directory.Exists(packagesFolder)) { resolver = new PackagesFolderResolver(this.Log); return resolver.GetPath(packagesFolder); } return null; }
protected override string GenerateFullPathToTool() { string path = null; IPathResolutionService resolver = null; string root = Path.GetDirectoryName(this.SolutionPath); string packagesFolder = Path.Combine(root, NuGetConstants.PackagesFolder); if (Directory.Exists(packagesFolder)) { resolver = new PackagesFolderResolver(); path = resolver.GetPath(packagesFolder); } if (string.IsNullOrWhiteSpace(path) || !File.Exists(path)) { this.Log.LogError(string.Format("The tool '{0}' location was not identified, or does not exist.", this.ToolName)); } return path; }