q2ebanking/boa-constrictor

[FEATURE]: Move request dumping methods to AbstractRestSharpAbility

thePantz opened this issue · 1 comments

Description

Currently we have these methods within CallRestApi:


        public CallRestApi DumpingRequestsTo(string dumpDir, string fileToken = "Request")
        {
            base.RequestDumper = new RequestDumper("REST Request Dumper", dumpDir, fileToken);
            return this;
        }

        public CallRestApi DumpingDownloadsTo(string dumpDir, string fileToken = "Download")
        {
            base.DownloadDumper = new ByteDumper("REST Download Dumper", dumpDir, fileToken);
            return this;
        }

These are great but only available if you're using this ability, otherwise you need to implement your own.
I feel that the above will handle 90% of the cases when using RestSharp and it would be great if we got them 'for free'

I propose making these virtual methods on AbstractRestSharpAbility so they have this default implementation, but could be overridden if the caller wishes. Thoughts?

Alternatives

Implement the dumpers on each ability that uses AbstractRestSharpAbility

Anything else?

No response

Commitments

  • I agree to follow Boa Constrictor's Code of Conduct.
  • I want to work on this issue myself. (This is voluntary, not required.)

This is not a bad idea! @thePantz, if you have time, please sketch it out in the code and drop some snippets here or send a pull request for further review.