public void Setup() { _customMatch = JsonConvert.DeserializeObject <CustomMatch>(File.ReadAllText(Halo5Config.CustomMatchJsonPath)); var mock = new Mock <IHaloSession>(); mock.Setup(m => m.Get <CustomMatch>(It.IsAny <string>())) .ReturnsAsync(_customMatch); _mockSession = mock.Object; }
private async Task <ArenaMatchResult> GetMatchResult(CustomMatch match, string gamerTag) { ArenaMatchResult result = Mapper.Map <ArenaMatchResult>(match); var players = new List <ArenaPlayer>(); foreach (var playerStat in match.PlayerStats) { var p = await GetCustomPlayer(playerStat); players.Add(p); } SetTeams(match, players, result, gamerTag); return(result); }