Beispiel #1
0
        public void CategoryWithHighestNumberOfUSACompetitors()
        {
            CategoryLogic   c   = new CategoryLogic(this.categrepo.Object, this.comprepo.Object, this.sponsorrepo.Object);
            CompetitorLogic com = new CompetitorLogic(this.comprepo.Object);

            StatLogic s = new StatLogic(this.categrepo.Object, this.comprepo.Object);

            List <Category> categlist = new List <Category>()
            {
                new Category()
                {
                    CategoryId = Guid.NewGuid().ToString(), Name = CategoryType.MrOlympia, StartingWeight = 90, MaximumWeight = 135
                },

                new Category()
                {
                    CategoryId = Guid.NewGuid().ToString(), Name = CategoryType.ClassicPhysique, StartingWeight = 80, MaximumWeight = 110
                },

                new Category()
                {
                    CategoryId = Guid.NewGuid().ToString(), Name = CategoryType.MensPhisyque, StartingWeight = 70, MaximumWeight = 100
                },

                new Category()
                {
                    CategoryId = Guid.NewGuid().ToString(), Name = CategoryType.WomensBikini, StartingWeight = 45, MaximumWeight = 70
                },
            };

            List <Competitor> complist = new List <Competitor>()
            {
                new Competitor {
                    CompetitorId = Guid.NewGuid().ToString(), Number = 1, Name = "Kökény Béla", Nationality = "Hungary", Gender = GenderType.Male, Height = 175, Weight = 103, AchivedPlace = 12, CategoryId = categlist.ElementAt(0).CategoryId
                },

                new Competitor {
                    CompetitorId = Guid.NewGuid().ToString(), Number = 2, Name = "Kökény Béci", Nationality = "Hungary", Gender = GenderType.Male, Height = 174, Weight = 93, AchivedPlace = 11, CategoryId = categlist.ElementAt(1).CategoryId
                },

                new Competitor {
                    CompetitorId = Guid.NewGuid().ToString(), Number = 3, Name = "Kökény Béna", Nationality = "USA", Gender = GenderType.Male, Height = 176, Weight = 95, AchivedPlace = 8, CategoryId = categlist.ElementAt(2).CategoryId
                },

                new Competitor {
                    CompetitorId = Guid.NewGuid().ToString(), Number = 4, Name = "Kökény Béláné", Nationality = "Hungary", Gender = GenderType.Female, Height = 164, Weight = 53, AchivedPlace = 15, CategoryId = categlist.ElementAt(3).CategoryId
                },

                new Competitor {
                    CompetitorId = Guid.NewGuid().ToString(), Number = 5, Name = "Kökény Másik Béláné", Nationality = "Hungary", Gender = GenderType.Female, Height = 163, Weight = 57, AchivedPlace = 19, CategoryId = categlist.ElementAt(3).CategoryId
                },
            };

            var expected = categlist[2].Name;

            categrepo.Setup(x => x.ListAll()).Returns(categlist.AsQueryable);
            comprepo.Setup(x => x.ListAll()).Returns(complist.AsQueryable);
            var result = s.OnlyUSA(categlist, complist);

            Assert.That(result, Is.EqualTo(expected));
        }
Beispiel #2
0
 public EditController(CategoryLogic categoryLogic, CompetitorLogic competitorLogic, SponsorLogic sponsorLogic)
 {
     this.categoryLogic   = categoryLogic;
     this.competitorLogic = competitorLogic;
     this.sponsorLogic    = sponsorLogic;
 }
Beispiel #3
0
 public CompetitorController(CompetitorLogic logic)
 {
     this.logic = logic;
 }