Beispiel #1
0
        public void ConvertOptions_MaxReceiveMessageSize()
        {
            var gaxOptions = GrpcChannelOptions.Empty.WithMaxReceiveMessageSize(100);
            var result     = GrpcNetClientAdapter.ConvertOptions(ChannelCredentials.Insecure, gaxOptions);

            Assert.Equal(100, result.MaxReceiveMessageSize);
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
        public void ConvertOptions_Empty()
        {
            var gaxOptions = GrpcChannelOptions.Empty;
            var result     = GrpcNetClientAdapter.ConvertOptions(ChannelCredentials.Insecure, gaxOptions);

            Assert.Same(ChannelCredentials.Insecure, result.Credentials);
        }
Beispiel #4
0
        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);
        }
Beispiel #5
0
 public void ConvertEndpoint(string input, string expectedOutput)
 {
     Assert.Equal(expectedOutput, GrpcNetClientAdapter.ConvertEndpoint(input));
 }
Beispiel #6
0
        public void ConvertOptions_EnableServiceConfigResolutionTrue_Throws()
        {
            var gaxOptions = GrpcChannelOptions.Empty.WithEnableServiceConfigResolution(true);

            Assert.Throws <ArgumentException>(() => GrpcNetClientAdapter.ConvertOptions(ChannelCredentials.Insecure, gaxOptions));
        }
Beispiel #7
0
        public void ConvertOptions_CustomOptions_Throws()
        {
            var gaxOptions = GrpcChannelOptions.Empty.WithCustomOption("foo", "bar");

            Assert.Throws <ArgumentException>(() => GrpcNetClientAdapter.ConvertOptions(ChannelCredentials.Insecure, gaxOptions));
        }