Chris Sainty 3/5/2018

Unit Testing ILogger in ASP.NET Core

Read Original

This technical article addresses a common problem in ASP.NET Core unit testing: mocking the ILogger<T> interface. It explains why standard mocking fails for LogError and other extension methods, provides code examples, and offers solutions, including verifying against the core ILogger.Log method.

Unit Testing ILogger in ASP.NET Core

Comments

No comments yet

Be the first to share your thoughts!

Browser Extension

Get instant access to AllDevBlogs from your browser

Top of the Week

1
The Beautiful Web
Jens Oliver Meiert 2 votes
3
LLM Use in the Python Source Code
Miguel Grinberg 1 votes
4
Wagon’s algorithm in Python
John D. Cook 1 votes