CodeSandwich / Mocktopus

Mocking framework for Rust
MIT License
233 stars 20 forks source link

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

Open kungfucop opened 4 years ago

kungfucop commented 4 years ago

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!

strottos commented 3 years ago

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.

gregdhill commented 3 years ago

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