public static Match CreateMatch(MatchService matchService, PavlovServer pavlovServer, bool teamMatch,
                                        TeamService teamService, SteamIdentityService steamIdentityService, UserManager <LiteDbUser> userManager,
                                        MatchSelectedSteamIdentitiesService matchSelectedSteamIdentitiesService,
                                        MatchSelectedTeamSteamIdentitiesService matchSelectedTeamSteamIdentitiesService)
        {
            var user = ServerSelectedModServiceTests.InsertUserAndSteamIdentity(steamIdentityService, userManager,
                                                                                "test");
            var user2 = ServerSelectedModServiceTests.InsertUserAndSteamIdentity(steamIdentityService, userManager,
                                                                                 "test2", "2");
            var steamIdentity1 = steamIdentityService.FindOne(user.Id).GetAwaiter().GetResult();
            var steamIdentity2 = steamIdentityService.FindOne(user2.Id).GetAwaiter().GetResult();
            var team1          = TeamSelectedSteamIdentityServiceTest.CreateTeam(teamService);
            var team2          = TeamSelectedSteamIdentityServiceTest.CreateTeam(teamService, "test2");

            if (teamMatch)
            {
                matchService.Upsert(new Match
                {
                    Name         = "Test",
                    MapId        = "null",
                    GameMode     = "TDM",
                    ForceStart   = false,
                    ForceSop     = false,
                    TimeLimit    = 40,
                    PlayerSlots  = 10,
                    Team0        = team1,
                    Team1        = team2,
                    PavlovServer = pavlovServer,
                    Status       = Status.Preparing
                }).GetAwaiter().GetResult();
            }
            else
            {
                matchService.Upsert(new Match
                {
                    Name         = "Test",
                    MapId        = "null",
                    GameMode     = "GUN",
                    ForceStart   = false,
                    ForceSop     = false,
                    TimeLimit    = 40,
                    PlayerSlots  = 10,
                    Team0        = team1,
                    PavlovServer = pavlovServer,
                    Status       = Status.Preparing
                }).GetAwaiter().GetResult();
            }


            var match = matchService.FindAll().GetAwaiter().GetResult().FirstOrDefault();

            if (teamMatch)
            {
                match.MatchTeam0SelectedSteamIdentities = new List <MatchTeamSelectedSteamIdentity>
                {
                    new()
                    {
                        SteamIdentityId = steamIdentity1.Id,
                        SteamIdentity   = steamIdentity1,
                        matchId         = match.Id,
                        TeamId          = 0
                    }
                };
                match.MatchTeam1SelectedSteamIdentities = new List <MatchTeamSelectedSteamIdentity>
                {
                    new()
                    {
                        SteamIdentityId = steamIdentity2.Id,
                        SteamIdentity   = steamIdentity2,
                        matchId         = match.Id,
                        TeamId          = 1
                    }
                };
                matchSelectedTeamSteamIdentitiesService.Upsert(match.MatchTeam0SelectedSteamIdentities, match.Id, 0)
                .GetAwaiter().GetResult();
                matchSelectedTeamSteamIdentitiesService.Upsert(match.MatchTeam1SelectedSteamIdentities, match.Id, 1)
                .GetAwaiter().GetResult();
            }
            else
            {
                match.MatchSelectedSteamIdentities = new List <MatchSelectedSteamIdentity>
                {
                    new()
                    {
                        SteamIdentityId = steamIdentity1.Id,
                        SteamIdentity   = steamIdentity1,
                        matchId         = match.Id
                    },
                    new()
                    {
                        SteamIdentityId = steamIdentity2.Id,
                        SteamIdentity   = steamIdentity2,
                        matchId         = match.Id
                    }
                };

                matchSelectedSteamIdentitiesService.Upsert(match.MatchSelectedSteamIdentities, match.Id).GetAwaiter()
                .GetResult();
            }

            matchService.Upsert(match);
            return(match);
        }