コード例 #1
0
        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");
        }
コード例 #3
0
 public SqlClientPersistence(IWritePrimitives writePrimitives,
     IDeferredValueGenerator<LargeInteger> deferredValueGenerator,
     IAttributeDecorator attributeDecorator, bool enforceKeyReferenceCheck)
 {
     this.writePrimitives = writePrimitives;
     this.deferredValueGenerator = deferredValueGenerator;
     this.attributeDecorator = attributeDecorator;
     this.enforceKeyReferenceCheck = enforceKeyReferenceCheck;
 }
コード例 #4
0
        public MemoryPersistence(IDeferredValueGenerator<LargeInteger> deferredValueGenerator, IAttributeDecorator attributeDecorator)
        {
            MemoryPersistence.Logger.Debug("Entering constructor");

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

            MemoryPersistence.Logger.Debug("Exiting constructor");
        }
コード例 #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;
 }
コード例 #6
0
        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");
        }
コード例 #7
0
        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");
        }
コード例 #8
0
        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());
        }
コード例 #9
0
        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);
        }
コード例 #10
0
 public AttributeDecorator(ITypeHelper typeHelper, IAttributeDecorator attributeDecorator = null)
 {
     _typeHelper         = typeHelper;
     _attributeDecorator = attributeDecorator ?? this;
 }
コード例 #11
0
        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)
 {
 }
コード例 #13
0
 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;
 }
コード例 #16
0
 public void Initialize()
 {
     this.attributeDecorator = new StandardAttributeDecorator(attributeDecorator => null, null);
 }
コード例 #17
0
 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));
 }
コード例 #18
0
 public MemoryUniqueValueGenerator(IPropertyValueAccumulator accumulator, IAttributeDecorator attributeDecorator,
     IDeferredValueGenerator<LargeInteger> deferredValueGenerator, bool throwIfUnhandledType)
     : base(accumulator, deferredValueGenerator, throwIfUnhandledType)
 {
     this.attributeDecorator = attributeDecorator;
 }
コード例 #19
0
 public MemoryValueGenerator(IValueProvider valueProvider, Func<ITypeGenerator> getTypeGenerator,
     Func<IArrayRandomizer> getArrayRandomizer, IUniqueValueGenerator uniqueValueGenerator, IAttributeDecorator attributeDecorator)
     : base(valueProvider, getTypeGenerator, getArrayRandomizer, uniqueValueGenerator, attributeDecorator)
 {
 }
コード例 #20
0
        public void Initialize()
        {
            XmlConfigurator.Configure();

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