title: Unit Testing Buttons in C# - .NET Visual Studio
body: <p>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.</p>
  
  <p>Is there anyway to do this without creating a method for each button inside my main program like:
  public void TestButton1Click(){ button1.PerformClick(); } </p>
  
  <p>For some reason the button variables don't show up in the context of the unit test.
  Any help is appreciated, thanks</p>