public void BuildBidiStreamingApiCall_PerCallSettings() { var perCallSettings = CallSettings.FromCancellationToken(new CancellationTokenSource().Token); var helper = new ClientHelper(new DummySettings()); var server = new DummyServerBidiStreaming(); var apiCall = helper.BuildApiCall <SimpleRequest, SimpleResponse>(server.Call, null, null); apiCall.Call(perCallSettings); Assert.Equal(perCallSettings.CancellationToken, server.CallOptions.CancellationToken); }
public void BuildBidiStreamingApiCall_ClientSettings() { var clientSettings = CallSettings.FromCancellationToken(new CancellationTokenSource().Token); var helper = new ClientHelper(new SimpleSettings { CallSettings = clientSettings }, logger: null); var server = new DummyServerBidiStreaming(); var apiCall = helper.BuildApiCall <SimpleRequest, SimpleResponse>("Method", server.Call, null, null); apiCall.Call(null); Assert.Equal(clientSettings.CancellationToken, server.CallOptions.CancellationToken); }