Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error thrown when calling mocked endpoint second time when using file-based response body #301

Closed
rwwilden opened this issue Jul 22, 2019 · 1 comment
Labels

Comments

@rwwilden
Copy link
Contributor

When you use a setup as follows:

server
  .Given(
      Request
          .Create()....)
  .RespondWith(
      Response
          .Create().....
          .WithBodyFromFile(fileName));

the mocked endpoint can only be called successfully the first time. Second time it will throw an error.

This is caused by the fact that the property BodyData.BodyAsFile is set to null right after the first successful response, causing an ArgumentNullException the second time. This happens in the Response class.

@StefH
Copy link
Collaborator

StefH commented Jul 22, 2019

Dankjewel.

@StefH StefH closed this as completed Jul 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants