public void Testing_of_Single_Play_strong_weak() { var simulator = new SimulatorHandler(null); var first = new FootballTeam() { AttackStrength = 1, CollaboratingStrength = 1, DefenceStrength = 1 }; var second = new FootballTeam() { AttackStrength = 10, CollaboratingStrength = 10, DefenceStrength = 10 }; var comp = new Competition() { FirstTeam = first, SecondTeam = second }; simulator.Play(comp); }
public void Testing_Summarize_Championship() { var context = GetContext(); var simulator = new SimulatorHandler(context); //get last championship var champ = context.SimulatorData <Championship>() .Include(el => el.Competitions) .OrderByDescending(el => el.Year).FirstOrDefault(); if (champ != null) { var allResults = simulator.Summarize(champ); } }
public void Testing_first_team_results() { var context = GetContext(); var simulator = new SimulatorHandler(context); //get last championship var champ = context.SimulatorData <Championship>() .Include(el => el.Competitions) .OrderByDescending(el => el.Year).FirstOrDefault(); if (champ != null) { var team = champ.Competitions.FirstOrDefault()? .FirstTeam; if (team != null) { var result = simulator.SummariseTeamResult(champ, team); } } }
public void Testing_of_Calculate_Championship_results() { var context = GetContext(); var simulator = new SimulatorHandler(context); //get last championship var last = context.SimulatorData <Championship>().OrderByDescending(el => el.Year).FirstOrDefault(); Championship champ; if (last == null || last.Completed) { var year = last == null ? DateTime.Now.Year : last.Year + 1; champ = simulator.CreateChampionship($"Championship {year}", year); } else { champ = last; } simulator.FinalizeChampionship(champ); }
public void Create_New_Chanpionship_with_competitions() { var context = GetContext(); var simulator = new SimulatorHandler(context); simulator.CreateChampionship("Test", 9999); var comps = context.SimulatorData <Competition>().Where(cmp => cmp.Championship.Year == 9999); var count = comps.Count(); Assert.IsNotNull(count == 6); context.Delete <Competition>(comps.ToList()); var champship = context.SimulatorData <Championship>() .FirstOrDefault(el => el.Caption == "Test"); context.Delete(champship); context.Save(); }
void Start() { main = this; Debug.Break(); EditorApplication.pauseStateChanged += OnPause; }