package tests

import (
	"testing"

	"github.com/akiver/cs-demo-analyzer/pkg/api"
	"github.com/akiver/cs-demo-analyzer/pkg/api/constants"
	"github.com/akiver/cs-demo-analyzer/tests/assertion"
	"github.com/akiver/cs-demo-analyzer/tests/fake"
	"github.com/akiver/cs-demo-analyzer/tests/testsutils"
	"github.com/markus-wa/demoinfocs-golang/v4/pkg/demoinfocs/common"
	"github.com/markus-wa/demoinfocs-golang/v4/pkg/demoinfocs/events"
)

// https://www.hltv.org/stats/matches/mapstatsid/151549/astralis-vs-saw
func TestChallengerModeSawVsAstralisM2Paris2023CqVertigo(t *testing.T) {
	demoName := "challengermode_saw_vs_astralis_m2_paris_2023_cq_vertigo"
	demoPath := testsutils.GetDemoPath("csgo", demoName)
	match, err := api.AnalyzeDemo(demoPath, api.AnalyzeDemoOptions{
		Source: constants.DemoSourceFaceIt,
	})
	if err != nil {
		t.Error(err)
	}

	expectedRoundCount := 36
	expectedPlayerCount := 10
	expectedScoreTeamA := 17
	expectedScoreTeamB := 19
	expectedScoreFirstHalfTeamA := 6
	expectedScoreFirstHalfTeamB := 9
	expectedScoreSecondHalfTeamA := 9
	expectedScoreSecondHalfTeamB := 6
	expectedTeamNameA := "Astralis"
	expectedTeamNameB := "SAW"
	expectedWinnerName := expectedTeamNameB
	expectedMaxRounds := 30

	if len(match.Rounds) != expectedRoundCount {
		t.Errorf("expected %d rounds but got %d", expectedRoundCount, len(match.Rounds))
	}
	if len(match.Players()) != expectedPlayerCount {
		t.Errorf("expected %d players but got %d", expectedPlayerCount, len(match.Players()))
	}
	if match.TeamA.Score != expectedScoreTeamA {
		t.Errorf("expected score team A to be %d got %d", expectedScoreTeamA, match.TeamA.Score)
	}
	if match.TeamB.Score != expectedScoreTeamB {
		t.Errorf("expected score team B to be %d got %d", expectedScoreTeamB, match.TeamB.Score)
	}
	if match.TeamA.Name != expectedTeamNameA {
		t.Errorf("expected team name A to be %s got %s", expectedTeamNameA, match.TeamA.Name)
	}
	if match.TeamB.Name != expectedTeamNameB {
		t.Errorf("expected team name B to be %s got %s", expectedTeamNameB, match.TeamB.Name)
	}
	if match.TeamA.ScoreFirstHalf != expectedScoreFirstHalfTeamA {
		t.Errorf("expected score first half team A to be %d got %d", expectedScoreFirstHalfTeamA, match.TeamA.ScoreFirstHalf)
	}
	if match.TeamB.ScoreFirstHalf != expectedScoreFirstHalfTeamB {
		t.Errorf("expected score first half team B to be %d got %d", expectedScoreFirstHalfTeamB, match.TeamB.ScoreFirstHalf)
	}
	if match.TeamA.ScoreSecondHalf != expectedScoreSecondHalfTeamA {
		t.Errorf("expected score second half team A to be %d got %d", expectedScoreSecondHalfTeamA, match.TeamA.ScoreSecondHalf)
	}
	if match.TeamB.ScoreSecondHalf != expectedScoreSecondHalfTeamB {
		t.Errorf("expected score second half team B to be %d got %d", expectedScoreSecondHalfTeamB, match.TeamB.ScoreSecondHalf)
	}
	if match.Winner.Name != expectedWinnerName {
		t.Errorf("expected winner to be %s but got %s", expectedWinnerName, match.Winner.Name)
	}
	if match.MaxRounds != expectedMaxRounds {
		t.Errorf("expected max rounds to be %d but got %d", expectedMaxRounds, match.MaxRounds)
	}

	var rounds = []fake.FakeRound{
		{
			Number:            1,
			StartTick:         65281,
			StartFrame:        65219,
			EndTick:           75265,
			FreezeTimeEndTick: 67832,
			TeamAStartMoney:   4000,
			TeamBStartMoney:   4000,
			TeamAEconomyType:  constants.EconomyTypePistol,
			TeamBEconomyType:  constants.EconomyTypePistol,
			EndReason:         events.RoundEndReasonTerroristsWin,
			WinnerSide:        common.TeamTerrorists,
			TeamAScore:        0,
			TeamBScore:        1,
			WinnerName:        expectedTeamNameB,
			TeamASide:         common.TeamCounterTerrorists,
			TeamBSide:         common.TeamTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			Number:            2,
			StartTick:         75904,
			StartFrame:        75840,
			EndTick:           82049,
			FreezeTimeEndTick: 78464,
			TeamAStartMoney:   11300,
			TeamBStartMoney:   18450,
			TeamAEconomyType:  constants.EconomyTypeEco,
			TeamBEconomyType:  constants.EconomyTypeSemi,
			EndReason:         events.RoundEndReasonTerroristsWin,
			WinnerSide:        common.TeamTerrorists,
			TeamAScore:        0,
			TeamBScore:        2,
			WinnerName:        expectedTeamNameB,
			TeamASide:         common.TeamCounterTerrorists,
			TeamBSide:         common.TeamTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			Number:            3,
			StartTick:         82691,
			StartFrame:        82616,
			EndTick:           93376,
			FreezeTimeEndTick: 85251,
			TeamAStartMoney:   22300,
			TeamBStartMoney:   19000,
			TeamAEconomyType:  constants.EconomyTypeFull,
			TeamBEconomyType:  constants.EconomyTypeFull,
			EndReason:         events.RoundEndReasonTerroristsWin,
			WinnerSide:        common.TeamTerrorists,
			TeamAScore:        0,
			TeamBScore:        3,
			WinnerName:        expectedTeamNameB,
			TeamASide:         common.TeamCounterTerrorists,
			TeamBSide:         common.TeamTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			Number:            4,
			StartTick:         94017,
			StartFrame:        93931,
			EndTick:           110451,
			FreezeTimeEndTick: 96577,
			TeamAStartMoney:   15350,
			TeamBStartMoney:   31950,
			TeamAEconomyType:  constants.EconomyTypeSemi,
			TeamBEconomyType:  constants.EconomyTypeFull,
			EndReason:         events.RoundEndReasonTargetBombed,
			WinnerSide:        common.TeamTerrorists,
			TeamAScore:        0,
			TeamBScore:        4,
			WinnerName:        expectedTeamNameB,
			TeamASide:         common.TeamCounterTerrorists,
			TeamBSide:         common.TeamTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			Number:            5,
			StartTick:         111091,
			StartFrame:        110993,
			EndTick:           129381,
			FreezeTimeEndTick: 113651,
			TeamAStartMoney:   26800,
			TeamBStartMoney:   38650,
			TeamAEconomyType:  constants.EconomyTypeFull,
			TeamBEconomyType:  constants.EconomyTypeFull,
			EndReason:         events.RoundEndReasonTargetBombed,
			WinnerSide:        common.TeamTerrorists,
			TeamAScore:        0,
			TeamBScore:        5,
			WinnerName:        expectedTeamNameB,
			TeamASide:         common.TeamCounterTerrorists,
			TeamBSide:         common.TeamTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			Number:            6,
			StartTick:         130021,
			StartFrame:        129912,
			EndTick:           147547,
			FreezeTimeEndTick: 132581,
			TeamAStartMoney:   18600,
			TeamBStartMoney:   44850,
			TeamAEconomyType:  constants.EconomyTypeSemi,
			TeamBEconomyType:  constants.EconomyTypeFull,
			EndReason:         events.RoundEndReasonBombDefused,
			WinnerSide:        common.TeamCounterTerrorists,
			TeamAScore:        1,
			TeamBScore:        5,
			WinnerName:        expectedTeamNameA,
			TeamASide:         common.TeamCounterTerrorists,
			TeamBSide:         common.TeamTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			Number:            7,
			StartTick:         148187,
			StartFrame:        148067,
			EndTick:           162851,
			FreezeTimeEndTick: 150747,
			TeamAStartMoney:   31250,
			TeamBStartMoney:   47550,
			TeamAEconomyType:  constants.EconomyTypeFull,
			TeamBEconomyType:  constants.EconomyTypeFull,
			EndReason:         events.RoundEndReasonTargetBombed,
			WinnerSide:        common.TeamTerrorists,
			TeamAScore:        1,
			TeamBScore:        6,
			WinnerName:        expectedTeamNameB,
			TeamASide:         common.TeamCounterTerrorists,
			TeamBSide:         common.TeamTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			Number:            8,
			StartTick:         167889,
			StartFrame:        167743,
			EndTick:           185169,
			FreezeTimeEndTick: 170449,
			TeamAStartMoney:   23350,
			TeamBStartMoney:   39900,
			TeamAEconomyType:  constants.EconomyTypeFull,
			TeamBEconomyType:  constants.EconomyTypeFull,
			EndReason:         events.RoundEndReasonTargetSaved,
			WinnerSide:        common.TeamCounterTerrorists,
			TeamAScore:        2,
			TeamBScore:        6,
			WinnerName:        expectedTeamNameA,
			TeamASide:         common.TeamCounterTerrorists,
			TeamBSide:         common.TeamTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			Number:            9,
			StartTick:         185809,
			StartFrame:        185663,
			EndTick:           200484,
			FreezeTimeEndTick: 188369,
			TeamAStartMoney:   19600,
			TeamBStartMoney:   27100,
			TeamAEconomyType:  constants.EconomyTypeFull,
			TeamBEconomyType:  constants.EconomyTypeFull,
			EndReason:         events.RoundEndReasonCTWin,
			WinnerSide:        common.TeamCounterTerrorists,
			TeamAScore:        3,
			TeamBScore:        6,
			WinnerName:        expectedTeamNameA,
			TeamASide:         common.TeamCounterTerrorists,
			TeamBSide:         common.TeamTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			Number:            10,
			StartTick:         201126,
			StartFrame:        200971,
			EndTick:           217044,
			FreezeTimeEndTick: 203686,
			TeamAStartMoney:   30000,
			TeamBStartMoney:   20800,
			TeamAEconomyType:  constants.EconomyTypeFull,
			TeamBEconomyType:  constants.EconomyTypeFull,
			EndReason:         events.RoundEndReasonCTWin,
			WinnerSide:        common.TeamCounterTerrorists,
			TeamAScore:        4,
			TeamBScore:        6,
			WinnerName:        expectedTeamNameA,
			TeamASide:         common.TeamCounterTerrorists,
			TeamBSide:         common.TeamTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			Number:            11,
			StartTick:         217683,
			StartFrame:        217518,
			EndTick:           228491,
			FreezeTimeEndTick: 220243,
			TeamAStartMoney:   40350,
			TeamBStartMoney:   13150,
			TeamAEconomyType:  constants.EconomyTypeFull,
			TeamBEconomyType:  constants.EconomyTypeEco,
			EndReason:         events.RoundEndReasonCTWin,
			WinnerSide:        common.TeamCounterTerrorists,
			TeamAScore:        5,
			TeamBScore:        6,
			WinnerName:        expectedTeamNameA,
			TeamASide:         common.TeamCounterTerrorists,
			TeamBSide:         common.TeamTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			Number:            12,
			StartTick:         233552,
			StartFrame:        233364,
			EndTick:           248138,
			FreezeTimeEndTick: 236112,
			TeamAStartMoney:   34200,
			TeamBStartMoney:   24850,
			TeamAEconomyType:  constants.EconomyTypeFull,
			TeamBEconomyType:  constants.EconomyTypeFull,
			EndReason:         events.RoundEndReasonBombDefused,
			WinnerSide:        common.TeamCounterTerrorists,
			TeamAScore:        6,
			TeamBScore:        6,
			WinnerName:        expectedTeamNameA,
			TeamASide:         common.TeamCounterTerrorists,
			TeamBSide:         common.TeamTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			Number:            13,
			StartTick:         248778,
			StartFrame:        248590,
			EndTick:           263095,
			FreezeTimeEndTick: 251338,
			TeamAStartMoney:   42050,
			TeamBStartMoney:   22950,
			TeamAEconomyType:  constants.EconomyTypeFull,
			TeamBEconomyType:  constants.EconomyTypeFull,
			EndReason:         events.RoundEndReasonTerroristsWin,
			WinnerSide:        common.TeamTerrorists,
			TeamAScore:        6,
			TeamBScore:        7,
			WinnerName:        expectedTeamNameB,
			TeamASide:         common.TeamCounterTerrorists,
			TeamBSide:         common.TeamTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			Number:            14,
			StartTick:         263737,
			StartFrame:        263538,
			EndTick:           273783,
			FreezeTimeEndTick: 266297,
			TeamAStartMoney:   26750,
			TeamBStartMoney:   18500,
			TeamAEconomyType:  constants.EconomyTypeFull,
			TeamBEconomyType:  constants.EconomyTypeFull,
			EndReason:         events.RoundEndReasonTerroristsWin,
			WinnerSide:        common.TeamTerrorists,
			TeamAScore:        6,
			TeamBScore:        8,
			WinnerName:        expectedTeamNameB,
			TeamASide:         common.TeamCounterTerrorists,
			TeamBSide:         common.TeamTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			Number:            15,
			StartTick:         274423,
			StartFrame:        274212,
			EndTick:           281625,
			FreezeTimeEndTick: 276983,
			TeamAStartMoney:   12000,
			TeamBStartMoney:   22750,
			TeamAEconomyType:  constants.EconomyTypeForceBuy,
			TeamBEconomyType:  constants.EconomyTypeFull,
			EndReason:         events.RoundEndReasonTerroristsWin,
			WinnerSide:        common.TeamTerrorists,
			TeamAScore:        6,
			TeamBScore:        9,
			WinnerName:        expectedTeamNameB,
			TeamASide:         common.TeamCounterTerrorists,
			TeamBSide:         common.TeamTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			Number:            16,
			StartTick:         283545,
			StartFrame:        283322,
			EndTick:           293732,
			FreezeTimeEndTick: 286105,
			TeamAStartMoney:   4000,
			TeamBStartMoney:   4000,
			TeamAEconomyType:  constants.EconomyTypePistol,
			TeamBEconomyType:  constants.EconomyTypePistol,
			EndReason:         events.RoundEndReasonBombDefused,
			WinnerSide:        common.TeamCounterTerrorists,
			TeamAScore:        6,
			TeamBScore:        10,
			WinnerName:        expectedTeamNameB,
			TeamASide:         common.TeamTerrorists,
			TeamBSide:         common.TeamCounterTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			Number:            17,
			StartTick:         294372,
			StartFrame:        294136,
			EndTick:           309953,
			FreezeTimeEndTick: 296932,
			TeamAStartMoney:   14550,
			TeamBStartMoney:   19900,
			TeamAEconomyType:  constants.EconomyTypeForceBuy,
			TeamBEconomyType:  constants.EconomyTypeSemi,
			EndReason:         events.RoundEndReasonCTWin,
			WinnerSide:        common.TeamCounterTerrorists,
			TeamAScore:        6,
			TeamBScore:        11,
			WinnerName:        expectedTeamNameB,
			TeamASide:         common.TeamTerrorists,
			TeamBSide:         common.TeamCounterTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			Number:            18,
			StartTick:         310596,
			StartFrame:        310349,
			EndTick:           324325,
			FreezeTimeEndTick: 313156,
			TeamAStartMoney:   12950,
			TeamBStartMoney:   18150,
			TeamAEconomyType:  constants.EconomyTypeEco,
			TeamBEconomyType:  constants.EconomyTypeFull,
			EndReason:         events.RoundEndReasonCTWin,
			WinnerSide:        common.TeamCounterTerrorists,
			TeamAScore:        6,
			TeamBScore:        12,
			WinnerName:        expectedTeamNameB,
			TeamASide:         common.TeamTerrorists,
			TeamBSide:         common.TeamCounterTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			Number:            19,
			StartTick:         324967,
			StartFrame:        324707,
			EndTick:           342863,
			FreezeTimeEndTick: 327527,
			TeamAStartMoney:   25350,
			TeamBStartMoney:   21400,
			TeamAEconomyType:  constants.EconomyTypeFull,
			TeamBEconomyType:  constants.EconomyTypeFull,
			EndReason:         events.RoundEndReasonTerroristsWin,
			WinnerSide:        common.TeamTerrorists,
			TeamAScore:        7,
			TeamBScore:        12,
			WinnerName:        expectedTeamNameA,
			TeamASide:         common.TeamTerrorists,
			TeamBSide:         common.TeamCounterTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			Number:            20,
			StartTick:         343503,
			StartFrame:        343232,
			EndTick:           362754,
			FreezeTimeEndTick: 346063,
			TeamAStartMoney:   18300,
			TeamBStartMoney:   18700,
			TeamAEconomyType:  constants.EconomyTypeFull,
			TeamBEconomyType:  constants.EconomyTypeEco,
			EndReason:         events.RoundEndReasonTargetBombed,
			WinnerSide:        common.TeamTerrorists,
			TeamAScore:        8,
			TeamBScore:        12,
			WinnerName:        expectedTeamNameA,
			TeamASide:         common.TeamTerrorists,
			TeamBSide:         common.TeamCounterTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			Number:            21,
			StartTick:         368377,
			StartFrame:        368083,
			EndTick:           385657,
			FreezeTimeEndTick: 370937,
			TeamAStartMoney:   23700,
			TeamBStartMoney:   25800,
			TeamAEconomyType:  constants.EconomyTypeFull,
			TeamBEconomyType:  constants.EconomyTypeFull,
			EndReason:         events.RoundEndReasonTargetSaved,
			WinnerSide:        common.TeamCounterTerrorists,
			TeamAScore:        8,
			TeamBScore:        13,
			WinnerName:        expectedTeamNameB,
			TeamASide:         common.TeamTerrorists,
			TeamBSide:         common.TeamCounterTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			Number:            22,
			StartTick:         392553,
			StartFrame:        392247,
			EndTick:           413793,
			FreezeTimeEndTick: 395113,
			TeamAStartMoney:   18000,
			TeamBStartMoney:   21100,
			TeamAEconomyType:  constants.EconomyTypeFull,
			TeamBEconomyType:  constants.EconomyTypeFull,
			EndReason:         events.RoundEndReasonTargetBombed,
			WinnerSide:        common.TeamTerrorists,
			TeamAScore:        9,
			TeamBScore:        13,
			WinnerName:        expectedTeamNameA,
			TeamASide:         common.TeamTerrorists,
			TeamBSide:         common.TeamCounterTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			Number:            23,
			StartTick:         414433,
			StartFrame:        414125,
			EndTick:           425442,
			FreezeTimeEndTick: 416993,
			TeamAStartMoney:   20700,
			TeamBStartMoney:   12350,
			TeamAEconomyType:  constants.EconomyTypeFull,
			TeamBEconomyType:  constants.EconomyTypeSemi,
			EndReason:         events.RoundEndReasonTerroristsWin,
			WinnerSide:        common.TeamTerrorists,
			TeamAScore:        10,
			TeamBScore:        13,
			WinnerName:        expectedTeamNameA,
			TeamASide:         common.TeamTerrorists,
			TeamBSide:         common.TeamCounterTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			Number:            24,
			StartTick:         426081,
			StartFrame:        425762,
			EndTick:           443361,
			FreezeTimeEndTick: 428641,
			TeamAStartMoney:   25450,
			TeamBStartMoney:   20400,
			TeamAEconomyType:  constants.EconomyTypeFull,
			TeamBEconomyType:  constants.EconomyTypeSemi,
			EndReason:         events.RoundEndReasonTargetSaved,
			WinnerSide:        common.TeamCounterTerrorists,
			TeamAScore:        10,
			TeamBScore:        14,
			WinnerName:        expectedTeamNameB,
			TeamASide:         common.TeamTerrorists,
			TeamBSide:         common.TeamCounterTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			Number:            25,
			StartTick:         447901,
			StartFrame:        447559,
			EndTick:           467857,
			FreezeTimeEndTick: 450461,
			TeamAStartMoney:   18450,
			TeamBStartMoney:   33300,
			TeamAEconomyType:  constants.EconomyTypeFull,
			TeamBEconomyType:  constants.EconomyTypeFull,
			EndReason:         events.RoundEndReasonTargetBombed,
			WinnerSide:        common.TeamTerrorists,
			TeamAScore:        11,
			TeamBScore:        14,
			WinnerName:        expectedTeamNameA,
			TeamASide:         common.TeamTerrorists,
			TeamBSide:         common.TeamCounterTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			Number:            26,
			StartTick:         468497,
			StartFrame:        468153,
			EndTick:           485361,
			FreezeTimeEndTick: 471057,
			TeamAStartMoney:   20950,
			TeamBStartMoney:   21400,
			TeamAEconomyType:  constants.EconomyTypeFull,
			TeamBEconomyType:  constants.EconomyTypeFull,
			EndReason:         events.RoundEndReasonTerroristsWin,
			WinnerSide:        common.TeamTerrorists,
			TeamAScore:        12,
			TeamBScore:        14,
			WinnerName:        expectedTeamNameA,
			TeamASide:         common.TeamTerrorists,
			TeamBSide:         common.TeamCounterTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			Number:            27,
			StartTick:         492110,
			StartFrame:        491742,
			EndTick:           510107,
			FreezeTimeEndTick: 494670,
			TeamAStartMoney:   26200,
			TeamBStartMoney:   16200,
			TeamAEconomyType:  constants.EconomyTypeFull,
			TeamBEconomyType:  constants.EconomyTypeEco,
			EndReason:         events.RoundEndReasonTerroristsWin,
			WinnerSide:        common.TeamTerrorists,
			TeamAScore:        13,
			TeamBScore:        14,
			WinnerName:        expectedTeamNameA,
			TeamASide:         common.TeamTerrorists,
			TeamBSide:         common.TeamCounterTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			Number:            28,
			StartTick:         510746,
			StartFrame:        510377,
			EndTick:           527345,
			FreezeTimeEndTick: 513306,
			TeamAStartMoney:   27450,
			TeamBStartMoney:   25900,
			TeamAEconomyType:  constants.EconomyTypeFull,
			TeamBEconomyType:  constants.EconomyTypeFull,
			EndReason:         events.RoundEndReasonCTWin,
			WinnerSide:        common.TeamCounterTerrorists,
			TeamAScore:        13,
			TeamBScore:        15,
			WinnerName:        expectedTeamNameB,
			TeamASide:         common.TeamTerrorists,
			TeamBSide:         common.TeamCounterTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			Number:            29,
			StartTick:         527984,
			StartFrame:        527602,
			EndTick:           544593,
			FreezeTimeEndTick: 530544,
			TeamAStartMoney:   16000,
			TeamBStartMoney:   17900,
			TeamAEconomyType:  constants.EconomyTypeForceBuy,
			TeamBEconomyType:  constants.EconomyTypeFull,
			EndReason:         events.RoundEndReasonTerroristsWin,
			WinnerSide:        common.TeamTerrorists,
			TeamAScore:        14,
			TeamBScore:        15,
			WinnerName:        expectedTeamNameA,
			TeamASide:         common.TeamTerrorists,
			TeamBSide:         common.TeamCounterTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			Number:            30,
			StartTick:         545232,
			StartFrame:        544836,
			EndTick:           556416,
			FreezeTimeEndTick: 547792,
			TeamAStartMoney:   18300,
			TeamBStartMoney:   12650,
			TeamAEconomyType:  constants.EconomyTypeFull,
			TeamBEconomyType:  constants.EconomyTypeForceBuy,
			EndReason:         events.RoundEndReasonTerroristsWin,
			WinnerSide:        common.TeamTerrorists,
			TeamAScore:        15,
			TeamBScore:        15,
			WinnerName:        expectedTeamNameA,
			TeamASide:         common.TeamTerrorists,
			TeamBSide:         common.TeamCounterTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			OvertimeNumber:    1,
			Number:            31,
			StartTick:         558336,
			StartFrame:        557927,
			EndTick:           572746,
			FreezeTimeEndTick: 560896,
			TeamAStartMoney:   62500,
			TeamBStartMoney:   62500,
			TeamAEconomyType:  constants.EconomyTypeFull,
			TeamBEconomyType:  constants.EconomyTypeFull,
			EndReason:         events.RoundEndReasonTargetBombed,
			WinnerSide:        common.TeamTerrorists,
			TeamAScore:        16,
			TeamBScore:        15,
			WinnerName:        expectedTeamNameA,
			TeamASide:         common.TeamTerrorists,
			TeamBSide:         common.TeamCounterTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			OvertimeNumber:    1,
			Number:            32,
			StartTick:         573386,
			StartFrame:        572959,
			EndTick:           588581,
			FreezeTimeEndTick: 575946,
			TeamAStartMoney:   54350,
			TeamBStartMoney:   44100,
			TeamAEconomyType:  constants.EconomyTypeFull,
			TeamBEconomyType:  constants.EconomyTypeFull,
			EndReason:         events.RoundEndReasonCTWin,
			WinnerSide:        common.TeamCounterTerrorists,
			TeamAScore:        16,
			TeamBScore:        16,
			WinnerName:        expectedTeamNameB,
			TeamASide:         common.TeamTerrorists,
			TeamBSide:         common.TeamCounterTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			OvertimeNumber:    1,
			Number:            33,
			StartTick:         589223,
			StartFrame:        588779,
			EndTick:           604569,
			FreezeTimeEndTick: 591783,
			TeamAStartMoney:   44850,
			TeamBStartMoney:   35250,
			TeamAEconomyType:  constants.EconomyTypeFull,
			TeamBEconomyType:  constants.EconomyTypeFull,
			EndReason:         events.RoundEndReasonCTWin,
			WinnerSide:        common.TeamCounterTerrorists,
			TeamAScore:        16,
			TeamBScore:        17,
			WinnerName:        expectedTeamNameB,
			TeamASide:         common.TeamTerrorists,
			TeamBSide:         common.TeamCounterTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			OvertimeNumber:    1,
			Number:            34,
			StartTick:         610724,
			StartFrame:        610254,
			EndTick:           625615,
			FreezeTimeEndTick: 613284,
			TeamAStartMoney:   62500,
			TeamBStartMoney:   62500,
			TeamAEconomyType:  constants.EconomyTypeFull,
			TeamBEconomyType:  constants.EconomyTypeFull,
			EndReason:         events.RoundEndReasonCTWin,
			WinnerSide:        common.TeamCounterTerrorists,
			TeamAScore:        17,
			TeamBScore:        17,
			WinnerName:        expectedTeamNameA,
			TeamASide:         common.TeamCounterTerrorists,
			TeamBSide:         common.TeamTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			OvertimeNumber:    1,
			Number:            35,
			StartTick:         626256,
			StartFrame:        625784,
			EndTick:           631971,
			FreezeTimeEndTick: 628816,
			TeamAStartMoney:   48550,
			TeamBStartMoney:   45950,
			TeamAEconomyType:  constants.EconomyTypeFull,
			TeamBEconomyType:  constants.EconomyTypeFull,
			EndReason:         events.RoundEndReasonTerroristsWin,
			WinnerSide:        common.TeamTerrorists,
			TeamAScore:        17,
			TeamBScore:        18,
			WinnerName:        expectedTeamNameB,
			TeamASide:         common.TeamCounterTerrorists,
			TeamBSide:         common.TeamTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			OvertimeNumber:    1,
			Number:            36,
			StartTick:         632614,
			StartFrame:        632129,
			EndTick:           643680,
			FreezeTimeEndTick: 635174,
			TeamAStartMoney:   36200,
			TeamBStartMoney:   36350,
			TeamAEconomyType:  constants.EconomyTypeFull,
			TeamBEconomyType:  constants.EconomyTypeFull,
			EndReason:         events.RoundEndReasonTerroristsWin,
			WinnerSide:        common.TeamTerrorists,
			TeamAScore:        17,
			TeamBScore:        19,
			WinnerName:        expectedTeamNameB,
			TeamASide:         common.TeamCounterTerrorists,
			TeamBSide:         common.TeamTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
	}

	var players = []fake.FakePlayer{
		{
			SteamID64:     76561198065448360,
			Name:          "story",
			KillCount:     28,
			AssistCount:   3,
			DeathCount:    19,
			Score:         71,
			Team:          match.TeamB,
			HeadshotCount: 8,
			MvpCount:      5,
			UtilityDamage: 176,
		},
		{
			SteamID64:     76561198012987839,
			Name:          "JUSTT",
			KillCount:     32,
			AssistCount:   3,
			DeathCount:    21,
			Score:         70,
			Team:          match.TeamB,
			HeadshotCount: 21,
			MvpCount:      4,
			UtilityDamage: 228,
		},
		{
			SteamID64:     76561197994395491,
			Name:          "roman",
			KillCount:     24,
			AssistCount:   6,
			DeathCount:    21,
			Score:         60,
			Team:          match.TeamB,
			HeadshotCount: 15,
			MvpCount:      3,
			UtilityDamage: 196,
		},
		{
			SteamID64:     76561198262460262,
			Name:          "ewjerkz",
			KillCount:     23,
			AssistCount:   3,
			DeathCount:    25,
			Score:         55,
			Team:          match.TeamB,
			HeadshotCount: 12,
			MvpCount:      5,
			UtilityDamage: 373,
		},
		{
			SteamID64:     76561197997981170,
			Name:          "MUTiRiS",
			KillCount:     18,
			AssistCount:   9,
			DeathCount:    24,
			Score:         52,
			Team:          match.TeamB,
			HeadshotCount: 8,
			MvpCount:      2,
			UtilityDamage: 285,
		},
		{
			SteamID64:     76561197987713664,
			Name:          "dev1ce",
			KillCount:     30,
			AssistCount:   2,
			DeathCount:    25,
			Score:         75,
			Team:          match.TeamA,
			HeadshotCount: 6,
			MvpCount:      4,
			UtilityDamage: 98,
		},
		{
			SteamID64:     76561198028458803,
			Name:          "blameF",
			KillCount:     25,
			AssistCount:   10,
			DeathCount:    25,
			Score:         61,
			Team:          match.TeamA,
			HeadshotCount: 11,
			MvpCount:      2,
			UtilityDamage: 222,
		},
		{
			SteamID64:     76561198010511021,
			Name:          "gla1ve",
			KillCount:     22,
			AssistCount:   3,
			DeathCount:    24,
			Score:         55,
			Team:          match.TeamA,
			HeadshotCount: 10,
			MvpCount:      6,
			UtilityDamage: 334,
		},
		{
			SteamID64:     76561197990682262,
			Name:          "Xyp9x",
			KillCount:     16,
			AssistCount:   5,
			DeathCount:    26,
			Score:         49,
			Team:          match.TeamA,
			HeadshotCount: 5,
			MvpCount:      3,
			UtilityDamage: 240,
		},
		{
			SteamID64:     76561198248953762,
			Name:          "Buzz",
			KillCount:     17,
			AssistCount:   8,
			DeathCount:    25,
			Score:         47,
			Team:          match.TeamA,
			HeadshotCount: 6,
			MvpCount:      2,
			UtilityDamage: 173,
		},
	}

	assertion.AssertPlayers(t, match, players)
	assertion.AssertRounds(t, match, rounds)
}
