I currently have a Windsor factory controller that works well. However, I am changing my controllers a bit, and Windsor is creating more data for the controllers. I forgot to update my installer class and it failed.
Thus, I realized that this is an ideal example for unit testing, so every time I run my unit tests, it checks that Windsor is configured correctly.
So I created the following unit test:
[TestMethod] public void Windsor_Can_Resolve_HomeController_Dependencies() {
This is exactly the same code that exists in my WindsorControllerFactory.GetControllerInstance() method, so I'm not sure why this is not working. When this is done, I get:
Test method MyApp.Tests.Controllers.HomeControllerTest.Windsor_Can_Resolve_HomeController_Dependencies threw exception: Castle.MicroKernel.ComponentNotFoundException: No component for supporting the service MyApp.Controllers.HomeController was found
I am not sure how to handle this. The only thing I can think of is that since in my test project, and not in my MVC Asp.net project, it cannot automatically build my CommandAndQueryInstaller class, which contains all my registration like a windsor.
Any tips on setting up dependencies for wind module testing?
source share