Files
Sharepoint-Toolbox/SharepointToolbox/Services/ISessionManager.cs
Dev c462a0b310 test(02-06): add failing test for PermissionsViewModel multi-site scan
- Write StartScanAsync_WithMultipleSiteUrls_CallsServiceOncePerUrl test (RED)
- Create ISessionManager interface for testability
- Implement ISessionManager on SessionManager
- Add PermissionsViewModel stub (NotImplementedException) to satisfy compile
2026-04-02 14:04:22 +02:00

21 lines
772 B
C#

using Microsoft.SharePoint.Client;
using SharepointToolbox.Core.Models;
namespace SharepointToolbox.Services;
/// <summary>
/// Abstraction over SessionManager, enabling unit testing of ViewModels
/// without live MSAL/SharePoint connections.
/// </summary>
public interface ISessionManager
{
/// <summary>Returns an existing ClientContext or creates one via interactive login.</summary>
Task<ClientContext> GetOrCreateContextAsync(TenantProfile profile, CancellationToken ct = default);
/// <summary>Clears the cached session for the given tenant URL.</summary>
Task ClearSessionAsync(string tenantUrl);
/// <summary>Returns true if an authenticated ClientContext exists for this tenantUrl.</summary>
bool IsAuthenticated(string tenantUrl);
}