aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/csharp
diff options
context:
space:
mode:
authorGravatar Jan Tattermusch <jtattermusch@google.com>2016-04-08 17:08:57 -0700
committerGravatar Jan Tattermusch <jtattermusch@google.com>2016-04-11 11:09:19 -0700
commitb323608b2717ed617edcebfca9ffb1249045e141 (patch)
tree8178e380209fa2ac520ec284bc64c01a7215807e /src/csharp
parentfd8d2735266bf9f8d481973956ea823aaadbb853 (diff)
fix test credentials for nunit3
Diffstat (limited to 'src/csharp')
-rw-r--r--src/csharp/Grpc.IntegrationTesting/TestCredentials.cs31
1 files changed, 28 insertions, 3 deletions
diff --git a/src/csharp/Grpc.IntegrationTesting/TestCredentials.cs b/src/csharp/Grpc.IntegrationTesting/TestCredentials.cs
index ce108d808b..aa54cd38a1 100644
--- a/src/csharp/Grpc.IntegrationTesting/TestCredentials.cs
+++ b/src/csharp/Grpc.IntegrationTesting/TestCredentials.cs
@@ -50,9 +50,29 @@ namespace Grpc.IntegrationTesting
{
public const string DefaultHostOverride = "foo.test.google.fr";
- public const string ClientCertAuthorityPath = "data/ca.pem";
- public const string ServerCertChainPath = "data/server1.pem";
- public const string ServerPrivateKeyPath = "data/server1.key";
+ public static string ClientCertAuthorityPath
+ {
+ get
+ {
+ return GetPath("data/ca.pem");
+ }
+ }
+
+ public static string ServerCertChainPath
+ {
+ get
+ {
+ return GetPath("data/server1.pem");
+ }
+ }
+
+ public static string ServerPrivateKeyPath
+ {
+ get
+ {
+ return GetPath("data/server1.key");
+ }
+ }
public static SslCredentials CreateSslCredentials()
{
@@ -66,5 +86,10 @@ namespace Grpc.IntegrationTesting
File.ReadAllText(ServerPrivateKeyPath));
return new SslServerCredentials(new[] { keyCertPair });
}
+
+ private static string GetPath(string relativePath)
+ {
+ return Path.Combine(TestContext.CurrentContext.TestDirectory, relativePath);
+ }
}
}