public void testReplayProperlyParsed() { csgoParser parser = new csgoParser(pathMirageDemo); parser.ParseAllRounds(); Assert.AreEqual(Team.CounterTerrorist, parser.GetWinningTeam()); Assert.AreEqual(25, parser.RoundsPlayed); Assert.AreEqual(25, parser.GetPlayerPathInAllRounds(parser.Players[0]).Keys.Count); for (int i = 0; i < parser.RoundsPlayed; i++) { var allPlayerPathsInRound = parser.GetAllPlayerPathInRound(i); //for every tick in a round a position is saved var ticksPerRound = parser.GetTicksPerRound(i); List <AdvancedPosition> path = allPlayerPathsInRound.getFirstKey(); Assert.AreEqual(ticksPerRound, path.Count); //10 player path are saved each round Assert.AreEqual(allPlayerPathsInRound.Keys.Count, 10); } }
public void testKillfeed() { csgoParser parser = new csgoParser(pathMirageDemo); parser.ParseAllRounds(); Dictionary <int, Dictionary <int, List <PlayerKilledEventArgs> > > killfeed = parser.GetKillFeed(); Assert.AreEqual(killfeed.Keys.Count, parser.RoundsPlayed); foreach (var item in killfeed.Keys) { Dictionary <int, List <PlayerKilledEventArgs> > kills = killfeed[item]; //Latest kill is still in the round Assert.LessOrEqual(kills.Keys.Last(), parser.GetTicksPerRound(item)); //No more than 10 deaths are possible in a round Assert.LessOrEqual(kills.Count, 10); } }