public static Dictionary<ScopeField, ScopeValue> BuildScopeMap(VariableScopeValues scopeValues, FilterConfiguration filter) { var environments = MapScope(scopeValues.Environments, filter.Environments); var roles = MapScope(scopeValues.Roles, filter.Roles); var targets = MapScope(scopeValues.Machines, filter.Targets); return new Dictionary<ScopeField, ScopeValue> { { ScopeField.Environment , new ScopeValue(environments)}, { ScopeField.Role , new ScopeValue(roles)}, { ScopeField.Machine , new ScopeValue(targets)} }; }
public OctopusIntegrationTests() { var filterConfig = new FilterConfiguration { Environments = { "dev" } }; _config = Substitute.For<IConfiguration>(); _config.OctopusHost.Returns(new Uri("http://172.28.128.20")); _config.OctopusApiKey.Returns("API-F6LZ4DWCNSDVWNSXVIOIMA11S"); _config.VariableSetName.Returns("ConsulSet"); _config.Filter.Returns(filterConfig); _filter = new VariableFilter(_config); }
public VariableFilter(IConfiguration config) { _filter = config.Filter; }