public bool IsValidEnviroment(params string[] enviroments) { Check.NotNull(enviroments, nameof(enviroments)); return(ExecutionType == ExecuteOn.Any && Enviroments.Any(row => Enviroments.Contains(row)) || ExecutionType == ExecuteOn.All && ContainsAll(enviroments, Enviroments)); bool ContainsAll <T>(IEnumerable <T> source, IEnumerable <T> values) { return(values.All(source.Contains)); } }