DEV Community

Discussion on: Integration Testing in .NET Core 2.0

Collapse
 
dwor profile image
andy • Edited

Great, great example.

Places where I struggled: I didn't know I was to add a reference to the main WebAPI solution. If I didn't pay close attention to your screen cap showing that, I wouldn't have known. Maybe add a point for this?

What unit test solution template did you use? MSTest? xUnit? NUnit? There is no direction on how to create the unit test project. When you add a new project to your solution, you have to pick one of those three from VS2017 project selections. I chose xUnit since that is what you use further down in the article.

Also, if you have an appsettings.json that your WebAPI is dependent on, your tests won't run. To get around this, I did this:

test