@@ -314,8 +314,26 @@ public void FindsSymbolsInFile()
314314 [ Fact ]
315315 public void FindsSymbolsInPesterFile ( )
316316 {
317- List < SymbolReference > symbolsResult = FindSymbolsInFile ( FindSymbolsInPesterFile . SourceDetails ) ;
318- Assert . Equal ( 5 , symbolsResult . Count ) ;
317+ List < PesterSymbolReference > symbolsResult = FindSymbolsInFile ( FindSymbolsInPesterFile . SourceDetails ) . OfType < PesterSymbolReference > ( ) . ToList ( ) ;
318+ Assert . Equal ( 5 , symbolsResult . Count ( r => r . SymbolType == SymbolType . Function ) ) ;
319+
320+ Assert . Equal ( 1 , symbolsResult . Count ( r => r . Command == PesterCommandType . Describe ) ) ;
321+ SymbolReference firstDescribeSymbol = symbolsResult . First ( r => r . Command == PesterCommandType . Describe ) ;
322+ Assert . Equal ( "Describe \" A dummy test\" " , firstDescribeSymbol . SymbolName ) ;
323+ Assert . Equal ( 1 , firstDescribeSymbol . ScriptRegion . StartLineNumber ) ;
324+ Assert . Equal ( 1 , firstDescribeSymbol . ScriptRegion . StartColumnNumber ) ;
325+
326+ Assert . Equal ( 1 , symbolsResult . Count ( r => r . Command == PesterCommandType . Context ) ) ;
327+ SymbolReference firstContextSymbol = symbolsResult . First ( r => r . Command == PesterCommandType . Context ) ;
328+ Assert . Equal ( "Context \" When a pester file is given\" " , firstContextSymbol . SymbolName ) ;
329+ Assert . Equal ( 2 , firstContextSymbol . ScriptRegion . StartLineNumber ) ;
330+ Assert . Equal ( 5 , firstContextSymbol . ScriptRegion . StartColumnNumber ) ;
331+
332+ Assert . Equal ( 3 , symbolsResult . Count ( r => r . Command == PesterCommandType . It ) ) ;
333+ SymbolReference lastItSymbol = symbolsResult . Last ( r => r . Command == PesterCommandType . It ) ;
334+ Assert . Equal ( "It \" Should return describe symbols\" " , lastItSymbol . SymbolName ) ;
335+ Assert . Equal ( 11 , lastItSymbol . ScriptRegion . StartLineNumber ) ;
336+ Assert . Equal ( 9 , lastItSymbol . ScriptRegion . StartColumnNumber ) ;
319337 }
320338
321339 [ Fact ]
0 commit comments