Files
2026-10-23 18:46:50 +02:00

91 lines
4.4 KiB
C#

using Omika.App.Local.Abstractions;
using Omika.Core.Contracts.Clients;
using Omika.Core.Contracts.Interventions;
using Omika.Core.Contracts.Mobile.Bootstrap;
using Omika.Core.Contracts.Mobile.Documents;
using Omika.Core.Contracts.Mobile.Interventions;
using Omika.Core.Contracts.Mobile.License;
using Omika.Core.Contracts.Mobile.Snapshot;
using Omika.Core.Contracts.Mobile.Sync;
using Omika.Core.Contracts.Planning;
using Omika.Core.Contracts.Sites;
namespace Omika.Tests.Mobile.Local;
/// <summary>
/// Stub réutilisable de <see cref="IMobileApiClient"/> : toutes les méthodes
/// lèvent <see cref="NotSupportedException"/>. Les tests qui ont besoin d'un
/// comportement réseau particulier remplacent ce stub par leur propre fake.
/// </summary>
public class StubMobileApiClient : IMobileApiClient
{
public string? AccessToken { get; set; }
public Task<MobileLicenseSessionResponse> ActivateAsync(LicenseActivateRequest request, CancellationToken cancellationToken = default)
=> throw new NotSupportedException();
public Task<MobileLicenseSessionResponse> ValidateAsync(LicenseValidateRequest request, CancellationToken cancellationToken = default)
=> throw new NotSupportedException();
public Task<MobileLicenseSessionResponse> GetDevelopmentSessionAsync(string deviceId, CancellationToken cancellationToken = default)
=> throw new NotSupportedException();
public Task<MobileBootstrapResponse> GetBootstrapAsync(CancellationToken cancellationToken = default)
=> throw new NotSupportedException();
public Task<SyncOperationReceipt> SendOperationAsync(SyncOperation operation, CancellationToken cancellationToken = default)
=> throw new NotSupportedException();
public Task<SyncStatusResponse> GetStatusAsync(Guid operationId, CancellationToken cancellationToken = default)
=> throw new NotSupportedException();
public Task<MobileSnapshotResponse> GetSnapshotAsync(CancellationToken cancellationToken = default)
=> throw new NotSupportedException();
public Task<DocumentDownloadResponse> DownloadDocumentAsync(Guid documentGuid, CancellationToken cancellationToken = default)
=> throw new NotSupportedException();
public Task<DocumentUploadResponse> UploadDocumentAsync(DocumentUploadRequest request, CancellationToken cancellationToken = default)
=> throw new NotSupportedException();
public Task<IReadOnlyList<MobileInterventionSearchResult>> SearchInterventionsAsync(MobileInterventionSearchRequest request, CancellationToken cancellationToken = default)
=> throw new NotSupportedException();
public Task<IReadOnlyList<MobileInterventionSearchResult>> GetInterventionsByIdsAsync(MobileInterventionsByIdsRequest request, CancellationToken cancellationToken = default)
=> throw new NotSupportedException();
public Task<DossierDetailsDto?> GetDossierByIdAsync(Guid dossierGuid, CancellationToken cancellationToken = default)
=> Task.FromResult<DossierDetailsDto?>(null);
public Task<InterventionDetailsDto?> GetInterventionByIdAsync(Guid interventionGuid, CancellationToken cancellationToken = default)
=> Task.FromResult<InterventionDetailsDto?>(null);
public Task<ClientDetailsDto?> GetClientByIdAsync(Guid clientGuid, CancellationToken cancellationToken = default)
=> Task.FromResult<ClientDetailsDto?>(null);
public Task<SiteDetailsDto?> GetSiteByIdAsync(Guid siteGuid, CancellationToken cancellationToken = default)
=> Task.FromResult<SiteDetailsDto?>(null);
/// <summary>
/// Surchargeable : les tests qui simulent l'agenda d'un collaborateur
/// retournent leurs rendez-vous ici (défaut : non supporté).
/// </summary>
public virtual Task<IReadOnlyList<RendezVousDetailsDto>> GetRendezVousByCollaborateurAsync(
Guid collaborateurGuid,
DateTime debutMin,
DateTime debutMax,
CancellationToken cancellationToken = default)
=> throw new NotSupportedException();
/// <summary>
/// Surchargeable : les tests qui simulent l'agenda d'une équipe retournent
/// leurs rendez-vous ici (défaut : non supporté).
/// </summary>
public virtual Task<IReadOnlyList<RendezVousDetailsDto>> GetRendezVousByCollaborateursAsync(
IReadOnlyList<Guid> collaborateurGuids,
DateTime debutMin,
DateTime debutMax,
CancellationToken cancellationToken = default)
=> throw new NotSupportedException();
}