Reading time ~3 minutes I’ve seen multiple people struggling with trying to mock the ILogger calls. This post will hopefully save some people from wandering this path. Here it goes:Please stop trying to mock the ILogger methods from .net core. Here is why: Most ILogger methods that we use for logging are extension methods - static methods. While mocking them is possible using Prig, or Microsoft Fakes it is not easy or pleasant. Mocking a static method boils down to replacing the code at runtime using...
Strona głównaSztuka programowania
Sztuka programowania 1918 dni, 20 godzin, 8 minut temu 128 pokaż kod licznika zwiń