Skip to content
Discussion options

You must be logged in to vote

Assuming it is a TestContext - it has a AsyncLocal
I think this is where the magic happens - in that this makes TestContext be uniquely accessed per async context.
This somehow allows for routing the Console.WriteLine request into the OutputWriter instance that is unique to the async context.

Yep this is right. When tests are invoked, they will be in the correct async context that the interceptor can call TestContext.Current to get the correct context.

This doesn't explain what happens when SetOut gets called again. I guess alternatively, this could be a bug that just hasn't been encountered before because it is uncommon for multiple test sessions to be active at once ?

Yes probably. …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@byzantium0001
Comment options

Answer selected by byzantium0001
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants