protected BaseValueGenerator(IValueProvider valueProvider, Func<ITypeGenerator> getTypeGenerator,
            Func<IArrayRandomizer> getArrayRandomizer, IUniqueValueGenerator uniqueValueGenerator, IAttributeDecorator attributeDecorator)
        {
            BaseValueGenerator.Logger.Debug("Entering constructor");

            this.ValueProvider = valueProvider;
            this.GetTypeGenerator = getTypeGenerator;
            this.GetArrayRandomizer = getArrayRandomizer;
            this.UniqueValueGenerator = uniqueValueGenerator;
            this.AttributeDecorator = attributeDecorator;

            this.typeValueGetterDictionary = new Dictionary<Type, GetValueForTypeDelegate>
            {
                {typeof (EmailAttribute), x => this.ValueProvider.GetEmailAddress()},
                {typeof (PrimaryKeyAttribute), this.GetPrimaryKey},
                {typeof (string), this.GetString},
                {typeof (decimal), this.GetDecimal},
                {typeof (int), this.GetInteger},
                {typeof (uint), this.GetInteger},
                {typeof (long), this.GetLong},
                {typeof (ulong), this.GetLong},
                {typeof (short), this.GetShort},
                {typeof (ushort), this.GetShort},
                {typeof (bool), x => this.ValueProvider.GetBoolean()},
                {typeof (char), x => this.ValueProvider.GetCharacter()},
                {typeof (DateTime), this.GetDateTime},
                {typeof (byte), x => this.ValueProvider.GetByte()},
                {typeof (double), this.GetDouble},
                {typeof (float), this.GetFloat},
                {typeof (Guid), this.GetGuid },
            };

            BaseValueGenerator.Logger.Debug("Exiting constructor");
        }
        public StandardPropertyValueAccumulator(LetterEncoder stringGenerator, IAttributeDecorator attributeDecorator)
        {
            StandardPropertyValueAccumulator.Logger.Debug("Entering contructor");

            this.stringGenerator = stringGenerator;
            this.attributeDecorator = attributeDecorator;

            StandardPropertyValueAccumulator.Logger.Debug("Exiting contructor");
        }
 public SqlClientPersistence(IWritePrimitives writePrimitives,
     IDeferredValueGenerator<LargeInteger> deferredValueGenerator,
     IAttributeDecorator attributeDecorator, bool enforceKeyReferenceCheck)
 {
     this.writePrimitives = writePrimitives;
     this.deferredValueGenerator = deferredValueGenerator;
     this.attributeDecorator = attributeDecorator;
     this.enforceKeyReferenceCheck = enforceKeyReferenceCheck;
 }
        public MemoryPersistence(IDeferredValueGenerator<LargeInteger> deferredValueGenerator, IAttributeDecorator attributeDecorator)
        {
            MemoryPersistence.Logger.Debug("Entering constructor");

            this.deferredValueGenerator = deferredValueGenerator;
            this.attributeDecorator = attributeDecorator;

            MemoryPersistence.Logger.Debug("Exiting constructor");
        }
Esempio n. 5
0
 public CommandExecutor(ICommandParser parser, ICommandExecutorOptions executorOptions, IAttributeDecorator attributeDecorator, IValueConverter valueConverter, ICommandHelper commandHelper, ITypeHelper typeHelper, ICommandExecutorImpl impl = null)
 {
     _parser             = parser;
     _options            = executorOptions;
     _attributeDecorator = attributeDecorator;
     _valueConverter     = valueConverter;
     _commandHelper      = commandHelper;
     _typeHelper         = typeHelper;
     _impl = impl ?? this;
 }
        public InsertRecordService(RecordReference recordReference, IAttributeDecorator attributeDecorator, bool enforceKeyReferenceCheck)
        {
            InsertRecordService.Logger.Debug("Entering constructor");

            this.recordReference = recordReference;
            this.attributeDecorator = attributeDecorator;
            this.enforceKeyReferenceCheck = enforceKeyReferenceCheck;

            InsertRecordService.Logger.Debug("Exiting constructor");
        }
        public InsertRecord(InsertRecordService service, RecordReference recordReference,
            IEnumerable<AbstractRepositoryOperation> peers, IAttributeDecorator attributeDecorator)
        {
            InsertRecord.Logger.Debug("Entering constructor");

            this.Peers = peers;
            this.RecordReference = recordReference;
            this.service = service;
            this.attributeDecorator = attributeDecorator;

            InsertRecord.Logger.Debug("Exiting constructor");
        }
        public void Initialize()
        {
            XmlConfigurator.Configure();

            this.attributeDecorator = new StandardAttributeDecorator(attributeDecorator => null, null);

            this.subject = new SubjectClass();
            this.recordReferenceMock = new Mock<RecordReference>(null, this.attributeDecorator);
            this.peers = new List<AbstractRepositoryOperation>();
            this.serviceMock = new Mock<InsertRecordService>(this.recordReferenceMock.Object, this.attributeDecorator, true);
            this.insertRecord = new InsertRecord(this.serviceMock.Object, this.recordReferenceMock.Object, this.peers, this.attributeDecorator);

            this.breakerMock = new Mock<CircularReferenceBreaker>();
            this.writePrimitivesMock = new Mock<IWritePrimitives>();

            this.recordReferenceMock.Setup(m => m.RecordObject).Returns(this.subject);
            this.recordReferenceMock.Setup(m => m.RecordType).Returns(this.subject.GetType());
        }
        public void Initialize()
        {
            XmlConfigurator.Configure();

            this.foreignKeyTable = new ForeignTable();

            this.attributeDecorator = new StandardAttributeDecorator(attributeDecorator => null, null);
            this.typeGeneratorMock = Helpers.GetTypeGeneratorMock(this.foreignKeyTable);
            this.recordReference = new RecordReference<ForeignTable>(this.typeGeneratorMock.Object, this.attributeDecorator);
            this.recordReference.Populate();
            this.insertRecordService = new InsertRecordService(this.recordReference, this.attributeDecorator, InsertRecordServiceTest.IsKeyReferenceCheckEnforced);
            this.writerMock = new Mock<IWritePrimitives>();
            this.peers = Enumerable.Empty<AbstractRepositoryOperation>();

            this.mainTableColumns = Helpers.GetColumns(this.foreignKeyTable, this.attributeDecorator);
        }
Esempio n. 10
0
 public AttributeDecorator(ITypeHelper typeHelper, IAttributeDecorator attributeDecorator = null)
 {
     _typeHelper         = typeHelper;
     _attributeDecorator = attributeDecorator ?? this;
 }
        public void Initialize()
        {
            this.attributeDecorator = new StandardAttributeDecorator(attributeDecorator => null, null);
            this.writePrimitivesMock = new Mock<IWritePrimitives>();
            this.deferredValueGeneratorMock = new Mock<IDeferredValueGenerator<LargeInteger>>();

            this.persistence = new SqlClientPersistence(this.writePrimitivesMock.Object,
                this.deferredValueGeneratorMock.Object, this.attributeDecorator, true);

            XmlConfigurator.Configure();
        }
 public Populator(IAttributeDecorator attributeDecorator)
     : base(attributeDecorator)
 {
 }
 protected RecordReference(ITypeGenerator typeGenerator, IAttributeDecorator attributeDecorator)
 {
     this.TypeGenerator = typeGenerator;
     this.AttributeDecorator = attributeDecorator;
 }
        public void Initialize()
        {
            XmlConfigurator.Configure();

            this.attributeDecorator = new StandardAttributeDecorator(attributeDecorator => null, null);

            this.propertyValueAccumulatorMock = new Mock<IPropertyValueAccumulator>();
            this.deferredValueGeneratorMock = new Mock<IDeferredValueGenerator<LargeInteger>>();

            this.generator = new MemoryUniqueValueGenerator(this.propertyValueAccumulatorMock.Object, this.attributeDecorator,
                this.deferredValueGeneratorMock.Object, throwIfUnhandledType: false);
        }
 public SqlWriterCommandTextGenerator(IAttributeDecorator attributeDecorator, SqlWriterCommandText sqlWriterCommandText)
 {
     this.attributeDecorator = attributeDecorator;
     this.sqlWriterCommandText = sqlWriterCommandText;
 }
 public void Initialize()
 {
     this.attributeDecorator = new StandardAttributeDecorator(attributeDecorator => null, null);
 }
 public CommandExecutor CreateSut(ICommandParser parser = null, ICommandExecutorOptions executorOptions = null, IAttributeDecorator attributeDecorator = null, IValueConverter valueConverter = null, ICommandHelper commandHelper = null, ITypeHelper typeHelper = null, ICommandExecutorImpl impl = null)
 {
     return(new CommandExecutor(parser ?? Substitute.For <ICommandParser>(),
                                executorOptions ?? Substitute.For <ICommandExecutorOptions>(),
                                attributeDecorator ?? Substitute.For <IAttributeDecorator>(),
                                valueConverter ?? Substitute.For <IValueConverter>(),
                                commandHelper ?? Substitute.For <ICommandHelper>(),
                                typeHelper ?? Substitute.For <ITypeHelper>(),
                                impl));
 }
 public MemoryUniqueValueGenerator(IPropertyValueAccumulator accumulator, IAttributeDecorator attributeDecorator,
     IDeferredValueGenerator<LargeInteger> deferredValueGenerator, bool throwIfUnhandledType)
     : base(accumulator, deferredValueGenerator, throwIfUnhandledType)
 {
     this.attributeDecorator = attributeDecorator;
 }
 public MemoryValueGenerator(IValueProvider valueProvider, Func<ITypeGenerator> getTypeGenerator,
     Func<IArrayRandomizer> getArrayRandomizer, IUniqueValueGenerator uniqueValueGenerator, IAttributeDecorator attributeDecorator)
     : base(valueProvider, getTypeGenerator, getArrayRandomizer, uniqueValueGenerator, attributeDecorator)
 {
 }
        public void Initialize()
        {
            XmlConfigurator.Configure();

            this.attributeDecorator = new StandardAttributeDecorator(attributeDecorator => null, null);
        }