예제 #1
0
 /// <summary>
 /// Adds a behavior to a mock.
 /// </summary>
 public static IMock AddBehavior(this IMock mock, InvokeBehavior behavior, string name = null)
 {
     mock.BehaviorFor(MockSetup.Current).Behaviors.Add(new InvocationBehavior(behavior, name));
     return(mock);
 }
예제 #2
0
 /// <summary>
 /// Inserts a behavior into the mock behavior pipeline at the specified
 /// index.
 /// </summary>
 public static IMock InsertBehavior(this IMock mock, int index, InvokeBehavior behavior, string name = null)
 {
     mock.BehaviorFor(MockSetup.Current).Behaviors.Insert(index, new InvocationBehavior(behavior, name));
     return(mock);
 }
예제 #3
0
 public IMockBehavior BehaviorFor(IMockSetup setup) => mock.BehaviorFor(setup);