-
Notifications
You must be signed in to change notification settings - Fork 19
Accessing methods
stephanenicolas edited this page Sep 12, 2013
·
1 revision
BoundBox provides access to all methods defined in a given class.
Let's say we have a class A like :
@SuppressWarnings("unused")
public class A {
private String foo() {
return "a";
}
}
With BoundBox, you can write a test that accesses methods of A :
public class ATest {
@BoundBox( boundClass = A.class )
private BoundBoxOfA boundBoxOfA;
@Before
public void setUp() {
boundBoxOfA = new BoundBoxOfA( new A() );
}
@Test
public void testFoo() {
//GIVEN
//WHEN
//THEN
assertEquals( "a", boundBoxOfA.foo());
}
}
For all methods defined in a class A, its BoundBox will contain the same method with the same list of parameters.