Ejemplo n.º 1
0
        public void GetBestRatedCaches()
        {
            DataFilter filter = filterManager.GetDefaultFilter();

            filter.Limit    = 5;
            filter.FromDate = new DateTime(2005, 01, 20);
            filter.ToDate   = new DateTime(2020, 01, 20);

            var expected = new List <StatisticData> {
                new StatisticData {
                    Name = "K&K Berg und Tal", Value = "7,3810"
                },
                new StatisticData {
                    Name = "Der alte Mann vom Maltatal", Value = "7,3636"
                },
                new StatisticData {
                    Name = "Ardningalm", Value = "7,3636"
                },
                new StatisticData {
                    Name = "Geologie am Hochfelln", Value = "7,3571"
                },
                new StatisticData {
                    Name = "Changing money in Hellbrunn", Value = "7,3333"
                },
            };

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

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

            foreach (StatisticData data in expected)
            {
                Assert.IsTrue(actual.Contains(data));
            }
        }
Ejemplo n.º 2
0
        public StatisticDataset GetCachesByRating(DataFilter filter)
        {
            filterManager.ValidateFilter(filter);
            var data = new StatisticDataset {
                Data           = cacheDao.GetBestRatedCaches(filter),
                Caption        = "Best rated caches",
                Column2Caption = "Cache name",
                Column3Caption = "Rating [1 - 10]"
            };

            return(data);
        }