5.8 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | |
|---|---|---|---|---|---|
|
2026-04-16T13:55:21.942566+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 responsible for loading and managing test summary data from .dts files. It implements IBaseModel and serves as the data access layer between the file system and the ITestSummaryListViewModel, handling asynchronous test metadata retrieval, list merging logic, and test selection state management. The class coordinates UI busy states and publishes application-wide events via Prism's IEventAggregator.
2. Public Interface
Properties
| Name | Type | Description |
|---|---|---|
Parent |
ITestSummaryListViewModel |
Reference to the parent ViewModel. Settable property. |
_eventAggregator |
IEventAggregator |
Prism event aggregator for publishing/subscribing to application events. Settable property. |
IsSaved |
bool |
Get-only property. Note: Appears unassigned in source (ReSharper suppression present). |
PropertyChanged |
PropertyChangedEventHandler |
Event raised when a property value changes. |
Methods
void GetTestSummary(string path, string file, bool Include = false, bool selectAll = false)
Loads test definitions from the specified data folder asynchronously.
-
Parameters:
path- Directory path to the data folder. Will be created if it doesn't exist.file- The.dtsfile to load.Include- Whentrueand list has multiple items, selects the first test in the list.selectAll- Whentrue, selects all tests; otherwise uses default selection logic.
-
Behavior:
- Sets
Parent.IsBusy = trueand publishesBusyIndicatorChangeNotification(true). - Publishes
AppStatusExEventwithAppStatusArg.Busy. - Creates the directory at
pathif it doesn't exist. - Delegates to
TestMetadataList.GetTestSummaryListAsync()to retrieve test summaries. - Merges results into
Parent.TestSummaryList, preserving existing selection state for duplicate tests. - Calls
DetermineTestsSelected(selectAll)to apply selection logic. - Publishes
TestLoadedCountNotificationwith loaded count and parent ViewModel reference. - Publishes
BusyIndicatorChangeNotification(false)and setsParent.IsBusy = falseon completion.
- Sets
void OnPropertyChanged(string propertyName)
Raises the PropertyChanged event for the specified property name.
3. Invariants
-
Directory Creation: If
pathis non-empty and the directory doesn't exist, it will be created before loading tests. -
Test Uniqueness: Tests are uniquely identified by the combination of
Id,SetupName, andDataType. When a duplicate is detected, the existing test is replaced at its original index while preserving itsIsSelectedstate. -
Selection Guarantees:
- If
selectAllistrue, all tests inParent.TestSummaryListwill haveIsSelected = true. - If
selectAllisfalseand the list contains exactly one test, that test is selected. - If
selectAllisfalse, the list has multiple tests, and all tests share the same setup name with at least oneDataType == "ALL", the first test is selected.
- If
-
Event Pairing:
BusyIndicatorChangeNotificationandAppStatusExEventare always published in pairs (busy/available) even in exception scenarios via thefinallyblock.
4. Dependencies
This Module Depends On:
DTS.Common.Classes.Viewer.TestMetadata.TestMetadataList- ProvidesGetTestSummaryListAsync()method.DTS.Common.Base.IBaseModel- Interface implemented by this class.DTS.Common.Events- Event types:BusyIndicatorChangeNotification,AppStatusExEvent,TestLoadedCountNotification.DTS.Common.Interface- Likely definesITestSummaryListViewModel(inferred).DTS.Viewer.TestSummaryList.ViewModel-ITestSummaryListViewModel,TestSummaryViewListModel.Prism.Events.IEventAggregator- Event aggregation pattern.System.Windows.Threading.Dispatcher- For async UI dispatching.
Event Types Referenced:
BusyIndicatorChangeNotification- Payload:boolAppStatusExEvent- Payload:AppStatusExArgTestLoadedCountNotification- Payload:TestLoadedCountNotificationArgAppStatusArg- Enum withBusyandAvailablemembers.
5. Gotchas
-
Unassigned Property:
IsSavedis a get-only auto-property with no visible assignment. The ReSharper comment// ReSharper disable UnassignedGetOnlyAutoPropertyindicates this is a known issue. Behavior is undefined. -
Naming Convention Violation:
_eventAggregatoris a public property prefixed with an underscore, which violates typical C# naming conventions for public members. -
Nested Try-Catch with Silent Failure: The inner try-catch block (lines 83-92) silently swallows all exceptions. The comment indicates this was added for a regression build to prevent crashes from a new feature (case 16158).
-
Async Void Lambda: The
InvokeAsyncuses anasynclambda, but the outer method returnsvoid. Exception handling is done inside the lambda, but any unhandled exceptions before the firstawaitcould be problematic. -
Collection Event Subscription: When
Parent.TestSummaryListis empty, the new list is assigned directly withCollectionChangedsubscription. When non-empty, items are added individually without apparentCollectionChangedsubscription on individual items. -
Historical Bug Fixes: Multiple manuscript case references in comments (28164, 35546, 16158) indicate this class has accumulated patches for specific edge cases around test selection and identification logic.