Skip to content

Object Mother pattern #498 #503

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Nov 26, 2016
Merged

Object Mother pattern #498 #503

merged 7 commits into from
Nov 26, 2016

Conversation

igeligel
Copy link
Contributor

@igeligel igeligel commented Oct 6, 2016

Added the object mother pattern and all diagrams to the context.

Add a simple king and queen classes which implement the behaviour of the
royalty interface. Also wrote the object mother of royalty objects which
is final so you can just call the static methods in it to create objects
with a specific state to use them fast in tests. The tests are already
created for testing the behaviour and the type of the objects which are
created by the object mother.
I also created the UML diagrams via object aid and updated the readme.
@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) to 84.331% when pulling 863ea75 on igeligel:master into 4ca205c on iluwatar:master.

@iluwatar
Copy link
Owner

The object-mother module has not been added to the parent pom.xml.


@Test
public void queenIsBlockingFlirtCauseDrunkKing() {
King soberUnhappyKing = RoyaltyObjectMother.createDrunkKing();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confusing naming here


@Test
public void queenIsBlockingFlirt() {
King soberUnhappyKing = RoyaltyObjectMother.createHappyKing();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confusing naming here


@Test
public void successfullKingFlirt() {
King soberUnhappyKing = RoyaltyObjectMother.createHappyKing();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confusing naming here

Copy link
Owner

@iluwatar iluwatar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@igeligel you have my review comments. Just a couple of minor mistakes found. Please fix them and the pattern is ready for merging.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.008%) to 83.382% when pulling 6aed26e on igeligel:master into 19cb715 on iluwatar:master.

@iluwatar
Copy link
Owner

@igeligel is this ready for another review?

@igeligel
Copy link
Contributor Author

Yeah, i have messed up the pom.xml at some commit but fixed it then. I also renamed the code parts where you wanted a change.

@iluwatar iluwatar merged commit cc02ff4 into iluwatar:master Nov 26, 2016
@iluwatar
Copy link
Owner

Looks good @igeligel. Thanks for the contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants