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.cs

Test Harness Features

  • Message composition and sending
  • State visualization
  • Event logging
  • Interactive geometry manipulation
  • Real-time state updates

Implementation Requirements

  1. XAML Controls

    • Message input panel
    • State visualization
    • Event log viewer
    • Geometry container
  2. ViewModels

    • Message handling
    • State management
    • Event routing visualization
  3. Testing

    • Unit tests for geometry behaviors
    • Integration tests for MQTT scenarios
    • Visual state verification

Getting Started

  1. Add the test harness to your project:
<Window ...>
    <controls:GeometryTestHarness
        GeometryType="Tree"
        InitialState="{Binding State}"
        MessageHandler="{Binding HandleMessage}" />
</Window>
  1. Configure your ViewModel:
public class MainViewModel : INotifyPropertyChanged
{
    public GeometryState State { get; }
    public ICommand HandleMessage { get; }
    
    // Implementation details...
}
  1. Run and test:
    • Enter test messages
    • Observe state changes
    • View event routing
    • Verify MQTT processing