import com.yoyoyo666.mock.*;
public class MyLibraryTest {
private MyLibrary myLibrary;
@Mock
private DependencyObject dependency;
@Before
public void setUp() {
YMock.initAnnotations(this);
myLibrary = new MyLibrary(dependency);
}
@Test
public void testLibraryMethod() {
YMock.when(dependency.calculate(5)).thenReturn(10);
int result = myLibrary.libraryMethod(5);
assertEquals(10, result);
YMock.verify(dependency).calculate(5);
}
}