Premiere commit - Omika
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
using Omika.App.Local.Abstractions;
|
||||
using Omika.App.Local.Models;
|
||||
using Omika.Core.Contracts.Mobile.License;
|
||||
|
||||
namespace Omika.Tests.Mobile.Local;
|
||||
|
||||
/// <summary>
|
||||
/// Stub réutilisable de <see cref="IMobileSessionService"/> : retourne un
|
||||
/// bootstrap configurable (défaut null) et ne fait aucun appel réseau.
|
||||
/// </summary>
|
||||
public sealed class StubSessionService : IMobileSessionService
|
||||
{
|
||||
public LocalBootstrapState? Bootstrap { get; set; }
|
||||
|
||||
public Task<bool> HasValidSessionAsync(CancellationToken cancellationToken = default)
|
||||
=> Task.FromResult(true);
|
||||
|
||||
public Task<bool> HasExpiredSessionAsync(CancellationToken cancellationToken = default)
|
||||
=> Task.FromResult(false);
|
||||
|
||||
public Task<LicenseResponse> ActivateAsync(string codeClient, string numeroLicence, CancellationToken cancellationToken = default)
|
||||
=> Task.FromResult(new LicenseResponse { IsValid = true });
|
||||
|
||||
public Task<LicenseResponse> ValidateAsync(CancellationToken cancellationToken = default)
|
||||
=> Task.FromResult(new LicenseResponse { IsValid = true });
|
||||
|
||||
public Task<LocalBootstrapState?> GetBootstrapAsync(CancellationToken cancellationToken = default)
|
||||
=> Task.FromResult(Bootstrap);
|
||||
|
||||
public Task<string?> GetAccessTokenAsync(CancellationToken cancellationToken = default)
|
||||
=> Task.FromResult<string?>(null);
|
||||
|
||||
public Task EnsureDevelopmentSessionAsync(CancellationToken cancellationToken = default)
|
||||
=> Task.CompletedTask;
|
||||
|
||||
public Task ClearSessionAsync(CancellationToken cancellationToken = default)
|
||||
=> Task.CompletedTask;
|
||||
}
|
||||
Reference in New Issue
Block a user