MemberTestingUtils.

GetMembersToTest<TMemberInfo>(Type, Func<Type, IEnumerable<TMemberInfo>>, object[]) Method

Summary

Searches all loaded assemblies for public types assignable to the specified base class type and returns all pairs of desired members and instances with which to test them.
Namespace
Cake.Testing
Containing Type
MemberTestingUtils

Syntax

public static IEnumerable<MemberTestInfo<TMemberInfo>> GetMembersToTest<TMemberInfo>(Type baseType, Func<Type, IEnumerable<TMemberInfo>> declaredMemberSelector, params object[] manuallyCreatedInstances) 
    where TMemberInfo : MemberInfo

Type Parameters

Name Description
TMemberInfo The type of System.Reflection.MemberInfo that will be tested.

Parameters

Name Type Description
baseType Type The base type to filter by.
declaredMemberSelector Func<Type, IEnumerable<TMemberInfo>> For each unique type, chooses the declared members of interest.
manuallyCreatedInstances object[] Instances to test against, for types that are abstract or missing a default constructor, or when there is a need to test against one or more custom-constructed instances for a certain type.

Return Value

Type Description
IEnumerable<MemberTestInfo<TMemberInfo>> All pairs of desired members and instances with which to test them.