Skip to content

Commit

Permalink
use cross-platform paths
Browse files Browse the repository at this point in the history
  • Loading branch information
TimHess committed Dec 22, 2022
1 parent 38b62ab commit 97dabff
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,12 @@ public void PostProcessors_CanBeEnabled()

private static string GetK8SResourcesDirectory(string name)
{
return Path.Combine(Environment.CurrentDirectory, $"..\\..\\..\\resources\\k8s\\{name}");
return Path.Combine(Environment.CurrentDirectory, "..", "..", "..", "resources", "k8s", $"{name}");
}

private static string GetEmptyK8SResourcesDirectory()
{
return Path.Combine(Environment.CurrentDirectory, "..\\..\\..\\resources\\k8s-empty\\");
return Path.Combine(Environment.CurrentDirectory, "..", "..", "..", "resources", "k8s-empty");
}

private class TestPostProcessor : IConfigurationPostProcessor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public void EnvironmentVariableSet()
try
{
var source = new ServiceBindingConfigurationSource();
Assert.Contains("resources\\k8s", source.ServiceBindingRoot, StringComparison.OrdinalIgnoreCase);
Assert.Contains(Path.Combine("resources", "k8s"), source.ServiceBindingRoot, StringComparison.OrdinalIgnoreCase);
Assert.NotNull(source.FileProvider);
Assert.NotNull(source.FileProvider.GetDirectoryContents("/"));
}
Expand Down Expand Up @@ -61,6 +61,6 @@ public void Build_CapturesParentConfiguration()

private static string GetK8SResourcesDirectory(string name)
{
return Path.Combine(Environment.CurrentDirectory, $"..\\..\\..\\resources\\k8s\\{name}");
return Path.Combine(Environment.CurrentDirectory, "..", "..", "..", "resources", "k8s", $"{name}");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public void PopulatesFromFileSystem_Kubernetes()
Assert.Equal("test-name-1", binding.Name);
Assert.Equal("test-type-1", binding.Type);
Assert.Equal("test-provider-1", binding.Provider);
Assert.Contains("resources\\k8s\\test-name-1", binding.Path, StringComparison.OrdinalIgnoreCase);
Assert.Contains(Path.Combine("resources", "k8s", "test-name-1"), binding.Path, StringComparison.OrdinalIgnoreCase);
Assert.NotNull(binding.Secrets);
Assert.Single(binding.Secrets);
Assert.Equal("test-secret-value", binding.Secrets["test-secret-key"]);
Expand All @@ -39,14 +39,14 @@ public void PopulatesFromFileSystem_WithHiddenFilesAndLinks_Kubernetes()
Assert.Equal("test-k8s", binding.Name);
Assert.Equal("test-type-1", binding.Type);
Assert.Equal("test-provider-1", binding.Provider);
Assert.Contains("resources\\k8s\\test-k8s", binding.Path, StringComparison.OrdinalIgnoreCase);
Assert.Contains(Path.Combine("resources", "k8s", "test-k8s"), binding.Path, StringComparison.OrdinalIgnoreCase);
Assert.NotNull(binding.Secrets);
Assert.Single(binding.Secrets);
Assert.Equal("test-secret-value", binding.Secrets["test-secret-key"]);
}

private static string GetK8SResourcesDirectory(string name)
{
return Path.Combine(Environment.CurrentDirectory, $"..\\..\\..\\resources\\k8s\\{name}");
return Path.Combine(Environment.CurrentDirectory, "..", "..", "..", "resources", "k8s", $"{name}");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ public void PopulatesContent()

private static string GetK8SResourcesDirectory()
{
return Path.Combine(Environment.CurrentDirectory, "..\\..\\..\\resources\\k8s\\");
return Path.Combine(Environment.CurrentDirectory, "..", "..", "..", "resources", "k8s");
}
}

0 comments on commit 97dabff

Please sign in to comment.