This commit is contained in:
Ilkka Seppälä
2019-12-13 21:09:28 +02:00
parent 0335c61512
commit b2b1ba95eb
127 changed files with 282 additions and 450 deletions

View File

@ -5,8 +5,7 @@ folder: object-mother
permalink: /patterns/object-mother/
categories: Creational
tags:
- Java
- Difficulty-Beginner
- Instantiation
---
## Object Mother
@ -19,13 +18,11 @@ Define a factory of immutable content with separated builder and factory interfa
Use the Object Mother pattern when
* You want consistent objects over several tests
* you want to reduce code for creation of objects in tests
* every test should run with fresh data
* You want to reduce code for creation of objects in tests
* Every test should run with fresh data
## Credits
* [Answer by David Brown](http://stackoverflow.com/questions/923319/what-is-an-objectmother) to the stackoverflow question: [What is an ObjectMother?](http://stackoverflow.com/questions/923319/what-is-an-objectmother)
* [c2wiki - Object Mother](http://c2.com/cgi/wiki?ObjectMother)
* [Nat Pryce - Test Data Builders: an alternative to the Object Mother pattern](http://www.natpryce.com/articles/000714.html)