5.5 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | |
|---|---|---|---|---|---|
|
2026-04-16T11:17:27.563683+00:00 | zai-org/GLM-5-FP8 | 1 | eacbbab8741bd493 |
Documentation: TestSummaryModel.cs
1. Purpose
TestSummaryModel is a model class within the DTS.Viewer.TestSummaryList module that orchestrates loading and merging test summary data from .dts files. It implements IBaseModel and serves as the data acquisition layer for the test summary list view, handling asynchronous file system operations, event publication for UI state management (busy indicators, app status), and intelligent merging of newly loaded tests with existing collections while preserving user selection state.
2. Public Interface
Properties
| Signature | Description |
|---|---|
ITestSummaryListViewModel Parent { get; set; } |
Reference to the parent view model. Must be set before calling GetTestSummary. Used to access and modify TestSummaryList, SelectedTestSummaryList, and IsBusy state. |
IEventAggregator _eventAggregator { get; set; } |
Prism event aggregator for publishing events. Despite the underscore prefix (typically indicating private), this is a public property. Must be set before calling GetTestSummary. |
bool IsSaved { get; } |
Read-only property. Appears to be an unimplemented auto-property (always returns default false). |
Methods
| Signature | Description |
|---|---|
void GetTestSummary(string path, string file, bool Include = false, bool selectAll = false) |
Loads test definitions from the specified path/file. Creates the directory if it doesn't exist. Merges results into Parent.TestSummaryList, replacing duplicates (matched by Id, SetupName, and DataType) while preserving selection state. Publishes BusyIndicatorChangeNotification, AppStatusExEvent, and TestLoadedCountNotification events. Executes work asynchronously via Dispatcher.CurrentDispatcher.InvokeAsync with DispatcherPriority.Background. |
void OnPropertyChanged(string propertyName) |
Raises the PropertyChanged event for the specified property name. |
Events
| Event | Description |
|---|---|
event PropertyChangedEventHandler PropertyChanged |
Standard INotifyPropertyChanged implementation. |
3. Invariants
- Parent must be assigned before calling
GetTestSummary. The method accessesParent.IsBusy,Parent.TestSummaryList, andParent.SelectedTestSummaryListwithout null checks. - _eventAggregator must be assigned before calling
GetTestSummary. Events are published without null checks. - Duplicate detection key: Tests are considered duplicates if they match on all three properties:
Id,SetupName, andDataType. - Selection preservation: When replacing a duplicate test, the
IsSelectedstate is preserved from the replaced test. - Collection event handling: When
Parent.TestSummaryListis empty, the new list is assigned directly andCollectionChangedis wired toParent.TestSummaryList_CollectionChanged. When non-empty, items are added/inserted individually. - Async execution:
GetTestSummaryreturns immediately; actual work is dispatched asynchronously. Callers cannot await completion.
4. Dependencies
This module depends on:
DTS.Common.Base—IBaseModelinterfaceDTS.Common.Classes.Viewer.TestMetadata—TestMetadataListclassDTS.Common.Events—BusyIndicatorChangeNotification,AppStatusExEvent,AppStatusExArg,AppStatusArg,TestLoadedCountNotification,TestLoadedCountNotificationArgDTS.Common.Interface— (specific interfaces unclear from source)DTS.Viewer.TestSummaryList.ViewModel—ITestSummaryListViewModel,TestSummaryViewListModelPrism.Events—IEventAggregatorSystem.Windows.Threading—Dispatcher,DispatcherPrioritySystem.Windows—MessageBoxSystem.IO—DirectorySystem.Linq— LINQ extension methods
What depends on this module:
- Cannot be determined from this source file alone. The
Parentproperty suggests consumption byITestSummaryListViewModelimplementations.
5. Gotchas
-
Misleading XML documentation: The
<summary>forGetTestSummarystates "Returns list of Test Definition" but the method returnsvoid. -
Naming convention violation:
_eventAggregatoruses an underscore prefix (conventionally indicating private fields) but is a public property. -
Fire-and-forget async pattern:
GetTestSummarydispatches work viaInvokeAsyncwith no mechanism for callers to know when loading completes. TheIsBusyflag and event publications are the only completion signals. -
Silent exception swallowing: Lines 99-108 contain a try/catch with an empty catch block (
catch (Exception) { }). The comment indicates this was added for a regression build to prevent crashes from a new feature (case 16158). -
Unimplemented property:
IsSavedis a get-only auto-property with no backing field assignment, meaning it always returnsfalse. -
Hardcoded string literal: The string
"ALL"is used forDataTypecomparison inDetermineTestsSelectedwithout a constant or enum. -
UI coupling in model: The model directly shows a
MessageBoxon errors (line 113), violating separation of concerns. -
Case reference comments: Multiple comments reference an internal manuscript system (e.g.,
http://manuscript.dts.local/f/cases/28164/) which are inaccessible outside the organization.