net.sf.molae.pipe.test
Class S1BinaryFunctionTest<B extends BinaryFunction<S,S,S>,S>

java.lang.Object
  extended by org.junit.Assert
      extended by net.sf.molae.pipe.test.ObjectTest<B>
          extended by net.sf.molae.pipe.test.BinaryFunctionTest<B,S,S,T>
              extended by net.sf.molae.pipe.test.S2BinaryFunctionTest<B,S,S>
                  extended by 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.


Constructor Summary
S1BinaryFunctionTest(B testObject)
          Creates a new test with the specified candidate.
 
Method Summary
static
<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.
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 net.sf.molae.pipe.test.S2BinaryFunctionTest
getInstance, testProperties, testProperties
 
Methods inherited from class net.sf.molae.pipe.test.BinaryFunctionTest
assertConsistency, getInstance, testWith, testWith
 
Methods inherited from class net.sf.molae.pipe.test.ObjectTest
assertFalse, assertTestValuesSet, getTestObject, setTestValuesSet, toString
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

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.
Method Detail

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 function
arg2 - a valid left and right argument to the underlying binary function
arg3 - a valid left and right argument to the underlying binary function
Throws:
AssertionFailedError - if the BinaryFunction contract is broken by the test object.