By Roy Osherove
The artwork of Unit trying out, moment Edition publications you step-by-step from writing your first uncomplicated assessments to constructing powerful try units which are maintainable, readable, and reliable. You'll grasp the foundational principles and quick stream to high-value matters like mocks, stubs, and isolation, together with frameworks similar to Moq, FakeItEasy, and Typemock Isolator. You'll discover attempt styles and association, operating with legacy code, or even "untestable" code. alongside the way in which, you'll know about integration trying out and methods and instruments for checking out databases and different technologies.
About this Book
You be aware of try to be unit checking out, so why aren't you doing it? If you're new to unit trying out, in the event you locate unit checking out tedious, or if you're simply no longer getting sufficient payoff for the trouble you place into it, preserve reading.
The artwork of Unit checking out, moment Edition publications you step-by-step from writing your first easy unit assessments to development entire try out units which are maintainable, readable, and reliable. You'll stream speedy to extra advanced matters like mocks and stubs, whereas studying to take advantage of isolation (mocking) frameworks like Moq, FakeItEasy, and Typemock Isolator. You'll discover attempt styles and association, refactor code purposes, and easy methods to try out "untestable" code. alongside the best way, you'll know about integration trying out and methods for trying out with databases.
The examples within the booklet use C#, yet will gain an individual utilizing a statically typed language resembling Java or C++.
• Create readable, maintainable, reliable tests
• Fakes, stubs, mock items, and isolation (mocking) frameworks
• easy dependency injection techniques
• Refactoring legacy code
About the Author
Roy Osherove has been coding for over 15 years, and he consults and trains groups around the globe at the mild paintings of unit checking out and test-driven improvement. His web publication is at ArtOfUnitTesting.com.
Table of Contents
PART 1: GETTING STARTED
1. the fundamentals of unit testing
2. a primary unit test
PART 2: middle TECHNIQUES
3. utilizing stubs to damage dependencies
4. interplay checking out utilizing mock objects
5. Isolation (mocking) frameworks
6. Digging deeper into isolation frameworks
PART three: THE attempt CODE
7. try hierarchies and organization
8. The pillars of excellent unit tests
PART four: layout AND PROCESS
9. Integrating unit checking out into the organization
10. operating with legacy code
11. layout and testability