public void ConvertOptions_MaxReceiveMessageSize() { var gaxOptions = GrpcChannelOptions.Empty.WithMaxReceiveMessageSize(100); var result = GrpcNetClientAdapter.ConvertOptions(ChannelCredentials.Insecure, gaxOptions); Assert.Equal(100, result.MaxReceiveMessageSize); }
public void ConvertOptions_CustomOptions_Ignored() { var gaxOptions = GrpcChannelOptions.Empty.WithCustomOption("foo", "bar"); var result = GrpcNetClientAdapter.ConvertOptions(ChannelCredentials.Insecure, gaxOptions); Assert.Same(ChannelCredentials.Insecure, result.Credentials); }
public void ConvertOptions_Empty() { var gaxOptions = GrpcChannelOptions.Empty; var result = GrpcNetClientAdapter.ConvertOptions(ChannelCredentials.Insecure, gaxOptions); Assert.Same(ChannelCredentials.Insecure, result.Credentials); }
public void ConvertOptions_IgnoredOptions_Valid() { var gaxOptions = GrpcChannelOptions.Empty .WithEnableServiceConfigResolution(false) // Ignored if false; throws when true .WithPrimaryUserAgent("primary user agent") .WithKeepAliveTime(TimeSpan.FromMinutes(1)); GrpcNetClientAdapter.ConvertOptions(ChannelCredentials.Insecure, gaxOptions); }
public void ConvertEndpoint(string input, string expectedOutput) { Assert.Equal(expectedOutput, GrpcNetClientAdapter.ConvertEndpoint(input)); }
public void ConvertOptions_EnableServiceConfigResolutionTrue_Throws() { var gaxOptions = GrpcChannelOptions.Empty.WithEnableServiceConfigResolution(true); Assert.Throws <ArgumentException>(() => GrpcNetClientAdapter.ConvertOptions(ChannelCredentials.Insecure, gaxOptions)); }
public void ConvertOptions_CustomOptions_Throws() { var gaxOptions = GrpcChannelOptions.Empty.WithCustomOption("foo", "bar"); Assert.Throws <ArgumentException>(() => GrpcNetClientAdapter.ConvertOptions(ChannelCredentials.Insecure, gaxOptions)); }