Beispiel #1
0
        public void SetUp()
        {
            _storageProviderDefinition = new UnitTestStorageProviderStubDefinition("SPID");

            _timestampProperty = SimpleStoragePropertyDefinitionObjectMother.TimestampProperty;
            _objectIDProperty  = ObjectIDStoragePropertyDefinitionObjectMother.ObjectIDProperty;
            _property1         = SimpleStoragePropertyDefinitionObjectMother.CreateStorageProperty("Column1");
            _property2         = SimpleStoragePropertyDefinitionObjectMother.CreateStorageProperty("Column2");
            _property3         = SimpleStoragePropertyDefinitionObjectMother.CreateStorageProperty("Column3");

            _synonyms = new[] { new EntityNameDefinition(null, "Test") };

            _baseEntityDefinition = TableDefinitionObjectMother.Create(_storageProviderDefinition);

            _indexes = new[] { MockRepository.GenerateStub <IIndexDefinition>() };
            _filterViewDefinition = new FilterViewDefinition(
                _storageProviderDefinition,
                new EntityNameDefinition("Schema", "Test"),
                _baseEntityDefinition,
                new[] { "ClassId1", "ClassId2" },
                _objectIDProperty,
                _timestampProperty,
                new[] { _property1, _property2, _property3 },
                _indexes,
                _synonyms);
        }
 public static UnionViewDefinition CreateWithSynonyms(StorageProviderDefinition storageProviderDefinition, IEnumerable <EntityNameDefinition> synonyms)
 {
     return(new UnionViewDefinition(
                storageProviderDefinition,
                new EntityNameDefinition("TestSchema", "TestUnionView"),
                new[] { TableDefinitionObjectMother.Create(storageProviderDefinition) },
                ObjectIDStoragePropertyDefinitionObjectMother.ObjectIDProperty,
                SimpleStoragePropertyDefinitionObjectMother.TimestampProperty,
                new IRdbmsStoragePropertyDefinition[0],
                new IIndexDefinition[0],
                synonyms));
 }
 public static FilterViewDefinition CreateWithIndexes(StorageProviderDefinition storageProviderDefinition, IEnumerable <IIndexDefinition> indexDefinitions)
 {
     return(new FilterViewDefinition(
                storageProviderDefinition,
                new EntityNameDefinition("TestSchema", "TestFilterView"),
                TableDefinitionObjectMother.Create(storageProviderDefinition),
                new[] { "Class1" },
                ObjectIDStoragePropertyDefinitionObjectMother.ObjectIDProperty,
                SimpleStoragePropertyDefinitionObjectMother.TimestampProperty,
                new IRdbmsStoragePropertyDefinition[0],
                indexDefinitions,
                new EntityNameDefinition[0]));
 }
        public void GetAllTables_IndirectTables()
        {
            var tableDefinition3    = TableDefinitionObjectMother.Create(_storageProviderDefinition);
            var baseUnionDefinition = new UnionViewDefinition(
                _storageProviderDefinition,
                new EntityNameDefinition(null, "UnionView"),
                new IRdbmsStorageEntityDefinition[] { _unionViewDefinition, tableDefinition3 },
                _objectIDProperty,
                _timestampProperty,
                new SimpleStoragePropertyDefinition[0],
                new IIndexDefinition[0],
                new EntityNameDefinition[0]);

            var result = baseUnionDefinition.GetAllTables().ToArray();

            Assert.That(result, Is.EqualTo(new[] { _tableDefinition1, _tableDefinition2, tableDefinition3 }));
        }
 public static FilterViewDefinition Create(StorageProviderDefinition storageProviderDefinition, EntityNameDefinition viewName)
 {
     return(Create(storageProviderDefinition, viewName, TableDefinitionObjectMother.Create(storageProviderDefinition)));
 }