@@ -567,27 +567,24 @@ public void SelectedCompoundOperandsAndProducerEventStayInTheInspectorsTraceSect
567567 var raw = System . IO . File . ReadAllText ( System . IO . Path . Combine ( AppContext . BaseDirectory ,
568568 "TestFixtures" , $ "trace-details-v3-{ word } .json") ) ;
569569 var response = WordTraceQuery . LoadDiagnostic ( raw ) . Value ! ;
570- var ( workspace , window ) = await PageScreenshots . OpenOverSampleData ( parse : false ) ;
571- try
572- {
573- var step = Steps ( response . Reading . Root ) . Single ( item => item . EventEvidence ? . ProducerStepId == producerId ) ;
574- var selected = new TraceStepViewModel ( step , null , refs : response . Reading . Refs . ToDictionary ( item => item . Id ) ) ;
575- Assert . NotNull ( selected . InspectSubject ) ;
576- workspace . Context . OpenInspector ( selected . InspectSubject ! , word ,
577- new InspectorTrace ( word , null ) , selected . Captured ) ;
578- await workspace . Inspector . Loading ;
579- Settle ( window ) ;
580- Assert . True ( workspace . Inspector . IsOpen ) ;
581- Assert . Equal ( $ "In this trace of { word } ", workspace . Inspector . TraceTitle ) ;
582- var details = workspace . Inspector . TraceDetails ;
583- Assert . Contains ( details , detail => detail . Label == "Producer event ID" && detail . Value == producerId ) ;
584- Assert . Contains ( details , detail => detail . Value . Contains ( firstOperand , StringComparison . Ordinal ) &&
585- detail . Value . Contains ( secondOperand , StringComparison . Ordinal ) ) ;
586- if ( subrule is not null )
587- Assert . Contains ( details , detail => detail . Label == "Subrule" && detail . Value == subrule . ToString ( ) ) ;
588- Assert . DoesNotContain ( workspace . Inspector . Facts , detail => detail . Value . Contains ( firstOperand , StringComparison . Ordinal ) ) ;
589- }
590- finally { window . Close ( ) ; }
570+ await using var sample = await SampleWorkspace . Open ( parse : false ) ;
571+ var workspace = sample . Workspace ;
572+ var step = Steps ( response . Reading . Root ) . Single ( item => item . EventEvidence ? . ProducerStepId == producerId ) ;
573+ var selected = new TraceStepViewModel ( step , null , refs : response . Reading . Refs . ToDictionary ( item => item . Id ) ) ;
574+ Assert . NotNull ( selected . InspectSubject ) ;
575+ workspace . Context . OpenInspector ( selected . InspectSubject ! , word ,
576+ new InspectorTrace ( word , null ) , selected . Captured ) ;
577+ await workspace . Inspector . Loading ;
578+ Avalonia . Threading . Dispatcher . UIThread . RunJobs ( ) ;
579+ Assert . True ( workspace . Inspector . IsOpen ) ;
580+ Assert . Equal ( $ "In this trace of { word } ", workspace . Inspector . TraceTitle ) ;
581+ var details = workspace . Inspector . TraceDetails ;
582+ Assert . Contains ( details , detail => detail . Label == "Producer event ID" && detail . Value == producerId ) ;
583+ Assert . Contains ( details , detail => detail . Value . Contains ( firstOperand , StringComparison . Ordinal ) &&
584+ detail . Value . Contains ( secondOperand , StringComparison . Ordinal ) ) ;
585+ if ( subrule is not null )
586+ Assert . Contains ( details , detail => detail . Label == "Subrule" && detail . Value == subrule . ToString ( ) ) ;
587+ Assert . DoesNotContain ( workspace . Inspector . Facts , detail => detail . Value . Contains ( firstOperand , StringComparison . Ordinal ) ) ;
591588 } , Deadline ) ;
592589
593590 static IEnumerable < TraceStep > Steps ( TraceStep step ) => new [ ] { step } . Concat ( step . Children . SelectMany ( Steps ) ) ;
0 commit comments