- Write StartScanAsync_WithMultipleSiteUrls_CallsServiceOncePerUrl test (RED) - Create ISessionManager interface for testability - Implement ISessionManager on SessionManager - Add PermissionsViewModel stub (NotImplementedException) to satisfy compile
21 lines
772 B
C#
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);
|
|
}
|