OnSendCompleted() public method

The previous IMessageEncoder.Send has just completed.
true if the message have been sent successfully; otherwise false.
public OnSendCompleted ( int bytesTransferred ) : bool
bytesTransferred int
return bool
        public void reset_after_each_successful_message()
        {
            var contentType = "text/plain;type=System.String";
            var serializer = new StringSerializer();
            var slice = new BufferSlice(new byte[520], 0, 520);
            var msg = "Hello world";
            var buffer = new SocketBufferFake();

            var sut = new MicroMessageEncoder(serializer, slice);
            sut.Prepare(msg);
            sut.Send(buffer);
            sut.OnSendCompleted(13);
            sut.Send(buffer);
            sut.OnSendCompleted(2 + MicroMessageEncoder.FixedHeaderLength + contentType.Length + msg.Length - 13);
            sut.Prepare(msg);
            sut.Send(buffer);
            sut.OnSendCompleted(5);
            sut.Send(buffer);
            

            buffer.Offset.Should().Be(5);
            buffer.Count.Should().Be(2 + MicroMessageEncoder.FixedHeaderLength + contentType.Length + msg.Length - 5);
        }
        public void partial_send__continue_sending_rest_of_the_buffer_before_doing_anything_else()
        {
            var contentType = "text/plain;type=System.String";
            var serializer = new StringSerializer();
            var slice = new BufferSlice(new byte[65535], 0, 65535);
            var msg = "Hello world";
            var buffer = new SocketBufferFake();

            var sut = new MicroMessageEncoder(serializer, slice);
            sut.Prepare(msg);
            sut.Send(buffer);
            sut.OnSendCompleted(10);
            sut.Send(buffer);

            buffer.Offset.Should().Be(10);
            buffer.Count.Should().Be(2+ MicroMessageEncoder.FixedHeaderLength + contentType.Length + msg.Length - 10);
        }
        public void too_small_buffer_requires_multiple_sends()
        {
            var contentType = "text/plain;type=System.String";
            var serializer = new StringSerializer();
            var slice = new BufferSlice(new byte[520], 0, 520);
            var msg = "Hello world".PadRight(520);
            var buffer = new SocketBufferFake();

            var sut = new MicroMessageEncoder(serializer, slice);
            sut.Prepare(msg);
            sut.Send(buffer);
            sut.OnSendCompleted(520).Should().BeFalse();
            sut.Send(buffer);

            buffer.Offset.Should().Be(0);
            // headerlength + fixed header length + content type length + content type - sent in first batch
            buffer.Count.Should().Be(2 + MicroMessageEncoder.FixedHeaderLength + contentType.Length + msg.Length - 520);
        }