public void getReportTypetestReportType_withGrandTotal()
        {
            Report report = new Report("test");

            Assert.AreEqual(report.getReportType(), "UNKNOWN TYPE");

            report = new LeagueStandingsReport("test", true);
            Assert.AreEqual(report.getReportType(), "LEAGUE STANDINGS");

            report = new LeagueGrandTotalsReport("test");
            Assert.AreEqual(report.getReportType(), "LEAGUE GRAND TOTALS");
        }
        public void Initialize()
        {
            Config.PRT_FILE_LOCATION = "testData";
            Config.LEAGUE_NAME       = "";
            Report.DATABASE.reset();
            RecordIndex.resetIndex(RecordIndex.INDEX.TestTeamId);

            SOMReportFile file = new SOMReportFile(Config.getConfigurationFile("ALL_REPORTS.PRT"));

            file.parseLeagueFile();
            leagueStandingsReport = (LeagueStandingsReport)file.FindReport("LEAGUE STANDINGS FOR");
            leagueStandingsReport.processReport(Program.LEAGUES[0].Length);

            leaguePrimaryStatReport = (LeagueGrandTotalsReport)file.FindReport("LEAGUE GRAND TOTALS (primary report) FOR");
            leaguePrimaryStatReport.processReport(Program.LEAGUES[0].Length);
        }
Example #3
0
        public void initialize(int daysPlayed)
        {
            Program.daysPlayed = daysPlayed;
            Report.DATABASE.reset();

            Console.WriteLine("  Loading League Report File ...");
            leagueReportFile = new SOMReportFile(Config.getConfigurationFile("ALL_REPORTS.PRT"));
            leagueReportFile.parseLeagueFile();


            IFeature feature = FeatureFactory.loadFeature(FeatureFactory.FEATURE.STANDINGS);

            feature.initialize(leagueReportFile);

            Console.WriteLine("    Building Grand Totals...");
            leaguePrimaryStatReport = (LeagueGrandTotalsReport)leagueReportFile.FindReport("LEAGUE GRAND TOTALS (primary report) FOR");
            leaguePrimaryStatReport.processReport(Program.LEAGUES[0].Length);

            Console.WriteLine("    Building League Report ...");
            lineScoreReport = (LineScoreAndMinorsReport)leagueReportFile.FindReport("INJURY/MINOR LEAGUE REPORT FOR");
            lineScoreReport.processReport(Program.LEAGUES[0].Length);

            Console.WriteLine("    Building Awards...");
            newspaperStyleReport = (NewspaperStyleReport)leagueReportFile.FindReport("AWARDS VOTING FOR");
            newspaperStyleReport.processReport(Program.LEAGUES[0].Length);

            Console.WriteLine("    Building Record Book...");
            feature = FeatureFactory.loadFeature(FeatureFactory.FEATURE.RECORD_BOOK);
            feature.initialize(leagueReportFile);

            output.setOutputHeader(leagueReportFile.SeasonTitle, daysPlayed);

            Console.WriteLine("  Loading Team Report File...");
            teamReportFile = new SOMReportFile(Config.getConfigurationFile("TEAM_ALL_REPORTS.PRT"));
            teamReportFile.parseTeamFile();

            featureUsage = FeatureFactory.loadFeature(FeatureFactory.FEATURE.USAGE);
            featureUsage.initialize(teamReportFile);

            featureUnderUsage = FeatureFactory.loadFeature(FeatureFactory.FEATURE.UNDERUSAGE);
            ((FeatureUnderUsage)featureUnderUsage).setReportData(((FeatureUsage)featureUsage).teamComparisonReport);
            featureUnderUsage.initialize(teamReportFile);
        }