fix: resolve post-milestone tech debt items
- Add DataGrid RowStyle with red highlighting for invalid CSV rows in BulkMembersView, BulkSitesView, and FolderStructureView - Fix cancel test locale mismatch by setting EN culture before assertion - Remove dead FeatureTabBase placeholder (replaced by full tab views) - Clean up unused xmlns:controls from MainWindow.xaml Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using System.Globalization;
|
||||
using Microsoft.Extensions.Logging.Abstractions;
|
||||
using SharepointToolbox.Core.Models;
|
||||
using SharepointToolbox.ViewModels;
|
||||
@@ -61,23 +62,33 @@ public class FeatureViewModelBaseTests
|
||||
[Fact]
|
||||
public async Task CancelCommand_DuringOperation_SetsStatusMessageToCancelled()
|
||||
{
|
||||
var vm = new TestViewModel();
|
||||
var started = new TaskCompletionSource<bool>();
|
||||
|
||||
vm.OperationFunc = async (ct, p) =>
|
||||
// Ensure EN culture so TranslationSource resolves "Operation cancelled"
|
||||
var prev = CultureInfo.CurrentUICulture;
|
||||
CultureInfo.CurrentUICulture = CultureInfo.GetCultureInfo("en");
|
||||
try
|
||||
{
|
||||
started.SetResult(true);
|
||||
await Task.Delay(5000, ct); // Will be cancelled
|
||||
};
|
||||
var vm = new TestViewModel();
|
||||
var started = new TaskCompletionSource<bool>();
|
||||
|
||||
var runTask = vm.RunCommand.ExecuteAsync(null);
|
||||
await started.Task;
|
||||
vm.OperationFunc = async (ct, p) =>
|
||||
{
|
||||
started.SetResult(true);
|
||||
await Task.Delay(5000, ct); // Will be cancelled
|
||||
};
|
||||
|
||||
vm.CancelCommand.Execute(null);
|
||||
await runTask;
|
||||
var runTask = vm.RunCommand.ExecuteAsync(null);
|
||||
await started.Task;
|
||||
|
||||
Assert.Contains("cancel", vm.StatusMessage, StringComparison.OrdinalIgnoreCase);
|
||||
Assert.False(vm.IsRunning);
|
||||
vm.CancelCommand.Execute(null);
|
||||
await runTask;
|
||||
|
||||
Assert.Contains("cancel", vm.StatusMessage, StringComparison.OrdinalIgnoreCase);
|
||||
Assert.False(vm.IsRunning);
|
||||
}
|
||||
finally
|
||||
{
|
||||
CultureInfo.CurrentUICulture = prev;
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
||||
Reference in New Issue
Block a user