Test Harness
The Matrix Framework includes a universal test harness for validating and demonstrating middleware geometries.
Project Structure
Matrix/
├── Controls/
│ ├── GeometryTestHarness.xaml
│ ├── GeometryTestHarness.xaml.cs
│ ├── MessagePanel.xaml
│ └── StateViewer.xaml
├── ViewModels/
│ ├── GeometryTestViewModel.cs
│ └── MessageViewModel.cs
├── Models/
│ └── GeometryState.cs
└── Tests/
└── GeometryTests/
└── TreeGeometryTests.csTest Harness Features
- Message composition and sending
- State visualization
- Event logging
- Interactive geometry manipulation
- Real-time state updates
Implementation Requirements
-
XAML Controls
- Message input panel
- State visualization
- Event log viewer
- Geometry container
-
ViewModels
- Message handling
- State management
- Event routing visualization
-
Testing
- Unit tests for geometry behaviors
- Integration tests for MQTT scenarios
- Visual state verification
Getting Started
- Add the test harness to your project:
<Window ...>
<controls:GeometryTestHarness
GeometryType="Tree"
InitialState="{Binding State}"
MessageHandler="{Binding HandleMessage}" />
</Window>- Configure your ViewModel:
public class MainViewModel : INotifyPropertyChanged
{
public GeometryState State { get; }
public ICommand HandleMessage { get; }
// Implementation details...
}- Run and test:
- Enter test messages
- Observe state changes
- View event routing
- Verify MQTT processing