Skip to content

ayeseeem/icm-jtest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Code Status

Replacement

This code is OBSOLETE. You should use ayeseeem/icm-bits-java instead, which is the same code, but with extra features and in different Java packages. This repository is liable to be deleted.

The name jtest unfortunately - and unintentionally - made it look as though this was related to Parasoft's Jtest.

icm-jtest

Build Status

Java test utilities from ayeseeem.org.

@ContainedItem for better ifs

Allows clearer, more expressive if statements testing whether an item is in a group of items. Which of these do you prefer? Which expresses more clearly and directly what is being asked?:

if (the(month).isOneOf(SEPTEMBER, OCTOBER, NOVEMBER, DECEMBER) {
    // it's name derives from its Latin ordinal in the Roman calendar
}

if (Arrays.asList(SEPTEMBER, OCTOBER, NOVEMBER, DECEMBER).contains(month)) {
    // ...
}
if (the(month).isIn(myFavouriteMonths) {
    // ...
}

if (myFavouriteMonths.contains(month)) {
    // ...
}

Works for a Collection, an array of objects, or individual items listed directly (using varargs). See ContainedItem.java and ContainedItemExamplesTest.java for more details.

@Characterization annotation for JUnit @Tests

Marks unit tests (whole test classes, or individual test methods) as characterization tests. That is, tests that characterize (capture, or describe, or document) the behaviour of the code, but without necessarily specifying the behaviour. For example,

 @Characterization
 @Test
 public void testDefaultResponseIsNull() {
     // ...
 }

See Characterization.java for more details.

About

Java test utilities from ayeseeem.org. OBSOLETE: use https://github.com/ayeseeem/icm-bits-java instead.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages