Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Easy Mock on settter?

  • 08-02-2012 10:06PM
    #1
    Closed Accounts Posts: 638 ✭✭✭


    Guys,

    I think im missing something obvious here for the last few hours.

    Im using easy mock to mock out some objects for a unit test, and I cant seem to get it to expect a void return type method call.

    pseudo code is as:
    mock = createMock(mock.class);
    mockB = createMock(mockB.class);
    mock.setMockB(mockB);

    expect(mock.getAbc(something)).return(5);

    expect(mockB.setSomething());

    replay()

    do stuff

    verify();

    The expect(mockB.setSomething()) statement is giving a compile time error.
    How do i tell easy mock to expect a void method to be called so i can replay/dostuff/then verify it was called.

    Google seems to skip over it so im obviously missing something so obvious that its not asked...ever! :$


Comments

Advertisement