Ejemplo n.º 1
0
 /// <summary>
 ///     Called when a value is written to the indexer.
 ///     This implementation will select the alternative branch if the set condition evaluates to <c>true</c>.
 /// </summary>
 /// <param name="mockInfo">Information about the mock through which the value is written.</param>
 /// <param name="key">The indexer key used.</param>
 /// <param name="value">The value being written.</param>
 public override void Set(IMockInfo mockInfo, TKey key, TValue value)
 {
     if (_setCondition?.Invoke(mockInfo.MockInstance, key, value) ?? false)
     {
         IfBranch.Set(mockInfo, key, value);
     }
     else
     {
         base.Set(mockInfo, key, value);
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 ///     Called when a value is written to the indexer, and redirects the call onto the if branch.
 /// </summary>
 /// <param name="mockInfo">Information about the mock through which the value is written.</param>
 /// <param name="key">The indexer key used.</param>
 /// <param name="value">The value being written.</param>
 public override void Set(IMockInfo mockInfo, TKey key, TValue value)
 {
     IfBranch.Set(mockInfo, key, value);
 }