0

I am working on a Windows Form application. Now I need to write Unit Test Cases for this. The 'visualstudio.testtools.unittesting' framework provide Unit Test support. But I do not believe it provide APIs for writing test cases for a WinForm class.

I have researched and found about NunitForms but it seems limited in terms of supported controls. Also if someone find good documentations/tutorials on this please share.

HSharma
  • 385
  • 2
  • 18

1 Answers1

0

You want to use the MS Built-in Unit Testing framework(MSTEST), is preferably good for standard Unit Tests IMO. However you can try MSTest Coded UI testing target winforms UI elements. If that's does not support the next best option is using a 3rd party framework.

I have personally worked on a winforms project and used Selenium.

Community
  • 1
  • 1
Spock
  • 7,009
  • 1
  • 41
  • 60
  • Thank you for your response Spock. I am looking for APIs which let me write Unit Tests for Winform event handler like btnSubmit_Click. The CodedUI and Selenium are for Automation test. – HSharma Nov 28 '14 at 07:02
  • Then why not use MVPVM pattern which allows you to abstract away the Click handler and write test against a Presenter for what happens inside the click handler? – Spock Nov 28 '14 at 10:37