public void Benchmark_Original_Finder() { using (DisposableTimer.TraceDuration <TypeFinderTests>("Starting test", "Finished test")) { using (DisposableTimer.TraceDuration <TypeFinderTests>("Starting FindClassesOfType", "Finished FindClassesOfType")) { for (var i = 0; i < 1000; i++) { Assert.Greater(TypeFinderOriginal.FindClassesOfType <DisposableObject>(_assemblies).Count(), 0); } } using (DisposableTimer.TraceDuration <TypeFinderTests>("Starting FindClassesOfTypeWithAttribute", "Finished FindClassesOfTypeWithAttribute")) { for (var i = 0; i < 1000; i++) { Assert.Greater(TypeFinderOriginal.FindClassesOfTypeWithAttribute <TestEditor, MyTestAttribute>(_assemblies).Count(), 0); } } using (DisposableTimer.TraceDuration <TypeFinderTests>("Starting FindClassesWithAttribute", "Finished FindClassesWithAttribute")) { for (var i = 0; i < 1000; i++) { Assert.Greater(TypeFinderOriginal.FindClassesWithAttribute <XsltExtensionAttribute>(_assemblies).Count(), 0); } } } }
public void Find_Classes_Of_Type() { var typesFound = TypeFinder.FindClassesOfType <IApplicationStartupHandler>(_assemblies); var originalTypesFound = TypeFinderOriginal.FindClassesOfType <IApplicationStartupHandler>(_assemblies); Assert.AreEqual(originalTypesFound.Count(), typesFound.Count()); Assert.AreEqual(6, typesFound.Count()); Assert.AreEqual(6, originalTypesFound.Count()); }