I have a form I want to create a unit testing for a Form. I want to demonstrate user click by calling the method that is activated OnClick. I don't even need to display the form itself.
The problem is that after I create a new Form in my tester Method, I am unable to access the OnClick function (even tho it access modifier is "public") , because I get the error: "The type 'Form' is defined in an assembly that is not referenced.
You must add a reference to assembly 'System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'."
I don't think I am approaching it in the right way, should I add a reference? But I don't want to even display the Form, all I want is to call the function. What is the right approach? how does unit test usually conducted on Forms?
Thank you in advance!!