mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-01-11 14:20:29 +01:00
How to mock a download limit when downloading a file? #348
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @JasonLandbridge on GitHub (May 15, 2021).
Originally assigned to: @StefH on GitHub.
Given the following code:
File downloads fine but It goes extremely fast as it is read from SSD into a memory stream. How can I make the download go slower as to mimic real life scenario?
Thanks in advance!
@StefH commented on GitHub (May 16, 2021):
Hello @JasonLandbridge,
As workaround, you can implement your own version from
IFileSystemHandler.See https://github.com/WireMock-Net/WireMock.Net/wiki/Settings#filesystemhandler for details.
@JasonLandbridge commented on GitHub (May 16, 2021):
@StefH, thanks for the answer!
I went a different route, I implemented a download limiter stream as explained here: stackoverflow
And now I can use that in my unit tests, which works perfectly with WireMock!
Also, thank you very much for all your work on WireMock.Net!
(Lekker bezig pik 💯 )