Example #1
0
        public void TestAddNewTeam()
        {
            TeamLogic t    = new TeamLogic(this.teamRepo.Object);
            Team      newt = new Team()
            {
                TID     = Guid.NewGuid().ToString(),
                TName   = "TestTeam",
                Created = 1999,
                Country = "TestCountry",
                Engine  = ESuppliers.Audi,
                LID     = Guid.NewGuid().ToString()
            };

            teamRepo.Setup(x => x.AddItem(It.IsAny <Team>()));
            t.AddTeam(newt);
            teamRepo.Verify(x => x.AddItem(newt), Times.Once);
        }
Example #2
0
 public void AddTeam([FromBody] Team item)
 {
     logic.AddTeam(item);
 }
Example #3
0
        public IActionResult GenerateData()
        {
            if (voltemar)
            {
                League L = new League {
                    LeagueID = "Premier Leauge", Country = "England"
                };
                leaguelogic.AddLeague(L);

                Team t = new Team {
                    TeamID = "Liverpool", City = "Liverpool", LeagueID = L.LeagueID
                };
                teamlogic.AddTeam(t);

                Team ta = new Team {
                    TeamID = "Chelsea", City = "London", LeagueID = L.LeagueID
                };
                teamlogic.AddTeam(ta);



                Player p = new Player {
                    PlayerName = "Van Dijk", TeamID = t.TeamID, Nationality = "Netherland", Rating = 90, WeakFoot = 2
                };
                p.IgazolasSzama = Guid.NewGuid().ToString();
                playerlogic.AddPlayer(p);

                Player pb = new Player {
                    PlayerName = "Pulisics", TeamID = ta.TeamID, Nationality = "USA", Rating = 82, WeakFoot = 2
                };
                pb.IgazolasSzama = Guid.NewGuid().ToString();
                playerlogic.AddPlayer(pb);

                //----------------------------------------------------------------------------------------------------------------------------

                League L1 = new League {
                    LeagueID = "MB1", Country = "Hungary"
                };
                leaguelogic.AddLeague(L1);

                Team t1 = new Team {
                    TeamID = "Kaposvár", City = "Kaposvár", LeagueID = L1.LeagueID
                };
                teamlogic.AddTeam(t1);

                Team t1b = new Team {
                    TeamID = "MTK", City = "Budapest", LeagueID = L1.LeagueID
                };
                teamlogic.AddTeam(t1b);



                Player p1 = new Player {
                    PlayerName = "Ács Péter", TeamID = t1.TeamID, Nationality = "Hungary", Rating = 76, WeakFoot = 5
                };
                p1.IgazolasSzama = Guid.NewGuid().ToString();
                playerlogic.AddPlayer(p1);

                Player p1b = new Player {
                    PlayerName = "Gazdag Dávid", TeamID = t1b.TeamID, Nationality = "Hungary", Rating = 81, WeakFoot = 5
                };
                p1b.IgazolasSzama = Guid.NewGuid().ToString();
                playerlogic.AddPlayer(p1b);


                //----------------------------------------------------------------------------------------------------------------------------

                League L2 = new League {
                    LeagueID = "Seria A", Country = "Italy"
                };
                leaguelogic.AddLeague(L2);

                Team t2 = new Team {
                    TeamID = "Juventus", City = "Torino", LeagueID = L2.LeagueID
                };
                teamlogic.AddTeam(t2);



                Player p2 = new Player {
                    PlayerName = "Cristano Ronaldo", TeamID = t2.TeamID, Nationality = "Portugal", Rating = 94, WeakFoot = 5
                };
                p2.IgazolasSzama = Guid.NewGuid().ToString();
                playerlogic.AddPlayer(p2);

                Player p3 = new Player {
                    PlayerName = "Khedira", TeamID = t2.TeamID, Nationality = "Germany", Rating = 81, WeakFoot = 3
                };
                p3.IgazolasSzama = Guid.NewGuid().ToString();
                playerlogic.AddPlayer(p3);

                voltemar = false;
            }



            return(RedirectToAction(nameof(Index)));
        }
Example #4
0
 public IActionResult TeamAdd(Team team)
 {
     team.TID = Guid.NewGuid().ToString();
     teamLogic.AddTeam(team);
     return(RedirectToAction(nameof(TeamList)));
 }
Example #5
0
 public void AddTeam([FromBody] Team team)
 {
     logic.AddTeam(team);
 }
        public void FillDb()
        {
            //HomeControllerből átillesztett kód!
            League lg1 = new League {
                Name = "Formula 1 (F1)", Rating = 10, Homology = true, RaceTypes = RaceType.circuit
            };

            llogic.AddLeague(lg1);
            League lg2 = new League {
                Name = "Deutsche Tourenwagen Masters (DTM)", Rating = 5, Homology = false, RaceTypes = RaceType.circuit
            };

            llogic.AddLeague(lg2);
            League lg3 = new League {
                Name = "World Touring Car Championship (WTCC)", Rating = 7, Homology = false, RaceTypes = RaceType.circuit
            };

            llogic.AddLeague(lg3);
            League lg4 = new League {
                Name = "Le Mans Series", Rating = 8, Homology = false, RaceTypes = RaceType.circuit
            };

            llogic.AddLeague(lg4);
            League lg5 = new League {
                Name = "Formula E", Rating = 3, Homology = true, RaceTypes = RaceType.circuit
            };

            llogic.AddLeague(lg5);
            League lg6 = new League {
                Name = "World of Outlaws Sprint Car Series", Rating = 5, Homology = false, RaceTypes = RaceType.sprint
            };

            llogic.AddLeague(lg6);
            /*------------------------------------------------------------------------*/
            Team tm1 = new Team {
                TName = "Mercedes-AMG Petronas F1 Team", Created = 2010, Country = "Germany", Engine = ESuppliers.Mercedes, LID = lg1.LID
            };

            tlogic.AddTeam(tm1);
            Team tm2 = new Team {
                TName = "Aston Martin Red Bull Racing", Created = 2005, Country = "Austria", Engine = ESuppliers.Honda, LID = lg1.LID
            };

            tlogic.AddTeam(tm2);
            Team tm3 = new Team {
                TName = "Renault DP World F1 Team", Created = 1977, Country = "France", Engine = ESuppliers.Renault, LID = lg1.LID
            };

            tlogic.AddTeam(tm3);
            Team tm4 = new Team {
                TName = "Audi MotorSport Abt Sportsline", Created = 1991, Country = "Germany", Engine = ESuppliers.Audi, LID = lg2.LID
            };

            tlogic.AddTeam(tm4);
            Team tm5 = new Team {
                TName = "Zengő Motorsport Services KFT", Created = 1996, Country = "Hungary", Engine = ESuppliers.Seat, LID = lg3.LID
            };

            tlogic.AddTeam(tm5);
            Team tm6 = new Team {
                TName = "DragonSpeed Racing", Created = 2007, Country = "USA", Engine = ESuppliers.Gibson, LID = lg4.LID
            };

            tlogic.AddTeam(tm6);
            Team tm7 = new Team {
                TName = "Alfa Romeo Racing Orlen", Created = 2019, Country = "Switzerland", Engine = ESuppliers.Ferrari, LID = lg1.LID
            };

            tlogic.AddTeam(tm7);
            Team tm8 = new Team {
                TName = "McLaren-Renault", Created = 1963, Country = "Switzerland", Engine = ESuppliers.Renault, LID = lg1.LID
            };

            tlogic.AddTeam(tm8);
            /*------------------------------------------------------------------------*/
            Driver dr1 = new Driver {
                DName = "Valtteri Bottas", BornYear = 1989, CountryB = "Finland", RaceNumber = 77, TID = tm1.TID
            };

            dlogic.AddDriver(dr1);
            Driver dr2 = new Driver {
                DName = "Daniel Ricciardo", BornYear = 1989, CountryB = "Australia", RaceNumber = 3, TID = tm3.TID
            };

            dlogic.AddDriver(dr2);
            Driver dr3 = new Driver {
                DName = "Max Verstappen", BornYear = 1997, CountryB = "Belgium", RaceNumber = 33, TID = tm2.TID
            };

            dlogic.AddDriver(dr3);
            Driver dr4 = new Driver {
                DName = "Lucas di Grassi", BornYear = 1984, CountryB = "Brazil", RaceNumber = 11, TID = tm4.TID
            };

            dlogic.AddDriver(dr4);
            Driver dr5 = new Driver {
                DName = "Boldizs Bence", BornYear = 1997, CountryB = "Hungary", RaceNumber = 55, TID = tm5.TID
            };

            dlogic.AddDriver(dr5);
            Driver dr6 = new Driver {
                DName = "Ben Hanley", BornYear = 1985, CountryB = "England", RaceNumber = 27, TID = tm6.TID
            };

            dlogic.AddDriver(dr6);
            Driver dr7 = new Driver {
                DName = "Esteban Ocon", BornYear = 1996, CountryB = "France", RaceNumber = 31, TID = tm3.TID
            };

            dlogic.AddDriver(dr7);
            Driver dr8 = new Driver {
                DName = "Kimi Räikkönen", BornYear = 1979, CountryB = "Finland", RaceNumber = 7, TID = tm7.TID
            };

            dlogic.AddDriver(dr8);
            Driver dr9 = new Driver {
                DName = "Lando Norris", BornYear = 1999, CountryB = "England", RaceNumber = 4, TID = tm8.TID
            };

            dlogic.AddDriver(dr9);
            Driver dr10 = new Driver {
                DName = "Carlos Sainz Jr.", BornYear = 1994, CountryB = "Spain", RaceNumber = 55, TID = tm8.TID
            };

            dlogic.AddDriver(dr10);
            Driver dr11 = new Driver {
                DName = "Paul Di Resta", BornYear = 1986, CountryB = "England", RaceNumber = 40, TID = tm8.TID
            };

            dlogic.AddDriver(dr11);
        }