0

My project requires Inputs from the User like clicking submit button , waiting for recording then again clicking some other button etc. so How can one do Unit Testing for such modules. I read a lot about Moq. does Moq satisfies this need.

Thanks

Micha
  • 5,117
  • 8
  • 34
  • 47
priya
  • 852
  • 18
  • 39

2 Answers2

2

You can also use Microsoft Coded UI Tests. Disadvantage is that you need at least Visual Studio (2012) Premium. Works fine in your projects.

Micha
  • 5,117
  • 8
  • 34
  • 47
  • That's great Mocha but Do you have any Idea whether we can go with Mbunit to test Code which Requires User inputs.Because I am Using Mbunit throughout my project – priya Oct 07 '13 at 10:35
  • "Mbunit" -> you should add this info to question. I do not know this framework, so I can't give you an answer if you can test "Code which Requires User inputs". But this is in my eyes not a framework question, this is question how you code is designed. – Micha Oct 07 '13 at 12:08
1

Unit testing solves different kind of problem than what you're facing. Unit tests are supposed to exercise (small) units of code, not entire user interaction scenarios. In your case, you could have unit test which will veryify that submit button logic works as intended. Then another test for second button. Small parts of your code - not entire scenarios.

To test those (test interaction scenarios), you either need human testers or more complex tools, like Test Complete (which allows you to do just that; record user actions and verify results) or Sikuli.

k.m
  • 30,794
  • 10
  • 62
  • 86