|
|
|
Copyright
|
|
|
|
Preface
|
|
|
|
|
Audience
|
|
|
|
|
Contents of This Book
|
|
|
|
|
Conventions Used in This Book
|
|
|
|
|
Using Code Examples
|
|
|
|
|
How to Contact Us
|
|
|
|
|
Acknowledgments
|
|
|
|
Chapter 1. Unit Test Frameworks: An Overview
|
|
|
|
|
Section 1.1. Test Driven Development
|
|
|
|
|
Section 1.2. Unit Testing and Quality Assurance
|
|
|
|
|
Section 1.3. Homegrown Unit Testing
|
|
|
|
Chapter 2. Getting Started: Tutorial
|
|
|
|
|
Section 2.1. Outline of an Application: the Virtual Library
|
|
|
|
|
Section 2.2. Example 1: Create a Book
|
|
|
|
|
Section 2.3. Example 2: Create a Library
|
|
|
|
Chapter 3. The xUnit Family of Unit Test Frameworks
|
|
|
|
|
Section 3.1. xUnit Family Members
|
|
|
|
|
Section 3.2. xUnit Extensions
|
|
|
|
|
Section 3.3. The xUnit Architecture
|
|
|
|
|
Section 3.4. xUnit Architecture Summary
|
|
|
|
Chapter 4. Writing Unit Tests
|
|
|
|
|
Section 4.1. Types of Asserts
|
|
|
|
|
Section 4.2. Defining Custom Asserts
|
|
|
|
|
Section 4.3. Single Condition Tests
|
|
|
|
|
Section 4.4. Testing Expected Errors
|
|
|
|
|
Section 4.5. (Not) Testing Get/Set Methods
|
|
|
|
|
Section 4.6. Testing Protected Behavior
|
|
|
|
|
Section 4.7. Test Code Organization
|
|
|
|
|
Section 4.8. Mock Objects
|
|
|
|
|
Section 4.9. AbstractTest
|
|
|
|
|
Section 4.10. Performance Tests
|
|
|
|
|
Section 4.11. New Library and Book Code
|
|
|
|
Chapter 5. Unit Testing GUI Applications
|
|
|
|
|
Section 5.1. Library GUI
|
|
|
|
Chapter 6. JUnit
|
|
|
|
|
Section 6.1. Overview
|
|
|
|
|
Section 6.2. Architecture
|
|
|
|
|
Section 6.3. Usage
|
|
|
|
|
Section 6.4. Test Assert Methods
|
|
|
|
Chapter 7. CppUnit
|
|
|
|
|
Section 7.1. Overview
|
|
|
|
|
Section 7.2. Architecture
|
|
|
|
|
Section 7.3. Usage
|
|
|
|
|
Section 7.4. Test Assert Methods
|
|
|
|
Chapter 8. NUnit
|
|
|
|
|
Section 8.1. Overview
|
|
|
|
|
Section 8.2. Architecture
|
|
|
|
|
Section 8.3. Usage
|
|
|
|
|
Section 8.4. Test Assert Methods
|
|
|
|
Chapter 9. PyUnit
|
|
|
|
|
Section 9.1. Overview
|
|
|
|
|
Section 9.2. Architecture
|
|
|
|
|
Section 9.3. Usage
|
|
|
|
|
Section 9.4. Test Assert Methods
|
|
|
|
Chapter 10. XMLUnit
|
|
|
|
|
Section 10.1. Overview
|
|
|
|
|
Section 10.2. Architecture
|
|
|
|
|
Section 10.3. Usage
|
|
|
|
|
Section 10.4. Test Assert Methods
|
|
|
|
Chapter 11. Resources
|
|
|
|
|
Section 11.1. Web Sites
|
|
|
|
|
Section 11.2. Discussion Groups
|
|
|
|
|
Section 11.3. Books
|
|
|
|
Appendix A. Simple C++ Unit Test Framework
|
|
|
|
|
Section A.1. Example 1: Create a Book
|
|
|
|
|
Section A.2. Example 2: Create a Library
|
|
|
|
Appendix B. JUnit Class Reference
|
|
|
|
|
Assert
|
|
|
|
|
AssertionFailedError
|
|
|
|
|
ComparisonFailure
|
|
|
|
|
Protectable
|
|
|
|
|
Test
|
|
|
|
|
TestCase
|
|
|
|
|
TestFailure
|
|
|
|
|
TestListener
|
|
|
|
|
TestResult
|
|
|
|
|
TestSuite
|
|
|
|
Appendix C. CppUnit Class Reference
|
|
|
|
|
assertion_traits
|
|
|
|
|
AutoRegisterSuite
|
|
|
|
|
CompilerOutputter
|
|
|
|
|
Exception
|
|
|
|
|
Exception::Type
|
|
|
|
|
ExpectedExceptionTraits
|
|
|
|
|
NamedRegistries
|
|
|
|
|
NotEqualException
|
|
|
|
|
Orthodox
|
|
|
|
|
Outputter
|
|
|
|
|
RepeatedTest
|
|
|
|
|
SourceLine
|
|
|
|
|
SynchronizedObject
|
|
|
|
|
SynchronizedObject::ExclusiveZone
|
|
|
|
|
SynchronizedObject::SynchronizationObject
|
|
|
|
|
Test
|
|
|
|
|
TestCaller
|
|
|
|
|
TestCase
|
|
|
|
|
TestDecorator
|
|
|
|
|
TestFactory
|
|
|
|
|
TestFactoryRegistry
|
|
|
|
|
TestFailure
|
|
|
|
|
TestFixture
|
|
|
|
|
TestFixtureFactory
|
|
|
|
|
TestListener
|
|
|
|
|
TestResult
|
|
|
|
|
TestResultCollector
|
|
|
|
|
TestRunner
|
|
|
|
|
TestSetUp
|
|
|
|
|
TestSucessListener
|
|
|
|
|
TestSuite
|
|
|
|
|
TestSuiteBuilder
|
|
|
|
|
TestSuiteFactory
|
|
|
|
|
TextOutputter
|
|
|
|
|
TextTestProgressListener
|
|
|
|
|
TextTestResult
|
|
|
|
|
XmlOutputter
|
|
|
|
|
XmlOutputter::Node
|
|
|
|
Colophon
|
|
|
|
Index
|