private static IVersioningAdapter WithPath(string x, IVersioningAdapter gitAdapter) { if (!string.IsNullOrEmpty(x)) { gitAdapter.DataSource.SetContext(DataSourceContextKeys.ExePath, x); } return(gitAdapter); }
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)); }
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)); }
public AutoDiscoveryAdapter() { if (Directory.Exists(".git")) { _adapter = new GitAdapter(); } else if (Directory.Exists(".hg")) { _adapter = new HgAdapter(); } else if (Directory.Exists(".svn")) { _adapter = new SvnAdapter(); } else { _adapter = new TFAdapter(); } }
public AutoDiscoveryAdapter() { if(Directory.Exists(".git")) { _adapter = new GitAdapter(); } else if (Directory.Exists(".hg")) { _adapter = new HgAdapter(); } else if(Directory.Exists(".svn")) { _adapter = new SvnAdapter(); } else { _adapter = new TFAdapter(); } }
private static IVersioningAdapter WithPath(string x, IVersioningAdapter gitAdapter) { if(!string.IsNullOrEmpty(x)) { gitAdapter.DataSource.SetContext(DataSourceContextKeys.ExePath, x); } return gitAdapter; }
public static Analyzer Create(IVersioningAdapter adapter) { return new Analyzer(adapter); }
internal Analyzer(IVersioningAdapter adapter) { _adapter = adapter; }