public void OnStopAuthorityCallsComponentsAndCatchesExceptions() { // add component UnityAction func = Substitute.For <UnityAction>(); identity.OnStopAuthority.AddListener(func); func .When(f => f.Invoke()) .Do(f => { throw new Exception("Some exception"); }); // make sure exceptions are not swallowed Assert.Throws <Exception>(() => { identity.StopAuthority(); }); func.Received(1).Invoke(); }