Beispiel #1
0
        public MethodAdornments Handle(Expression <Action <T> > expression, Delegate handler, uint expectedCallCount)
        {
            this.Namespaces.Add(handler.GetType().Namespace);
            var methodCall = ((MethodCallExpression)expression.Body);
            var method     = methodCall.Method;

            method.AddNamespaces(this.Namespaces);

            var info = new HandlerInformation(handler, expectedCallCount, methodCall.GetArgumentExpectations());

            this.Handlers.AddOrUpdate(method.MetadataToken,
                                      () => new List <HandlerInformation> {
                info
            }, _ => _.Add(info));
            return(new MethodAdornments(info));
        }
 public MethodAdornments(HandlerInformation handler) => this.Handler = handler;
Beispiel #3
0
		public MethodAdornments(HandlerInformation handler)
		{
			this.handler = handler;
		}