GetPackagePath() public static method

public static GetPackagePath ( string nugetConfigPath ) : string
nugetConfigPath string
return string
Example #1
0
    public void NugetConfigWithPlaceholderRemovesToken()
    {
        var configPath             = Path.Combine(TestContext.CurrentContext.TestDirectory, "NugetConfigWithPlaceholder.txt");
        var packagesPathFromConfig = NugetConfigReader.GetPackagePath(configPath);

        Assert.False(packagesPathFromConfig.Contains("$"));
    }
Example #2
0
    public void NugetConfigWithPlaceholderUsesDirectory()
    {
        var configPath             = Path.Combine(TestContext.CurrentContext.TestDirectory, "NugetConfigWithPlaceholder.txt");
        var packagesPathFromConfig = NugetConfigReader.GetPackagePath(configPath);

        Assert.AreEqual(Path.Combine(TestContext.CurrentContext.TestDirectory, "Packages"), packagesPathFromConfig);
    }
Example #3
0
    public void NugetConfigWithRepoNodeEmpty()
    {
        var configPath             = Path.Combine(TestContext.CurrentContext.TestDirectory, "NugetConfigWithRepoNodeEmpty.txt");
        var packagesPathFromConfig = NugetConfigReader.GetPackagePath(configPath);

        Assert.IsNull(packagesPathFromConfig);
    }
Example #4
0
    public void NugetConfigWithKeyNode()
    {
        var configPath             = Path.Combine(TestContext.CurrentContext.TestDirectory, "NugetConfigWithKeyNode.txt");
        var packagesPathFromConfig = NugetConfigReader.GetPackagePath(configPath);

        Assert.AreEqual(Path.Combine(TestContext.CurrentContext.TestDirectory, "repositoryPathValue"), packagesPathFromConfig);
    }
    public void NugetConfigWithKeyNodeEmpty()
    {
        var configPath             = Path.Combine(Environment.CurrentDirectory, "NugetConfigWithKeyNodeEmpty.txt");
        var packagesPathFromConfig = NugetConfigReader.GetPackagePath(configPath);

        Assert.IsNull(packagesPathFromConfig);
    }
Example #6
0
    public void NugetConfigWithPlaceholderUsesDirectory()
    {
        var configPath             = Path.Combine(AssemblyLocation.CurrentDirectory, "Fody/NugetConfigWithPlaceholder.txt");
        var packagesPathFromConfig = NugetConfigReader.GetPackagePath(configPath);

        Assert.Equal(Path.Combine(AssemblyLocation.CurrentDirectory, @"Fody\Packages"), packagesPathFromConfig);
    }
Example #7
0
    public void NugetConfigWithPlaceholderRemovesToken()
    {
        var configPath             = Path.Combine(AssemblyLocation.CurrentDirectory, "Fody/NugetConfigWithPlaceholder.txt");
        var packagesPathFromConfig = NugetConfigReader.GetPackagePath(configPath);

        Assert.DoesNotContain("$", packagesPathFromConfig);
    }
Example #8
0
    public void NugetConfigWithKeyNode()
    {
        var configPath             = Path.Combine(AssemblyLocation.CurrentDirectory, "Fody/NugetConfigWithKeyNode.txt");
        var packagesPathFromConfig = NugetConfigReader.GetPackagePath(configPath);

        Assert.Equal(Path.Combine(AssemblyLocation.CurrentDirectory, @"Fody\repositoryPathValue"), packagesPathFromConfig);
    }
Example #9
0
    public void NugetConfigWithRepoNodeEmpty()
    {
        var configPath             = Path.Combine(AssemblyLocation.CurrentDirectory, "Fody/NugetConfigWithRepoNodeEmpty.txt");
        var packagesPathFromConfig = NugetConfigReader.GetPackagePath(configPath);

        Assert.Null(packagesPathFromConfig);
    }