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

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

            Assert.Same(ChannelCredentials.Insecure, result.Credentials);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 5
0
        public void ConvertOptions_EnableServiceConfigResolutionTrue_Throws()
        {
            var gaxOptions = GrpcChannelOptions.Empty.WithEnableServiceConfigResolution(true);

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

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