private static AnalysisResult GetAnalysisResultWithDateBackAnalysis(Options options, Analyzer analyzer) { DateTime dt; if(!DateTime.TryParseExact(options.Date, "dd-M-yyyy", CultureInfo.InvariantCulture, DateTimeStyles.None, out dt)) { dt = DateTime.Now.Subtract(TimeSpan.FromDays(int.Parse(options.Date))); //crash hard if not really an int. } return analyzer.Analyze(dt); }
public static void AssertAdapterFixture(IVersioningAdapter gitAdapter, string fixturesGitLog, string fixturesGitLogResult) { var text = File.ReadAllText(fixturesGitLog); var mkrunner = new Mock<IAdapterDataSource>(); mkrunner.Setup(x => x.GetDataWithQuery(It.IsAny<string>())).Returns(text); gitAdapter.DataSource = mkrunner.Object; var analysisResult = new Analyzer(gitAdapter).Analyze(); var s = new StringWriter(); var tableReporter = new TableReporter(s); tableReporter.Write(analysisResult, new MinimalCutoffProcessor(0), int.MaxValue); s.ToString().ShouldBe(File.ReadAllText(fixturesGitLogResult)); }