Пример #1
0
        public static void Expect(this BaseCommand command, BaseCommand.Type type)
        {
            if (command.CommandType == type)
            {
                return;
            }

            if (command.CommandType == BaseCommand.Type.Error)
            {
                command.Error.Throw();
            }

            if (command.CommandType == BaseCommand.Type.SendError)
            {
                command.SendError.Throw();
            }

            throw new UnexpectedResponseException($"Expected '{type}' but got '{command.CommandType}'");
        }
Пример #2
0
 public bool IsCommandType(BaseCommand.Type commandType)
 => commandType == BaseCommand.Type.Connect;
Пример #3
0
 public bool IsCommandType(BaseCommand.Type commandType)
 => commandType == BaseCommand.Type.Send;