Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Easy Mock on settter?

Options
  • 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