- add: Unit tests

This commit is contained in:
2025-07-03 12:17:15 +03:00
parent 517fadaab8
commit ae17ff2d89
15 changed files with 467 additions and 12 deletions

View File

@@ -112,7 +112,7 @@ public class ConfigurationService
return false;
}
public void SetConfigValue<T>(ConVar<T> conVar, T value)
public void SetConfigValue<T>(ConVar<T> conVar, T? value)
{
if (value == null)
{

View File

@@ -1,5 +1,4 @@
using System.IO.Compression;
using System.Runtime.InteropServices;
using Nebula.Shared.FileApis;
using Nebula.Shared.FileApis.Interfaces;
using Nebula.Shared.Models;
@@ -11,7 +10,7 @@ namespace Nebula.Shared.Services;
[ServiceRegister]
public class FileService
{
public static readonly string RootPath = Path.Join(Environment.GetFolderPath(
public static string RootPath = Path.Join(Environment.GetFolderPath(
Environment.SpecialFolder.ApplicationData), "Datum");
private readonly ILogger _logger;

View File

@@ -11,7 +11,7 @@ namespace Nebula.Shared.Services;
[ServiceRegister]
public class RestService
{
private readonly HttpClient _client = new();
private readonly HttpClient _client;
private readonly ILogger _logger;
private readonly JsonSerializerOptions _serializerOptions = new()
@@ -20,8 +20,9 @@ public class RestService
WriteIndented = true
};
public RestService(DebugService debug)
public RestService(DebugService debug, HttpClient? client = null)
{
_client = client ?? new HttpClient();
_logger = debug.GetLogger(this);
}