Perhaps this is easier if you let Visual Studio create the Unit Test project when it creates the MVC project. But seeing as how that wasn't done, how should I add a Unit Test project now?
Here's what I did:
After all of that, I see a little yellow hazard icon on the newly added reference, and I can't access any of its namespaces in the code.
I figured it out. I forgot that there will be a warning message that goes along with the little yellow warning icon on a reference. So I went to the Error List and enabled "Warnings" in the filter. There was a message about mismatched .NET versions. The unit test project was using .NET 4.5 and the MVC project was 4.5.1. I changed the unit test project to 4.5.1, and voila, it works.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With