Esempio n. 1
0
        public void Create()
        {
            var json = Resources.Get("fighters.json");

            List <Fighter> fighters = JsonConvert.DeserializeObject <List <Fighter> >(json);

            List <int> selected = fighters.Select(i => i.Id).ToList();

            List <List <Fighter> > groups = _ruleContest.Groups(fighters, selected);

            List <List <Ranking> > rankings = new List <List <Ranking> >();

            foreach (List <Fighter> group in groups)
            {
                List <Ranking> raking = _ruleContest.GroupRanking(group);
                rankings.Add(raking);
            }

            List <List <Fighter> > quarters = _ruleContest.QuarterFinals(fighters, rankings);

            Assert.AreEqual(quarters.Count(), 4);

            foreach (List <Fighter> quarter in quarters)
            {
                Assert.AreEqual(quarter.Count(), 2);
            }
        }
Esempio n. 2
0
        public void Create()
        {
            var json = Resources.Get("fighters.json");

            List <Fighter> fighters = JsonConvert.DeserializeObject <List <Fighter> >(json);

            List <int> selected = fighters.Select(i => i.Id).ToList();

            List <List <Fighter> > groups = _ruleContest.Groups(fighters, selected);

            Assert.AreEqual(groups.Count(), 4);

            foreach (List <Fighter> group in groups)
            {
                Assert.AreEqual(group.Count(), 5);
            }
        }