Esempio n. 1
0
 public generating_code_and_sql_for_hierarchy_smoke_Tests()
 {
     theHierarchy = DocumentMapping.For <Squad>();
     theHierarchy.AddSubClass(typeof(BasketballTeam));
     theHierarchy.AddSubClass(typeof(BaseballTeam));
     theHierarchy.AddSubClass(typeof(FootballTeam));
 }
Esempio n. 2
0
 public generating_code_and_sql_for_hierarchy_smoke_Tests_on_other_database_schema()
 {
     theHierarchy = DocumentMapping.For <Squad>("other");
     theHierarchy.AddSubClass(typeof(BasketballTeam));
     theHierarchy.AddSubClass(typeof(BaseballTeam));
     theHierarchy.AddSubClass(typeof(FootballTeam));
 }
Esempio n. 3
0
 public generating_code_and_sql_for_hierarchy_smoke_Tests()
 {
     theHierarchy = new DocumentMapping(typeof(Squad), new StoreOptions());
     theHierarchy.AddSubClass(typeof(BasketballTeam));
     theHierarchy.AddSubClass(typeof(BaseballTeam));
     theHierarchy.AddSubClass(typeof(FootballTeam));
 }
        public HierarchyArgumentTests()
        {
            mapping = new DocumentMapping(typeof(Squad), new StoreOptions());

            arg = new HierarchyArgument(mapping);

            mapping.AddSubClass(typeof(BasketballTeam));
            mapping.AddSubClass(typeof(BaseballTeam));
            mapping.AddSubClass(typeof(FootballTeam), "football");
        }
Esempio n. 5
0
        public void can_migrate_missing_hierarchical_columns()
        {
            writeTable();
            theMapping.AddSubClass(typeof(SuperUser));
            var newTable = new DocumentTable(theMapping);

            writeAndApplyPatch(AutoCreate.CreateOrUpdate, newTable);

            var theActual = theTable.FetchExisting(_conn);

            theActual.HasColumn(DocumentMapping.DocumentTypeColumn);
        }
Esempio n. 6
0
        public void storage_arguments_adds_hierarchy_argument_with_subclasses()
        {
            var mapping = new DocumentMapping(typeof(Squad), new StoreOptions());

            mapping.AddSubClass(typeof(FootballTeam));

            mapping.ToArguments().OfType <HierarchyArgument>()
            .Single().Mapping.ShouldBeSameAs(mapping);
        }