public StatisticDataset GetCacheDistributionByCacheDifficulty(DataFilter filter)
        {
            filterManager.ValidateFilter(filter);
            var data = new StatisticDataset {
                Data           = cacheDao.GetCacheDistributionByCacheDifficulty(filter),
                Caption        = "Distribution of caches by cache difficulty",
                Column2Caption = "Difficulty Level",
                Column3Caption = "Share [%]"
            };

            return(data);
        }
Example #2
0
        public void GetCacheDistributionByCacheDifficultyTest( )
        {
            DataFilter filter = filterManager.GetDefaultFilter();

            filter.FromPosition = new GeoPosition(47.0, 12.5);
            filter.ToPosition   = new GeoPosition(48.0, 14.0);

            var expected = new List <StatisticData> {
                new StatisticData {
                    Name = "2", Value = "28,7938"
                },
                new StatisticData {
                    Name = "1,5", Value = "19,0661"
                },
                new StatisticData {
                    Name = "2,5", Value = "16,7315"
                },
                new StatisticData {
                    Name = "3", Value = "13,2296"
                },
                new StatisticData {
                    Name = "1", Value = "11,6732"
                },
                new StatisticData {
                    Name = "3,5", Value = "5,8366"
                },
                new StatisticData {
                    Name = "4", Value = "1,9455"
                },
                new StatisticData {
                    Name = "5", Value = "1,9455"
                },
                new StatisticData {
                    Name = "4,5", Value = "0,7782"
                }
            };

            IList <StatisticData> actual = target.GetCacheDistributionByCacheDifficulty(filter);

            Assert.AreEqual(expected.Count, actual.Count);

            foreach (StatisticData data in expected)
            {
                Assert.IsTrue(actual.Contains(data));
            }
        }