Two a day keeps stagnation away
DateTimeProvider for unit testing

DateTimeProvider for unit testing

When writing unit tests, you probably met with the question of how to test the method, the calculation of which is dependent on DateTime.NowDateTime.Now always returns a new value according to the current time, so testing this method is not directly possible.

Read more: https://blog.burgyn.online/c%23/.net/.net%20core/unit%20tests/patterns/2019/12/06/date-time-provider.html

Leave a Reply

Your email address will not be published. Required fields are marked *