コード例 #1
0
        public void DthStartup_ProtocolNegotiation_ZeroIsNoAllowed()
        {
            using (var server = new DthTestServer(_loggerFactory))
                using (var client = new DthTestClient(server, _loggerFactory))
                {
                    client.SetProtocolVersion(0);

                    Assert.Throws <TimeoutException>(() =>
                    {
                        client.DrainTillFirst(MessageTypes.ProtocolVersion, timeout: TimeSpan.FromSeconds(1));
                    });
                }
        }
コード例 #2
0
        public void DthStartup_ProtocolNegotiation(int requestVersion, int expectVersion)
        {
            using (var server = new DthTestServer(_loggerFactory))
                using (var client = new DthTestClient(server, _loggerFactory))
                {
                    client.SetProtocolVersion(requestVersion);

                    var response = client.DrainTillFirst(MessageTypes.ProtocolVersion, TimeSpan.FromDays(1));
                    response.EnsureSource(server, client);

                    Assert.Equal(expectVersion, response.Payload["Version"]?.Value <int>());
                }
        }
コード例 #3
0
ファイル: DthTests.cs プロジェクト: ericstj/cli
        public void DthStartup_ProtocolNegotiation(int requestVersion, int expectVersion)
        {
            using (var server = new DthTestServer(_loggerFactory))
            using (var client = new DthTestClient(server))
            {
                client.SetProtocolVersion(requestVersion);

                var response = client.DrainTillFirst(MessageTypes.ProtocolVersion, TimeSpan.FromDays(1));
                response.EnsureSource(server, client);

                Assert.Equal(expectVersion, response.Payload["Version"]?.Value<int>());
            }
        }
コード例 #4
0
ファイル: DthTests.cs プロジェクト: cdmihai/cli
        public void DthStartup_ProtocolNegotiation_ZeroIsNoAllowed()
        {
            using (var server = new DthTestServer(_loggerFactory))
            using (var client = new DthTestClient(server))
            {
                client.SetProtocolVersion(0);

                Assert.Throws<TimeoutException>(() =>
                {
                    client.DrainTillFirst(MessageTypes.ProtocolVersion, timeout: TimeSpan.FromSeconds(1));
                });
            }
        }