diff --git a/src/Compiler/Config/ConfigIncludeLoader.cs b/src/Compiler/Config/ConfigIncludeLoader.cs index d00ad394..f8709ad6 100644 --- a/src/Compiler/Config/ConfigIncludeLoader.cs +++ b/src/Compiler/Config/ConfigIncludeLoader.cs @@ -1,8 +1,10 @@ using System; using System.Collections.Generic; using System.IO; +using System.Linq; using Compiler.Exception; using Compiler.Input.Rule; +using Compiler.Input.Sorter; using Compiler.Output; using Newtonsoft.Json.Linq; @@ -103,8 +105,9 @@ string configFilePath // Get the airport folders string configFileFolder = GetFolderForConfigFile(configFilePath); - string[] directories = - Directory.GetDirectories(configFileFolder + Path.DirectorySeparatorChar + configItem.Key); + var directories = Directory + .GetDirectories(configFileFolder + Path.DirectorySeparatorChar + configItem.Key) + .OrderBy(directory => directory, new AlphabeticalPathSorter()).ToList(); /* * Airports are a bit special as there are lots of them. diff --git a/tests/CompilerTest/Config/ConfigIncludeLoaderTest.cs b/tests/CompilerTest/Config/ConfigIncludeLoaderTest.cs index 198f116c..57052446 100644 --- a/tests/CompilerTest/Config/ConfigIncludeLoaderTest.cs +++ b/tests/CompilerTest/Config/ConfigIncludeLoaderTest.cs @@ -12,6 +12,7 @@ using Compiler.Input.Rule; using Compiler.Output; using Newtonsoft.Json.Linq; +using Xunit.Abstractions; using FileExists = Compiler.Input.Validator.FileExists; namespace CompilerTest.Config @@ -20,11 +21,13 @@ public class ConfigIncludeLoaderTest { private readonly ConfigIncludeLoader fileLoader; private readonly ConfigInclusionRules includes; + private readonly ITestOutputHelper output; - public ConfigIncludeLoaderTest() + public ConfigIncludeLoaderTest(ITestOutputHelper output) { fileLoader = ConfigIncludeLoaderFactory.Make(new CompilerArguments()); includes = new ConfigInclusionRules(); + this.output = output; } [Theory]