fix method signature and add test

pull/2873/head
Jan Tattermusch 9 years ago
parent 03ad9510ce
commit 1338798897
  1. 8
      src/csharp/Grpc.Core.Tests/GrpcEnvironmentTest.cs
  2. 2
      src/csharp/Grpc.Core/GrpcEnvironment.cs

@ -69,5 +69,13 @@ namespace Grpc.Core.Tests
Assert.IsFalse(object.ReferenceEquals(env1, env2)); Assert.IsFalse(object.ReferenceEquals(env1, env2));
} }
[Test]
public void GetCoreVersionString()
{
var coreVersion = GrpcEnvironment.GetCoreVersionString();
var parts = coreVersion.Split('.');
Assert.AreEqual(4, parts.Length);
}
} }
} }

@ -169,7 +169,7 @@ namespace Grpc.Core
/// <summary> /// <summary>
/// Gets version of gRPC C core. /// Gets version of gRPC C core.
/// </summary> /// </summary>
internal string GetCoreVersionString() internal static string GetCoreVersionString()
{ {
var ptr = grpcsharp_version_string(); // the pointer is not owned var ptr = grpcsharp_version_string(); // the pointer is not owned
return Marshal.PtrToStringAnsi(ptr); return Marshal.PtrToStringAnsi(ptr);

Loading…
Cancel
Save