Closed
Description
When testing the full server stack, it can be useful to invoke an operation with a CancellationToken other than CancellationToken.None, i.e.
new CancellationToken(canceled: true)
This support can be introduced by modifying ServerTestBuilder:
- Add a private field
CancellationToken cancellationToken
to the class, which by default is initialized to CancellationToken.None to preserve the current behavior - Add a method
IServerTestBuilder WithCancellationToken(CancellationToken cancellationToken)
which sets the private field - In ServerTestBuilder +124, send the request with the value of this.cancellationToken
What are your thoughts on this idea and its potential implementation? I'd be happy to implement it myself; your library has already been very helpful in testing my WebApi application.