Exemplo n.º 1
0
        public void PivotGridDeleteFieldMissedValuesDuplicateTest()
        {
            IAvrPivotGridField date1 = GetIAvrPivotGridField("Date");

            date1.SearchFieldDataType = typeof(DateTime);
            date1.AddMissedValues     = true;

            IAvrPivotGridField region1 = GetIAvrPivotGridField("Region");
            IAvrPivotGridField region2 = GetIAvrPivotGridField("Region");

            region2.AddMissedValues = true;
            IAvrPivotGridField region3 = GetIAvrPivotGridField("Region");

            region3.AddMissedValues = true;

            IAvrPivotGridField date2 = GetIAvrPivotGridField("Date");

            date2.SearchFieldDataType = typeof(DateTime);
            date2.AddMissedValues     = true;

            var fields = new List <IAvrPivotGridField> {
                date1, region1, region2, region3, date2
            };

            foreach (IAvrPivotGridField field in fields)
            {
                field.AllPivotFields = fields;
            }
            List <IAvrPivotGridField> result = AvrPivotGridHelper.AddRelatedFields(fields).ToList();

            Assert.AreEqual(2, result.Count);
            Assert.AreEqual(date1, result[0]);
            Assert.AreEqual(region2, result[1]);
        }
Exemplo n.º 2
0
        public void PivotGridLinkedFieldRayonRegionSettlementTest()
        {
            WinPivotGridField region = GetIAvrPivotGridField("Region");
            WinPivotGridField rayon  = GetIAvrPivotGridField("Rayon");

            rayon.RelatedFields = new List <IAvrPivotGridField> {
                region
            };
            WinPivotGridField settlement = GetIAvrPivotGridField("Settlement");

            settlement.RelatedFields = new List <IAvrPivotGridField> {
                rayon, region
            };
            WinPivotGridField diagnosis = GetIAvrPivotGridField("Diagnosis");
            WinPivotGridField zoonotic  = GetIAvrPivotGridField("Zoonotic");

            zoonotic.RelatedFields = new List <IAvrPivotGridField> {
                diagnosis
            };

            var allFields = new List <IAvrPivotGridField> {
                region, rayon, settlement, diagnosis, zoonotic
            };

            foreach (IAvrPivotGridField field in allFields)
            {
                field.AllPivotFields = allFields;
            }

            Assert.AreEqual(2, settlement.GetRelatedFieldChain().Count);
            Assert.AreEqual(1, zoonotic.GetRelatedFieldChain().Count);

            var fields = new List <IAvrPivotGridField> {
                rayon, region, settlement, zoonotic
            };
            List <IAvrPivotGridField> result = AvrPivotGridHelper.AddRelatedFields(fields).ToList();

            Assert.AreEqual(5, result.Count);
            Assert.AreEqual(region, result[0]);
            Assert.AreEqual(rayon, result[1]);
            Assert.AreEqual(settlement, result[2]);
            Assert.AreEqual(diagnosis, result[3]);
            Assert.AreEqual(zoonotic, result[4]);
        }
Exemplo n.º 3
0
        public void PivotGridLinkedFieldSimpleTest()
        {
            IAvrPivotGridField region     = GetIAvrPivotGridField("Region");
            IAvrPivotGridField rayon      = GetIAvrPivotGridField("Rayon");
            IAvrPivotGridField settlement = GetIAvrPivotGridField("Settlement");

            var fields = new List <IAvrPivotGridField> {
                region, rayon, settlement
            };

            foreach (IAvrPivotGridField field in fields)
            {
                field.AllPivotFields = fields;
            }
            List <IAvrPivotGridField> result = AvrPivotGridHelper.AddRelatedFields(fields).ToList();

            Assert.AreEqual(3, result.Count);
            Assert.AreEqual(region, result[0]);
            Assert.AreEqual(rayon, result[1]);
            Assert.AreEqual(settlement, result[2]);
        }
Exemplo n.º 4
0
        public void PivotGridDeleteFieldMissedValuesSingleTest()
        {
            IAvrPivotGridField region1 = GetIAvrPivotGridField("Region");
            IAvrPivotGridField region2 = GetIAvrPivotGridField("Region");
            IAvrPivotGridField region3 = GetIAvrPivotGridField("Region");

            region3.AddMissedValues = true;

            var fields = new List <IAvrPivotGridField> {
                region1, region2, region3
            };

            foreach (IAvrPivotGridField field in fields)
            {
                field.AllPivotFields = fields;
            }
            List <IAvrPivotGridField> result = AvrPivotGridHelper.AddRelatedFields(fields).ToList();

            Assert.AreEqual(1, result.Count);
            Assert.AreEqual(region3, result[0]);
        }
Exemplo n.º 5
0
        public void PivotGridMissedValuesFilterDateTest()
        {
            IAvrPivotGridField date1 = GetIAvrPivotGridField("Date");

            date1.SearchFieldDataType = typeof(DateTime);
            date1.GroupInterval       = PivotGroupInterval.DateYear;
            date1.AddMissedValues     = true;

            IAvrPivotGridField date2 = GetIAvrPivotGridField("Date");

            date2.SearchFieldDataType = typeof(DateTime);
            date2.GroupInterval       = PivotGroupInterval.DateMonth;
            date2.AddMissedValues     = true;


            IAvrPivotGridField date3 = GetIAvrPivotGridField("Date");

            date3.SearchFieldDataType = typeof(DateTime);
            date3.IsHiddenFilterField = true;


            var fields = new List <IAvrPivotGridField> {
                date1, date2, date3
            };

            foreach (IAvrPivotGridField field in fields)
            {
                field.AllPivotFields = fields;
            }
            List <IAvrPivotGridField> result = AvrPivotGridHelper.AddRelatedFields(new List <IAvrPivotGridField> {
                date1, date2
            }).ToList();

            Assert.AreEqual(1, result.Count);
            Assert.AreEqual(date1, result[0]);
        }