Package org.easymock.tests

Examples of org.easymock.tests.IMethods.simpleMethod()


    public void callbackGetsArgumentsEvenIfAMockCallsAnother() {

        final StringBuilder buffer = new StringBuilder();

        final IMethods mock2 = createStrictMock(IMethods.class);
        mock2.simpleMethod();
        expectLastCall().andAnswer(new IAnswer<Object>() {
            public Object answer() {
                // empty, only needed to force deletion of arguments
                return null;
            }
View Full Code Here


        }).times(2);

        mock.simpleMethodWithArgument((String) notNull());
        expectLastCall().andAnswer(new IAnswer<Object>() {
            public Object answer() {
                mock2.simpleMethod();
                buffer.append((String) getCurrentArguments()[0]);
                return null;
            }
        }).times(2);
View Full Code Here

*/
public class NameTest {
    @Test
    public void nameForMock() {
        final IMethods mock = createMock("mock", IMethods.class);
        mock.simpleMethod();
        replay(mock);
        try {
            verify(mock);
        } catch (final AssertionError expected) {
            final String actualMessage = expected.getMessage();
View Full Code Here

    }

    @Test
    public void nameForStrictMock() {
        final IMethods mock = createStrictMock("mock", IMethods.class);
        mock.simpleMethod();
        replay(mock);
        try {
            verify(mock);
        } catch (final AssertionError expected) {
            final String actualMessage = expected.getMessage();
View Full Code Here

    }

    @Test
    public void nameForNiceMock() {
        final IMethods mock = createNiceMock("mock", IMethods.class);
        mock.simpleMethod();
        replay(mock);
        try {
            verify(mock);
        } catch (final AssertionError expected) {
            final String actualMessage = expected.getMessage();
View Full Code Here

    @Test
    public void nameForMocksControl() {
        final IMocksControl control = createControl();
        final IMethods mock = control.createMock("mock", IMethods.class);
        mock.simpleMethod();
        replay(mock);
        try {
            verify(mock);
        } catch (final AssertionError expected) {
            final String actualMessage = expected.getMessage();
View Full Code Here

        replay(mock);

        mock.oneArg(true);

        try {
            mock.simpleMethod();
        } catch (final AssertionError error) {
        }

        mock.oneArg(true);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.