Null reference to DataContext when testing an ASP.NET MVC app with NUnit

Posted by user252160 on Stack Overflow See other posts from Stack Overflow or by user252160
Published on 2010-03-20T16:43:32Z Indexed on 2010/03/20 16:51 UTC
Read the original article Hit count: 372

I have an ASP.NET MVC application with a separate project added for tests. I know the plusses and minuses of using the connection to the database when running unit tests, and I still want to use it. Yet, every time when I run the tests with the NUnit tool, they all fail due to my Data Context being null. I heard something about having a separate config file for the tests assembly, but i am not sure whether I did it properly, or whether that works at all.

© Stack Overflow or respective owner

Related posts about asp.net-mvc

Related posts about ASP.NET