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

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,T>
Direct Known Subclasses:
S1BinaryFunctionTest

public class S2BinaryFunctionTest<B extends BinaryFunction<S,S,T>,S,T>
extends BinaryFunctionTest<B,S,S,T>

Test methods to check the contract of BinaryFunction implementing classes where both operands have the same type.


Constructor Summary
S2BinaryFunctionTest(B testObject)
          Creates a new test with the specified candidate.
 
Method Summary
static
<S,T> S2BinaryFunctionTest<BinaryFunction<S,S,T>,S,T>
getInstance(BinaryFunction<S,S,T> testObject)
          Creates a new instance of this class with the specified testObject as test object.
 void testProperties(S arg1, S arg2)
          Performs various tests using the specified objects as arguments to the compute function of the tested binary function.
 void testProperties(S arg1, S arg2, S arg3)
          Performs various tests using the specified objects as arguments to the compute function of the tested binary function.
 
Methods inherited from class net.sf.molae.pipe.test.BinaryFunctionTest
assertConsistency, getInstance, testWith, 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

S2BinaryFunctionTest

public S2BinaryFunctionTest(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,T> S2BinaryFunctionTest<BinaryFunction<S,S,T>,S,T> getInstance(BinaryFunction<S,S,T> 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.

testProperties

public void testProperties(S arg1,
                           S arg2)
Performs various tests using the specified objects as arguments to the compute function of the tested binary function.

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
Throws:
AssertionFailedError - if the BinaryFunction contract is broken by the test object.

testProperties

public void testProperties(S arg1,
                           S arg2,
                           S arg3)
Performs various tests using the specified objects as arguments to the compute function of the tested binary function.

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.