Beispiel #1
0
        public void RetrieveStatisticsWithNoFilter()
        {
            var t_Repo    = new MockStatisticsRepository();
            var t_Service = new StatisticsService(t_Repo);

            var t_Elections = t_Service.RetrieveElections().ToList();

            Assert.AreEqual(1, t_Elections.Count);
            Assert.AreEqual(1900, t_Elections[0].Year.Value);
            Assert.AreEqual(2, t_Elections[0].Results.Count);
        }
Beispiel #2
0
        public void RetrieveStatisticsWithFilter()
        {
            var t_Repo    = new MockStatisticsRepository();
            var t_Service = new StatisticsService(t_Repo);

            var t_Elections = t_Service.RetrieveAndFilterElections(
                new HighestParticipation()
                ).ToList();

            Assert.AreEqual(1, t_Elections.Count);
            Assert.AreEqual(1900, t_Elections[0].Year.Value);
            Assert.AreEqual(1, t_Elections[0].Results.Count);

            Assert.AreEqual("Foo", t_Elections[0].Results[0].Region.Name);
            Assert.AreEqual(0.9m, t_Elections[0].Results[0].Participation.Value.Value);
        }