Closed astian92 closed 8 years ago
@astian92 Yes, it is possible without running a TestServer, although I admit it is not the most prettiest solution:
Just add all assemblies with controller types. If you run this code before the controller tests, then you can test controllers normally:
Will this work for you? Because I have an idea where unit testing can be possible without all the setup.
Hi,
Thanks. Using this code seems to do the trick. Thank you for your quick reaction and help. Good luck with this and your other wonderful libraries.
Hi Ivaylo,
Sorry if I am not writing this at the correct place for it. First of all, amazing work, thank you for providing us with a great way to end the reign of the magic strings. However, can I ask if it is possible to use this library in an action and test that action using a normal unit test. When I try to make a simple test that does not use a Test server it results in a NullReference exception. I saw that it is because it is using IServiceProvider and a some other stuff that are a part of the MVC architecture, while I am simply instantiating a Controller class and calling a method that returns a RedirectResult.
So, is it possible to test an action that uses it without running up a TestServer? (With just a simple UnitTest)