Beispiel #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         if (base.IsLeagueSelected)
         {
             using (var db = new FantasyGolfContext())
             {
                 var tournaments = TournamentService.List(this.CurrentLeagueId);
                 tournament_list.DataSource = tournaments;
                 tournament_list.DataBind();
                 tournament_list.Items.Insert(0, "");
                 tournament_list.SelectedIndex = 0;
             }
         }
         message_label_panel.Visible = false;
     }
 }
Beispiel #2
0
        public void FindById_GivenExistingTournamentAndId_ShouldReturnTournament()
        {
            //Given
            var tournamentId         = 1;
            var tournamentRepository = Substitute.For <ITournamentRepository>();
            var tournamentService    = new TournamentService(tournamentRepository);
            var tournaments          = new List <Tournament>()
            {
                new Tournament(1, "Tournament 1", DateTime.Now.AddMonths(-2), "Location 1")
            };

            tournamentRepository.FindById(tournamentId).Returns(tournaments);
            //When
            var results = tournamentService.FindById(tournamentId);

            //Then
            results.Should().BeEquivalentTo(tournaments);
        }
Beispiel #3
0
        private HeadJudgeViewModel GetModelForHeadJudge(long tournamentId, long?judgeId = null)
        {
            var tourney = TournamentService.GetTournamentGuarded(tournamentId);
            var judges  = tourney.Judges;

            foreach (var j in judges)
            {
                if (j.Id == judgeId)
                {
                    judges.Remove(j);
                    break;
                }
            }
            var judge = TournamentService.GetJudgeGuarded(judgeId.Value);
            var model = new HeadJudgeViewModel(tourney, judge, judges);

            return(model);
        }
Beispiel #4
0
        public async Task TestCreateAsyncWhitUnavailableServiceMovieAndReturnsUnsuccess()
        {
            // Arrange
            var expected = new Response <string>(false, "Error connecting to the movie service");

            var responseMovie = new Response <IEnumerable <MovieViewModel> >(false, "Error connecting to the movie service");

            _movieServiceMock.Setup(x => x.GetMoviesAsync())
            .Returns(Task.FromResult(responseMovie));

            var service = new TournamentService(_movieServiceMock.Object, _standingServiceMock.Object, _repositoryMock.Object, _mapperMock.Object);
            // Act
            var result = await service.CreateAsync(It.IsAny <CreateTournamentViewModel>());

            // Assert
            _movieServiceMock.Verify(x => x.GetMoviesAsync(), Times.Once);
            result.Should().BeEquivalentTo(expected);
        }
        public async Task ThrowArgumentNullException_WhenPassedNullFilter()
        {
            // Arrange
            Mock <IPandaScoreClient> pandaScoreClientMock = new Mock <IPandaScoreClient>();
            Mock <DataContext>       dataContextMock      = new Mock <DataContext>();

            string validSortOrder  = string.Empty;
            string invalidFilter   = null;
            int    validPageNumber = 1;
            int    validPageSize   = 10;

            TournamentService SUT = new TournamentService(
                pandaScoreClientMock.Object,
                dataContextMock.Object);

            // Act & Assert
            await Assert.ThrowsExceptionAsync <ArgumentNullException>(
                () => SUT.FilterTournamentsAsync(validSortOrder, invalidFilter, validPageNumber, validPageSize));
        }
Beispiel #6
0
        public void DoesTournamentReturnNullIfNotInProgress()
        {
            //Arrange
            var Provider = new Mock <ITournamentProvider>();

            Provider.Setup(x => x.GetTournamentInProgress())
            .Returns(new ProviderResult <Tournament>()
            {
                Status = ProviderStatusCode.NotFound, Value = null
            });

            ITournamentService TournamentServ = new TournamentService(Provider.Object);

            //Act
            var result = TournamentServ.GetTournamentInProgress();

            //Assert
            Assert.IsNull(result);
        }
Beispiel #7
0
        public TournamentServiceUnitTests()
        {
            tournamentRepositoryMock = new Mock <ITournamentRepository>();
            teamRepositoryMock       = new Mock <ITeamRepository>();
            teamServiceMock          = new Mock <ITeamService>();
            playerRepositoryMock     = new Mock <IPlayerRepository>();
            userRepositoryMock       = new Mock <IUserRepository>();
            matchRepositoryMock      = new Mock <IMatchRepository>();
            disciplineRepositoryMock = new Mock <IDisciplineRepository>();
            pointsRepositoryMock     = new Mock <IPointsRepository>();
            bracketManager           = new BracketManager(new Mapper(new MapperConfiguration(new MapperConfigurationExpression())));
            unitOfWorkMock           = new Mock <IUnitOfWork>();
            mapperMock = new Mock <IMapper>();

            tournamentService = new TournamentService(tournamentRepositoryMock.Object, teamRepositoryMock.Object,
                                                      teamServiceMock.Object, playerRepositoryMock.Object, userRepositoryMock.Object,
                                                      matchRepositoryMock.Object, disciplineRepositoryMock.Object, unitOfWorkMock.Object,
                                                      pointsRepositoryMock.Object, mapperMock.Object, bracketManager);
        }
Beispiel #8
0
        public void FindAll_GivenItemsExist_ShouldReturnAll()
        {
            //Given
            var tournamentRepository = Substitute.For <ITournamentRepository>();
            var tournamentService    = new TournamentService(tournamentRepository);
            var tournaments          = new List <Tournament>()
            {
                new Tournament(1, "Tournament 1", DateTime.Now.AddMonths(-2), "Location 1"),
                new Tournament(2, "Tournament 2", DateTime.Now.AddMonths(2), "Location 2"),
                new Tournament(3, "Tournament 3", DateTime.Now.AddYears(2), "Location 3")
            };

            tournamentRepository.FindAll().Returns(tournaments);
            //When
            var results = tournamentService.FindAll();

            //Then
            results.Should().BeEquivalentTo(tournaments);
        }
Beispiel #9
0
        public void FindByDate_GivenItemsExist_ShouldReturnMatchingItems()
        {
            //Given
            var tournamentRepository = Substitute.For <ITournamentRepository>();
            var tournamentService    = new TournamentService(tournamentRepository);
            var tournaments          = new List <Tournament>()
            {
                new Tournament(1, "Tournament 1", DateTime.Parse("2018/10/18"), "Location 1"),
                new Tournament(2, "Tournament 2", DateTime.Parse("2019/12/25"), "Location 2"),
                new Tournament(3, "Tournament 3", DateTime.Parse("2016/01/01"), "Location 3")
            };

            tournamentRepository.FindByDate(Arg.Any <DateTime>()).Returns(tournaments);
            //When
            var results = tournamentService.FindByDate(DateTime.Parse("2018/10/18"));

            //Then
            results.Should().BeEquivalentTo(tournaments);
        }
        public async Task HasEndedShouldReturnTrueIfTournamentHasEnded()
        {
            // Arange
            var dbContext = Testing.CreateDatabaseContext();
            var mapper    = Testing.CreateMapper();

            await dbContext.Tournaments.AddAsync(new Tournament { Id = 1, HasEnded = true });

            await dbContext.SaveChangesAsync();

            var tournamentService = new TournamentService(dbContext, mapper);

            // Act
            var result = tournamentService.HasEnded(1);

            // Assert
            result
            .Should()
            .BeTrue();
        }
        public async Task ContainsAsyncShouldReturnTrueIfTournamentExists()
        {
            // Arange
            var dbContext = Testing.CreateDatabaseContext();
            var mapper    = Testing.CreateMapper();

            await dbContext.Tournaments.AddAsync(new Tournament { Id = 1 });

            await dbContext.SaveChangesAsync();

            var tournamentService = new TournamentService(dbContext, mapper);

            // Act
            var result = await tournamentService.ContainsAsync(1);

            // Assert
            result
            .Should()
            .BeTrue();
        }
Beispiel #12
0
        public void ReturnCountEqualsToOne_WhenTournamentsCountainsOneTournament()
        {
            // Arrange
            int page     = 1;
            int pageSize = 1;

            Guid id        = Guid.NewGuid();
            Guid countryId = Guid.NewGuid();

            Tournament expectedTournament = new Tournament
            {
                Id        = id,
                Name      = "Test tournament",
                StartDate = DateTime.Now,
                EndDate   = DateTime.Now,
                Place     = "Test place",
                CountryId = countryId
            };

            var expectedTournaments = new List <Tournament>()
            {
                expectedTournament
            };

            var tournamentDbSetMock = QueryableDbSetMock.GetQueryableMockDbSet(expectedTournaments);

            var yoyoTournamentsDbContextMock = new Mock <IYoyoTournamentsDbContext>();

            yoyoTournamentsDbContextMock.Setup(x => x.Tournaments).Returns(tournamentDbSetMock.Object);

            var divisionTypeServiceMock = new Mock <IDivisionTypeService>();

            var tournamentService = new TournamentService(yoyoTournamentsDbContextMock.Object, divisionTypeServiceMock.Object);

            // Act
            var actualCount       = 0;
            var actualTournaments = tournamentService.GetAllTournamentsWIthPaging(out actualCount, page, pageSize);

            // Assert
            Assert.AreEqual(expectedTournaments.Count, actualCount);
        }
        void PruebaTournamentService()
        {
            Tournament t = new Tournament
            {
                CreationDate = DateTime.Now,
                Name         = "RusíA 2018"
            };

            TournamentService service = new TournamentService(null);

            try
            {
                service.Insert(t);
                Console.WriteLine("Registro exitoso");
            }
            catch (Exception ex)
            {
                Console.WriteLine("Error {0}", ex.Message);
            }
            Console.ReadLine();
        }
Beispiel #14
0
        public static void Update()
        {
            HttpClient           client      = new HttpClient();
            string               Url         = PandaScoreUtils.PandaBaseAddress + $"tournaments?token={PandaScoreUtils.Token}&{PandaScoreUtils.MaxPerPage}";
            List <TournamentApi> tournaments = new List <TournamentApi>();

            HttpResponseMessage msg = client.GetAsync(Url).Result;

            tournaments.AddRange(JsonConvert.DeserializeObject <List <TournamentApi> >(msg.Content.ReadAsStringAsync().Result));

            TournamentService     tournamentService     = new TournamentService();
            TeamTournamentService teamTournamentService = new TeamTournamentService();

            foreach (TournamentApi t in tournaments)
            {
                Tournament tournament = new Tournament()
                {
                    BeginAt        = t.BeginAt,
                    EndAt          = t.EndAt,
                    Id             = t.Id,
                    ImageURL       = t.League.ImageURL,
                    LeagueName     = t.League.Name,
                    Name           = t.Name,
                    Prizepool      = t.Prizepool,
                    SeriesFullName = t.Serie.FullName
                };

                tournamentService.Update(tournament);

                foreach (TeamApi team in t.Teams)
                {
                    TeamTournamentRegister TTR = new TeamTournamentRegister()
                    {
                        TeamId       = team.Id,
                        TournamentId = t.Id
                    };
                    teamTournamentService.Update(TTR);
                }
            }
        }
Beispiel #15
0
        public async Task FindAsync_ShouldReturnTournament_WhenPassedValidParameters()
        {
            // Arrange
            var contextOptions = new DbContextOptionsBuilder <DataContext>()
                                 .UseInMemoryDatabase(databaseName: "FindAsync_ShouldReturnTournament_WhenPassedValidParameters")
                                 .Options;

            Guid validId = Guid.NewGuid();

            Tournament validTournament = new Tournament
            {
                Id   = validId,
                Name = "testTournament"
            };

            Tournament result = null;

            // Act
            using (DataContext actContext = new DataContext(contextOptions))
            {
                Mock <IPandaScoreClient> pandaScoreClientMock = new Mock <IPandaScoreClient>();

                await actContext.Tournaments.AddAsync(validTournament);

                await actContext.SaveChangesAsync();

                TournamentService SUT = new TournamentService(
                    pandaScoreClientMock.Object,
                    actContext);

                result = await SUT.FindAsync(validId.ToString());
            }

            // Assert
            using (DataContext assertContext = new DataContext(contextOptions))
            {
                Assert.IsTrue(assertContext.Tournaments.Any(c => c.Id.Equals(result.Id)));
                Assert.IsTrue(assertContext.Tournaments.Any(c => c.Name.Equals(result.Name)));
            }
        }
        public void CheckOpenShouldStart()
        {
            // Arrange
            var mockUnitOfWork       = TestUtils.GetUnitOfWorkMock();
            var tournamentRepository = new MockTournamentRepository();

            mockUnitOfWork.SetupGet(x => x.Tournaments).Returns(tournamentRepository);
            var unitOfWork      = mockUnitOfWork.Object;
            var gameServiceMock = new Mock <IGameService>();
            var service         = new TournamentService(TestUtils.MockUserProvider(), unitOfWork, gameServiceMock.Object, TestUtils.MockMapTemplateProvider());

            var openTournament = new Tournament(
                "Tournament",
                8,
                3,
                3,
                3,
                DateTime.UtcNow.AddDays(-1),
                DateTime.UtcNow,
                new Domain.Games.GameOptions
            {
                NumberOfPlayersPerTeam = 1
            });

            tournamentRepository.Add(openTournament);

            for (int i = 0; i < 8; ++i)
            {
                openTournament.AddUser(TestUtils.CreateUser($"User{i}"));
            }

            // Act
            var started = service.CheckOpenTournaments(new TestLogger(), new RandomGen());

            // Assert
            Assert.IsTrue(started);
            Assert.AreEqual(TournamentState.Groups, openTournament.State);
            Assert.AreEqual(12, openTournament.Pairings.Count());
        }
Beispiel #17
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                if (base.IsLeagueSelected)
                {
                    var tournaments = TournamentService.List(this.CurrentLeagueId);
                    tournament_list.DataSource = tournaments;
                    tournament_list.DataBind();
                    tournament_list.Items.Insert(0, "");
                    tournament_list.SelectedIndex = 0;

                    var users = UserService.List(this.CurrentLeagueId);
                    user_list.DataSource = users;
                    user_list.DataBind();
                    user_list.Items.Insert(0, "");
                    user_list.SelectedIndex = 0;

                    BindStandingsGrid();
                }
            }
        }
        private static async Task <ITournamentService> GetTournamentService(string databaseName)
        {
            var db = new FakeSportDbContext(databaseName);

            var config = new MapperConfiguration(cfg =>
            {
                cfg.AddProfile(new DomainProfile());
            });
            var mapper = config.CreateMapper();

            if (databaseName.Equals("TournamentCreate") ||
                databaseName.Equals("TournamentGetTournamentPlayers"))
            {
                await AddUsers(db);
            }
            else
            {
                await AddTournaments(db);
            }

            var user = new User()
            {
                Id = new Guid().ToString()
            };


            var mockUserStore = new Mock <IUserStore <User> >();
            var userManager   = GetUserManager(mockUserStore);

            mockUserStore.Setup(x => x.FindByIdAsync(user.Id, CancellationToken.None))
            .ReturnsAsync(new User()
            {
                Id = user.Id
            });
            ITournamentService service = new TournamentService(mapper, db.Data, userManager);

            return(service);
        }
Beispiel #19
0
        public WhenALargeOddTournamentCompletes()
        {
            _tournament = new Tournament();

            for (int dudeNumber = 1; dudeNumber <= NumberOfDudes; dudeNumber++)
            {
                _tournament.AddDude(new Dude(string.Format("Dude{0}", dudeNumber)));
            }

            var tournamentSvc = new TournamentService();

            _tournament = tournamentSvc.Start(_tournament);

            Game gameToWin;
            int  winner = 0;

            while (null !=
                   (gameToWin = _tournament.Games().Where(game => game.IsInProgress()).FirstOrDefault()))
            {
                winner      = (winner == 0 ? 1 : 0);
                _tournament = tournamentSvc.GameWon(_tournament, gameToWin, gameToWin.Dudes()[winner]);
            }
        }
Beispiel #20
0
        public void ReturnTournamentWithProvidedId()
        {
            // Arrange
            Guid id        = Guid.NewGuid();
            Guid countryId = Guid.NewGuid();

            Tournament expectedTournament = new Tournament
            {
                Id        = id,
                Name      = "Test tournament",
                StartDate = DateTime.Now,
                EndDate   = DateTime.Now,
                Place     = "Test place",
                CountryId = countryId
            };

            var tournamentDbSetMock = QueryableDbSetMock.GetQueryableMockDbSet(new List <Tournament>()
            {
                expectedTournament
            });

            tournamentDbSetMock.Setup(x => x.Find(expectedTournament.Id)).Returns(expectedTournament);

            var yoyoTournamentsDbContextMock = new Mock <IYoyoTournamentsDbContext>();

            yoyoTournamentsDbContextMock.Setup(x => x.Tournaments).Returns(tournamentDbSetMock.Object);

            var divisionTypeServiceMock = new Mock <IDivisionTypeService>();

            var tournamentService = new TournamentService(yoyoTournamentsDbContextMock.Object, divisionTypeServiceMock.Object);

            // Act
            var actualTournament = tournamentService.GetTournamentById(id);

            // Assert
            Assert.AreSame(expectedTournament, actualTournament);
        }
Beispiel #21
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                if (base.IsLeagueSelected)
                {
                    //load up values
                    //SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["default"].ConnectionString);
                    //connection.Open();

                    //var tournaments = connection.Query<Tournament>("Tournament_List", new { LeagueId = base.CurrentLeague }, commandType: CommandType.StoredProcedure);
                    using (var db = new FantasyGolfContext())
                    {
                        var tournaments = TournamentService.List(this.CurrentLeagueId);
                        tournament_list.DataSource = tournaments;
                        tournament_list.DataBind();
                        tournament_list.Items.Insert(0, "");
                        tournament_list.SelectedIndex = 0;

                        //var users = connection.Query<RonsHouse.FantasyGolf.Model.User>("LeagueUser_List", new { LeagueId = base.CurrentLeague }, commandType: CommandType.StoredProcedure);
                        var users = UserService.List(this.CurrentLeagueId);
                        user_list.DataSource = users;
                        user_list.DataBind();
                        user_list.Items.Insert(0, "");
                        user_list.SelectedIndex = 0;

                        //var golfers = connection.Query<Golfer>("select *, LastName + ', ' + FirstName as Name from Golfer order by LastName");
                        var golfers = GolferService.ListActive();
                        golfer_list.DataSource = golfers;
                        golfer_list.DataBind();
                        golfer_list.Items.Insert(0, "");
                        golfer_list.SelectedIndex = 0;
                    }
                }
                message_label_panel.Visible = false;
            }
        }
        public async Task SigninShouldSignInCurrentUser()
        {
            //Arrange
            const string databaseName = "TournamentSigninUser";
            var          db           = new FakeSportDbContext(databaseName);

            var config = new MapperConfiguration(cfg =>
            {
                cfg.AddProfile(new DomainProfile());
            });
            var mapper = config.CreateMapper();

            await AddTournaments(db);

            var mockUserStore = new Mock <IUserStore <User> >();
            UserManager <User> userManager = GetUserManager(mockUserStore);

            ITournamentService service = new TournamentService(mapper, db.Data, userManager);
            //Act
            var user = new User()
            {
                Id = new Guid().ToString()
            };

            mockUserStore.Setup(x => x.FindByIdAsync(user.Id, CancellationToken.None))
            .ReturnsAsync(new User()
            {
                Id = user.Id
            });

            service.Signin(1, user);
            var actualResult = db.Data.UserTournament.Any(u => u.UserId == user.Id);

            //Assert
            Assert.True(actualResult);
        }
        public async Task HandleValidSubmitAsync()
        {
            IsDisabledButton = true;
            StateHasChanged();

            var league = (League)Convert.ToInt32(Model.League);

            TournamentService.NewGamePlayed += NewGamePlayedEvent;
            try
            {
                var games = await TournamentService.NewTournamentAsync(league);

                await TournamentService.InsertNewTournamentAsync(league, games);
            }
            catch (Exception e)
            {
                Toaster.Error(e.Message);
                NavigationManager.NavigateTo("/tournaments");
                return;
            }

            Toaster.Info("Turnaj byl odehrán.");
            NavigationManager.NavigateTo("/tournaments");
        }
Beispiel #24
0
        public void DoesTournamentFailToCreateIfNoTournamentExists()
        {
            //Arrange
            var rtnObj = new Tournament()
            {
                InProgress = true
            };
            var returnResult = new ProviderResult <Tournament>()
            {
                Status = ProviderStatusCode.Ok, Value = rtnObj
            };

            var newTournament = new Tournament()
            {
                ID = 0, InProgress = false, Name = "test"
            };
            var provResult = new ProviderResult <Tournament>()
            {
                Status = ProviderStatusCode.NotFound, Value = null
            };

            var Provider = new Mock <ITournamentProvider>();

            Provider.Setup(x => x.GetTournamentInProgress())
            .Returns(returnResult);
            Provider.Setup(x => x.Create(It.IsAny <Tournament>()))
            .Returns(provResult);

            ITournamentService tournamentServ = new TournamentService(Provider.Object);

            //Act
            var result = tournamentServ.CreateNewTournament(newTournament);

            //Assert
            Assert.IsNull(result);
        }
Beispiel #25
0
        public void DoesTournamentReturnIfInProgress()
        {
            //Arrange
            var RtnObj = new ProviderResult <Tournament>()
            {
                Status = ProviderStatusCode.Ok, Value = new Tournament()
                {
                    InProgress = true
                }
            };

            var Provider = new Mock <ITournamentProvider>();

            Provider.Setup(x => x.GetTournamentInProgress())
            .Returns(RtnObj);

            ITournamentService TournamentServ = new TournamentService(Provider.Object);

            //Act
            var result = TournamentServ.GetTournamentInProgress();

            //Assert
            Assert.AreSame(RtnObj.Value, result);
        }
 public InProgressTournamentsViewComponent(ApplicationDBContext context, TournamentService service)
 {
     _context = context;
     _service = service;
 }
 public TournamentsController(TournomentContext context, TournamentService tournamentService)
 {
     _context           = context;
     _tournamentService = tournamentService;
 }
 public void Initialize()
 {
     unitOfWork = new UnitOfWork("StringTest");
     service    = new TournamentService(unitOfWork);
 }
        public void SynchronizeGames()
        {
            // Arrange
            var mockUnitOfWork = TestUtils.GetUnitOfWorkMock();

            mockUnitOfWork.SetupGet(x => x.Tournaments).Returns(new MockTournamentRepository());
            mockUnitOfWork.SetupGet(x => x.Games).Returns(new MockGamesRepository());
            var unitOfWork = mockUnitOfWork.Object;

            var gameServiceMock = new Mock <IGameService>();
            var service         = new TournamentService(TestUtils.MockUserProvider(), unitOfWork, gameServiceMock.Object, TestUtils.MockMapTemplateProvider());

            var tournament = new Tournament("T", 2, 0, 1, 1, DateTime.UtcNow, DateTime.UtcNow, new GameOptions {
                NumberOfPlayersPerTeam = 1
            });

            tournament.State = TournamentState.Knockout;

            var user1 = TestUtils.CreateUser("1");
            var user2 = TestUtils.CreateUser("2");

            var teamA = new TournamentTeam(tournament);

            teamA.AddUser(user1);

            var teamB = new TournamentTeam(tournament);

            teamB.AddUser(user2);

            var pairing = new TournamentPairing(tournament, 1, 1, teamA, teamB, 1);

            pairing.State       = PairingState.Active;
            tournament.Pairings = new[] { pairing };

            tournament.Teams.Add(teamA);
            tournament.Teams.Add(teamB);

            var game = new Game(null, Enums.GameType.Tournament, "T", "WorldDeluxe", new GameOptions());

            game.State = Enums.GameState.Ended;

            var team1 = new Team(game);

            team1.Players.Add(new Player(game, user1, team1)
            {
                Outcome = Enums.PlayerOutcome.Won
            });
            game.Teams.Add(team1);

            var team2 = new Team(game);

            team2.Players.Add(new Player(game, user2, team2)
            {
                Outcome = Enums.PlayerOutcome.Defeated
            });
            game.Teams.Add(team2);

            pairing.Games = new[] { game };

            // Act
            service.SynchronizeGamesToPairings(new TestLogger(), tournament);

            // Assert
            Assert.IsTrue(tournament.Pairings.First().CanWinnerBeDetermined);
            Assert.AreEqual(PairingState.Done, pairing.State);
            Assert.AreEqual(TournamentTeamState.InActive, teamB.State);
            Assert.AreEqual(TournamentTeamState.Active, teamA.State);
        }
Beispiel #30
0
 public TournamentController(TournamentService tournamentService)
 {
     this.tournamentService = tournamentService;
 }