c# - Is MessageBox usable in TestClasses/TestMethods? -
i have created testclass multiple testmethods. in 1 of test methods, trying display information popup box using messagebox.show. intellisense not pick messagebox here (manually typing won't resolve symbol). able use elsewhere throughout project wondering if there test methods preventing use.
short answer
since can use messagebox in rest of project, miss using system.windows.forms
long answer
i don't think it's idea use messagebox in testmethod blocks further test execution. consider using testcontext instead:
[testclass] public class mytestclass { // declare property , test framework set public testcontext testcontext {get; set;} [testmethod] public void mytestmethod() { //... test code testcontext.writeline("hey, got information you"); // more of test code } } see testcontext.writeline() more information.
Comments
Post a Comment