< Summary

Information
Class: FirebaseAdapter.Configuration.FirebaseOptions
Assembly: FirebaseAdapter
File(s): /home/runner/work/KicktippAi/KicktippAi/src/FirebaseAdapter/Configuration/FirebaseOptions.cs
Line coverage
100%
Covered lines: 8
Uncovered lines: 0
Coverable lines: 8
Total lines: 45
Line coverage: 100%
Branch coverage
100%
Covered branches: 6
Total branches: 6
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_ProjectId()100%11100%
set_ProjectId(...)100%11100%
.ctor()100%11100%
get_ServiceAccountJson()100%11100%
set_ServiceAccountJson(...)100%11100%
get_ServiceAccountPath()100%11100%
set_ServiceAccountPath(...)100%11100%
Validate()100%66100%

File(s)

/home/runner/work/KicktippAi/KicktippAi/src/FirebaseAdapter/Configuration/FirebaseOptions.cs

#LineLine coverage
 1namespace FirebaseAdapter.Configuration;
 2
 3/// <summary>
 4/// Configuration options for Firebase database connection.
 5/// </summary>
 6public class FirebaseOptions
 7{
 8    /// <summary>
 9    /// The section name for configuration binding.
 10    /// </summary>
 11    public const string SectionName = "Firebase";
 12
 13    /// <summary>
 14    /// Firebase project ID.
 15    /// </summary>
 116    public string ProjectId { get; set; } = string.Empty;
 17
 18    /// <summary>
 19    /// Firebase service account private key JSON content.
 20    /// This should contain the complete JSON service account key.
 21    /// </summary>
 122    public string ServiceAccountJson { get; set; } = string.Empty;
 23
 24    /// <summary>
 25    /// Optional: Path to the service account JSON file.
 26    /// If specified, this will be used instead of ServiceAccountJson.
 27    /// </summary>
 128    public string? ServiceAccountPath { get; set; }
 29
 30    /// <summary>
 31    /// Validates that the required configuration is present.
 32    /// </summary>
 33    public void Validate()
 34    {
 135        if (string.IsNullOrWhiteSpace(ProjectId))
 36        {
 137            throw new InvalidOperationException("Firebase ProjectId is required.");
 38        }
 39
 140        if (string.IsNullOrWhiteSpace(ServiceAccountJson) && string.IsNullOrWhiteSpace(ServiceAccountPath))
 41        {
 142            throw new InvalidOperationException("Either Firebase ServiceAccountJson or ServiceAccountPath must be provid
 43        }
 144    }
 45}