Exemplo n.º 1
0
        public IFakeUpConfig <TFakeObject> With(Func <IObjectCreationContext, TMetaMember> func)
        {
            var relativeMemberInfo = new FillerRelativeMemberInfo(
                (ctx) => func(ctx),
                this.memberExpr.ToCallChain(),
                typeof(TMember),
                typeof(TMetaMember)
                );

            this.config.RelativeTypeFillers.Add(relativeMemberInfo);
            return(this.config);
        }
Exemplo n.º 2
0
        public IFakeUpConfig <TFakeObject> With(Action <IFakeUpConfig <TMetaMember> > configOverride)
        {
            var relativeMemberInfo = new FillerRelativeMemberInfo(
                (_) => FakeUp.NewObject(configOverride),
                this.memberExpr.ToCallChain(),
                typeof(TMember),
                typeof(TMetaMember)
                );

            this.config.RelativeTypeFillers.Add(relativeMemberInfo);
            return(this.config);
        }
Exemplo n.º 3
0
        public IFakeUpConfig <TFakeObject> With(TMetaMember constant)
        {
            var relativeMemberInfo = new FillerRelativeMemberInfo(
                (_) => constant,
                this.memberExpr.ToCallChain(),
                typeof(TMember),
                typeof(TMetaMember)
                );

            this.config.RelativeTypeFillers.Add(relativeMemberInfo);
            return(this.config);
        }