Skip to content

An example java project created for my blog post "A first approach to contract test"

License

Notifications You must be signed in to change notification settings

chicio/Contract-Tests

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Contract Tests

Build Status GitHub license

An example java project created for my blog post "A first approach to contract test".

Description

The app contains and example of how much powerful are contract test and how they can help you to avoid duplication while writing your unit tests. Below an article quote:

Sometimes you have to unit test multiple implementations of the same interface. So basically you have the same tests for multiple concrete implementation of the same interface. In a case like this one, contract test could help you save a lot of time. Using contract test you will be able to run the same set of test for different concrete implementations. How does it work? The main point is to have a template base abstract "ContractTest" test class that incapsulate the logic of the tests using abstract methods that use the base interface of the objects under test. These abstract methods will be implmented in the subclasses of this "ContractTest" class and they will feed the test with a concrete implementation of the interface used in the declaration of the abstract methods.

Click here to read the post.

About

An example java project created for my blog post "A first approach to contract test"

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages