コード例 #1
0
ファイル: ProtocolHeaderSpecs.cs プロジェクト: jagrem/msg
        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);
        }
コード例 #2
0
ファイル: ProtocolHeaderSpecs.cs プロジェクト: jagrem/msg
        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 });
        }
コード例 #3
0
ファイル: ProtocolHeaderSpecs.cs プロジェクト: jagrem/msg
        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');
        }