private static void Main(string[] args) { IStatCalculator stats = null; bool showErrors = true; bool showHelp = false; var p = new OptionSet { { "b|burndown", "Get burndown chart data", v => { stats = new BurndownStats(); }}, { "c|cfd", "Get cumulative flow chart data", v => { stats = new CumulativeFlowStats(); }}, { "t|table", "Summarize issues in sprint", v => { stats = new ContentTableStats(); }}, { "e|errors", "Turn on or off list of issues with state errors (defaults to on)", v => { showErrors = v != null; } }, { "h|?|help", "Display this help message", v => showHelp = v != null } }; List<String> extras = p.Parse(args); if (showHelp) { ShowHelp(p); return; } IList<Tuple<string, string>> repos = GetRepoNames(extras); if (stats == null) { stats = new BurndownStats(); } var program = new Program(stats, repos, showErrors); program.Go(); }
public void Setup() { _cache = new RedisCacheRepository( connectionString: "localhost,abortConnect=false", environment: "local", functionalArea: "bts", serializer: new XmlSerializer(), logger: new FakeCacheLogger(), expire: false); var lineupRepo = new CachedLineupRepository( new LineupRepository(), _cache); var actualRoster = new ActualRoster( lineupRepo); _gameLogRepository = new GameLogRepository(); _cachedGameLogRepository = new CachedGameLogRepository( _gameLogRepository, _cache); _statCalculator = new StatCalculator( _cachedGameLogRepository); _rosterMaster = new FbbRosters( new FbbEventStore.FbbEventStore()); _sut = new HotList( actualRoster, _rosterMaster, _statCalculator); }
Program(IStatCalculator stats, IEnumerable<Tuple<string, string>> repoNames, bool listErrors) { this.stats = stats; this.repoNames = new List<Tuple<string, string>>(repoNames); ConnectToGithub(); CreateFormatters(listErrors); }
Program(IStatCalculator stats, IEnumerable <Tuple <string, string> > repoNames, bool listErrors) { this.stats = stats; this.repoNames = new List <Tuple <string, string> >(repoNames); ConnectToGithub(); CreateFormatters(listErrors); }
public UnitStatPM(IUnit i_unit, string i_stat, IStatCalculator i_calculator) : base() { Unit = i_unit; Stat = i_stat; mStatCalculator = i_calculator; SetProperties(); }
public UnitInfoPM(List <IUnit> i_units, int i_selectedIndex, IStatCalculator i_statCalculator) : base() { mUnits = i_units; mSelectedIndex = i_selectedIndex; mStatCalculator = i_statCalculator; RefreshPM(); }
public HotList( IActualRoster actualRoster, IRosterMaster rosterMaster, IStatCalculator statCalculator) { _actualRoster = actualRoster; _rosterMaster = rosterMaster; _statCalculator = statCalculator; }
public void GetSprintStatistics(IStatCalculator stats) { repository = github.GetRepository(ownerLogin, repositoryName); FindCurrentMilestone(); FindIssues(); stats.StartRepository(repository.Name, currentMilestone.Title); CalculateStatistics(stats); }
public void GetSprintStatistics(IStatCalculator stats) { repository = github.GetRepository(ownerLogin, repositoryName); FindCurrentMilestone(); FindIssues(); stats.StartRepository(repository.Name, currentMilestone.Title); CalculateStatistics(stats); }
private void CalculateStatistics(IStatCalculator stats) { foreach (Issue issue in openIssues.Concat(closedIssues).Where(i => !GithubConventions.IsPartnerIssue(i))) { float devEstimate; float testEstimate; GithubConventions.ParseEstimates(issue, stats, out devEstimate, out testEstimate); stats.AddIssue(issue, devEstimate, testEstimate); } }
public void VerifyStatName_MatchesCalculator() { string statName = "TestStatName"; IStatCalculator mockStatCalculator = Substitute.For <IStatCalculator>(); mockStatCalculator.GetStatName(Arg.Any <string>()).Returns(statName); UnitStatPM testPM = new UnitStatPM(Substitute.For <IUnit>(), "TestStat", mockStatCalculator); Assert.AreEqual(testPM.ViewModel.GetPropertyValue <string>(UnitStatPM.STAT_NAME_PROPERTY), statName); }
public void VerifyGuildBonus_MatchesStatCalculator() { int bonusValue = 111; IStatCalculator mockStatCalculator = Substitute.For <IStatCalculator>(); mockStatCalculator.GetStatBonusFromSource(Arg.Any <IUnit>(), Arg.Any <string>(), Arg.Any <StatBonusSources>()).Returns(bonusValue); UnitStatPM testPM = new UnitStatPM(Substitute.For <IUnit>(), "TestStat", mockStatCalculator); Assert.AreEqual(testPM.ViewModel.GetPropertyValue <int>(UnitStatPM.STAT_GUILD_BONUS_PROPERTY), bonusValue); }
private void CalculateStatistics(IStatCalculator stats) { foreach (Issue issue in openIssues.Concat(closedIssues).Where(i => !GithubConventions.IsPartnerIssue(i))) { float devEstimate; float testEstimate; GithubConventions.ParseEstimates(issue, stats, out devEstimate, out testEstimate); stats.AddIssue(issue, devEstimate, testEstimate); } }
public void VerifyStatTotal_MatchesCalculator() { int totalValue = 111; IStatCalculator mockStatCalculator = Substitute.For <IStatCalculator>(); mockStatCalculator.GetTotalStatFromUnit(Arg.Any <IUnit>(), Arg.Any <string>()).Returns(totalValue); UnitStatPM testPM = new UnitStatPM(Substitute.For <IUnit>(), "TestStat", mockStatCalculator); Assert.AreEqual(testPM.ViewModel.GetPropertyValue <int>(UnitStatPM.STAT_TOTAL_PROPERTY), totalValue); }
private void SetStatCalculator() { List <IUnit> testList = new List <IUnit>(); testList.Add(mTestUnit); IStatCalculator calculator = Substitute.For <IStatCalculator>(); calculator.GetUnitsWithStat(Arg.Any <string>()).Returns(testList); StatCalculator.Instance = calculator; }
private void Output(IStatCalculator stats) { bool errorHeaderWritten = false; var errors = stats.Errors .GroupBy(e => e.Issue.Number); foreach (var group in errors) { if (!errorHeaderWritten) { WriteErrorHeader(); errorHeaderWritten = true; } WriteErrors(group); } }
private void Output(IStatCalculator stats) { bool errorHeaderWritten = false; var errors = stats.Errors .GroupBy(e => e.Issue.Number); foreach (var group in errors) { if (!errorHeaderWritten) { WriteErrorHeader(); errorHeaderWritten = true; } WriteErrors(group); } }
public static void ParseEstimates(Issue issue, IStatCalculator stats, out float devEstimate, out float testEstimate) { Match devMatches = devEstimateRegex.Match(issue.Body); Match testMatches = testEstimateRegex.Match(issue.Body); if (!devMatches.Success) { stats.AddError(issue, "Dev estimate not found in issue"); } if (!testMatches.Success) { stats.AddError(issue, "Test estimate not found in issue"); } float.TryParse(devMatches.Groups["estimate"].Value, out devEstimate); float.TryParse(testMatches.Groups["estimate"].Value, out testEstimate); }
public static void ParseEstimates(Issue issue, IStatCalculator stats, out float devEstimate, out float testEstimate) { Match devMatches = devEstimateRegex.Match(issue.Body); Match testMatches = testEstimateRegex.Match(issue.Body); if (!devMatches.Success) { stats.AddError(issue, "Dev estimate not found in issue"); } if (!testMatches.Success) { stats.AddError(issue, "Test estimate not found in issue"); } float.TryParse(devMatches.Groups["estimate"].Value, out devEstimate); float.TryParse(testMatches.Groups["estimate"].Value, out testEstimate); }
private static void Main(string[] args) { IStatCalculator stats = null; bool showErrors = true; bool showHelp = false; var p = new OptionSet { { "b|burndown", "Get burndown chart data", v => { stats = new BurndownStats(); } }, { "c|cfd", "Get cumulative flow chart data", v => { stats = new CumulativeFlowStats(); } }, { "t|table", "Summarize issues in sprint", v => { stats = new ContentTableStats(); } }, { "e|errors", "Turn on or off list of issues with state errors (defaults to on)", v => { showErrors = v != null; } }, { "h|?|help", "Display this help message", v => showHelp = v != null } }; List <String> extras = p.Parse(args); if (showHelp) { ShowHelp(p); return; } IList <Tuple <string, string> > repos = GetRepoNames(extras); if (stats == null) { stats = new BurndownStats(); } var program = new Program(stats, repos, showErrors); program.Go(); }
public Simulator(IStatCalculator statCalculator, IGetStatMethods getStatMethods) { this._statCalculator = statCalculator; this._getStatMethods = getStatMethods; }
public Monster(IStatCalculator calculator) { _calculator = calculator; }
private void WriteHeader(string label, IStatCalculator stats) { output.WriteLine("{0}: Repository {1}, milestone {2}", label, stats.RepoName, stats.Milestone); }
private void WriteHeader(string label, IStatCalculator stats) { output.WriteLine("{0}: Repository {1}, milestone {2}", label, stats.RepoName, stats.Milestone); }