Beispiel #1
0
 /// <summary>
 ///     Called when an event handler is being removed from the mocked event.
 ///     This implementation will select the alternative branch if the remove condition evaluates to <c>true</c>.
 /// </summary>
 /// <param name="mockInfo">Information about the mock through which the event handler is being removed.</param>
 /// <param name="value">The event handler that is being removed.</param>
 public override void Remove(IMockInfo mockInfo, THandler?value)
 {
     if (_removeCondition?.Invoke(value) ?? false)
     {
         IfBranch.Remove(mockInfo, value);
     }
     else
     {
         base.Remove(mockInfo, value);
     }
 }
Beispiel #2
0
 /// <summary>
 ///     Called when an event handler is being removed from the mocked event. This implementation redirects the call onto
 ///     the alternative branch.
 /// </summary>
 /// <param name="mockInfo">Information about the mock through which the event handler is being removed.</param>
 /// <param name="value">The event handler that is being removed.</param>
 public override void Remove(IMockInfo mockInfo, THandler?value)
 {
     IfBranch.Remove(mockInfo, value);
 }