Using xUnit to Test your C# Code

Hey @ruchinmunjal , thank you for appreciating my article. I hope it has been helpful for you.

Regarding the integration-test folder, a few paragraphs before, I invited the reader to create it:

So, to prepare your environment, move to the unit-integration-test-xunit folder, and create a new integration-tests folder.

Related to the encoded slash, it is weird. I can’t reproduce this issue. Also, it sounds strange that only that slash in the URL is encoded :thinking:

Finally, the FakeJwtManager class does not add the Location header. It simply generates fake access tokens instead of getting them from an authorization server such as Auth0.
The Location header is populated by the Web API. In particular, the POST method called on the api/glossary endpoint generates a response with the 201 Created status code and the URL of the newly created resource in the Location header, as per specifications (it’s one of the best practices in building APIs inspired by the REST paradigm).
You can take a look at the source code of the API endpoint to better understand it.

1 Like