Mimic NSWorkspaceWillSleepNotification for testing purposes

Hi, I am new to MAC development and not sure if this is possible at all, but I would like to test how my app reacts to NSWorkspaceWillSleepNotification and NSWorkspaceDidWakeNotification events. So I want to setup googletest which will:

  1. initialize my own stuff
  2. from another thread send an event to my tested code that will make it "think" system will go to sleep
  3. perform "OnSleep" logic
  4. after some time, from another thread, mimic wake event
  5. detect in tested code I am awaken and check if my code works ok

Additionally, if there are multiple handlers registered to sleep/wake events - did they all get executed (I guess - yes) and in which order (in order of registration)?

Many thanks in advance