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/matches/2373609/bleed-vs-parivision-skyesports-championship-2024
// - 2 overtimes
func Test_MatchZy_Bleed_vs_Parivision_2024_Mirage(t *testing.T) {
	demoName := "matchzy_bleed_vs_parivision_2024_mirage"
	demoPath := testsutils.GetDemoPath("cs2", demoName)
	match, err := api.AnalyzeDemo(demoPath, api.AnalyzeDemoOptions{
		Source: constants.DemoSourceMatchZy,
	})
	if err != nil {
		t.Error(err)
	}

	expectedRoundCount := 36
	expectedPlayerCount := 10
	expectedScoreTeamA := 17
	expectedScoreTeamB := 19
	expectedScoreFirstHalfTeamA := 7
	expectedScoreFirstHalfTeamB := 5
	expectedScoreSecondHalfTeamA := 5
	expectedScoreSecondHalfTeamB := 7
	expectedTeamNameA := "Parivision"
	expectedTeamNameB := "Bleed Esports"
	expectedWinnerName := expectedTeamNameB
	expectedMaxRounds := 24

	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:         6967,
			StartFrame:        8229,
			EndTick:           16385,
			FreezeTimeEndTick: 10198,
			TeamAStartMoney:   4000,
			TeamBStartMoney:   4000,
			TeamAEconomyType:  constants.EconomyTypePistol,
			TeamBEconomyType:  constants.EconomyTypePistol,
			EndReason:         events.RoundEndReasonCTWin,
			WinnerSide:        common.TeamCounterTerrorists,
			TeamAScore:        1,
			TeamBScore:        0,
			WinnerName:        expectedTeamNameA,
			TeamASide:         common.TeamCounterTerrorists,
			TeamBSide:         common.TeamTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			Number:            2,
			StartTick:         16705,
			StartFrame:        19919,
			EndTick:           25016,
			FreezeTimeEndTick: 19871,
			TeamAStartMoney:   18450,
			TeamBStartMoney:   11000,
			TeamAEconomyType:  constants.EconomyTypeSemi,
			TeamBEconomyType:  constants.EconomyTypeForceBuy,
			EndReason:         events.RoundEndReasonTargetBombed,
			WinnerSide:        common.TeamTerrorists,
			TeamAScore:        1,
			TeamBScore:        1,
			WinnerName:        expectedTeamNameB,
			TeamASide:         common.TeamCounterTerrorists,
			TeamBSide:         common.TeamTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			Number:            3,
			StartTick:         25336,
			StartFrame:        30935,
			EndTick:           31351,
			FreezeTimeEndTick: 26616,
			TeamAStartMoney:   9200,
			TeamBStartMoney:   20000,
			TeamAEconomyType:  constants.EconomyTypeSemi,
			TeamBEconomyType:  constants.EconomyTypeFull,
			EndReason:         events.RoundEndReasonCTWin,
			WinnerSide:        common.TeamCounterTerrorists,
			TeamAScore:        2,
			TeamBScore:        1,
			WinnerName:        expectedTeamNameA,
			TeamASide:         common.TeamCounterTerrorists,
			TeamBSide:         common.TeamTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			Number:            4,
			StartTick:         31671,
			StartFrame:        38805,
			EndTick:           38708,
			FreezeTimeEndTick: 36513,
			TeamAStartMoney:   20350,
			TeamBStartMoney:   9700,
			TeamAEconomyType:  constants.EconomyTypeFull,
			TeamBEconomyType:  constants.EconomyTypeForceBuy,
			EndReason:         events.RoundEndReasonCTWin,
			WinnerSide:        common.TeamCounterTerrorists,
			TeamAScore:        3,
			TeamBScore:        1,
			WinnerName:        expectedTeamNameA,
			TeamASide:         common.TeamCounterTerrorists,
			TeamBSide:         common.TeamTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			Number:            5,
			StartTick:         39028,
			StartFrame:        48662,
			EndTick:           45799,
			FreezeTimeEndTick: 40308,
			TeamAStartMoney:   27000,
			TeamBStartMoney:   10550,
			TeamAEconomyType:  constants.EconomyTypeFull,
			TeamBEconomyType:  constants.EconomyTypeEco,
			EndReason:         events.RoundEndReasonCTWin,
			WinnerSide:        common.TeamCounterTerrorists,
			TeamAScore:        4,
			TeamBScore:        1,
			WinnerName:        expectedTeamNameA,
			TeamASide:         common.TeamCounterTerrorists,
			TeamBSide:         common.TeamTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			Number:            6,
			StartTick:         46119,
			StartFrame:        57429,
			EndTick:           54517,
			FreezeTimeEndTick: 47399,
			TeamAStartMoney:   31600,
			TeamBStartMoney:   22450,
			TeamAEconomyType:  constants.EconomyTypeFull,
			TeamBEconomyType:  constants.EconomyTypeFull,
			EndReason:         events.RoundEndReasonTargetBombed,
			WinnerSide:        common.TeamTerrorists,
			TeamAScore:        4,
			TeamBScore:        2,
			WinnerName:        expectedTeamNameB,
			TeamASide:         common.TeamCounterTerrorists,
			TeamBSide:         common.TeamTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			Number:            7,
			StartTick:         54837,
			StartFrame:        68123,
			EndTick:           62418,
			FreezeTimeEndTick: 56117,
			TeamAStartMoney:   25150,
			TeamBStartMoney:   19450,
			TeamAEconomyType:  constants.EconomyTypeFull,
			TeamBEconomyType:  constants.EconomyTypeFull,
			EndReason:         events.RoundEndReasonTargetBombed,
			WinnerSide:        common.TeamTerrorists,
			TeamAScore:        4,
			TeamBScore:        3,
			WinnerName:        expectedTeamNameB,
			TeamASide:         common.TeamCounterTerrorists,
			TeamBSide:         common.TeamTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			Number:            8,
			StartTick:         62738,
			StartFrame:        78227,
			EndTick:           72005,
			FreezeTimeEndTick: 64018,
			TeamAStartMoney:   14450,
			TeamBStartMoney:   25550,
			TeamAEconomyType:  constants.EconomyTypeFull,
			TeamBEconomyType:  constants.EconomyTypeFull,
			EndReason:         events.RoundEndReasonTerroristsWin,
			WinnerSide:        common.TeamTerrorists,
			TeamAScore:        4,
			TeamBScore:        4,
			WinnerName:        expectedTeamNameB,
			TeamASide:         common.TeamCounterTerrorists,
			TeamBSide:         common.TeamTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			Number:            9,
			StartTick:         74245,
			StartFrame:        92636,
			EndTick:           79460,
			FreezeTimeEndTick: 75525,
			TeamAStartMoney:   17650,
			TeamBStartMoney:   34900,
			TeamAEconomyType:  constants.EconomyTypeSemi,
			TeamBEconomyType:  constants.EconomyTypeFull,
			EndReason:         events.RoundEndReasonTerroristsWin,
			WinnerSide:        common.TeamTerrorists,
			TeamAScore:        4,
			TeamBScore:        5,
			WinnerName:        expectedTeamNameB,
			TeamASide:         common.TeamCounterTerrorists,
			TeamBSide:         common.TeamTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			Number:            10,
			StartTick:         79780,
			StartFrame:        99813,
			EndTick:           89031,
			FreezeTimeEndTick: 81060,
			TeamAStartMoney:   24850,
			TeamBStartMoney:   37150,
			TeamAEconomyType:  constants.EconomyTypeFull,
			TeamBEconomyType:  constants.EconomyTypeFull,
			EndReason:         events.RoundEndReasonBombDefused,
			WinnerSide:        common.TeamCounterTerrorists,
			TeamAScore:        5,
			TeamBScore:        5,
			WinnerName:        expectedTeamNameA,
			TeamASide:         common.TeamCounterTerrorists,
			TeamBSide:         common.TeamTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			Number:            11,
			StartTick:         91873,
			StartFrame:        115229,
			EndTick:           98932,
			FreezeTimeEndTick: 93153,
			TeamAStartMoney:   19750,
			TeamBStartMoney:   35850,
			TeamAEconomyType:  constants.EconomyTypeFull,
			TeamBEconomyType:  constants.EconomyTypeFull,
			EndReason:         events.RoundEndReasonCTWin,
			WinnerSide:        common.TeamCounterTerrorists,
			TeamAScore:        6,
			TeamBScore:        5,
			WinnerName:        expectedTeamNameA,
			TeamASide:         common.TeamCounterTerrorists,
			TeamBSide:         common.TeamTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			Number:            12,
			StartTick:         99252,
			StartFrame:        124420,
			EndTick:           106566,
			FreezeTimeEndTick: 100532,
			TeamAStartMoney:   21250,
			TeamBStartMoney:   19700,
			TeamAEconomyType:  constants.EconomyTypeFull,
			TeamBEconomyType:  constants.EconomyTypeForceBuy,
			EndReason:         events.RoundEndReasonCTWin,
			WinnerSide:        common.TeamCounterTerrorists,
			TeamAScore:        7,
			TeamBScore:        5,
			WinnerName:        expectedTeamNameA,
			TeamASide:         common.TeamCounterTerrorists,
			TeamBSide:         common.TeamTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			Number:            13,
			StartTick:         107526,
			StartFrame:        134753,
			EndTick:           118996,
			FreezeTimeEndTick: 116384,
			TeamAStartMoney:   4000,
			TeamBStartMoney:   4000,
			TeamAEconomyType:  constants.EconomyTypePistol,
			TeamBEconomyType:  constants.EconomyTypePistol,
			EndReason:         events.RoundEndReasonTerroristsWin,
			WinnerSide:        common.TeamTerrorists,
			TeamAScore:        8,
			TeamBScore:        5,
			WinnerName:        expectedTeamNameA,
			TeamASide:         common.TeamTerrorists,
			TeamBSide:         common.TeamCounterTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			Number:            14,
			StartTick:         119316,
			StartFrame:        150214,
			EndTick:           123731,
			FreezeTimeEndTick: 120596,
			TeamAStartMoney:   18650,
			TeamBStartMoney:   10800,
			TeamAEconomyType:  constants.EconomyTypeSemi,
			TeamBEconomyType:  constants.EconomyTypeEco,
			EndReason:         events.RoundEndReasonTerroristsWin,
			WinnerSide:        common.TeamTerrorists,
			TeamAScore:        9,
			TeamBScore:        5,
			WinnerName:        expectedTeamNameA,
			TeamASide:         common.TeamTerrorists,
			TeamBSide:         common.TeamCounterTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			Number:            15,
			StartTick:         124051,
			StartFrame:        156183,
			EndTick:           129940,
			FreezeTimeEndTick: 125331,
			TeamAStartMoney:   18000,
			TeamBStartMoney:   23100,
			TeamAEconomyType:  constants.EconomyTypeFull,
			TeamBEconomyType:  constants.EconomyTypeFull,
			EndReason:         events.RoundEndReasonCTWin,
			WinnerSide:        common.TeamCounterTerrorists,
			TeamAScore:        9,
			TeamBScore:        6,
			WinnerName:        expectedTeamNameB,
			TeamASide:         common.TeamTerrorists,
			TeamBSide:         common.TeamCounterTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			Number:            16,
			StartTick:         130260,
			StartFrame:        164295,
			EndTick:           137524,
			FreezeTimeEndTick: 131540,
			TeamAStartMoney:   17000,
			TeamBStartMoney:   18000,
			TeamAEconomyType:  constants.EconomyTypeEco,
			TeamBEconomyType:  constants.EconomyTypeFull,
			EndReason:         events.RoundEndReasonCTWin,
			WinnerSide:        common.TeamCounterTerrorists,
			TeamAScore:        9,
			TeamBScore:        7,
			WinnerName:        expectedTeamNameB,
			TeamASide:         common.TeamTerrorists,
			TeamBSide:         common.TeamCounterTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			Number:            17,
			StartTick:         137844,
			StartFrame:        173916,
			EndTick:           144446,
			FreezeTimeEndTick: 139124,
			TeamAStartMoney:   24150,
			TeamBStartMoney:   26000,
			TeamAEconomyType:  constants.EconomyTypeFull,
			TeamBEconomyType:  constants.EconomyTypeFull,
			EndReason:         events.RoundEndReasonTargetBombed,
			WinnerSide:        common.TeamTerrorists,
			TeamAScore:        10,
			TeamBScore:        7,
			WinnerName:        expectedTeamNameA,
			TeamASide:         common.TeamTerrorists,
			TeamBSide:         common.TeamCounterTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			Number:            18,
			StartTick:         144766,
			StartFrame:        182846,
			EndTick:           150390,
			FreezeTimeEndTick: 146046,
			TeamAStartMoney:   19850,
			TeamBStartMoney:   19700,
			TeamAEconomyType:  constants.EconomyTypeFull,
			TeamBEconomyType:  constants.EconomyTypeFull,
			EndReason:         events.RoundEndReasonCTWin,
			WinnerSide:        common.TeamCounterTerrorists,
			TeamAScore:        10,
			TeamBScore:        8,
			WinnerName:        expectedTeamNameB,
			TeamASide:         common.TeamTerrorists,
			TeamBSide:         common.TeamCounterTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			Number:            19,
			StartTick:         150710,
			StartFrame:        190651,
			EndTick:           156034,
			FreezeTimeEndTick: 151990,
			TeamAStartMoney:   18850,
			TeamBStartMoney:   28800,
			TeamAEconomyType:  constants.EconomyTypeSemi,
			TeamBEconomyType:  constants.EconomyTypeFull,
			EndReason:         events.RoundEndReasonCTWin,
			WinnerSide:        common.TeamCounterTerrorists,
			TeamAScore:        10,
			TeamBScore:        9,
			WinnerName:        expectedTeamNameB,
			TeamASide:         common.TeamTerrorists,
			TeamBSide:         common.TeamCounterTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			Number:            20,
			StartTick:         156354,
			StartFrame:        197690,
			EndTick:           163278,
			FreezeTimeEndTick: 157634,
			TeamAStartMoney:   23750,
			TeamBStartMoney:   31200,
			TeamAEconomyType:  constants.EconomyTypeFull,
			TeamBEconomyType:  constants.EconomyTypeFull,
			EndReason:         events.RoundEndReasonCTWin,
			WinnerSide:        common.TeamCounterTerrorists,
			TeamAScore:        10,
			TeamBScore:        10,
			WinnerName:        expectedTeamNameB,
			TeamASide:         common.TeamTerrorists,
			TeamBSide:         common.TeamCounterTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			Number:            21,
			StartTick:         165518,
			StartFrame:        209479,
			EndTick:           171756,
			FreezeTimeEndTick: 166798,
			TeamAStartMoney:   14200,
			TeamBStartMoney:   40850,
			TeamAEconomyType:  constants.EconomyTypeEco,
			TeamBEconomyType:  constants.EconomyTypeFull,
			EndReason:         events.RoundEndReasonCTWin,
			WinnerSide:        common.TeamCounterTerrorists,
			TeamAScore:        10,
			TeamBScore:        11,
			WinnerName:        expectedTeamNameB,
			TeamASide:         common.TeamTerrorists,
			TeamBSide:         common.TeamCounterTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			Number:            22,
			StartTick:         173996,
			StartFrame:        220229,
			EndTick:           181067,
			FreezeTimeEndTick: 175276,
			TeamAStartMoney:   26700,
			TeamBStartMoney:   43100,
			TeamAEconomyType:  constants.EconomyTypeFull,
			TeamBEconomyType:  constants.EconomyTypeFull,
			EndReason:         events.RoundEndReasonTerroristsWin,
			WinnerSide:        common.TeamTerrorists,
			TeamAScore:        11,
			TeamBScore:        11,
			WinnerName:        expectedTeamNameA,
			TeamASide:         common.TeamTerrorists,
			TeamBSide:         common.TeamCounterTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			Number:            23,
			StartTick:         181387,
			StartFrame:        229600,
			EndTick:           192176,
			FreezeTimeEndTick: 182667,
			TeamAStartMoney:   18600,
			TeamBStartMoney:   31400,
			TeamAEconomyType:  constants.EconomyTypeFull,
			TeamBEconomyType:  constants.EconomyTypeFull,
			EndReason:         events.RoundEndReasonTargetBombed,
			WinnerSide:        common.TeamTerrorists,
			TeamAScore:        12,
			TeamBScore:        11,
			WinnerName:        expectedTeamNameA,
			TeamASide:         common.TeamTerrorists,
			TeamBSide:         common.TeamCounterTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			Number:            24,
			StartTick:         192496,
			StartFrame:        242971,
			EndTick:           198452,
			FreezeTimeEndTick: 193776,
			TeamAStartMoney:   24600,
			TeamBStartMoney:   15200,
			TeamAEconomyType:  constants.EconomyTypeFull,
			TeamBEconomyType:  constants.EconomyTypeForceBuy,
			EndReason:         events.RoundEndReasonCTWin,
			WinnerSide:        common.TeamCounterTerrorists,
			TeamAScore:        12,
			TeamBScore:        12,
			WinnerName:        expectedTeamNameB,
			TeamASide:         common.TeamTerrorists,
			TeamBSide:         common.TeamCounterTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			Number:            25,
			StartTick:         199412,
			StartFrame:        251751,
			EndTick:           208087,
			FreezeTimeEndTick: 200692,
			TeamAStartMoney:   50000,
			TeamBStartMoney:   50000,
			TeamAEconomyType:  constants.EconomyTypeFull,
			TeamBEconomyType:  constants.EconomyTypeFull,
			EndReason:         events.RoundEndReasonTerroristsWin,
			WinnerSide:        common.TeamTerrorists,
			TeamAScore:        13,
			TeamBScore:        12,
			WinnerName:        expectedTeamNameA,
			TeamASide:         common.TeamTerrorists,
			TeamBSide:         common.TeamCounterTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
			OvertimeNumber:    1,
		},
		{
			Number:            26,
			StartTick:         208407,
			StartFrame:        262765,
			EndTick:           216449,
			FreezeTimeEndTick: 209687,
			TeamAStartMoney:   40800,
			TeamBStartMoney:   33150,
			TeamAEconomyType:  constants.EconomyTypeFull,
			TeamBEconomyType:  constants.EconomyTypeFull,
			EndReason:         events.RoundEndReasonTerroristsWin,
			WinnerSide:        common.TeamTerrorists,
			TeamAScore:        14,
			TeamBScore:        12,
			WinnerName:        expectedTeamNameA,
			TeamASide:         common.TeamTerrorists,
			TeamBSide:         common.TeamCounterTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
			OvertimeNumber:    1,
		},
		{
			Number:            27,
			StartTick:         216769,
			StartFrame:        273276,
			EndTick:           222637,
			FreezeTimeEndTick: 218049,
			TeamAStartMoney:   37350,
			TeamBStartMoney:   19100,
			TeamAEconomyType:  constants.EconomyTypeFull,
			TeamBEconomyType:  constants.EconomyTypeForceBuy,
			EndReason:         events.RoundEndReasonBombDefused,
			WinnerSide:        common.TeamCounterTerrorists,
			TeamAScore:        14,
			TeamBScore:        13,
			WinnerName:        expectedTeamNameB,
			TeamASide:         common.TeamTerrorists,
			TeamBSide:         common.TeamCounterTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
			OvertimeNumber:    1,
		},
		{
			Number:            28,
			StartTick:         223597,
			StartFrame:        281957,
			EndTick:           231422,
			FreezeTimeEndTick: 224877,
			TeamAStartMoney:   50000,
			TeamBStartMoney:   50000,
			TeamAEconomyType:  constants.EconomyTypeFull,
			TeamBEconomyType:  constants.EconomyTypeFull,
			EndReason:         events.RoundEndReasonTerroristsWin,
			WinnerSide:        common.TeamTerrorists,
			TeamAScore:        14,
			TeamBScore:        14,
			WinnerName:        expectedTeamNameB,
			TeamASide:         common.TeamCounterTerrorists,
			TeamBSide:         common.TeamTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
			OvertimeNumber:    1,
		},
		{
			Number:            29,
			StartTick:         231742,
			StartFrame:        292365,
			EndTick:           238411,
			FreezeTimeEndTick: 233022,
			TeamAStartMoney:   30400,
			TeamBStartMoney:   41500,
			TeamAEconomyType:  constants.EconomyTypeFull,
			TeamBEconomyType:  constants.EconomyTypeFull,
			EndReason:         events.RoundEndReasonCTWin,
			WinnerSide:        common.TeamCounterTerrorists,
			TeamAScore:        15,
			TeamBScore:        14,
			WinnerName:        expectedTeamNameA,
			TeamASide:         common.TeamCounterTerrorists,
			TeamBSide:         common.TeamTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
			OvertimeNumber:    1,
		},
		{
			Number:            30,
			StartTick:         238731,
			StartFrame:        301234,
			EndTick:           245277,
			FreezeTimeEndTick: 240011,
			TeamAStartMoney:   20650,
			TeamBStartMoney:   39150,
			TeamAEconomyType:  constants.EconomyTypeFull,
			TeamBEconomyType:  constants.EconomyTypeFull,
			EndReason:         events.RoundEndReasonTerroristsWin,
			WinnerSide:        common.TeamTerrorists,
			TeamAScore:        15,
			TeamBScore:        15,
			WinnerName:        expectedTeamNameB,
			TeamASide:         common.TeamCounterTerrorists,
			TeamBSide:         common.TeamTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
			OvertimeNumber:    1,
		},
		{
			Number:            31,
			StartTick:         246237,
			StartFrame:        310597,
			EndTick:           252225,
			FreezeTimeEndTick: 247517,
			TeamAStartMoney:   50000,
			TeamBStartMoney:   50000,
			TeamAEconomyType:  constants.EconomyTypeFull,
			TeamBEconomyType:  constants.EconomyTypeFull,
			EndReason:         events.RoundEndReasonCTWin,
			WinnerSide:        common.TeamCounterTerrorists,
			TeamAScore:        16,
			TeamBScore:        15,
			WinnerName:        expectedTeamNameA,
			TeamASide:         common.TeamCounterTerrorists,
			TeamBSide:         common.TeamTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
			OvertimeNumber:    2,
		},
		{
			Number:            32,
			StartTick:         252545,
			StartFrame:        318659,
			EndTick:           259368,
			FreezeTimeEndTick: 253825,
			TeamAStartMoney:   39600,
			TeamBStartMoney:   34050,
			TeamAEconomyType:  constants.EconomyTypeFull,
			TeamBEconomyType:  constants.EconomyTypeFull,
			EndReason:         events.RoundEndReasonTerroristsWin,
			WinnerSide:        common.TeamTerrorists,
			TeamAScore:        16,
			TeamBScore:        16,
			WinnerName:        expectedTeamNameB,
			TeamASide:         common.TeamCounterTerrorists,
			TeamBSide:         common.TeamTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
			OvertimeNumber:    2,
		},
		{
			Number:            33,
			StartTick:         259688,
			StartFrame:        327835,
			EndTick:           267515,
			FreezeTimeEndTick: 260968,
			TeamAStartMoney:   24000,
			TeamBStartMoney:   27500,
			TeamAEconomyType:  constants.EconomyTypeFull,
			TeamBEconomyType:  constants.EconomyTypeFull,
			EndReason:         events.RoundEndReasonCTWin,
			WinnerSide:        common.TeamCounterTerrorists,
			TeamAScore:        17,
			TeamBScore:        16,
			WinnerName:        expectedTeamNameA,
			TeamASide:         common.TeamCounterTerrorists,
			TeamBSide:         common.TeamTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
			OvertimeNumber:    2,
		},
		{
			Number:            34,
			StartTick:         268475,
			StartFrame:        338686,
			EndTick:           276950,
			FreezeTimeEndTick: 269755,
			TeamAStartMoney:   50000,
			TeamBStartMoney:   50000,
			TeamAEconomyType:  constants.EconomyTypeFull,
			TeamBEconomyType:  constants.EconomyTypeFull,
			EndReason:         events.RoundEndReasonCTWin,
			WinnerSide:        common.TeamCounterTerrorists,
			TeamAScore:        17,
			TeamBScore:        17,
			WinnerName:        expectedTeamNameB,
			TeamASide:         common.TeamTerrorists,
			TeamBSide:         common.TeamCounterTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
			OvertimeNumber:    2,
		},
		{
			Number:            35,
			StartTick:         279280,
			StartFrame:        352413,
			EndTick:           288023,
			FreezeTimeEndTick: 280560,
			TeamAStartMoney:   33750,
			TeamBStartMoney:   39300,
			TeamAEconomyType:  constants.EconomyTypeFull,
			TeamBEconomyType:  constants.EconomyTypeFull,
			EndReason:         events.RoundEndReasonBombDefused,
			WinnerSide:        common.TeamCounterTerrorists,
			TeamAScore:        17,
			TeamBScore:        18,
			WinnerName:        expectedTeamNameB,
			TeamASide:         common.TeamTerrorists,
			TeamBSide:         common.TeamCounterTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
			OvertimeNumber:    2,
		},
		{
			Number:            36,
			StartTick:         288343,
			StartFrame:        363626,
			EndTick:           295814,
			FreezeTimeEndTick: 289623,
			TeamAStartMoney:   23100,
			TeamBStartMoney:   38800,
			TeamAEconomyType:  constants.EconomyTypeFull,
			TeamBEconomyType:  constants.EconomyTypeFull,
			EndReason:         events.RoundEndReasonCTWin,
			WinnerSide:        common.TeamCounterTerrorists,
			TeamAScore:        17,
			TeamBScore:        19,
			WinnerName:        expectedTeamNameB,
			TeamASide:         common.TeamTerrorists,
			TeamBSide:         common.TeamCounterTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
			OvertimeNumber:    2,
		},
	}

	var players = []fake.FakePlayer{
		{
			SteamID64:     76561198156778414,
			Name:          "ArtFr0st",
			KillCount:     34,
			AssistCount:   1,
			DeathCount:    24,
			Score:         78,
			Team:          match.TeamA,
			HeadshotCount: 5,
			MvpCount:      7,
			UtilityDamage: 145,
		},
		{
			SteamID64:     76561198127236290,
			Name:          "Qikert",
			KillCount:     26,
			AssistCount:   6,
			DeathCount:    24,
			Score:         65,
			Team:          match.TeamA,
			HeadshotCount: 16,
			MvpCount:      6,
			UtilityDamage: 62,
		},
		{
			SteamID64:     76561198253670517,
			Name:          "BELCHONOKK",
			KillCount:     19,
			AssistCount:   10,
			DeathCount:    24,
			Score:         54,
			Team:          match.TeamA,
			HeadshotCount: 9,
			MvpCount:      2,
			UtilityDamage: 199,
		},
		{
			SteamID64:     76561198288540801,
			Name:          "Patsi",
			KillCount:     22,
			AssistCount:   8,
			DeathCount:    28,
			Score:         53,
			Team:          match.TeamA,
			HeadshotCount: 5,
			MvpCount:      2,
			UtilityDamage: 156,
		},
		{
			SteamID64:     76561198845426189,
			Name:          "alpha",
			KillCount:     20,
			AssistCount:   8,
			DeathCount:    31,
			Score:         53,
			Team:          match.TeamA,
			HeadshotCount: 15,
			MvpCount:      0,
			UtilityDamage: 99,
		},
		{
			SteamID64:     76561198002708642,
			Name:          "jkaem",
			KillCount:     37,
			AssistCount:   10,
			DeathCount:    24,
			Score:         88,
			Team:          match.TeamB,
			HeadshotCount: 21,
			MvpCount:      7,
			UtilityDamage: 204,
		},
		{
			SteamID64:     76561198153651861,
			Name:          "nawwk",
			KillCount:     28,
			AssistCount:   4,
			DeathCount:    21,
			Score:         69,
			Team:          match.TeamB,
			HeadshotCount: 9,
			MvpCount:      2,
			UtilityDamage: 49,
		},
		{
			SteamID64:     76561197999825422,
			Name:          "nexa",
			KillCount:     24,
			AssistCount:   9,
			DeathCount:    25,
			Score:         64,
			Team:          match.TeamB,
			HeadshotCount: 9,
			MvpCount:      1,
			UtilityDamage: 193,
		},
		{
			SteamID64:     76561198251984554,
			Name:          "CYPHER",
			KillCount:     25,
			AssistCount:   16,
			DeathCount:    28,
			Score:         74,
			Team:          match.TeamB,
			HeadshotCount: 12,
			MvpCount:      4,
			UtilityDamage: 140,
		},
		{
			SteamID64:     76561198086945950,
			Name:          "hampus",
			KillCount:     17,
			AssistCount:   8,
			DeathCount:    23,
			Score:         53,
			Team:          match.TeamB,
			HeadshotCount: 7,
			MvpCount:      5,
			UtilityDamage: 62,
		},
	}

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