34 lines
No EOL
1.5 KiB
C#
34 lines
No EOL
1.5 KiB
C#
using EllieHub.Features.AppConfig.Models;
|
|
using EllieHub.Features.AppConfig.Services.Abstractions;
|
|
using EllieHub.Features.AppWindow.Models;
|
|
|
|
namespace EllieHub.Features.AppConfig.Services.Mocks;
|
|
|
|
/// <summary>
|
|
/// Represents a service that pretends to manage the application's settings.
|
|
/// </summary>
|
|
internal sealed class MockAppConfigManager : IAppConfigManager
|
|
{
|
|
/// <inheritdoc/>
|
|
public ReadOnlyAppSettings AppConfig { get; } = new(new() { BotEntries = new() { [Guid.Empty] = new("MockBot", Path.Join(AppStatics.AppDefaultBotDirectoryUri, "MockBot"), 0) } });
|
|
|
|
/// <inheritdoc/>
|
|
public ValueTask<BotEntry> CreateBotEntryAsync(CancellationToken cToken = default)
|
|
=> ValueTask.FromResult(new BotEntry(Guid.Empty, AppConfig.BotEntries[Guid.Empty]));
|
|
|
|
/// <inheritdoc/>
|
|
public ValueTask<BotEntry?> DeleteBotEntryAsync(Guid id, CancellationToken cToken = default)
|
|
=> ValueTask.FromResult<BotEntry?>(null);
|
|
|
|
/// <inheritdoc/>
|
|
public ValueTask<bool> SwapBotEntryAsync(Guid firstBotId, Guid secondBotId, CancellationToken cToken = default)
|
|
=> ValueTask.FromResult(false);
|
|
|
|
/// <inheritdoc/>
|
|
public ValueTask<bool> UpdateBotEntryAsync(Guid id, Func<BotInstanceInfo, BotInstanceInfo> selector, CancellationToken cToken = default)
|
|
=> ValueTask.FromResult(false);
|
|
|
|
/// <inheritdoc/>
|
|
public ValueTask UpdateConfigAsync(Action<AppSettings> action, CancellationToken cToken = default)
|
|
=> ValueTask.CompletedTask;
|
|
} |