Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I use breakpoints (as while debugging) while 'unit testing'?

I'm walking through the FrontStore series tutorial on TDD in MVC (Part 3 by Rob Conery/ASP.NET). The test I'm concerned with is the CatalogRepository_Each_Category_Contains_5_Products(). Until I get to that test, everything was working fine. Now, I've gone through every line that makes this test (including the test itself, the TestCatalogRepository, ...). I've also compared my code to that of Rob, but the test keeps failing.

I also checked the source code from CodePlex, that test was not there.

Now, I wonder if I can put a break point somewhere to check the local values as the test is being executed? If not, something similar?

Thanks for helping.

like image 740
Richard77 Avatar asked Sep 18 '26 02:09

Richard77


1 Answers

Debugging tests should be exactly the same as debugging your code - put a break point and run the test in debug (in MSTest ctrl+R, ctrl+T).

like image 133
Dror Helper Avatar answered Sep 19 '26 22:09

Dror Helper