Exemplo n.º 1
0
        public void Shoud_Be_47_The_Maximum_Age_When_Get_Age_Count_Map()
        {
            var cup    = new FIFACupStats();
            var ageMap = cup.AgeCountMap();

            Assert.NotNull(ageMap);
            Assert.Equal(47, ageMap.Keys.Max());
        }
Exemplo n.º 2
0
        public void Shoud_Be_16_The_Minimum_Age_In_Get_Age_Count_Map()
        {
            var cup    = new FIFACupStats();
            var ageMap = cup.AgeCountMap();

            Assert.NotNull(ageMap);
            Assert.Equal(16, ageMap.Keys.Min());
        }
Exemplo n.º 3
0
        public void Shoud_Return_Map_Of_Ages()
        {
            string expectedMap = "16,18|17,270|18,682|19,1088|20,1252|21,1275|22,1324|23,1395|24,1321|25,1515|26,1199|27,1153|28,1053|29,1127|30,807|31,666|32,506|33,610|34,271|35,188|36,137|37,69|38,38|39,18|40,4|41,3|43,2|44,2|47,1|";
            var    cup         = new FIFACupStats();

            var map = cup.AgeCountMap();

            string str_mapa = "";
            int    value;

            foreach (var key in map.Keys)
            {
                if (map.TryGetValue(key, out value))
                {
                    str_mapa += key.ToString() + ',' + value.ToString() + '|';
                }
            }

            Assert.Equal(expectedMap, str_mapa);
        }
Exemplo n.º 4
0
        public void Shoud_Return_Right_Age_Count_Map()
        {
            var cup    = new FIFACupStats();
            var ageMap = cup.AgeCountMap();

            Assert.NotNull(ageMap);

            var expected = new Dictionary <int, int>();

            expected.Add(16, 18);
            expected.Add(17, 270);
            expected.Add(18, 682);
            expected.Add(19, 1088);
            expected.Add(20, 1252);
            expected.Add(21, 1275);
            expected.Add(22, 1324);
            expected.Add(23, 1395);
            expected.Add(24, 1321);
            expected.Add(25, 1515);
            expected.Add(26, 1199);
            expected.Add(27, 1153);
            expected.Add(28, 1053);
            expected.Add(29, 1127);
            expected.Add(30, 807);
            expected.Add(31, 666);
            expected.Add(32, 506);
            expected.Add(33, 610);
            expected.Add(34, 271);
            expected.Add(35, 188);
            expected.Add(36, 137);
            expected.Add(37, 69);
            expected.Add(39, 18);
            expected.Add(38, 38);
            expected.Add(40, 4);
            expected.Add(41, 3);
            expected.Add(43, 2);
            expected.Add(44, 2);
            expected.Add(47, 1);
            Assert.Equal(expected, ageMap);
        }
Exemplo n.º 5
0
        public void Shoud_Return_AgeCountMap()
        {
            var cup = new FIFACupStats();
            var age = cup.AgeCountMap();

            Assert.True(age.ContainsKey(16));
            Assert.Equal(18, age[16]);
            Assert.Equal(270, age[17]);
            Assert.Equal(682, age[18]);
            Assert.Equal(1088, age[19]);
            Assert.Equal(1252, age[20]);
            Assert.Equal(1275, age[21]);
            Assert.Equal(1324, age[22]);
            Assert.Equal(1395, age[23]);
            Assert.Equal(1321, age[24]);
            Assert.Equal(1515, age[25]);
            Assert.Equal(1199, age[26]);
            Assert.Equal(1153, age[27]);
            Assert.Equal(1053, age[28]);
            Assert.Equal(1127, age[29]);
            Assert.Equal(807, age[30]);
            Assert.Equal(666, age[31]);
            Assert.Equal(506, age[32]);
            Assert.Equal(610, age[33]);
            Assert.Equal(271, age[34]);
            Assert.Equal(188, age[35]);
            Assert.Equal(137, age[36]);
            Assert.Equal(69, age[37]);
            Assert.Equal(38, age[38]);
            Assert.Equal(18, age[39]);
            Assert.Equal(4, age[40]);
            Assert.Equal(3, age[41]);
            Assert.Equal(2, age[43]);
            Assert.Equal(2, age[44]);
            Assert.Equal(1, age[47]);
        }