public static LiteDbUser InsertUserAndSteamIdentity(SteamIdentityService steamIdentityService, UserManager <LiteDbUser> userManager, string userName = "******", string steamIdentityId = "1") { var user = UserServiceTests.SetUpUser(userManager, userName); var identity = SteamIdentityServiceTest.SteamIdentity(steamIdentityId); identity.LiteDbUser = user; identity.LiteDbUserId = user.Id.ToString(); steamIdentityService.Upsert(identity).GetAwaiter().GetResult(); return(user); }
public void IsModSomeWhere() { // arrange var pavlovServers = InitializePavlovServer(_sshServerSerivce, _pavlovServerService); var user = UserServiceTests.SetUpUser(_userManager); var steamIdentity = SteamIdentityServiceTest.SteamIdentity(); steamIdentity.LiteDbUser = user; steamIdentity.LiteDbUserId = user.Id.ToString(); _steamIdentityService.Upsert(steamIdentity).GetAwaiter().GetResult(); _serverSelectedModsService.Insert(new ServerSelectedMods { PavlovServer = pavlovServers.First(), LiteDbUser = user }).GetAwaiter().GetResult(); // act var isMod = _pavlovServerService.IsModSomeWhere(user, _serverSelectedModsService).GetAwaiter().GetResult(); // assert isMod.Should().BeTrue(); }