diff options
author | Tim Emiola <tbetbetbe@users.noreply.github.com> | 2015-02-13 13:06:11 -0800 |
---|---|---|
committer | Tim Emiola <tbetbetbe@users.noreply.github.com> | 2015-02-13 13:06:11 -0800 |
commit | d853baacd812d4b89f2713eb99f818dbd7424bda (patch) | |
tree | 07f5855999778c47d8e8d2ac3269299b7996c9f0 /src/csharp/GrpcApiTests | |
parent | f47491954dbdcb7c4f004d6f1dc41ff9dadc26fd (diff) | |
parent | 23821ceb690a71ef307c8878d352c534c27d838b (diff) |
Merge pull request #516 from jtattermusch/csharp_shutdown
C# refactoring of GrpcEnvironment and PortPicker
Diffstat (limited to 'src/csharp/GrpcApiTests')
-rw-r--r-- | src/csharp/GrpcApiTests/MathClientServerTests.cs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/csharp/GrpcApiTests/MathClientServerTests.cs b/src/csharp/GrpcApiTests/MathClientServerTests.cs index f5c74573de..bb3f75d4ac 100644 --- a/src/csharp/GrpcApiTests/MathClientServerTests.cs +++ b/src/csharp/GrpcApiTests/MathClientServerTests.cs @@ -46,7 +46,7 @@ namespace math.Tests /// </summary> public class MathClientServerTest { - string serverAddr = "localhost:" + PortPicker.PickUnusedPort(); + string host = "localhost"; Server server; Channel channel; MathGrpc.IMathServiceClient client; @@ -54,11 +54,13 @@ namespace math.Tests [TestFixtureSetUp] public void Init() { + GrpcEnvironment.Initialize(); + server = new Server(); server.AddServiceDefinition(MathGrpc.BindService(new MathServiceImpl())); - server.AddPort(serverAddr); + int port = server.AddPort(host + ":0"); server.Start(); - channel = new Channel(serverAddr); + channel = new Channel(host + ":" + port); client = MathGrpc.NewStub(channel); } |