public void PlayerCountTest() { Mock <IRepository <Player> > mockedRepo = new Mock <IRepository <Player> >(MockBehavior.Loose); List <Player> playerlist = new List <Player>() { new Player() { IgazolasSzama = Guid.NewGuid().ToString(), PlayerName = "Van Dijk", Nationality = "Netherland", Rating = 90, WeakFoot = 2 /*,Csapat = teamlist[0]*/ }, new Player() { IgazolasSzama = Guid.NewGuid().ToString(), PlayerName = "Ács Péter", Nationality = "Hungary", Rating = 76, WeakFoot = 5, /*Csapat =teamlist[1]*/ }, new Player() { IgazolasSzama = Guid.NewGuid().ToString(), PlayerName = "Cristano Ronaldo", Nationality = "Portugal", Rating = 94, WeakFoot = 5, /*Csapat =teamlist[2]*/ } }; mockedRepo.Setup(repo => repo.Read()); var expected = playerlist.Count; StatLogic stl = new StatLogic(mockedRepo.Object); var result = stl.PlayerCount(playerlist); Assert.That(result, Is.EqualTo(expected)); }
public HomeController(PlayerLogic playerlogic, LeagueLogic leaguelogic, TeamLogic teamlogic, StatLogic statLogic) { this.playerlogic = playerlogic; this.leaguelogic = leaguelogic; this.teamlogic = teamlogic; this.statLogic = statLogic; }
public HomeController(WitcherLogic WitcherLogic, HumanLogic HumanLogic, MonsterLogic MonsterLogic, StatLogic StatLogic) { this.WitcherLogic = WitcherLogic; this.HumanLogic = HumanLogic; this.MonsterLogic = MonsterLogic; this.StatLogic = StatLogic; }
public void GetSchoolStats() { StatLogic sl = GetWitcherLogic(); string bestschool = "School of the Wolf"; string testschool = sl.SchoolStats(); Assert.That(bestschool, Is.EqualTo(testschool)); }
public void TestOldTeamDrivers() { DriverLogic dl = new DriverLogic(this.driverRepo.Object); TeamLogic tl = new TeamLogic(this.teamRepo.Object); StatLogic s = new StatLogic(tl, dl); List <Team> teams = new List <Team>() { new Team { TID = Guid.NewGuid().ToString(), TName = "Mercedes-AMG Petronas F1 Team", Created = 2010, Country = "Germany", Engine = ESuppliers.Mercedes }, new Team { TID = Guid.NewGuid().ToString(), TName = "Aston Martin Red Bull Racing", Created = 2005, Country = "Austria", Engine = ESuppliers.Honda }, new Team { TID = Guid.NewGuid().ToString(), TName = "Renault DP World F1 Team", Created = 1977, Country = "France", Engine = ESuppliers.Renault }, new Team { TID = Guid.NewGuid().ToString(), TName = "Zengő Motorsport Services KFT", Created = 1996, Country = "Hungary", Engine = ESuppliers.Seat }, }; List <Driver> drivers = new List <Driver>() { new Driver { DID = Guid.NewGuid().ToString(), DName = "Valtteri Bottas", BornYear = 1989, CountryB = "Finland", RaceNumber = 77, TID = teams.ElementAt(0).TID }, new Driver { DID = Guid.NewGuid().ToString(), DName = "Daniel Ricciardo", BornYear = 1989, CountryB = "Australia", RaceNumber = 3, TID = teams.ElementAt(2).TID }, new Driver { DID = Guid.NewGuid().ToString(), DName = "Max Verstappen", BornYear = 1997, CountryB = "Belgium", RaceNumber = 33, TID = teams.ElementAt(1).TID }, new Driver { DID = Guid.NewGuid().ToString(), DName = "Boldizs Bence", BornYear = 1997, CountryB = "Hungary", RaceNumber = 55, TID = teams.ElementAt(3).TID }, new Driver { DID = Guid.NewGuid().ToString(), DName = "Teszt Elek", BornYear = 1990, CountryB = "Test2", RaceNumber = 4, TID = teams.ElementAt(2).TID } }; List <Driver> expected = new List <Driver>(); /*{ * new Driver { DID = drivers[1].DID, DName = "Daniel Ricciardo", BornYear = 1989, CountryB = "Australia", RaceNumber = 3, TID = teams.ElementAt(2).TID }, * new Driver { DID = drivers[4].DID, DName = "Teszt Elek", BornYear = 1990, CountryB = "Test2", RaceNumber = 4, TID = teams.ElementAt(2).TID } * };*/ expected.Add(drivers[1]); expected.Add(drivers[4]); teamRepo.Setup(x => x.Search()).Returns(teams.AsQueryable); driverRepo.Setup(x => x.Search()).Returns(drivers.AsQueryable); var result = s.OldestTeamDrivers(); Assert.That(result, Is.EqualTo(expected)); }
public void GetHasRedenianFriend() { StatLogic sl = GetWitcherLogic(); int redenians = 2; int testredenians = sl.HasRedenianFriend(); Assert.That(redenians, Is.EqualTo(testredenians)); }
public void GetAvgHuntedBounty() { StatLogic sl = GetWitcherLogic(); string avgbountyleader = "wbot3"; string testbounty = sl.AvgHuntedBounty(); Assert.That(avgbountyleader, Is.EqualTo(testbounty)); }
// Start is called before the first frame update void Start() { currentExp = 0; expBar.maxValue = levelUp; expBar.value = currentExp; eventScript = eventDisplay.GetComponent <EventScript>(); statLogic = statDisplay.GetComponent <StatLogic>(); statLogic.UpdateDamage(bulletDamage); statLogic.UpdateBulletCount(bulletCount); }
public IActionResult Stat() { Stat s = new Stat(); StatLogic sl = new StatLogic(); s.BiggesAvgWeight = sl.BiggestAvg(categorylogic.List().ToList(), competitorlogic.List().ToList()); s.HighestCompsCategory = sl.HighestCompCategory(categorylogic.List().ToList(), competitorlogic.List().ToList()); s.OnlyUSACategory = sl.OnlyUSA(categorylogic.List().ToList(), competitorlogic.List().ToList()); return(View(nameof(Stat), s)); }
// Start is called before the first frame update void Start() { currentHealth = startingHealth; isDead = false; test_damage = 0; spawn = this.gameObject.GetComponent <PlayerMovement>(); sprite = GetComponent <SpriteRenderer>(); flickering = false; statLogic = statBox.GetComponent <StatLogic>(); }
public void TestTeamOfBestLeague() { LeagueLogic ll = new LeagueLogic(this.leagueRepo.Object); TeamLogic tl = new TeamLogic(this.teamRepo.Object); StatLogic s = new StatLogic(tl, ll); List <League> leagues = new List <League>() { new League() { LID = Guid.NewGuid().ToString(), Name = "Formula 1 (F1)", Rating = 8, Homology = true, RaceTypes = RaceType.circuit }, new League() { LID = Guid.NewGuid().ToString(), Name = "World Touring Car Championship (WTCC)", Rating = 7, Homology = false, RaceTypes = RaceType.circuit }, }; List <Team> teams = new List <Team>() { new Team { TID = Guid.NewGuid().ToString(), TName = "Mercedes-AMG Petronas F1 Team", Created = 2010, Country = "Germany", Engine = ESuppliers.Mercedes, LID = leagues.ElementAt(0).LID }, new Team { TID = Guid.NewGuid().ToString(), TName = "Aston Martin Red Bull Racing", Created = 2005, Country = "Austria", Engine = ESuppliers.Honda, LID = leagues.ElementAt(0).LID }, new Team { TID = Guid.NewGuid().ToString(), TName = "Renault DP World F1 Team", Created = 1977, Country = "France", Engine = ESuppliers.Renault, LID = leagues.ElementAt(0).LID }, new Team { TID = Guid.NewGuid().ToString(), TName = "Zengő Motorsport Services KFT", Created = 1996, Country = "Hungary", Engine = ESuppliers.Seat, LID = leagues.ElementAt(1).LID }, }; List <Team> expected = new List <Team>(); expected.Add(teams[1]); expected.Add(teams[0]); expected.Add(teams[2]); leagueRepo.Setup(x => x.Search()).Returns(leagues.AsQueryable); teamRepo.Setup(x => x.Search()).Returns(teams.AsQueryable); var result = s.TeamOfBestLeague(); Assert.That(result, Is.EqualTo(expected)); }
public IActionResult Statistics() { StatLogic statLogic = new StatLogic(leagueLogic, teamLogic, driverLogic); Stat stat = new Stat(); //Oldest team drivers stat stat.OldestTeamDrivers = statLogic.OldestTeamDrivers(); stat.MostDriverInTeam = statLogic.MostDriverInTeam(); /*----------------------------------------------------------------------*/ //Most popular League and its teams stat.TeamsOfBestLeague = statLogic.TeamOfBestLeague(); /*----------------------------------------------------------------------*/ //Most used engine type and count stat.MostUsedEngine = statLogic.MostUsedEngine(); return(View(stat)); }
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)); }