Ejemplo n.º 1
0
 public void Assert(MethodBase method, params object[] args)
 {
     ProfilerInterceptor.GuardInternal(() =>
     {
         var message = MockingUtil.GetAssertionMessage(args);
         MockingContext.CurrentRepository.AssertMethodInfo(message, null, method, args, null);
     });
 }
Ejemplo n.º 2
0
 public void Assert(object target, MethodInfo method, Occurs occurs, params object[] args)
 {
     ProfilerInterceptor.GuardInternal(() =>
     {
         var message = MockingUtil.GetAssertionMessage(args);
         MockingContext.CurrentRepository.AssertMethodInfo(message, target, method, args, occurs);
     });
 }
Ejemplo n.º 3
0
 void INonPublicExpectation.Assert <TReturn>(Type targetType, string memberName, params object[] args)
 {
     ProfilerInterceptor.GuardInternal(() =>
     {
         var message = MockingUtil.GetAssertionMessage(args);
         var method  = MockingUtil.GetMethodByName(targetType, typeof(TReturn), memberName, ref args);
         MockingContext.CurrentRepository.AssertMethodInfo(message, null, method, args, null);
     });
 }
Ejemplo n.º 4
0
 public void Assert(Type targetType, string memberName, Occurs occurs, params object[] args)
 {
     ProfilerInterceptor.GuardInternal(() =>
     {
         var message = MockingUtil.GetAssertionMessage(args);
         var method  = MockingUtil.GetMethodByName(targetType, typeof(void), memberName, ref args);
         MockingContext.CurrentRepository.AssertMethodInfo(message, null, method, args, occurs);
     });
 }
Ejemplo n.º 5
0
        public void Assert <T, TRefReturn>(string memberName, Occurs occurs, params object[] args)
        {
            ProfilerInterceptor.GuardInternal(() =>
            {
                var returnType = typeof(TRefReturn).MakeByRefType();
                var method     = MockingUtil.GetMethodByName(typeof(T), returnType, memberName, ref args);

                var message = MockingUtil.GetAssertionMessage(args);
                MockingContext.CurrentRepository.AssertMethodInfo(message, null, method, args, occurs);
            });
        }
Ejemplo n.º 6
0
        public void Assert(object target, string memberName, Occurs occurs, params object[] args)
        {
            ProfilerInterceptor.GuardInternal(() =>
            {
                var type  = target.GetType();
                var mixin = MocksRepository.GetMockMixin(target, null);
                if (mixin != null)
                {
                    type = mixin.DeclaringType;
                }

                var message = MockingUtil.GetAssertionMessage(args);
                var method  = MockingUtil.GetMethodByName(type, typeof(void), memberName, ref args);
                MockingContext.CurrentRepository.AssertMethodInfo(message, target, method, args, occurs);
            });
        }