Ejemplo n.º 1
0
        public void scheduleGames_DoubleLine()
        {
            const String LINE_1 = "MLG-TXG  PTB-TBM  DTB-OKM  SDG-LAM* CLM-SLB* SEG-NYB* CHB-AZB*";
            const String LINE_2 = "KCM-WSG* PHM-TOG*";

            ScheduleDay day = new ScheduleDay();

            day.addGames(LINE_1);
            day.addGames(LINE_2);

            String result1 = day.getTeamsGameToday("MLG");

            Assert.IsTrue(result1.Equals("at TXG<br>"));
            String result2 = day.getTeamsGameToday("TXG");

            Assert.IsTrue(result2.Equals("vs MLG<br>"));

            String result3 = day.getTeamsGameToday("SDG");

            Assert.IsTrue(result3.Equals("at LAM<br>"));
            String result4 = day.getTeamsGameToday("LAM");

            Assert.IsTrue(result4.Equals("vs SDG<br>"));


            String result5 = day.getTeamsGameToday("KCM");

            Assert.IsTrue(result5.Equals("at WSG<br>"));
            String result6 = day.getTeamsGameToday("WSG");

            Assert.IsTrue(result6.Equals("vs KCM<br>"));
        }
Ejemplo n.º 2
0
 public void scheduleGames_Blank()
 {
     try
     {
         ScheduleDay day = new ScheduleDay();
         day.addGames("");
     }
     catch (Exception)
     {
         Assert.Fail("An exception should not have been thrown because the file should exist");
     }
     Assert.IsTrue(true);
 }
Ejemplo n.º 3
0
        public void initialize(ISOMReportFile file)
        {
            List <String> lines = file.readFileLinesOnly(false);

            ScheduleDay day    = null;
            String      header = "";
            String      games  = "";

            foreach (String line in lines)
            {
                if (line.StartsWith("["))
                {
                    continue;
                }
                else
                {
                    header = line.Substring(0, 15).Trim();
                    if (header.StartsWith("Schedule for "))
                    {
                        continue;
                    }
                    if (header.Length == 0)
                    {
                        //This is a continuation of the previous day
                        games = line.Substring(16).Trim();
                        day.addGames(games);
                    }
                    else
                    {
                        if (day != null)
                        {
                            schedule.Add(day);
                        }
                        // New Day.
                        day           = new ScheduleDay();
                        day.dayNumber = getDayNumber(line);
                        // Store the previous day
                        games = line.Substring(15).Trim();
                        day.addGames(games);
                    }
                }
            }
        }
Ejemplo n.º 4
0
        public void scheduleGames_SingleLine()
        {
            const String SINGLE_LINE = "MLG-TXG* PTB-TBM* DTB-OKM* SDG-LAM*";

            ScheduleDay day = new ScheduleDay();

            day.addGames(SINGLE_LINE);

            String result1 = day.getTeamsGameToday("MLG");

            Assert.IsTrue(result1.Equals("at TXG<br>"));
            String result2 = day.getTeamsGameToday("TXG");

            Assert.IsTrue(result2.Equals("vs MLG<br>"));

            String result3 = day.getTeamsGameToday("SDG");

            Assert.IsTrue(result3.Equals("at LAM<br>"));
            String result4 = day.getTeamsGameToday("LAM");

            Assert.IsTrue(result4.Equals("vs SDG<br>"));
        }