Ben Foster 11/22/2013

Testing handlers/filters that access IDependencyScope in Web API

Read Original

This technical article explains how to test ASP.NET Web API filters and message handlers that access the IDependencyScope for dependency resolution. It discusses the challenges of coupling to the dependency resolver, proposes a solution using constructor injection with a Func delegate for better testability, and provides a concrete example using a RavenDB unit-of-work filter with accompanying unit tests.

Testing handlers/filters that access IDependencyScope in Web API

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