Exemple #1
0
        static T Create <T>(Func <object, MockInvocationInterceptor, T> factoryFunc, ExpectationScope expectationScope)
        {
            var mock = new Mock(MockName <T> .GetUniqueInScope(expectationScope));

            lock (factory)
            {
                return(factoryFunc(mock, new MockInvocationInterceptor(expectationScope)));
            }
        }
Exemple #2
0
 public static T Delegate <T>(ExpectationScope expectationScope)
 {
     return(Create <T>(factory.CreateDelegateProxy <T>, expectationScope));
 }
Exemple #3
0
 public static T Interface <T>(ExpectationScope expectationScope)
 {
     return(Create <T>(factory.CreateInterfaceProxy <T>, expectationScope));
 }
 public static void IsMetFor(ExpectationScope expectationScope)
 {
     AssertInvocationsWasMade.MatchingExpectationsFor(expectationScope);
 }
Exemple #5
0
 public static void MatchingExpectationsFor(ExpectationScope expectationScope)
 {
     AssertExpectationScopeIsMet(expectationScope);
 }
 public OrderedChildScope(ExpectationScope parent) : base(parent)
 {
 }
 protected ChildScope(ExpectationScope parent)
 {
     this.parent          = parent;
     this.expectationList = new List <IExpectation>();
 }