Can anybody advice some good unit testing framework/tool for complicated project that have AJAX parts, complex models (btw it's ASP.NET MVC3 project)? I hope I can get almost all code coverage with your help. Thanks in advance!
Asked
Active
Viewed 250 times
2 Answers
3
- SpecFlow if you are using BDD
- Watin as you mentioned for browser involved testing
- Moq as the mocking framework for tests
- Visual Studio unit tests for testing environment
- Most important - Knowledge of concepts of designing unit tests and unit testable projects, when to unit test, what to unit test. Unit test should be kept simple, should really test single unit, not the whole project, should be able to execute fast. Project design also should be capable of being unit tested - its components be loosely coupled, using dependency injection, units separated clearly from each other. Presentation and business logic also separated from each other. And after having implemented all that, project is no more
complex
, it's just big, needing high amount of code and tests. Project should not be complex, as it's hard (if not impossible) to unit test. If you don't feel knowledge power in these aspects, you better do some research before doing tests. All these unit testing frameworks are just helpers that speed up doing stuff that you already know how to.

archil
- 39,013
- 7
- 65
- 82
-
Brilliant answer! Love SO :) Yes, I going to do some research and refactorings before developing testing part of project. I would be very happy to get some experience in some manuals. – kseen Jul 27 '11 at 09:08
-
He may also want a QUnit test-suite for his client-side javascript. – Raynos Jul 27 '11 at 09:09
-
@kseen no. it's a set of unit tests written in javascript running directly in your browser. [Like such](http://view.jquery.com/tags/1.3.2/test/) – Raynos Jul 27 '11 at 09:26
1
I advice NUnit and Rhino mocks (for mocking database calls and other stuff). You should build that AJAX part so, that you can test the business logic without doing the AJAX call. The AJAX part should just be a presenter layer.
For testing your AJAX calls you should use and GUI testing tool

Ivo
- 3,406
- 4
- 33
- 56
-
-
Check out this thread on SO for some GUI testing suggestions http://stackoverflow.com/questions/805910/automated-web-ui-testing – Ivo Jul 27 '11 at 08:49