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)); }); } }
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>()); } }
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>()); } }
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)); }); } }