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}'"); }
public bool IsCommandType(BaseCommand.Type commandType) => commandType == BaseCommand.Type.Connect;
public bool IsCommandType(BaseCommand.Type commandType) => commandType == BaseCommand.Type.Send;