public void GetTypes_should_not_return_non_public_types() { var assembly = CSharpAssemblyFactory.Compile( @" public class Foo { } class Bar { } "); var scanner = new AssemblyTypeScanner(assembly); var types = scanner.GetTypes(x => true); types.Count().ShouldEqual(1); }
public void GetTypes_should_only_return_class_types() { var assembly = CSharpAssemblyFactory.Compile( @" public class Foo { } public struct Bar { } "); var scanner = new AssemblyTypeScanner(assembly); var types = scanner.GetTypes(x => true); types.Count().ShouldEqual(1); }
public void GetTypes_should_return_all_types_in_assembly_that_matches_predicate() { var assembly = CSharpAssemblyFactory.Compile( @" public class Foo { } public class Bar { } "); var scanner = new AssemblyTypeScanner(assembly); var types = scanner.GetTypes(x => x.Name.Equals("Bar")); types.Count().ShouldEqual(1); }
public void GetTypes_should_return_all_types_in_assembly_that_matches_predicate() { var assembly = CSharpAssemblyFactory.Compile( @" public class Foo { } public class Bar { } "); var scanner = new AssemblyTypeScanner(assembly); var types = scanner.GetTypes(x => x.Name.Equals("Bar")); types.Count().ShouldEqual(1); }