public void Given_a_protocol_header_When_converting_to_a_byte_array_Then_it_contains_the_protocol_id () { //----------------------------------------------------------------------------------------------------------- // Arrange //----------------------------------------------------------------------------------------------------------- var subject = new ProtocolHeader (ProtocolIds.AMQP, new Version (1, 2, 3)); //----------------------------------------------------------------------------------------------------------- // Act //----------------------------------------------------------------------------------------------------------- byte [] result = subject; //----------------------------------------------------------------------------------------------------------- // Assert //----------------------------------------------------------------------------------------------------------- result.Should ().HaveElementAt (4, (byte)0); }
public void Given_a_protocol_header_When_converting_to_a_byte_array_Then_it_contains_the_version () { //----------------------------------------------------------------------------------------------------------- // Arrange //----------------------------------------------------------------------------------------------------------- var subject = new ProtocolHeader (ProtocolIds.AMQP, new Version (1, 2, 3)); //----------------------------------------------------------------------------------------------------------- // Act //----------------------------------------------------------------------------------------------------------- byte [] result = subject; //----------------------------------------------------------------------------------------------------------- // Assert //----------------------------------------------------------------------------------------------------------- result.Should ().ContainInOrder (new byte [] { 0, 1, 2, 3 }); }
public void Given_a_protocol_header_When_converting_to_a_byte_array_Then_it_starts_with_AMQP () { //----------------------------------------------------------------------------------------------------------- // Arrange //----------------------------------------------------------------------------------------------------------- var subject = new ProtocolHeader (ProtocolIds.AMQP, new Version (1, 2, 3)); //----------------------------------------------------------------------------------------------------------- // Act //----------------------------------------------------------------------------------------------------------- byte [] result = subject; //----------------------------------------------------------------------------------------------------------- // Assert //----------------------------------------------------------------------------------------------------------- result.Should ().ContainInOrder ((byte)'A', (byte)'M', (byte)'Q', (byte)'P'); }