public void When_writing_logout_operation_it_must_be_correct()
        {
            // Arrange
            var operation = new LogoutOperation();

            // Act
            byte[] buffer = PacketWriter.Write(operation, false);

            // Assert
            buffer.ShouldBeEquivalentTo(new byte[]
            {
                2,
                ByteFor('0'),
                ByteFor('2'),
                ByteFor('\t'),
                3
            });
        }
 public void Accept(LogoutOperation operation)
 {
 }
 void IOperationAcceptor.Accept(LogoutOperation operation)
 {
     owner.Logout();
 }
 public void Accept(LogoutOperation operation)
 {
     WarnForUnexpectedOperation(operation);
 }
        public void When_reading_logout_operation_it_must_be_correct()
        {
            // Arrange
            byte[] buffer =
            {
                2,
                ByteFor('0'),
                ByteFor('2'),
                ByteFor('\t'),
                3
            };
            var reader = new PacketReader();

            // Act
            Operation operation = reader.Read(buffer);

            // Assert
            var expected = new LogoutOperation();
            operation.ShouldBeEquivalentTo(expected, options => options.IncludingAllRuntimeProperties());
        }