public async Task <ChannelVersionRuleTestResult> Test(IOctopusAsyncRepository repository, ChannelVersionRuleResource rule, string packageVersion) { if (rule == null) { // Anything goes if there is no rule defined for this step return(ChannelVersionRuleTestResult.Null()); } var link = repository.Client.RootDocument.Link("VersionRuleTest"); var resource = new { version = packageVersion, versionRange = rule.VersionRange, preReleaseTag = rule.Tag }; var response = repository.Client.RootDocument.UsePostForChannelVersionRuleTest() ? repository.Client.Post <object, ChannelVersionRuleTestResult>(link, resource) : repository.Client.Get <ChannelVersionRuleTestResult>(link, resource); return(await response.ConfigureAwait(false)); }
public static ChannelVersionRuleTestResult IsSatified(this ChannelVersionRuleTestResult versionRuleTestResult) { versionRuleTestResult.SatisfiesPreReleaseTag = true; versionRuleTestResult.SatisfiesVersionRange = true; return(versionRuleTestResult); }
public void SetChannelVersionRuleTestResult(ChannelVersionRuleTestResult result) { ChannelVersionRuleTestResult = result; }