JasperFx / alba

Easy integration testing for ASP.NET Core applications
https://jasperfx.github.io/alba
Apache License 2.0
406 stars 39 forks source link

Expose ReadBody on ScenarioAssertionException #133

Closed Hawxy closed 1 year ago

Hawxy commented 1 year ago

Closes #132

jeremydmiller commented 1 year ago

@Hawxy @egil This would have to wait for V8 like you already said, but I think I'd vote to eliminate the Body property and have folks rely on GetBody() -- or rename that as ReadBodyAsString() or something. Need to tip off folks that it requires some work to get there. And it's been awkward over the years for folks that try to read the body multiple times in the same test.

I think I also like the idea of any assertions in Scenario that assert on the contents of the body that they do their thing, but then we rewind the response stream so as not to trip up users doing secondary reads of that content.

That's all from thinking about this for just a minute or two though.