Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

diffblue/ExampleTestFactory

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Example of how to use test factories to increase coverage

Compile project with mvn clean install

Focus on the Opportunity class. The other class are simple constructors

Lets start by generating tests OOTB by running the command dcover create com.example.FactoryExample.Opportunity

Note in the creation summary the following outputs:

No tests created for: 12 methods

INFO 8 R013: No inputs found that don't throw a trivial exception

INFO 4 R081: Exception in arrange section

Uncomment the createOpportunity method in OpportunityTestUtil within the src/test directory Re-run dcover create com.example.FactoryExample.Opportunity

Note how new tests have been unlocked, coverage has increased and now the DiffblueTests use the factory methods.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.