private IEnumerable<object[]> FillFromFixture(MethodInfo method)
        {
            var fixture = new Fixture();

            fixture.Customize(new StructureMapCustomization());

            yield return GetParameterData(method.GetParameters(), fixture);
        }
示例#2
0
        private IEnumerable <object[]> FillFromFixture(MethodInfo method)
        {
            var fixture = new Fixture();

            fixture.Customize(new StructureMapCustomization());

            yield return(GetParameterData(method.GetParameters(), fixture));
        }
示例#3
0
        public void Execute(Fixture context, Action next)
        {
            var registry = new Ploeh.AutoFixture.Fixture().Customize(new AutoNSubstituteCustomization());

            Func <int> randomValue = () =>
            {
                var rand = new Random((int)DateTime.Now.Ticks);
                return(rand.Next(40, 100));
            };

            registry.Customize <Customer>(x => x.With(p => p.Age, randomValue.Invoke()));

            context.TryField("Registry", registry);

            next();
        }
        public void Execute(Fixture context, Action next)
        {
            var registry = new Ploeh.AutoFixture.Fixture().Customize(new AutoNSubstituteCustomization());

            Func<int> randomValue = () =>
            {
                var rand = new Random((int)DateTime.Now.Ticks);
                return rand.Next(40, 100);
            };

            registry.Customize<Customer>(x => x.With(p => p.Age, randomValue.Invoke()));

            context.TryField("Registry", registry);

            next();
        }