Mocktopus icon indicating copy to clipboard operation
Mocktopus copied to clipboard

Request feature to verify mock is called by exact number of times and in certain sequence?

Open kungfucop opened this issue 4 years ago • 2 comments

Hi, for function to test like following:

fn handle_response(response:Response) {
  save_db(response.get_users());
  let unread_count = read_unread_from_db();
  send_push_notification(unread_count);
}

I'd like to make sure send_push_notification did get called with the desired count in the unit test. How could I do this?

Thanks a lot!

kungfucop avatar Apr 28 '20 08:04 kungfucop

I would very much like to see this also. Mocktopus is great at preventing some things having to be called but it would be v nice to be able to verify the calls being made to the functions.

strottos avatar Mar 01 '21 15:03 strottos

Please see the discussion in #33, recommendations / contributions would be appreciated!

gregdhill avatar Apr 02 '21 12:04 gregdhill