public void When_writing_login_operation_it_must_be_correct()
        {
            // Arrange
            var operation = new LoginOperation();

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

            // Assert
            buffer.ShouldBeEquivalentTo(new byte[]
            {
                2,
                ByteFor('0'),
                ByteFor('1'),
                ByteFor('\t'),
                3
            });
        }
        public void When_reading_login_operation_it_must_be_correct()
        {
            // Arrange
            byte[] buffer =
            {
                2,
                ByteFor('0'),
                ByteFor('1'),
                ByteFor('\t'),
                3
            };
            var reader = new PacketReader();

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

            // Assert
            var expected = new LoginOperation();

            operation.ShouldBeEquivalentTo(expected, options => options.IncludingAllRuntimeProperties());
        }
 public void Accept(LoginOperation operation)
 {
 }
 void IOperationAcceptor.Accept(LoginOperation operation)
 {
     owner.Login();
 }
 public void Accept(LoginOperation operation)
 {
     WarnForUnexpectedOperation(operation);
 }