namespace Tests.Parsers;

public class TeamParser_Tests
{
	[Test]
	public void ParseTest()
	{
		var competitiveEvents = TestEntityHandler.GetEvents();
		var teams = TestEntityHandler.GetTeams(competitiveEvents, TestEntityHandler.GetStudents(competitiveEvents));

		foreach (var team in teams)
		{

			Console.WriteLine($"{team.Event.Name}");
			var join = string.Join(", ", team.Students.OrderByDescending(s=> s.Grade + s.TsaYear).Select(s => $"{s.FirstNameLastName}{(team.Captain == s ? " *" : "")}"));
			Console.WriteLine($"\t{join}");

		}
		Assert.Pass();
	}


	[Test]
	public void RegionalPresubmissions()
	{
		var competitiveEvents = TestEntityHandler.GetEvents();
		var students = TestEntityHandler.GetStudents(competitiveEvents);
		var teams = TestEntityHandler.GetTeams(competitiveEvents, students);

		foreach (var team in teams.Where(t => t.Event.RegionalEvent))
		{
			Console.WriteLine($"{team.Event.Name} {team.Event.RegionalEvent} team.RegionalTimeSlot");
			var join = string.Join(", ", team.Students.OrderByDescending(s => team.Captain == s).ThenByDescending(s => s.Grade + s.TsaYear).Select(s => $"{s.FirstNameLastName}{(team.Captain == s ? " *" +
				"(Cpt.)" : "")}"));
			Console.WriteLine($"\t{join}");
			//Console.WriteLine(team.RegionalTimeSlotObj);
		}
	}

}