public void Given_a_version_When_converting_to_a_byte_array_Then_the_third_byte_equals_the_revision_number () { //----------------------------------------------------------------------------------------------------------- // Arrange //----------------------------------------------------------------------------------------------------------- var subject = new Version (1, 2, 3); //----------------------------------------------------------------------------------------------------------- // Act //----------------------------------------------------------------------------------------------------------- byte[] result = subject; //----------------------------------------------------------------------------------------------------------- // Assert //----------------------------------------------------------------------------------------------------------- result.Should ().HaveElementAt (2, (byte)3); }
public AmqpTcpConnection (Version amqpVersion, bool isConnected) { this.AmqpVersion = amqpVersion; this.IsConnected = isConnected; }
public static AmqpTcpConnection CreateFailedConnection(Version amqpVersion) { return new AmqpTcpConnection (amqpVersion, isConnected: false); }
public static AmqpTcpConnection CreateSuccessfulConnection(Version amqpVersion) { return new AmqpTcpConnection (amqpVersion, isConnected: true); }
bool IsVersionSupported (Version version) { return this.settings.SupportedVersions.Any (range => range.Contains (version)); }
public static async Task WriteVersionAsync(this Stream stream, Version version) { await stream.WriteAsync (version, 0, 8); }
public void Given_two_versions_When_comparing_them_Then_they_have_value_equality (byte major, byte minor, byte revision) { //----------------------------------------------------------------------------------------------------------- // Arrange //----------------------------------------------------------------------------------------------------------- var left = new Version (major, minor, revision); var right = new Version (major, minor, revision); //----------------------------------------------------------------------------------------------------------- // Act //----------------------------------------------------------------------------------------------------------- var result = right == left; //----------------------------------------------------------------------------------------------------------- // Assert //----------------------------------------------------------------------------------------------------------- result.Should ().BeTrue (); }
public void Given_two_versions_When_comparing_them_Then_the_right_version_is_less_than_the_right (byte leftMajor, byte leftMinor, byte leftRevision, byte rightMajor, byte rightMinor, byte rightRevision) { //----------------------------------------------------------------------------------------------------------- // Arrange //----------------------------------------------------------------------------------------------------------- var left = new Version (leftMajor, leftMinor, leftRevision); var right = new Version (rightMajor, rightMinor, rightRevision); //----------------------------------------------------------------------------------------------------------- // Act //----------------------------------------------------------------------------------------------------------- var result = right < left; //----------------------------------------------------------------------------------------------------------- // Assert //----------------------------------------------------------------------------------------------------------- result.Should ().BeTrue (); }
public ProtocolHeader (ProtocolId id, Version version) { ProtocolId = id; Version = version; }