public void Append_Should_produce_one_block_When_appending_byte_by_bytes_same_as_block_size()
        {
            var numOfBytesToAdd = PayloadBuilder.BlockSize;
            var bytesToAdd      = GetBytesToAdd(numOfBytesToAdd);

            UnitUnderTest.Append(bytesToAdd);

            var payload = UnitUnderTest.ToPayload();

            payload.BlockCount.Should().Be(1);
            payload.Size.Should().Be(numOfBytesToAdd);
            payload.Should().BeEquivalentTo(bytesToAdd);
        }
        public void Append_Should_produce_one_block_When_appending_payload_with_bytes_less_then_block_size()
        {
            var numOfBytesToAdd = PayloadBuilder.BlockSize - 1;
            var bytesToAdd      = GetBytesToAdd(numOfBytesToAdd);
            var payloadFake     = GetPayloadFake(bytesToAdd);

            UnitUnderTest.Append(payloadFake);

            var payload = UnitUnderTest.ToPayload();

            payload.BlockCount.Should().Be(1);
            payload.Size.Should().Be(numOfBytesToAdd);
            payload.Should().BeEquivalentTo(bytesToAdd);
        }
        public void Append_Should_produce_two_blocks_When_appending_byte_by_byte_one_more_then_block_size()
        {
            var numOfBytesToAdd = PayloadBuilder.BlockSize + 1;
            var bytesToAdd      = GetBytesToAdd(numOfBytesToAdd);

            foreach (var b in bytesToAdd)
            {
                UnitUnderTest.Append(b);
            }

            var payload = UnitUnderTest.ToPayload();

            payload.BlockCount.Should().Be(2);
            payload.Size.Should().Be(numOfBytesToAdd);
            payload.Should().BeEquivalentTo(bytesToAdd);
        }
        public void Append_Should_produce_two_blocks_When_appending_payload_with_bytes_being_one_more_then_block_size()
        {
            var bytesToAdd1 = GetBytesToAdd(PayloadBuilder.BlockSize);
            var bytesToAdd2 = GetBytesToAdd(1);
            var payloadFake = GetPayloadFake(bytesToAdd1, bytesToAdd2);

            UnitUnderTest.Append(payloadFake);

            var payload = UnitUnderTest.ToPayload();

            payload.BlockCount.Should().Be(2);
            payload.Size.Should().Be(bytesToAdd1.Length + bytesToAdd2.Length);
            payload.Should().BeEquivalentTo(new List <byte[]> {
                bytesToAdd1, bytesToAdd2
            }.SelectMany(i => i));
        }