46 lines
3.6 KiB
Markdown
46 lines
3.6 KiB
Markdown
|
|
---
|
|||
|
|
source_files:
|
|||
|
|
- Common/DTS.CommonCore/Interface/DTS.Viewer/TestModule/ITestModuleView.cs
|
|||
|
|
- Common/DTS.CommonCore/Interface/DTS.Viewer/TestModule/ITestModuleViewModel.cs
|
|||
|
|
generated_at: "2026-04-16T02:32:30.110646+00:00"
|
|||
|
|
model: "Qwen/Qwen3-Coder-Next-FP8"
|
|||
|
|
schema_version: 1
|
|||
|
|
sha256: "43e7cc3a0d236351"
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
# TestModule
|
|||
|
|
|
|||
|
|
## 1. Purpose
|
|||
|
|
This module defines the foundational view and view-model interfaces for a *Test Module* within the DTS Viewer subsystem. Its role is to establish a contract for UI components responsible for displaying or managing test-related functionality—specifically, operations involving .NET `Assembly` inspection or manipulation—by extending the common base interfaces (`IBaseView` and `IBaseViewModel`) and exposing a list of assemblies (`AssemblyList`) as its core data payload.
|
|||
|
|
|
|||
|
|
## 2. Public Interface
|
|||
|
|
|
|||
|
|
### `ITestModuleView`
|
|||
|
|
- **Signature**: `public interface ITestModuleView : IBaseView`
|
|||
|
|
- **Behavior**: A marker interface for the *view* layer of the Test Module. It inherits from `IBaseView`, implying it adheres to the standard view contract (e.g., binding context, lifecycle hooks) defined elsewhere in `DTS.Common.Base`. No additional members are declared here.
|
|||
|
|
|
|||
|
|
### `ITestModuleViewModel`
|
|||
|
|
- **Signature**: `public interface ITestModuleViewModel : IBaseViewModel`
|
|||
|
|
- **Behavior**: A view-model interface for the Test Module. It extends `IBaseViewModel` and exposes a single property:
|
|||
|
|
- `AssemblyList`: A `List<Assembly>` (read-write) intended to hold the collection of .NET assemblies relevant to the test module’s functionality (e.g., loaded test assemblies, plugin assemblies, or candidate assemblies for execution).
|
|||
|
|
|
|||
|
|
## 3. Invariants
|
|||
|
|
- `ITestModuleView` and `ITestModuleViewModel` must be used in conjunction per the standard MVVM pattern (view ↔ view-model binding), though the source does not enforce this directly.
|
|||
|
|
- `AssemblyList` is nullable by default (as it is a read-write property of a reference type); implementations must ensure it is initialized before use to avoid `NullReferenceException`.
|
|||
|
|
- No explicit validation rules or ordering constraints are defined for `AssemblyList` (e.g., no requirement for uniqueness, null-safety, or sortedness).
|
|||
|
|
|
|||
|
|
## 4. Dependencies
|
|||
|
|
- **Depends on**:
|
|||
|
|
- `DTS.Common.Base` (for `IBaseView`, `IBaseViewModel`)
|
|||
|
|
- `System.Collections.Generic` (for `List<T>`)
|
|||
|
|
- `System.Reflection` (for `Assembly`)
|
|||
|
|
- **Depended on by**:
|
|||
|
|
- Unknown from source alone. Concretions (e.g., `TestModuleView : ITestModuleView`, `TestModuleViewModel : ITestModuleViewModel`) and consumers (e.g., DI containers, view-resolution logic) are not visible here.
|
|||
|
|
|
|||
|
|
## 5. Gotchas
|
|||
|
|
- **Ambiguous scope of `AssemblyList`**: The interface does not clarify whether `AssemblyList` represents *all* assemblies, *selected* assemblies, *loaded* assemblies, or *candidate* assemblies. Its semantics are implementation-defined.
|
|||
|
|
- **No immutability or change notification**: The property is read-write with no indication of reactive updates (e.g., `INotifyCollectionChanged`). Consumers may need to manually handle synchronization if the list is modified externally.
|
|||
|
|
- **No null-safety contract**: While `List<Assembly>` is non-nullable as a type, the property itself may be `null` at initialization. Implementers must decide whether to auto-initialize or require callers to do so.
|
|||
|
|
- **Namespace quirk**: The `// ReSharper disable CheckNamespace` directive suggests intentional namespace flattening (likely to avoid deep nesting), but this is a tooling hint—not a runtime behavior—and does not affect semantics.
|
|||
|
|
|
|||
|
|
None identified beyond the above.
|