public void Find_Class_Of_Type_With_Attribute() { var typeFinder = new TypeFinder(GetTestProfilingLogger()); var typesFound = typeFinder.FindClassesOfTypeWithAttribute <TestEditor, MyTestAttribute>(_assemblies); Assert.AreEqual(2, typesFound.Count()); }
public void Benchmark_New_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(TypeFinder.FindClassesOfType <DisposableObject>(_assemblies).Count(), 0); } } using (DisposableTimer.TraceDuration <TypeFinderTests>("Starting FindClassesOfTypeWithAttribute", "Finished FindClassesOfTypeWithAttribute")) { for (var i = 0; i < 1000; i++) { Assert.Greater(TypeFinder.FindClassesOfTypeWithAttribute <TestEditor, MyTestAttribute>(_assemblies).Count(), 0); } } using (DisposableTimer.TraceDuration <TypeFinderTests>("Starting FindClassesWithAttribute", "Finished FindClassesWithAttribute")) { for (var i = 0; i < 1000; i++) { Assert.Greater(TypeFinder.FindClassesWithAttribute <XsltExtensionAttribute>(_assemblies).Count(), 0); } } } }
public void Find_Class_Of_Type_With_Attribute() { var typeFinder = new TypeFinder(Mock.Of <ILogger <TypeFinder> >(), new DefaultUmbracoAssemblyProvider(GetType().Assembly, NullLoggerFactory.Instance)); IEnumerable <Type> typesFound = typeFinder.FindClassesOfTypeWithAttribute <TestEditor, MyTestAttribute>(_assemblies); Assert.AreEqual(2, typesFound.Count()); }
public void Find_Class_Of_Type_With_Attribute() { var typesFound = TypeFinder.FindClassesOfTypeWithAttribute <TestEditor, MyTestAttribute>(_assemblies); Assert.AreEqual(2, typesFound.Count()); }