public void Should_Register_Teams_on_Championship_and_not_add_a_Player_reason_no_CBF() { // <~~~~~~~~~~~~~~~~~~~~~~~[Creating Championship]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~> var champ = new Championship(); // <~~~~~~~~~~~~~~~~~~~~~~~[Register User]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~> champ.RegisterUser("Tiago", Profile.CBF, "admin123"); // <~~~~~~~~~~~~~~~~~~~~~~~[Register Teams]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~> champ.RegisterTeams(TeamsMock()); // <~~~~~~~~~~~~~~~~~~~~~~~[Add Player to Teams]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~> var teamId = champ.GetTeamIdByName("Flasco"); var foundTeam = champ.GetTeamById(teamId); champ.RegisterUser("Godofredo"); var tryAdd = champ.AddPlayer(new Player("Leozim"), teamId); Assert.False(tryAdd); Assert.Equal(16, foundTeam.Players.Count); }
public void Should_Register_Teams_on_Championship_and_add_a_Player() { // <~~~~~~~~~~~~~~~~~~~~~~~[Creating Championship]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~> var champ = new Championship(); // <~~~~~~~~~~~~~~~~~~~~~~~[Register User]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~> champ.RegisterUser("Tiago", Profile.CBF, "admin123"); // <~~~~~~~~~~~~~~~~~~~~~~~[Register Teams]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~> var teamsmock = TeamsMock(); champ.RegisterTeams(teamsmock); // <~~~~~~~~~~~~~~~~~~~~~~~[Add Player to Teams]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~> var teamId = champ.GetTeamIdByName("Flasco"); var tryAdd = champ.AddPlayer(new Player("Leozim"), teamId); var foundTeam = champ.GetTeamById(teamId); var foundPlayer = foundTeam.GetPlayerById(foundTeam.GetPlayerIdByName("Leozim")); Assert.True(tryAdd); Assert.Equal(17, foundTeam.Players.Count); Assert.Equal("Leozim", foundPlayer.Name); }