dimanche 24 janvier 2016

Unit Testing Buttons in C# - .NET Visual Studio

I have a Windows Form Application that is just a bunch of buttons. I want to be able to test them with something like button1.PerformClick(); in my unit test class.

Is there anyway to do this without creating a method for each button inside my main program like: public void TestButton1Click(){ button1.PerformClick(); }

For some reason the button variables don't show up in the context of the unit test. Any help is appreciated, thanks

Aucun commentaire:

Enregistrer un commentaire