+ 2

Debug when using XUnit and TestExplorer

I have some projects. Where I use TestExplorer and Xunit. These are not my own development. But I need to develop code that passes the tests. How can I put a debug.writeline, breakpoint or watch. In the code. The test explorer seems to block all my usual debug methods

22nd Dec 2019, 8:04 PM
sneeze
sneeze - avatar
8 Answers
+ 1
Right click on test project on Solution explorer and press "Debug tests" https://drive.google.com/open?id=1xIdCh9-Z-B5gEvn3BUteFjoinMW89tgv
5th Feb 2020, 6:12 AM
Stephan
Stephan - avatar
+ 1
What do you mean by "I can't follow the program flow"? Step by step execution?
5th Feb 2020, 9:44 AM
Stephan
Stephan - avatar
+ 1
Do you have button as on my screenshot? It allows to use breakpoints. I don't know about vs 2017. But it works in 2019 version.
6th Feb 2020, 9:26 PM
Stephan
Stephan - avatar
+ 1
That's test explorer, but I mentioned solution explorer panel. Try on solution explorer
6th Feb 2020, 9:32 PM
Stephan
Stephan - avatar
0
Yes. I did understand that. I like to add my own debug statement to the test. I can run the test but I can't follow the program flow. Can I do that with something like a debug.writeline or assert.
5th Feb 2020, 9:27 AM
sneeze
sneeze - avatar
0
I use visual studio 2017. And take the projects from https://exercism.io/ These projects come with test cases and some projects-files to get you started. I can run the tests, but I do not know how to do step by step execution since the tests run all at once. Also I am unable to add debug-statements to my code. The only way I can see some is process flow is by setting variables.
6th Feb 2020, 9:18 PM
sneeze
sneeze - avatar
0
Thank you for answering. I posted a screenshot in my feed. https://www.sololearn.com/post/237434/?ref=app
6th Feb 2020, 9:29 PM
sneeze
sneeze - avatar
0
This is my view in solution explorer https://www.sololearn.com/post/237441/?ref=app
6th Feb 2020, 9:44 PM
sneeze
sneeze - avatar