Mock IOptions in unit test

The Issue

You wish to unit test using the microsoft options Interface, but how do you inject you class into your test framework?

The solution

That code will create an IOptions<MyConfiguration> class that you constructed.

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.