@TestInterface(value=ch.powerunit.bifunction.impl.BiFunctionTesterImpl.class) public final class BiFunctionTester<T,U,R> extends Object
| Modifier and Type | Method and Description |
|---|---|
List<Supplier<T>> |
getInput1()
Used by the framework.
|
List<Supplier<U>> |
getInput2()
Used by the framework.
|
List<Supplier<String>> |
getName()
Used by the framework.
|
List<Supplier<Matcher<? super R>>> |
getResult()
Used by the framework.
|
BiFunction<T,U,R> |
getUnderTest()
Used by the framework.
|
static <T,U,R> BiFunctionTesterStartDSL<T,U,R> |
of(BiFunction<T,U,R> bifunctionUnderTest)
Start the creation of a tester of function.
|
public static <T,U,R> BiFunctionTesterStartDSL<T,U,R> of(BiFunction<T,U,R> bifunctionUnderTest)
For example :
@TestDelegate
public final BiFunctionTester<Short, Integer, Long> tester1 = BiFunctionTester
.of(this::bifunctionToBeTested).passingAsParameter((short) 1, 2)
.thenExpectingResult(3l).testNamed("tested")
.passingAsParameter((short) 2, 4).thenExpectingResult(6l).build();
T - the first input argument typeU - the second input argument typeR - the result typebifunctionUnderTest - the function to be testedthe DSLNullPointerException - when bifunctionUnderTest is nullTestDelegatepublic BiFunction<T,U,R> getUnderTest()
public List<Supplier<Matcher<? super R>>> getResult()
Copyright © 2015 Powerunit. All rights reserved.