public async Task LoadAndSaveMapAndRace() { var playerRepository = new PlayerStatsRepository(MongoClient); var player = PlayerRaceOnMapVersusRaceRatio.Create("peter#123", 0); await playerRepository.UpsertMapAndRaceStat(player); var playerLoaded = await playerRepository.LoadMapAndRaceStat(player.BattleTag, 0); Assert.AreEqual(player.BattleTag, playerLoaded.BattleTag); }
public async Task MapWinsAsTotalRace() { var playerRepository = new PlayerStatsRepository(MongoClient); var player = PlayerRaceOnMapVersusRaceRatio.Create("peter#123", 0); var patch = "1.32.5"; player.AddMapWin(Race.HU, Race.UD, "TM", true, patch); player.AddMapWin(Race.NE, Race.UD, "TM", true, patch); player.AddMapWin(Race.OC, Race.UD, "TM", true, patch); await playerRepository.UpsertMapAndRaceStat(player); var playerLoaded = await playerRepository.LoadMapAndRaceStat(player.BattleTag, 0); Assert.AreEqual(3, playerLoaded.GetWinLoss(Race.Total, Race.UD, "TM", patch).Wins); }