Writing test with a real database and xUnit
When writing tests, in some cases we need to connect with the database to read data from it or store records in it. If we use a fixed database, the values in the database will change every time the tests are run, and if someone else works with the database and changes ....
Read more
Integration test in Asp.Net Core with xUnit
In the previous article, we examined an example of writing a unit test. In this article, we want to implement testing for APIs using the xUnit library. For this, we first create an Asp.Net Core Web App project. Then we create a controller called UsersController ....
Read more
Use ThrowHelper instead of throw new Exception
When we want to raise an error in the program, we usually use throw new exception and put the appropriate text of the error in the exception class. But if the number of these export errors increases, it will increase the assembly code. ....
Read more
MongoDB expiration time index in Asp.Net Core
Sometimes you need to keep data for a certain period of time and then delete it. If you want to do it yourself, you are doing something time-consuming and unreasonable. But you can do this using the Expiration time for the MongoDB database or the TTL for Radis ....
Read more
How does ConfigureAwait(false) work?
If you have worked with Asp.Net MVC, you are probably familiar with this word. When a request is sent to Asp.Net MVC applications, request information such as Uri, Headers, RemoteAddress, etc. is contained in HttpContext.Current. ....
Read more