1

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!

2 Answers 2

3
  1. SpecFlow if you are using BDD
  2. Watin as you mentioned for browser involved testing
  3. Moq as the mocking framework for tests
  4. Visual Studio unit tests for testing environment
  5. 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.
Sign up to request clarification or add additional context in comments.

3 Comments

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.
He may also want a QUnit test-suite for his client-side javascript.
@kseen no. it's a set of unit tests written in javascript running directly in your browser. Like such
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

2 Comments

Thanks for your response! What is GUI testing tool you mean?
Check out this thread on SO for some GUI testing suggestions stackoverflow.com/questions/805910/automated-web-ui-testing

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.