Ejemplo n.º 1
0
        public void TestGetPrimaryMetadataForEveryone()
        {
            // Blow away excessive nychanis data.
            FastDAO <NycDatum> dataDao = new FastDAO <NycDatum>("PDP.Data", "NYCHANIS");
            DaoCriteria        crit    = new DaoCriteria();

            crit.Expressions.Add(new EqualExpression("IndicatorId", 201, false));
            crit.Expressions.Add(new GreaterExpression("IndicatorId", 10));
            dataDao.Delete(crit);

            // And also excessive PDB data.
            PdbTwoTableHelper helper = new PdbTwoTableHelper(Config.GetConfig("PDP.Data"), "Properties",
                                                             PdbEntityType.Properties);
            DictionaryDao primaryPdbDao = new DictionaryDao(
                dataDao.ConnDesc, helper.GetClassMapForPrimaryTable(new SecurityRole[] { SecurityRole.@public }));
            FastDAO <PdbSecondaryTableProperty> secondaryPdbDao = new FastDAO <PdbSecondaryTableProperty>(
                dataDao.ConnDesc, helper.GetClassMapForSecondaryTable());

            crit.Expressions.Clear();
            crit.Expressions.Add(new GreaterExpression("UID", 100630));
            primaryPdbDao.Delete(crit);
            crit.Expressions.Clear();
            crit.Expressions.Add(new GreaterExpression("ForeignKey", 100630));
            secondaryPdbDao.Delete(crit);
        }
Ejemplo n.º 2
0
        public void TestPrimaryTableClassMapForEveryone()
        {
            ClassMapping priMap = _helper.GetClassMapForPrimaryTable(new SecurityRole[] { SecurityRole.@public });

            // Should be number of cols in the DB attributes tables, but also one for the primary key, and
            // two for latlon.
            Assert.AreEqual(34, priMap.AllDataColsInOrder.Count,
                            "Wrong number of primary table columns for all users.");
        }