Пример #1
0
        public IActionResult GetDefaultAgentSteps(AgentType agentType)
        {
            var steps = AgentProvider.GetDefaultStepConfigurationForAgentType(agentType);

            IEnumerable <ItemType> FilterStepsFor(IEnumerable <Step> xs)
            => xs.Select(x => runtimeLoader.Steps.First(s => s.TechnicalName == x.Type));

            return(new OkObjectResult(new
            {
                NormalPipeline = FilterStepsFor(steps.NormalPipeline),
                ErrorPipeline = FilterStepsFor(steps.ErrorPipeline ?? Enumerable.Empty <Step>())
            }));
        }
 public void RegistryContainsDefaultConfigurationForAllAgentTypes()
 {
     Assert.All(
         Enum.GetValues(typeof(AgentType)).Cast <AgentType>(),
         t => Assert.NotNull(AgentProvider.GetDefaultStepConfigurationForAgentType(t)));
 }