54 lines
4.2 KiB
Markdown
54 lines
4.2 KiB
Markdown
|
|
---
|
|||
|
|
source_files:
|
|||
|
|
- Common/DTS.Common/Interface/DTS.Viewer/TestModule/ITestModuleView.cs
|
|||
|
|
- Common/DTS.Common/Interface/DTS.Viewer/TestModule/ITestModuleViewModel.cs
|
|||
|
|
generated_at: "2026-04-16T03:06:43.064505+00:00"
|
|||
|
|
model: "Qwen/Qwen3-Coder-Next-FP8"
|
|||
|
|
schema_version: 1
|
|||
|
|
sha256: "e731cfdd77fd98b8"
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
# TestModule
|
|||
|
|
|
|||
|
|
## 1. Purpose
|
|||
|
|
This module defines the foundational view and view-model interfaces for a *Test Module* within the DTS Viewer subsystem. Its purpose is to establish a contract for test-related UI components—specifically, to enable the display and management of loaded .NET assemblies (e.g., for dynamic test discovery or execution). It extends the base view/view-model abstractions (`IBaseView`, `IBaseViewModel`) to provide a standardized structure for test module UIs, ensuring separation of concerns between presentation logic and data.
|
|||
|
|
|
|||
|
|
## 2. Public Interface
|
|||
|
|
|
|||
|
|
### `ITestModuleView`
|
|||
|
|
```csharp
|
|||
|
|
public interface ITestModuleView : IBaseView { }
|
|||
|
|
```
|
|||
|
|
- **Behavior**: A marker interface representing the *view* (UI layer) for the test module. It inherits from `IBaseView`, implying it adheres to the common view contract (e.g., lifecycle management, binding context), though the exact members of `IBaseView` are not visible here. No additional members are defined in this interface.
|
|||
|
|
|
|||
|
|
### `ITestModuleViewModel`
|
|||
|
|
```csharp
|
|||
|
|
public interface ITestModuleViewModel : IBaseViewModel
|
|||
|
|
{
|
|||
|
|
List<Assembly> AssemblyList { get; set; }
|
|||
|
|
}
|
|||
|
|
```
|
|||
|
|
- **Behavior**: Represents the *view model* for the test module. It inherits from `IBaseViewModel`, implying standard view-model responsibilities (e.g., data binding, command handling). Its sole public member is `AssemblyList`, a mutable `List<Assembly>` property intended to hold the set of assemblies relevant to testing (e.g., test assemblies, dependencies). The property supports both read and write access, allowing replacement of the entire list.
|
|||
|
|
|
|||
|
|
## 3. Invariants
|
|||
|
|
- `ITestModuleView` and `ITestModuleViewModel` must be used in conjunction (e.g., via MVVM binding), with `ITestModuleView` bound to an instance of `ITestModuleViewModel`.
|
|||
|
|
- The `AssemblyList` property must be initialized to a non-null `List<Assembly>` before use (since it is a reference type with no default initialization in the interface).
|
|||
|
|
- Assemblies in `AssemblyList` are expected to be *loaded* and *valid* (though the interface does not enforce this—consumers must handle `ReflectionTypeLoadException`, `BadImageFormatException`, etc., if applicable).
|
|||
|
|
- No ordering guarantee is specified for `AssemblyList`; consumers must not assume any particular sequence unless enforced by the implementation.
|
|||
|
|
|
|||
|
|
## 4. Dependencies
|
|||
|
|
- **Depends on**:
|
|||
|
|
- `DTS.Common.Base.IBaseView` and `DTS.Common.Base.IBaseViewModel` (base abstractions for view/view-model).
|
|||
|
|
- `System.Collections.Generic` (for `List<T>`).
|
|||
|
|
- `System.Reflection` (for `Assembly`).
|
|||
|
|
- **Depended on by**:
|
|||
|
|
- Likely concrete implementations of test module views (e.g., WPF/WinForms controls) and view models (e.g., test assembly loader/view logic).
|
|||
|
|
- The DTS Viewer subsystem’s composition or DI container (to resolve `ITestModuleView`/`ITestModuleViewModel` pairs).
|
|||
|
|
*(Exact dependents are not inferable from this source alone.)*
|
|||
|
|
|
|||
|
|
## 5. Gotchas
|
|||
|
|
- **No validation on `AssemblyList`**: The interface does not constrain the contents of `AssemblyList` (e.g., null assemblies, duplicate entries, non-test assemblies). Implementations must handle invalid entries.
|
|||
|
|
- **Mutable property**: `AssemblyList` is a `set`table property, meaning external code can replace the entire list. This may cause unexpected UI updates if the view does not subscribe to change notifications (e.g., `INotifyPropertyChanged`—though not visible here, `IBaseViewModel` may or may not implement it).
|
|||
|
|
- **No test-specific semantics**: Despite the name "TestModule", the interface provides no test-related functionality (e.g., test discovery, execution, filtering). All such behavior must reside in implementations.
|
|||
|
|
- **Namespace quirk**: `// ReSharper disable CheckNamespace` suggests the namespace is intentionally `DTS.Common.Interface` (not nested under a `TestModule` sub-namespace), which may cause confusion in large solutions.
|
|||
|
|
- **None identified from source alone.**
|