Ejemplo n.º 1
0
 private void WriteToAdmin(string name, string email, ShirtSizeType shirtSize, TeamType color)
 {
     using (var fileStream = new FileStream(_adminFilename, FileMode.Append))
         using (var streamWriter = new StreamWriter(fileStream))
         {
             streamWriter.WriteLine($"{name},{email},{shirtSize:G},{color}");
         }
 }
Ejemplo n.º 2
0
        public TeamType AddPlayer(string name, string email, ShirtSizeType shirtSize)
        {
            var redTeamCount   = GetTeamCount(_redTeamFilename);
            var blackTeamCount = GetTeamCount(_blackTeamFilename);

            if (blackTeamCount > redTeamCount)
            {
                WriteToRedTeam(name);
                WriteToAdmin(name, email, shirtSize, TeamType.Red);
                return(TeamType.Red);
            }

            WriteToBlackTeam(name);
            WriteToAdmin(name, email, shirtSize, TeamType.Black);
            return(TeamType.Black);
        }
Ejemplo n.º 3
0
 public TeamType AddPlayer(string name, string email, ShirtSizeType shirtSize)
 {
     return(TeamType.Red);
 }