2828using System . Linq ;
2929using System . Reflection ;
3030using PuppeteerSharp . Nunit ;
31+ using PuppeteerSharp . Tests ;
3132
3233namespace PuppeteerSharp . Tooling
3334{
@@ -54,26 +55,24 @@ public static void Run(IdentifyMissingTestsOptions options)
5455 // let's map the test cases from the spec files
5556 MapTestsCases ( directoryInfo , options , string . Empty ) ;
5657
57- // now, let's load the DLL and use some reflection-fu
58- var assembly = Assembly . LoadFrom ( options . TestsAssemblyPath ) ;
59-
60- var attributes = assembly . DefinedTypes . SelectMany (
61- type => type . GetMethods ( ) . SelectMany ( method => method . GetCustomAttributes < PuppeteerTestAttribute > ( ) ) ) ;
62-
6358 var potentialMatches = 0 ;
6459 var fullMatches = 0 ;
6560 var noMatches = 0 ;
6661 var totalTests = 0 ;
6762
6863 List < PuppeteerTestAttribute > missingTests = new ( ) ;
6964 List < KeyValuePair < PuppeteerTestAttribute , List < PuppeteerTestAttribute > > > invalidMaps = new ( ) ;
65+
66+ var attributes = new ScreenshotHelper ( ) . GetType ( ) . Assembly . DefinedTypes . SelectMany (
67+ type => type . GetMethods ( ) . SelectMany ( method => method . GetCustomAttributes < PuppeteerTestAttribute > ( ) ) ) ;
68+
7069 foreach ( var x in _testPairs )
7170 {
7271 totalTests ++ ;
7372
7473 // a test can either be a full match, a partial (i.e. just the test name) or no match
7574 var potentialMatch = attributes . Where ( atx => string . Equals ( x . TestName , atx . TestName , StringComparison . InvariantCultureIgnoreCase ) )
76- . Where ( atx => string . Equals ( x . Describe , atx . Describe , StringComparison . InvariantCultureIgnoreCase ) ) ;
75+ . Where ( atx => string . Equals ( x . Describe , atx . Describe , StringComparison . InvariantCultureIgnoreCase ) ) ;
7776 if ( ! potentialMatch . Any ( ) )
7877 {
7978 noMatches ++ ;
0 commit comments