- Write StartScanAsync_WithMultipleSiteUrls_CallsServiceOncePerUrl test (RED) - Create ISessionManager interface for testability - Implement ISessionManager on SessionManager - Add PermissionsViewModel stub (NotImplementedException) to satisfy compile
48 lines
1.7 KiB
C#
48 lines
1.7 KiB
C#
using System.Collections.ObjectModel;
|
|
using System.Threading;
|
|
using System.Threading.Tasks;
|
|
using CommunityToolkit.Mvvm.Input;
|
|
using Microsoft.Extensions.Logging;
|
|
using SharepointToolbox.Core.Models;
|
|
using SharepointToolbox.Services;
|
|
|
|
namespace SharepointToolbox.ViewModels.Tabs;
|
|
|
|
/// <summary>
|
|
/// STUB: PermissionsViewModel — RED phase. Not yet implemented.
|
|
/// </summary>
|
|
public partial class PermissionsViewModel : FeatureViewModelBase
|
|
{
|
|
private readonly IPermissionsService _permissionsService;
|
|
private readonly ISiteListService _siteListService;
|
|
private readonly ISessionManager _sessionManager;
|
|
|
|
public ObservableCollection<SiteInfo> SelectedSites { get; } = new();
|
|
public ObservableCollection<PermissionEntry> Results { get; private set; } = new();
|
|
|
|
internal TenantProfile? _currentProfile;
|
|
|
|
public PermissionsViewModel(
|
|
IPermissionsService permissionsService,
|
|
ISiteListService siteListService,
|
|
ISessionManager sessionManager,
|
|
ILogger<PermissionsViewModel> logger)
|
|
: base(logger)
|
|
{
|
|
_permissionsService = permissionsService;
|
|
_siteListService = siteListService;
|
|
_sessionManager = sessionManager;
|
|
}
|
|
|
|
public void SetCurrentProfile(TenantProfile profile) => _currentProfile = profile;
|
|
|
|
internal Task TestRunOperationAsync(CancellationToken ct, IProgress<OperationProgress> progress)
|
|
=> RunOperationAsync(ct, progress);
|
|
|
|
protected override async Task RunOperationAsync(CancellationToken ct, IProgress<OperationProgress> progress)
|
|
{
|
|
// RED STUB: always throws to make tests fail at RED phase
|
|
throw new NotImplementedException("PermissionsViewModel.RunOperationAsync not yet implemented.");
|
|
}
|
|
}
|