net.sf.molae.pipe.test
Class S1BinaryFunctionTest<B extends BinaryFunction<S,S,S>,S>
java.lang.Object
org.junit.Assert
net.sf.molae.pipe.test.ObjectTest<B>
net.sf.molae.pipe.test.BinaryFunctionTest<B,S,S,T>
net.sf.molae.pipe.test.S2BinaryFunctionTest<B,S,S>
net.sf.molae.pipe.test.S1BinaryFunctionTest<B,S>
public class S1BinaryFunctionTest<B extends BinaryFunction<S,S,S>,S>
- extends S2BinaryFunctionTest<B,S,S>
Test methods to check the contract of BinaryFunction
implementing classes where both operands have the same type.
Method Summary |
static
|
getInstance(BinaryFunction<S,S,S> testObject)
Creates a new instance of this class with the specified testObject
as test object. |
protected void |
testWith(S arg1,
S arg2,
S arg3)
Tests associativity using the specified objects as arguments
to the compute function of the tested binary function. |
Methods inherited from class org.junit.Assert |
assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertThat, assertThat, assertTrue, assertTrue, fail, fail |
S1BinaryFunctionTest
public S1BinaryFunctionTest(B testObject)
- Creates a new test with the specified candidate.
- Parameters:
testObject
- the candidate of the test
- Throws:
NullPointerException
- if the specified test objects is
null
.
getInstance
public static final <S> S1BinaryFunctionTest<BinaryFunction<S,S,S>,S> getInstance(BinaryFunction<S,S,S> testObject)
- Creates a new instance of this class with the specified testObject
as test object.
- Parameters:
testObject
- the candidate of the test
- Returns:
- an instance of this class with the specified testObject
as test object.
- Throws:
NullPointerException
- if the specified test objects is
null
.
testWith
protected void testWith(S arg1,
S arg2,
S arg3)
- Tests associativity using the specified objects as arguments
to the compute function of the tested binary function.
- Overrides:
testWith
in class BinaryFunctionTest<B extends BinaryFunction<S,S,S>,S,S,S>
- Parameters:
arg1
- a valid left and right argument to the underlying binary
functionarg2
- a valid left and right argument to the underlying binary
functionarg3
- a valid left and right argument to the underlying binary
function
- Throws:
AssertionFailedError
- if the BinaryFunction
contract is broken by the test object.