public void ShouldNotBeIncremented() { var gitVersionContext = contextBuilder .WithConfig(new Config { NextVersion = "1.0.0" }).Build(); var baseVersion = strategy.GetVersions(gitVersionContext).Single(); baseVersion.ShouldIncrement.ShouldBe(false); baseVersion.SemanticVersion.ToString().ShouldBe("1.0.0"); }
private static BaseVersion GetBaseVersion(Config config = null) { var contextBuilder = new GitVersionContextBuilder(); if (config != null) { contextBuilder = contextBuilder.WithConfig(config); } contextBuilder.Build(); var strategy = contextBuilder.ServicesProvider.GetServiceForType <IVersionStrategy, ConfigNextVersionVersionStrategy>(); return(strategy.GetVersions().SingleOrDefault()); }