< Summary

Information
Class: Orchestrator.PathUtility
Assembly: Orchestrator
File(s): /home/runner/work/KicktippAi/KicktippAi/src/Orchestrator/PathUtility.cs
Line coverage
100%
Covered lines: 14
Uncovered lines: 0
Coverable lines: 14
Total lines: 58
Line coverage: 100%
Branch coverage
100%
Covered branches: 4
Total branches: 4
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
FindSolutionRoot()100%44100%
GetInstructionsTemplatePath()100%11100%
GetEnvFilePath(...)100%11100%
GetFirebaseJsonPath()100%11100%

File(s)

/home/runner/work/KicktippAi/KicktippAi/src/Orchestrator/PathUtility.cs

#LineLine coverage
 1namespace Orchestrator;
 2
 3public static class PathUtility
 4{
 5    /// <summary>
 6    /// Finds the solution root directory by looking for KicktippAi.slnx in parent directories.
 7    /// </summary>
 8    /// <returns>The path to the solution root directory.</returns>
 9    /// <exception cref="DirectoryNotFoundException">Thrown when the solution root cannot be found.</exception>
 10    public static string FindSolutionRoot()
 11    {
 112        var currentDirectory = Directory.GetCurrentDirectory();
 113        var directory = new DirectoryInfo(currentDirectory);
 14
 115        while (directory != null)
 16        {
 117            var solutionFile = Path.Combine(directory.FullName, "KicktippAi.slnx");
 118            if (File.Exists(solutionFile))
 19            {
 120                return directory.FullName;
 21            }
 122            directory = directory.Parent;
 23        }
 24
 125        throw new DirectoryNotFoundException($"Could not find solution root (KicktippAi.slnx) starting from: {currentDir
 26    }
 27
 28    /// <summary>
 29    /// Gets the path to the instructions template relative to the solution root.
 30    /// </summary>
 31    /// <returns>The full path to the instructions template.</returns>
 32    public static string GetInstructionsTemplatePath()
 33    {
 134        var solutionRoot = FindSolutionRoot();
 135        return Path.Combine(solutionRoot, "prompts", "reasoning-models", "predict-one-match", "v0-handcrafted", "instruc
 36    }
 37
 38    /// <summary>
 39    /// Gets the path to the .env file for a specific project relative to the solution root.
 40    /// </summary>
 41    /// <param name="projectName">The name of the project (e.g., "Orchestrator").</param>
 42    /// <returns>The full path to the .env file.</returns>
 43    public static string GetEnvFilePath(string projectName)
 44    {
 145        var solutionRoot = FindSolutionRoot();
 146        return Path.Combine(solutionRoot, "..", "KicktippAi.Secrets", "src", projectName, ".env");
 47    }
 48
 49    /// <summary>
 50    /// Gets the path to the Firebase service account JSON file relative to the solution root.
 51    /// </summary>
 52    /// <returns>The full path to the firebase.json file.</returns>
 53    public static string GetFirebaseJsonPath()
 54    {
 155        var solutionRoot = FindSolutionRoot();
 156        return Path.Combine(solutionRoot, "..", "KicktippAi.Secrets", "src", "Orchestrator", "firebase.json");
 57    }
 58}