@@ -655,6 +655,27 @@ void main() {
655
655
expect (constructedEvent.eventData.length, 20 );
656
656
});
657
657
658
+ test ('Event.dartMCPEvent constructed' , () {
659
+ final event = Event .dartMCPEvent (
660
+ client: 'test client' ,
661
+ clientVersion: '1.0.0' ,
662
+ serverVersion: '1.1.0' ,
663
+ type: 'some_event' ,
664
+ additionalData:
665
+ _TestMetrics (boolField: true , stringField: 'hello' , intField: 1 ));
666
+ expect (
667
+ event.eventData,
668
+ equals ({
669
+ 'client' : 'test client' ,
670
+ 'clientVersion' : '1.0.0' ,
671
+ 'serverVersion' : '1.1.0' ,
672
+ 'type' : 'some_event' ,
673
+ 'boolField' : true ,
674
+ 'stringField' : 'hello' ,
675
+ 'intField' : 1 ,
676
+ }));
677
+ });
678
+
658
679
test ('Confirm all constructors were checked' , () {
659
680
var constructorCount = 0 ;
660
681
for (final declaration in reflectClass (Event ).declarations.keys) {
@@ -667,7 +688,7 @@ void main() {
667
688
668
689
// Change this integer below if your PR either adds or removes
669
690
// an Event constructor
670
- final eventsAccountedForInTests = 28 ;
691
+ final eventsAccountedForInTests = 29 ;
671
692
expect (eventsAccountedForInTests, constructorCount,
672
693
reason: 'If you added or removed an event constructor, '
673
694
'ensure you have updated '
0 commit comments