• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

davewalker5 / ADS-B-BaseStationReader / 17820836521

18 Sep 2025 07:04AM UTC coverage: 89.162% (+0.1%) from 89.06%
17820836521

push

github

davewalker5
Added support for tracking profile files

393 of 477 branches covered (82.39%)

Branch coverage included in aggregate %.

36 of 48 new or added lines in 5 files covered. (75.0%)

1491 of 1636 relevant lines covered (91.14%)

45.82 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

35.71
/src/BaseStationReader.BusinessLogic/Configuration/TrackingProfileReaderWriter.cs
1
using System.Text.Json;
2
using System.Text.Json.Serialization;
3
using BaseStationReader.Entities.Config;
4
using BaseStationReader.Entities.Interfaces;
5

6
namespace BaseStationReader.BusinessLogic.Configuration
7
{
8
    public class TrackingProfileReaderWriter : ITrackingProfileReaderWriter
9
    {
10
        private readonly JsonSerializerOptions _serializerOptions;
11

12
        public TrackingProfileReaderWriter()
23✔
13
        {
23✔
14
            // Configure the JSON serialization options so Enums are written as member names, not
15
            // the corresponding integer values
16
            _serializerOptions = new() { WriteIndented = true };
23✔
17
            _serializerOptions.Converters.Add(new JsonStringEnumConverter());
23✔
18
        }
23✔
19

20
        /// <summary>
21
        /// Read a tracking profile from a JSON file
22
        /// </summary>
23
        /// <param name="filePath"></param>
24
        /// <returns></returns>
25
        public TrackingProfile Read(string filePath)
26
        {
×
27
            var json = File.ReadAllText(filePath);
×
NEW
28
            var profile = JsonSerializer.Deserialize<TrackingProfile>(json, _serializerOptions);
×
29
            return profile;
×
30
        }
×
31

32
        /// <summary>
33
        /// Write a tracking profile to a JSON file
34
        /// </summary>
35
        /// <param name="profile"></param>
36
        /// <param name="filePath"></param>
37
        public void Write(TrackingProfile profile, string filePath)
38
        {
×
NEW
39
            var json = JsonSerializer.Serialize(profile, _serializerOptions);
×
40
            File.WriteAllText(filePath, json);
×
41
        }
×
42
    }
43
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc