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/151559/astralis-vs-saw
func TestChallengerModeSawVsAstralisM2Paris2023CqInferno(t *testing.T) {
	demoName := "challengermode_saw_vs_astralis_m3_Paris_2023_CQ_inferno"
	demoPath := testsutils.GetDemoPath("csgo", demoName)
	match, err := api.AnalyzeDemo(demoPath, api.AnalyzeDemoOptions{
		Source: constants.DemoSourceFaceIt,
	})
	if err != nil {
		t.Error(err)
	}

	expectedRoundCount := 30
	expectedPlayerCount := 10
	expectedScoreTeamA := 16
	expectedScoreTeamB := 14
	expectedScoreFirstHalfTeamA := 7
	expectedScoreFirstHalfTeamB := 8
	expectedScoreSecondHalfTeamA := 9
	expectedScoreSecondHalfTeamB := 6
	expectedTeamNameA := "Astralis"
	expectedTeamNameB := "SAW"
	expectedWinnerName := expectedTeamNameA
	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:         54964,
			StartFrame:        54923,
			EndTick:           69993,
			FreezeTimeEndTick: 57517,
			TeamAStartMoney:   4000,
			TeamBStartMoney:   4000,
			TeamAEconomyType:  constants.EconomyTypePistol,
			TeamBEconomyType:  constants.EconomyTypePistol,
			EndReason:         events.RoundEndReasonBombDefused,
			WinnerSide:        common.TeamCounterTerrorists,
			TeamAScore:        1,
			TeamBScore:        0,
			WinnerName:        expectedTeamNameA,
			TeamASide:         common.TeamCounterTerrorists,
			TeamBSide:         common.TeamTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			Number:            2,
			StartTick:         70633,
			StartFrame:        70591,
			EndTick:           82869,
			FreezeTimeEndTick: 73193,
			TeamAStartMoney:   19900,
			TeamBStartMoney:   15000,
			TeamAEconomyType:  constants.EconomyTypeSemi,
			TeamBEconomyType:  constants.EconomyTypeForceBuy,
			EndReason:         events.RoundEndReasonCTWin,
			WinnerSide:        common.TeamCounterTerrorists,
			TeamAScore:        2,
			TeamBScore:        0,
			WinnerName:        expectedTeamNameA,
			TeamASide:         common.TeamCounterTerrorists,
			TeamBSide:         common.TeamTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			Number:            3,
			StartTick:         83509,
			StartFrame:        83454,
			EndTick:           97284,
			FreezeTimeEndTick: 86069,
			TeamAStartMoney:   20300,
			TeamBStartMoney:   12400,
			TeamAEconomyType:  constants.EconomyTypeFull,
			TeamBEconomyType:  constants.EconomyTypeEco,
			EndReason:         events.RoundEndReasonCTWin,
			WinnerSide:        common.TeamCounterTerrorists,
			TeamAScore:        3,
			TeamBScore:        0,
			WinnerName:        expectedTeamNameA,
			TeamASide:         common.TeamCounterTerrorists,
			TeamBSide:         common.TeamTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			Number:            4,
			StartTick:         97923,
			StartFrame:        97854,
			EndTick:           110531,
			FreezeTimeEndTick: 100483,
			TeamAStartMoney:   27050,
			TeamBStartMoney:   25300,
			TeamAEconomyType:  constants.EconomyTypeFull,
			TeamBEconomyType:  constants.EconomyTypeFull,
			EndReason:         events.RoundEndReasonTerroristsWin,
			WinnerSide:        common.TeamTerrorists,
			TeamAScore:        3,
			TeamBScore:        1,
			WinnerName:        expectedTeamNameB,
			TeamASide:         common.TeamCounterTerrorists,
			TeamBSide:         common.TeamTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			Number:            5,
			StartTick:         116629,
			StartFrame:        116533,
			EndTick:           134915,
			FreezeTimeEndTick: 119189,
			TeamAStartMoney:   20300,
			TeamBStartMoney:   19450,
			TeamAEconomyType:  constants.EconomyTypeForceBuy,
			TeamBEconomyType:  constants.EconomyTypeFull,
			EndReason:         events.RoundEndReasonTargetBombed,
			WinnerSide:        common.TeamTerrorists,
			TeamAScore:        3,
			TeamBScore:        2,
			WinnerName:        expectedTeamNameB,
			TeamASide:         common.TeamCounterTerrorists,
			TeamBSide:         common.TeamTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			Number:            6,
			StartTick:         135555,
			StartFrame:        135459,
			EndTick:           151956,
			FreezeTimeEndTick: 138115,
			TeamAStartMoney:   10300,
			TeamBStartMoney:   21650,
			TeamAEconomyType:  constants.EconomyTypeSemi,
			TeamBEconomyType:  constants.EconomyTypeFull,
			EndReason:         events.RoundEndReasonBombDefused,
			WinnerSide:        common.TeamCounterTerrorists,
			TeamAScore:        4,
			TeamBScore:        2,
			WinnerName:        expectedTeamNameA,
			TeamASide:         common.TeamCounterTerrorists,
			TeamBSide:         common.TeamTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			Number:            7,
			StartTick:         152596,
			StartFrame:        152487,
			EndTick:           171701,
			FreezeTimeEndTick: 155156,
			TeamAStartMoney:   21450,
			TeamBStartMoney:   26550,
			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:         172341,
			StartFrame:        172218,
			EndTick:           188752,
			FreezeTimeEndTick: 174901,
			TeamAStartMoney:   13450,
			TeamBStartMoney:   19900,
			TeamAEconomyType:  constants.EconomyTypeSemi,
			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:         189394,
			StartFrame:        189258,
			EndTick:           202127,
			FreezeTimeEndTick: 191954,
			TeamAStartMoney:   21800,
			TeamBStartMoney:   24450,
			TeamAEconomyType:  constants.EconomyTypeFull,
			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:         208984,
			StartFrame:        208821,
			EndTick:           225601,
			FreezeTimeEndTick: 211544,
			TeamAStartMoney:   13400,
			TeamBStartMoney:   25700,
			TeamAEconomyType:  constants.EconomyTypeEco,
			TeamBEconomyType:  constants.EconomyTypeFull,
			EndReason:         events.RoundEndReasonTargetBombed,
			WinnerSide:        common.TeamTerrorists,
			TeamAScore:        4,
			TeamBScore:        6,
			WinnerName:        expectedTeamNameB,
			TeamASide:         common.TeamCounterTerrorists,
			TeamBSide:         common.TeamTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			Number:            11,
			StartTick:         226241,
			StartFrame:        226078,
			EndTick:           236381,
			FreezeTimeEndTick: 228801,
			TeamAStartMoney:   24500,
			TeamBStartMoney:   26800,
			TeamAEconomyType:  constants.EconomyTypeFull,
			TeamBEconomyType:  constants.EconomyTypeFull,
			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:         237022,
			StartFrame:        236846,
			EndTick:           249758,
			FreezeTimeEndTick: 239582,
			TeamAStartMoney:   20950,
			TeamBStartMoney:   21400,
			TeamAEconomyType:  constants.EconomyTypeFull,
			TeamBEconomyType:  constants.EconomyTypeFull,
			EndReason:         events.RoundEndReasonTerroristsWin,
			WinnerSide:        common.TeamTerrorists,
			TeamAScore:        5,
			TeamBScore:        7,
			WinnerName:        expectedTeamNameB,
			TeamASide:         common.TeamCounterTerrorists,
			TeamBSide:         common.TeamTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			Number:            13,
			StartTick:         250400,
			StartFrame:        250211,
			EndTick:           268532,
			FreezeTimeEndTick: 252960,
			TeamAStartMoney:   18750,
			TeamBStartMoney:   20100,
			TeamAEconomyType:  constants.EconomyTypeSemi,
			TeamBEconomyType:  constants.EconomyTypeFull,
			EndReason:         events.RoundEndReasonTerroristsWin,
			WinnerSide:        common.TeamTerrorists,
			TeamAScore:        5,
			TeamBScore:        8,
			WinnerName:        expectedTeamNameB,
			TeamASide:         common.TeamCounterTerrorists,
			TeamBSide:         common.TeamTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			Number:            14,
			StartTick:         269174,
			StartFrame:        268972,
			EndTick:           278424,
			FreezeTimeEndTick: 271734,
			TeamAStartMoney:   26500,
			TeamBStartMoney:   22650,
			TeamAEconomyType:  constants.EconomyTypeFull,
			TeamBEconomyType:  constants.EconomyTypeFull,
			EndReason:         events.RoundEndReasonCTWin,
			WinnerSide:        common.TeamCounterTerrorists,
			TeamAScore:        6,
			TeamBScore:        8,
			WinnerName:        expectedTeamNameA,
			TeamASide:         common.TeamCounterTerrorists,
			TeamBSide:         common.TeamTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			Number:            15,
			StartTick:         279064,
			StartFrame:        278849,
			EndTick:           286943,
			FreezeTimeEndTick: 281624,
			TeamAStartMoney:   18150,
			TeamBStartMoney:   10250,
			TeamAEconomyType:  constants.EconomyTypeFull,
			TeamBEconomyType:  constants.EconomyTypeForceBuy,
			EndReason:         events.RoundEndReasonCTWin,
			WinnerSide:        common.TeamCounterTerrorists,
			TeamAScore:        7,
			TeamBScore:        8,
			WinnerName:        expectedTeamNameA,
			TeamASide:         common.TeamCounterTerrorists,
			TeamBSide:         common.TeamTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			Number:            16,
			StartTick:         294433,
			StartFrame:        294191,
			EndTick:           305609,
			FreezeTimeEndTick: 296993,
			TeamAStartMoney:   4000,
			TeamBStartMoney:   4000,
			TeamAEconomyType:  constants.EconomyTypePistol,
			TeamBEconomyType:  constants.EconomyTypePistol,
			EndReason:         events.RoundEndReasonCTWin,
			WinnerSide:        common.TeamCounterTerrorists,
			TeamAScore:        7,
			TeamBScore:        9,
			WinnerName:        expectedTeamNameB,
			TeamASide:         common.TeamTerrorists,
			TeamBSide:         common.TeamCounterTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			Number:            17,
			StartTick:         306251,
			StartFrame:        306009,
			EndTick:           322309,
			FreezeTimeEndTick: 308811,
			TeamAStartMoney:   10550,
			TeamBStartMoney:   18500,
			TeamAEconomyType:  constants.EconomyTypeEco,
			TeamBEconomyType:  constants.EconomyTypeSemi,
			EndReason:         events.RoundEndReasonCTWin,
			WinnerSide:        common.TeamCounterTerrorists,
			TeamAScore:        7,
			TeamBScore:        10,
			WinnerName:        expectedTeamNameB,
			TeamASide:         common.TeamTerrorists,
			TeamBSide:         common.TeamCounterTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			Number:            18,
			StartTick:         322949,
			StartFrame:        322696,
			EndTick:           338164,
			FreezeTimeEndTick: 325509,
			TeamAStartMoney:   21550,
			TeamBStartMoney:   19100,
			TeamAEconomyType:  constants.EconomyTypeFull,
			TeamBEconomyType:  constants.EconomyTypeFull,
			EndReason:         events.RoundEndReasonCTWin,
			WinnerSide:        common.TeamCounterTerrorists,
			TeamAScore:        7,
			TeamBScore:        11,
			WinnerName:        expectedTeamNameB,
			TeamASide:         common.TeamTerrorists,
			TeamBSide:         common.TeamCounterTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			Number:            19,
			StartTick:         338804,
			StartFrame:        338539,
			EndTick:           351239,
			FreezeTimeEndTick: 341364,
			TeamAStartMoney:   15550,
			TeamBStartMoney:   29150,
			TeamAEconomyType:  constants.EconomyTypeSemi,
			TeamBEconomyType:  constants.EconomyTypeFull,
			EndReason:         events.RoundEndReasonTerroristsWin,
			WinnerSide:        common.TeamTerrorists,
			TeamAScore:        8,
			TeamBScore:        11,
			WinnerName:        expectedTeamNameA,
			TeamASide:         common.TeamTerrorists,
			TeamBSide:         common.TeamCounterTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			Number:            20,
			StartTick:         357189,
			StartFrame:        356898,
			EndTick:           374469,
			FreezeTimeEndTick: 359749,
			TeamAStartMoney:   25850,
			TeamBStartMoney:   26850,
			TeamAEconomyType:  constants.EconomyTypeFull,
			TeamBEconomyType:  constants.EconomyTypeFull,
			EndReason:         events.RoundEndReasonTargetSaved,
			WinnerSide:        common.TeamCounterTerrorists,
			TeamAScore:        8,
			TeamBScore:        12,
			WinnerName:        expectedTeamNameB,
			TeamASide:         common.TeamTerrorists,
			TeamBSide:         common.TeamCounterTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			Number:            21,
			StartTick:         380198,
			StartFrame:        379893,
			EndTick:           394899,
			FreezeTimeEndTick: 382758,
			TeamAStartMoney:   14550,
			TeamBStartMoney:   18000,
			TeamAEconomyType:  constants.EconomyTypeSemi,
			TeamBEconomyType:  constants.EconomyTypeFull,
			EndReason:         events.RoundEndReasonTargetBombed,
			WinnerSide:        common.TeamTerrorists,
			TeamAScore:        9,
			TeamBScore:        12,
			WinnerName:        expectedTeamNameA,
			TeamASide:         common.TeamTerrorists,
			TeamBSide:         common.TeamCounterTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			Number:            22,
			StartTick:         395539,
			StartFrame:        395234,
			EndTick:           411536,
			FreezeTimeEndTick: 398099,
			TeamAStartMoney:   27200,
			TeamBStartMoney:   7700,
			TeamAEconomyType:  constants.EconomyTypeFull,
			TeamBEconomyType:  constants.EconomyTypeSemi,
			EndReason:         events.RoundEndReasonTerroristsWin,
			WinnerSide:        common.TeamTerrorists,
			TeamAScore:        10,
			TeamBScore:        12,
			WinnerName:        expectedTeamNameA,
			TeamASide:         common.TeamTerrorists,
			TeamBSide:         common.TeamCounterTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			Number:            23,
			StartTick:         412178,
			StartFrame:        411860,
			EndTick:           422347,
			FreezeTimeEndTick: 414738,
			TeamAStartMoney:   37950,
			TeamBStartMoney:   15900,
			TeamAEconomyType:  constants.EconomyTypeFull,
			TeamBEconomyType:  constants.EconomyTypeEco,
			EndReason:         events.RoundEndReasonTerroristsWin,
			WinnerSide:        common.TeamTerrorists,
			TeamAScore:        11,
			TeamBScore:        12,
			WinnerName:        expectedTeamNameA,
			TeamASide:         common.TeamTerrorists,
			TeamBSide:         common.TeamCounterTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			Number:            24,
			StartTick:         422987,
			StartFrame:        422654,
			EndTick:           443181,
			FreezeTimeEndTick: 425547,
			TeamAStartMoney:   44000,
			TeamBStartMoney:   26700,
			TeamAEconomyType:  constants.EconomyTypeFull,
			TeamBEconomyType:  constants.EconomyTypeFull,
			EndReason:         events.RoundEndReasonTargetBombed,
			WinnerSide:        common.TeamTerrorists,
			TeamAScore:        12,
			TeamBScore:        12,
			WinnerName:        expectedTeamNameA,
			TeamASide:         common.TeamTerrorists,
			TeamBSide:         common.TeamCounterTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			Number:            25,
			StartTick:         443821,
			StartFrame:        443475,
			EndTick:           455527,
			FreezeTimeEndTick: 446381,
			TeamAStartMoney:   51800,
			TeamBStartMoney:   15500,
			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,
		},
		{
			Number:            26,
			StartTick:         456168,
			StartFrame:        455808,
			EndTick:           472974,
			FreezeTimeEndTick: 458728,
			TeamAStartMoney:   60350,
			TeamBStartMoney:   18750,
			TeamAEconomyType:  constants.EconomyTypeFull,
			TeamBEconomyType:  constants.EconomyTypeSemi,
			EndReason:         events.RoundEndReasonCTWin,
			WinnerSide:        common.TeamCounterTerrorists,
			TeamAScore:        13,
			TeamBScore:        13,
			WinnerName:        expectedTeamNameB,
			TeamASide:         common.TeamTerrorists,
			TeamBSide:         common.TeamCounterTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			Number:            27,
			StartTick:         473614,
			StartFrame:        473239,
			EndTick:           492799,
			FreezeTimeEndTick: 476174,
			TeamAStartMoney:   50350,
			TeamBStartMoney:   28300,
			TeamAEconomyType:  constants.EconomyTypeFull,
			TeamBEconomyType:  constants.EconomyTypeFull,
			EndReason:         events.RoundEndReasonTargetBombed,
			WinnerSide:        common.TeamTerrorists,
			TeamAScore:        14,
			TeamBScore:        13,
			WinnerName:        expectedTeamNameA,
			TeamASide:         common.TeamTerrorists,
			TeamBSide:         common.TeamCounterTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			Number:            28,
			StartTick:         493439,
			StartFrame:        493051,
			EndTick:           512876,
			FreezeTimeEndTick: 495999,
			TeamAStartMoney:   41900,
			TeamBStartMoney:   22550,
			TeamAEconomyType:  constants.EconomyTypeFull,
			TeamBEconomyType:  constants.EconomyTypeFull,
			EndReason:         events.RoundEndReasonTargetBombed,
			WinnerSide:        common.TeamTerrorists,
			TeamAScore:        15,
			TeamBScore:        13,
			WinnerName:        expectedTeamNameA,
			TeamASide:         common.TeamTerrorists,
			TeamBSide:         common.TeamCounterTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			Number:            29,
			StartTick:         513516,
			StartFrame:        513113,
			EndTick:           521516,
			FreezeTimeEndTick: 516076,
			TeamAStartMoney:   50300,
			TeamBStartMoney:   24850,
			TeamAEconomyType:  constants.EconomyTypeFull,
			TeamBEconomyType:  constants.EconomyTypeFull,
			EndReason:         events.RoundEndReasonCTWin,
			WinnerSide:        common.TeamCounterTerrorists,
			TeamAScore:        15,
			TeamBScore:        14,
			WinnerName:        expectedTeamNameB,
			TeamASide:         common.TeamTerrorists,
			TeamBSide:         common.TeamCounterTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
		{
			Number:            30,
			StartTick:         522157,
			StartFrame:        521738,
			EndTick:           535463,
			FreezeTimeEndTick: 524717,
			TeamAStartMoney:   47000,
			TeamBStartMoney:   25150,
			TeamAEconomyType:  constants.EconomyTypeFull,
			TeamBEconomyType:  constants.EconomyTypeFull,
			EndReason:         events.RoundEndReasonTerroristsWin,
			WinnerSide:        common.TeamTerrorists,
			TeamAScore:        16,
			TeamBScore:        14,
			WinnerName:        expectedTeamNameA,
			TeamASide:         common.TeamTerrorists,
			TeamBSide:         common.TeamCounterTerrorists,
			TeamAName:         expectedTeamNameA,
			TeamBName:         expectedTeamNameB,
		},
	}

	var players = []fake.FakePlayer{
		{
			SteamID64:     76561198065448360,
			Name:          "story",
			KillCount:     15,
			AssistCount:   3,
			DeathCount:    17,
			Score:         51,
			Team:          match.TeamB,
			HeadshotCount: 5,
			MvpCount:      6,
			UtilityDamage: 139,
		},
		{
			SteamID64:     76561198012987839,
			Name:          "JUSTT",
			KillCount:     24,
			AssistCount:   3,
			DeathCount:    21,
			Score:         56,
			Team:          match.TeamB,
			HeadshotCount: 17,
			MvpCount:      3,
			UtilityDamage: 59,
		},
		{
			SteamID64:     76561197994395491,
			Name:          "roman",
			KillCount:     11,
			AssistCount:   3,
			DeathCount:    19,
			Score:         33,
			Team:          match.TeamB,
			HeadshotCount: 9,
			MvpCount:      2,
			UtilityDamage: 94,
		},
		{
			SteamID64:     76561198262460262,
			Name:          "ewjerkz",
			KillCount:     19,
			AssistCount:   2,
			DeathCount:    21,
			Score:         44,
			Team:          match.TeamB,
			HeadshotCount: 9,
			MvpCount:      3,
			UtilityDamage: 240,
		},
		{
			SteamID64:     76561197997981170,
			Name:          "MUTiRiS",
			KillCount:     17,
			AssistCount:   6,
			DeathCount:    24,
			Score:         43,
			Team:          match.TeamB,
			HeadshotCount: 6,
			MvpCount:      0,
			UtilityDamage: 174,
		},
		{
			SteamID64:     76561197987713664,
			Name:          "dev1ce",
			KillCount:     25,
			AssistCount:   7,
			DeathCount:    19,
			Score:         64,
			Team:          match.TeamA,
			HeadshotCount: 9,
			MvpCount:      4,
			UtilityDamage: 230,
		},
		{
			SteamID64:     76561198028458803,
			Name:          "blameF",
			KillCount:     18,
			AssistCount:   3,
			DeathCount:    14,
			Score:         48,
			Team:          match.TeamA,
			HeadshotCount: 5,
			MvpCount:      2,
			UtilityDamage: 289,
		},
		{
			SteamID64:     76561198010511021,
			Name:          "gla1ve",
			KillCount:     22,
			AssistCount:   9,
			DeathCount:    19,
			Score:         62,
			Team:          match.TeamA,
			HeadshotCount: 12,
			MvpCount:      5,
			UtilityDamage: 93,
		},
		{
			SteamID64:     76561197990682262,
			Name:          "Xyp9x",
			KillCount:     8,
			AssistCount:   6,
			DeathCount:    17,
			Score:         27,
			Team:          match.TeamA,
			HeadshotCount: 3,
			MvpCount:      0,
			UtilityDamage: 253,
		},
		{
			SteamID64:     76561198248953762,
			Name:          "Buzz",
			KillCount:     29,
			AssistCount:   4,
			DeathCount:    17,
			Score:         77,
			Team:          match.TeamA,
			HeadshotCount: 15,
			MvpCount:      5,
			UtilityDamage: 23,
		},
	}

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