public void SetUp()
 {
     var builderSetup = new BuilderSettings();
     reflectionUtil = Substitute.For<IReflectionUtil>();
     generator = Substitute.For<IRandomGenerator>();
     propertyNamer = new RandomValuePropertyNamer(generator, reflectionUtil, false,builderSetup);
 }
Example #2
0
        public void SetUp()
        {
            mocks = new MockRepository();

            reflectionUtil = mocks.StrictMock <IReflectionUtil>();
            propertyNamer  = mocks.StrictMock <IPropertyNamer>();
        }
Example #3
0
        public void SetUp()
        {
            mocks = new MockRepository();

            reflectionUtil = mocks.StrictMock<IReflectionUtil>();
            propertyNamer = mocks.StrictMock<IPropertyNamer>();
        }
        public void SetUp()
        {
            var builderSetup = new BuilderSettings();

            reflectionUtil = Substitute.For <IReflectionUtil>();
            generator      = Substitute.For <IRandomGenerator>();
            propertyNamer  = new RandomValuePropertyNamer(generator, reflectionUtil, false, builderSetup);
        }
Example #5
0
        public void SetUp()
        {
            IReflectionUtil reflectionUtil = MockRepository.GenerateStub <IReflectionUtil>();

            reflectionUtil.Stub(p => p.IsDefaultValue(Arg <int> .Is.Anything)).Return(true);

            propertyNamer = new PropertyNamerStub(reflectionUtil);
        }
        public void SetUp()
        {
            BuilderSettings builderSettings = new BuilderSettings();
            IReflectionUtil reflectionUtil  = Substitute.For <IReflectionUtil>();

            reflectionUtil.IsDefaultValue(Arg.Any <int?>()).Returns(true);

            propertyNamer = new PropertyNamerStub(reflectionUtil, builderSettings);
        }
Example #7
0
 public RandomValuePropertyNamer(IRandomGenerator generator, IReflectionUtil reflectionUtil, bool generatePositiveValuesOnly, DateTime minDate, DateTime maxDate, bool useLoremIpsumForStrings)
     : base(reflectionUtil)
 {
     this.generator = generator;
     this.generatePositiveValuesOnly = generatePositiveValuesOnly;
     this.useLoremIpsumForStrings    = useLoremIpsumForStrings;
     this.minDate = minDate;
     this.maxDate = maxDate;
 }
        public ObjectBuilderTests()
        {
            var builderSetup = new BuilderSettings();

            reflectionUtil = Substitute.For <IReflectionUtil>();

            builder = new ObjectBuilder <MyClass>(reflectionUtil, builderSetup);
            myClassWithConstructorBuilder         = new ObjectBuilder <MyClassWithConstructor>(reflectionUtil, builderSetup);
            myClassWithOptionalConstructorBuilder = new ObjectBuilder <MyClassWithOptionalConstructor>(reflectionUtil, builderSetup);
        }
        public void SetUp()
        {
            mocks = new MockRepository();

            reflectionUtil = mocks.DynamicMock<IReflectionUtil>();

            builder = new ObjectBuilder<MyClass>(reflectionUtil);
            myClassWithConstructorBuilder = new ObjectBuilder<MyClassWithConstructor>(reflectionUtil);
            myClassWithOptionalConstructorBuilder = new ObjectBuilder<MyClassWithOptionalConstructor>(reflectionUtil);
        }
        public void SetUp()
        {
            mocks = new MockRepository();

            reflectionUtil = mocks.DynamicMock <IReflectionUtil>();

            builder = new ObjectBuilder <MyClass>(reflectionUtil);
            myClassWithConstructorBuilder         = new ObjectBuilder <MyClassWithConstructor>(reflectionUtil);
            myClassWithOptionalConstructorBuilder = new ObjectBuilder <MyClassWithOptionalConstructor>(reflectionUtil);
        }
Example #11
0
        public FormSubmissionContextPropertyValueReader(string propertyName)
        {
            if (string.IsNullOrWhiteSpace(propertyName))
            {
                throw new ArgumentOutOfRangeException(nameof(propertyName), (object)propertyName, "Property name must be specified.");
            }

            this.PropertyName   = propertyName;
            this.ReflectionUtil = Sitecore.DataExchange.DataAccess.Reflection.ReflectionUtil.Instance;
        }
Example #12
0
 public CustomProductPropertyNamer(IReflectionUtil reflectionUtil, BuilderSettings builderSettings)
     : base(reflectionUtil, builderSettings)
 {
     aisleGenerator = new SequentialGenerator <char>();
     shelfGenerator = new SequentialGenerator <int> {
         Increment = 2
     };
     locGenerator = new SequentialGenerator <int> {
         Increment = 1000
     };
 }
Example #13
0
        public ListBuilder(int size, IPropertyNamer propertyNamer, IReflectionUtil reflectionUtil)
        {
            this.size           = size;
            this.propertyNamer  = propertyNamer;
            this.reflectionUtil = reflectionUtil;

            mainList = new T[size];

            declarations = new DeclarationQueue <T>(size);

            ScopeUniqueRandomGenerator = new UniqueRandomGenerator();
        }
        public void SetUp()
        {
            reflectionUtil = MockRepository.GenerateStub<IReflectionUtil>();
            reflectionUtil.Stub(x => x.IsDefaultValue(null)).IgnoreArguments().Return(true).Repeat.Any();

            theList = new List<MyClass>();

            for (int i = 0; i < listSize; i++)
                theList.Add(new MyClass());

            new SequentialPropertyNamer(reflectionUtil,new BuilderSetup()).SetValuesOfAllIn(theList);
        }
Example #15
0
        public ListBuilder(int size, IPropertyNamer propertyNamer, IReflectionUtil reflectionUtil, BuilderSettings builderSettings)
        {
            this.Capacity       = size;
            this.propertyNamer  = propertyNamer;
            this.reflectionUtil = reflectionUtil;
            BuilderSettings     = builderSettings;

            mainList = new T[size];

            declarations = new DeclarationQueue <T>(size);

            ScopeUniqueRandomGenerator = new UniqueRandomGenerator();
        }
Example #16
0
        public void SetUp()
        {
            reflectionUtil = MockRepository.GenerateStub <IReflectionUtil>();
            reflectionUtil.Stub(x => x.IsDefaultValue(null)).IgnoreArguments().Return(true).Repeat.Any();

            theList = new List <MyClass>();

            for (int i = 0; i < listSize; i++)
            {
                theList.Add(new MyClass());
            }

            new SequentialPropertyNamer(reflectionUtil, new BuilderSettings()).SetValuesOfAllIn(theList);
        }
Example #17
0
        public void SetUp()
        {
            reflectionUtil = new ReflectionUtil();

            theList = new List <MyClass>();

            for (int i = 0; i < listSize; i++)
            {
                theList.Add(new MyClass());
            }

            new SequentialPropertyNamer(reflectionUtil, new BuilderSettings())
            .SetValuesOfAllIn(theList);
        }
        public RandomValuePropertyNamerTests_LoremIpsumStrings()
        {
            generator      = Substitute.For <IRandomGenerator>();
            reflectionUtil = Substitute.For <IReflectionUtil>();

            reflectionUtil.IsDefaultValue(null).Returns(true);

            theList = new List <MyClass>();

            for (int i = 0; i < listSize; i++)
            {
                theList.Add(new MyClass());
            }

            // The lorem ipsum string generator does this to get a random length of the string
            generator.Next(1, 10).Returns(5);

            new RandomValuePropertyNamer(generator, reflectionUtil, false, DateTime.MinValue, DateTime.MaxValue, true, new BuilderSettings()).SetValuesOfAllIn(theList);
        }
        public void SetUp()
        {
            mocks = new MockRepository();

            generator = MockRepository.GenerateStub<IRandomGenerator>();
            reflectionUtil = MockRepository.GenerateStub<IReflectionUtil>();

            reflectionUtil.Stub(x => x.IsDefaultValue(null)).IgnoreArguments().Return(true).Repeat.Any();

            theList = new List<MyClass>();

            for (int i = 0; i < listSize; i++)
                theList.Add(new MyClass());

            // The lorem ipsum string generator does this to get a random length of the string
            generator.Expect(x => x.Next(1, 10)).Return(5).Repeat.Any();

            new RandomValuePropertyNamer(generator, reflectionUtil, false, DateTime.MinValue, DateTime.MaxValue, true,new BuilderSetup()).SetValuesOfAllIn(theList);
        }
Example #20
0
        public void SetUp()
        {
            mocks = new MockRepository();

            generator      = MockRepository.GenerateStub <IRandomGenerator>();
            reflectionUtil = MockRepository.GenerateStub <IReflectionUtil>();

            reflectionUtil.Stub(x => x.IsDefaultValue(null)).IgnoreArguments().Return(true).Repeat.Any();

            theList = new List <MyClass>();

            for (int i = 0; i < listSize; i++)
            {
                theList.Add(new MyClass());
            }

            // The lorem ipsum string generator does this to get a random length of the string
            generator.Expect(x => x.Next(1, 10)).Return(5).Repeat.Any();

            new RandomValuePropertyNamer(generator, reflectionUtil, false, DateTime.MinValue, DateTime.MaxValue, true, new BuilderSetup()).SetValuesOfAllIn(theList);
        }
 public void SetUp()
 {
     reflectionUtil = MockRepository.GenerateStub <IReflectionUtil>();
     propertyNamer  = new SequentialPropertyNamer(reflectionUtil);
 }
Example #22
0
 public ObjectBuilder(Type type, IReflectionUtil reflectionUtil)
 {
     _type = type;
     _reflectionUtil = reflectionUtil;
 }
 public SequentialPropertyNamer(IReflectionUtil reflectionUtil, BuilderSettings builderSettings)
     : base(reflectionUtil, builderSettings)
 {
 }
 public IndexerPropertyValueReader(params object[] indexes)
 {
     this.ReflectionUtil           = Sitecore.DataExchange.DataAccess.Reflection.ReflectionUtil.Instance;
     this.ContainsIndexMethodNames = new List <string>();
     this.Indexes = indexes;
 }
 public void SetUp()
 {
     reflectionUtil = MockRepository.GenerateStub<IReflectionUtil>();
     propertyNamer = new SequentialPropertyNamer(reflectionUtil);
 }
Example #26
0
 public SequentialPropertyNamer(IReflectionUtil reflectionUtil)
     : base(reflectionUtil)
 {
 }
Example #27
0
 public void SetUp()
 {
     reflectionUtil = Substitute.For <IReflectionUtil>();
     propertyNamer  = Substitute.For <IPropertyNamer>();
 }
Example #28
0
 public RandomValuePropertyNamer(IRandomGenerator generator, IReflectionUtil reflectionUtil, bool generatePositiveValuesOnly, BuilderSetup builderSetup)
     : this(generator, reflectionUtil, generatePositiveValuesOnly, DateTime.MinValue, DateTime.MaxValue, false, builderSetup)
 {
     this.generator = generator;
 }
 public PropertyNamerStub(IReflectionUtil reflectionUtil, BuilderSettings builderSettings) : base(reflectionUtil, builderSettings)
 {
 }
Example #30
0
 public ObjectBuilder(IReflectionUtil reflectionUtil, BuilderSetup builderSetup)
 {
     BuilderSetup        = builderSetup;
     this.reflectionUtil = reflectionUtil;
 }
 public SequentialPropertyNamerTests()
 {
     reflectionUtil = Substitute.For <IReflectionUtil>();
     propertyNamer  = new SequentialPropertyNamer(reflectionUtil, new BuilderSettings());
 }
Example #32
0
 public ObjectBuilder(IReflectionUtil reflectionUtil, BuilderSettings builderSettings)
 {
     BuilderSettings     = builderSettings;
     this.reflectionUtil = reflectionUtil;
 }
Example #33
0
 public ObjectBuilder(IReflectionUtil reflectionUtil)
 {
     this.reflectionUtil = reflectionUtil;
 }
 public PersistableEntityPropertyNamer(IReflectionUtil reflectionUtil)
     : base(reflectionUtil)
 {
 }
 public MyPropertyNamer(IReflectionUtil reflectionUtil)
     : base(reflectionUtil)
 {
 }
 public void SetUp()
 {
     reflectionUtil = Substitute.For <IReflectionUtil>();
     generator      = Substitute.For <IRandomGenerator>();
     propertyNamer  = new RandomValuePropertyNamer(generator, reflectionUtil, false);
 }
Example #37
0
 public PropertyNamerStub(IReflectionUtil reflectionUtil) : base(reflectionUtil)
 {
 }
Example #38
0
 protected PropertyNamer(IReflectionUtil reflectionUtil, BuilderSetup builderSetup)
 {
     this.ReflectionUtil = reflectionUtil;
     _builderSetup       = builderSetup;
 }
Example #39
0
 protected PropertyNamer(IReflectionUtil reflectionUtil)
 {
     this.ReflectionUtil = reflectionUtil;
 }
 public void SetUp()
 {
     reflectionUtil = Substitute.For<IReflectionUtil>();
     generator = Substitute.For<IRandomGenerator>();
     propertyNamer = new RandomValuePropertyNamer(generator, reflectionUtil, false);
 }