Tests passed using Mock

This commit is contained in:
2023-11-01 08:27:25 -07:00
parent f684c4b7ef
commit 3dd4034a84
81 changed files with 171126 additions and 139391 deletions

View File

@ -9,17 +9,17 @@ namespace OI.Metrology.Server.Repository;
public class ExportRepository : IExportRepository
{
private readonly Serilog.ILogger _Log;
private readonly string _RepositoryName;
private readonly AppSettings _AppSettings;
private readonly ILogger<ExportRepository> _Logger;
private readonly Dictionary<string, Dictionary<long, HeaderCommon>> _RdsToHeaderCommonCollection;
public ExportRepository(AppSettings appSettings)
public ExportRepository(ILogger<ExportRepository> logger, AppSettings appSettings)
{
_Logger = logger;
_AppSettings = appSettings;
_RdsToHeaderCommonCollection = new();
_RepositoryName = nameof(ExportRepository)[..^10];
_Log = Serilog.Log.ForContext<ExportRepository>();
}
private static string[] Get()
@ -93,7 +93,7 @@ public class ExportRepository : IExportRepository
if (jsonElement is not null && jsonElement.Value.ValueKind == JsonValueKind.Object)
{
jsonProperties = (from l in jsonElement.Value.EnumerateObject() where l.Name == ticks select l).ToArray();
if (jsonProperties.Any() && long.TryParse(jsonProperties[0].Value.ToString(), out long ticksValue))
if (jsonProperties.Length != 0 && long.TryParse(jsonProperties[0].Value.ToString(), out long ticksValue))
hc.Date = new(ticksValue);
}
results.Add(hc);