public static PavlovServer[] InitializePavlovServer(SshServerSerivce sshServerSerivce, PavlovServerService pavlovServerService) { var sshServer = SshServerServiceTests.SshServerInsert(sshServerSerivce); return(PavlovServers(sshServer, pavlovServerService)); }
public PavlovServerController(SshServerSerivce service, UserService userService, PavlovServerService pavlovServerService, ServerBansService serverBansService, ServerSelectedMapService serverSelectedMapService, MapsService mapsService, SshServerSerivce sshServerSerivce, ServerSelectedWhitelistService whitelistService, SteamIdentityStatsServerService steamIdentityStatsServerService, ServerSelectedModsService serverSelectedModsService, SteamIdentityService steamIdentityService, UserManager <LiteDbUser> userManager, IToastifyService notyfService) { _notifyService = notyfService; _service = service; _userservice = userService; _pavlovServerService = pavlovServerService; _serverSelectedMapService = serverSelectedMapService; _serverBansService = serverBansService; _steamIdentityStatsServerService = steamIdentityStatsServerService; _mapsService = mapsService; _whitelistService = whitelistService; _steamIdentityService = steamIdentityService; _sshServerSerivce = sshServerSerivce; _serverSelectedModsService = serverSelectedModsService; UserManager = userManager; }
public static SshServer SshServerInsert(SshServerSerivce sshServerSerivce) { sshServerSerivce.Insert(SshServer(), false).GetAwaiter().GetResult(); var sshServer = sshServerSerivce.FindAll().GetAwaiter().GetResult().FirstOrDefault(); return(sshServer); }
public SshServerServiceTests() { services = new ServicesBuilder(); _mocker = new AutoMocker(); services.Build(_mocker); _sshServerSerivce = _mocker.CreateInstance <SshServerSerivce>(); _pavlovServerService = _mocker.CreateInstance <PavlovServerService>(); }
public SshServerController(SshServerSerivce service, UserService userService, ServerSelectedMapService serverSelectedMapService, MapsService mapsService, PavlovServerService pavlovServerService, IConfiguration configuration) { _service = service; _userservice = userService; _serverSelectedMapService = serverSelectedMapService; _mapsService = mapsService; _pavlovServerService = pavlovServerService; _configuration = configuration; }
public PublicViewListsServiceTest() { services = new ServicesBuilder(); _mocker = new AutoMocker(); services.Build(_mocker); _pavlovServerService = _mocker.CreateInstance <PavlovServerService>(); _sshServerSerivce = _mocker.CreateInstance <SshServerSerivce>(); _pavlovServerInfoService = _mocker.CreateInstance <PavlovServerInfoService>(); _pavlovServerPlayerService = _mocker.CreateInstance <PavlovServerPlayerService>(); _publicViewListsService = _mocker.CreateInstance <PublicViewListsService>(); }
public ServerSelectedWhitelistServiceTests() { services = new ServicesBuilder(); _mocker = new AutoMocker(); services.Build(_mocker); _serverSelectedWhitelistService = _mocker.CreateInstance <ServerSelectedWhitelistService>(); _steamIdentityService = _mocker.CreateInstance <SteamIdentityService>(); _pavlovServerService = _mocker.CreateInstance <PavlovServerService>(); _sshServerSerivce = _mocker.CreateInstance <SshServerSerivce>(); _userManager = services.GetUserManager(); }
public MatchServiceTest() { services = new ServicesBuilder(); _mocker = new AutoMocker(); services.Build(_mocker); _pavlovServerService = _mocker.CreateInstance <PavlovServerService>(); _sshServerSerivce = _mocker.CreateInstance <SshServerSerivce>(); _teamService = _mocker.CreateInstance <TeamService>(); _matchService = _mocker.CreateInstance <MatchService>(); _steamIdentityService = _mocker.CreateInstance <SteamIdentityService>(); _matchSelectedSteamIdentitiesService = _mocker.CreateInstance <MatchSelectedSteamIdentitiesService>(); _matchSelectedTeamSteamIdentitiesService = _mocker.CreateInstance <MatchSelectedTeamSteamIdentitiesService>(); _userManager = services.GetUserManager(); }
private static PavlovServer[] InsertToPavlovServer(LiteDbUser user, SshServerSerivce sshServerSerivce, PavlovServerService pavlovServerService, ServerSelectedModsService serverSelectedModsService, bool withInsert = true) { var pavlovServers = PavlovServerServiceTests.InitializePavlovServer(sshServerSerivce, pavlovServerService); if (withInsert) { serverSelectedModsService.Insert(new ServerSelectedMods { LiteDbUser = user, PavlovServer = pavlovServers.First() }).GetAwaiter().GetResult(); } return(pavlovServers); }
public ApiWithKeyController(PavlovServerService pavlovServerService, SshServerSerivce sshServerSerivce, ReservedServersService reservedServersService, UserService userService, UserManager <LiteDbUser> userManager, IToastifyService notyfService, IConfiguration configuration) { _notifyService = notyfService; _pavlovServerService = pavlovServerService; _sshServerSerivce = sshServerSerivce; _userService = userService; _reservedServersService = reservedServersService; _configuration = configuration; _userManager = userManager; ApiKey = configuration.GetSection("ApiKey").Value; GeneratedServerPath = configuration.GetSection("GeneratedServerPath").Value; }
public PavlovServerServiceTests() { services = new ServicesBuilder(); _mocker = new AutoMocker(); services.Build(_mocker); _userManager = services.GetUserManager(); // Mock ValidatePavlovServer function var tmpService = _mocker .Setup <PavlovServerService, Task <PavlovServer> >(x => x.ValidatePavlovServer(It.IsAny <PavlovServer>(), It.IsAny <bool>())) .ReturnsAsync((PavlovServer server, bool root) => server); _mocker.Use(tmpService); _pavlovServerService = _mocker.GetMock <PavlovServerService>().Object; _sshServerSerivce = _mocker.CreateInstance <SshServerSerivce>(); _serverSelectedModsService = _mocker.CreateInstance <ServerSelectedModsService>(); _steamIdentityService = _mocker.CreateInstance <SteamIdentityService>(); }
public AccountController( UserManager <LiteDbUser> userManager, SignInManager <LiteDbUser> signInManager, IEmailSender emailSender, ReservedServersService reservedServersService, SteamIdentityService steamIdentityService, PavlovServerService pavlovServerService, SshServerSerivce sshServerSerivce, ILogger <AccountController> logger, UserService userService) { _userManager = userManager; _signInManager = signInManager; _emailSender = emailSender; _logger = logger; _userService = userService; _sshServerSerivce = sshServerSerivce; _steamIdentityService = steamIdentityService; _reservedServersService = reservedServersService; _pavlovServerService = pavlovServerService; }