Пример #1
0
        public void TestSmallPivotGenerator()
        {
            var data = SmallDatasets.GenerateFullFlatData();

            var typeWrapper = new Pivot.Accessories.Mapping.TypeWrapper <TwoByTwo, AggregationFunctions>();
            var generator   = new PivotGenerator <TwoByTwo, AggregationFunctions>(typeWrapper);

            var mtx = generator.GeneratePivot(data).Matrix;

            DataOutput.CSVHelper.SaveCSVFile(mtx, "SmallTwoByTwoMatrix.csv");
        }
Пример #2
0
        public void TestXYDictionarySmallSet_CheckOrder()
        {
            var data = SmallDatasets.GenerateFullFlatData();

            var typeWrapper = new Pivot.Accessories.Mapping.TypeWrapper <TwoByTwo, AggregationFunctions>();
            var generator   = new DictionaryGenerator <TwoByTwo, AggregationFunctions>(typeWrapper);

            // checking X
            var dirX = generator.GenerateXDictionary(data);

            Assert.AreEqual(6, dirX.Count); // expecting exact amount for combinations
        }
Пример #3
0
        public void TestGenerateXLevelTree()
        {
            var data        = SmallDatasets.GenerateFullFlatData();
            var typeWrapper = new Pivot.Accessories.Mapping.TypeWrapper <TwoByTwo, AggregationFunctions>();
            var generator   = new DictionaryGenerator <TwoByTwo, AggregationFunctions>(typeWrapper);
            SortedDictionary <FieldList, int> dirX = generator.GenerateXDictionary(data);

            int level = 0;
            IEnumerable <AggregationTreeNode> q0 = GenerateAggregationTreeXAnyLevel(dirX, level);
            var lst = q0.ToList();

            Assert.AreEqual(4, lst.Count);

            level = 1;
            IEnumerable <AggregationTreeNode> q1 = GenerateAggregationTreeXAnyLevel(dirX, level);

            lst = q1.ToList();
            Assert.AreEqual(2, lst.Count);
        }