Hermetic real-MainWindow tests: LayoutPathOverride temp-DB seam (InternalsVisibleTo); fix tests persisting fake webcam sources over the real layout DB; LayoutStore delete-roundtrip guard
This commit is contained in:
@@ -481,7 +481,7 @@ public class MainViewModel : ViewModelBase
|
||||
SaveLayoutAsCommand = new RelayCommand(_ => SaveLayoutAs());
|
||||
OpenLayoutCommand = new RelayCommand(_ => OpenLayoutFile());
|
||||
|
||||
_layoutStore = new LayoutStore(DefaultLayoutPath);
|
||||
_layoutStore = new LayoutStore(LayoutPathOverride ?? DefaultLayoutPath);
|
||||
_activeLayoutPath = _layoutStore.ActivePath;
|
||||
|
||||
_cameraEnumerator = new MediaCaptureCameraEnumerator();
|
||||
@@ -531,6 +531,11 @@ public class MainViewModel : ViewModelBase
|
||||
"ytLlive",
|
||||
"ytLlive.db");
|
||||
|
||||
// Test seam: a real MainWindow test must never read or write the user's
|
||||
// real layout DB (it would persist test sources over real ones). Tests set
|
||||
// this to a temp path before constructing MainWindow and reset it after.
|
||||
internal static string? LayoutPathOverride { get; set; }
|
||||
|
||||
private void LoadLayout()
|
||||
{
|
||||
_isLoading = true;
|
||||
|
||||
Reference in New Issue
Block a user