Пример #1
0
        /// <inheritdoc/>
        public override object CreateFake(Type interfaceType, params object[] args)
        {
            var stub = MockRepository.GenerateMock(interfaceType, new Type[0], args);

            RhinoPropertyBehavior.RegisterPropertyBehavior((IMockedObject)stub);
            stub.Replay();
            return(stub);
        }
        /// <inheritdoc/>
        protected override IQueryOptions <TReturnValue> OnSetUpQueryBehaviorFor <TDependency, TReturnValue>(
            TDependency fake,
            Expression <Func <TDependency, TReturnValue> > func)
        {
            if (IsPropertyAccess(func))
            {
                RhinoPropertyBehavior.RemovePropertyBehavior(fake);
            }

            return(new RhinoQueryOptions <TReturnValue>(fake.Stub(f => func.Compile()(f))));
        }