Class ExtensibilityPointFactory
Represents a factory for the types used for extensibility throughout the system.
public static class ExtensibilityPointFactory
- Inheritance
-
ExtensibilityPointFactory
- Inherited Members
Methods
GetAssemblyBeforeAfterTestAttributes(Assembly)
Gets the IBeforeAfterTestAttributes attached to the given test assembly.
public static IReadOnlyCollection<IBeforeAfterTestAttribute> GetAssemblyBeforeAfterTestAttributes(Assembly testAssembly)
Parameters
testAssemblyAssemblyThe test assembly
Returns
GetAssemblyFixtureTypes(Assembly)
Gets the fixture types that are attached to the test assembly via IAssemblyFixtureAttributes.
public static IReadOnlyCollection<Type> GetAssemblyFixtureTypes(Assembly testAssembly)
Parameters
testAssemblyAssemblyThe test assembly
Returns
GetAssemblyTestCaseOrderer(Assembly)
Gets the test case orderer that's attached to a test assembly. Returns null if there
isn't one attached.
public static ITestCaseOrderer? GetAssemblyTestCaseOrderer(Assembly testAssembly)
Parameters
testAssemblyAssemblyThe test assembly
Returns
GetAssemblyTestCollectionOrderer(Assembly)
Gets the test collection orderer that's attached to a test assembly. Returns null if there
isn't one attached.
public static ITestCollectionOrderer? GetAssemblyTestCollectionOrderer(Assembly testAssembly)
Parameters
testAssemblyAssemblyThe test assembly
Returns
GetAssemblyTraits(Assembly)
Gets the traits that are attached to the test assembly via ITraitAttributes.
public static IReadOnlyDictionary<string, IReadOnlyCollection<string>> GetAssemblyTraits(Assembly testAssembly)
Parameters
testAssemblyAssemblyThe test assembly
Returns
GetClassBeforeAfterTestAttributes(Type, IReadOnlyCollection<IBeforeAfterTestAttribute>)
Gets the IBeforeAfterTestAttributes attached to the given test class.
public static IReadOnlyCollection<IBeforeAfterTestAttribute> GetClassBeforeAfterTestAttributes(Type testClass, IReadOnlyCollection<IBeforeAfterTestAttribute> collectionBeforeAfterAttributes)
Parameters
testClassTypeThe test class
collectionBeforeAfterAttributesIReadOnlyCollection<IBeforeAfterTestAttribute>The before after attributes from the test collection, to be merged into the result.
Returns
GetClassClassFixtureTypes(Type, IReadOnlyCollection<Type>)
Gets the fixture types that are attached to the test class via IClassFixture<TFixture>.
public static IReadOnlyCollection<Type> GetClassClassFixtureTypes(Type testClass, IReadOnlyCollection<Type> collectionClassFixtureTypes)
Parameters
testClassTypeThe test class
collectionClassFixtureTypesIReadOnlyCollection<Type>The class fixture types from the test collection, which will be merged into the result
Returns
GetClassTestCaseOrderer(Type)
Gets the test case orderer that's attached to a test class. Returns null if there
isn't one attached.
public static ITestCaseOrderer? GetClassTestCaseOrderer(Type testClass)
Parameters
testClassTypeThe test class
Returns
GetClassTraits(Type?, IReadOnlyDictionary<string, IReadOnlyCollection<string>>?)
Gets the traits that are attached to the test class via ITraitAttributes.
public static IReadOnlyDictionary<string, IReadOnlyCollection<string>> GetClassTraits(Type? testClass, IReadOnlyDictionary<string, IReadOnlyCollection<string>>? testCollectionTraits)
Parameters
testClassTypeThe test class
testCollectionTraitsIReadOnlyDictionary<string, IReadOnlyCollection<string>>The traits inherited from the test collection
Returns
GetCollectionBeforeAfterTestAttributes(Type?, IReadOnlyCollection<IBeforeAfterTestAttribute>)
Gets the IBeforeAfterTestAttributes attached to the given test collection.
public static IReadOnlyCollection<IBeforeAfterTestAttribute> GetCollectionBeforeAfterTestAttributes(Type? collectionDefinition, IReadOnlyCollection<IBeforeAfterTestAttribute> assemblyBeforeAfterTestAttributes)
Parameters
collectionDefinitionTypeThe collection definition type
assemblyBeforeAfterTestAttributesIReadOnlyCollection<IBeforeAfterTestAttribute>The before after attributes from the test assembly, to be merged into the result.
Returns
GetCollectionBehavior(Assembly)
Gets the ICollectionBehaviorAttribute that's attached to the test assembly, if there is one.
public static ICollectionBehaviorAttribute? GetCollectionBehavior(Assembly testAssembly)
Parameters
testAssemblyAssemblyThe test assembly
Returns
GetCollectionClassFixtureTypes(Type?)
Gets the fixture types that are attached to the test collection via IClassFixture<TFixture>.
public static IReadOnlyCollection<Type> GetCollectionClassFixtureTypes(Type? collectionDefinition)
Parameters
collectionDefinitionTypeThe test collection definition type
Returns
GetCollectionCollectionFixtureTypes(Type?)
Gets the fixture types that are attached to the test collection via ICollectionFixture<TFixture>.
public static IReadOnlyCollection<Type> GetCollectionCollectionFixtureTypes(Type? collectionDefinition)
Parameters
collectionDefinitionTypeThe test collection definition type
Returns
GetCollectionDefinitions(Assembly)
Gets the CollectionDefinitionAttributes that are attached to the test assembly. Verifies that there are no collection definitions with identical names.
public static IReadOnlyDictionary<string, (Type Type, CollectionDefinitionAttribute Attribute)> GetCollectionDefinitions(Assembly testAssembly)
Parameters
testAssemblyAssemblyThe test assembly
Returns
GetCollectionTestCaseOrderer(Type?)
Gets the test case orderer that's attached to a test collection. Returns null if there
isn't one attached.
public static ITestCaseOrderer? GetCollectionTestCaseOrderer(Type? collectionDefinition)
Parameters
collectionDefinitionTypeThe test collection definition
Returns
GetCollectionTraits(Type?, IReadOnlyDictionary<string, IReadOnlyCollection<string>>?)
Gets the traits that are attached to the test collection via ITraitAttributes.
public static IReadOnlyDictionary<string, IReadOnlyCollection<string>> GetCollectionTraits(Type? testCollectionDefinition, IReadOnlyDictionary<string, IReadOnlyCollection<string>>? testAssemblyTraits)
Parameters
testCollectionDefinitionTypeThe test collection
testAssemblyTraitsIReadOnlyDictionary<string, IReadOnlyCollection<string>>The traits inherited from the test assembly
Returns
GetMethodBeforeAfterTestAttributes(MethodInfo, IReadOnlyCollection<IBeforeAfterTestAttribute>)
Gets the IBeforeAfterTestAttributes attached to the given method.
public static IReadOnlyCollection<IBeforeAfterTestAttribute> GetMethodBeforeAfterTestAttributes(MethodInfo testMethod, IReadOnlyCollection<IBeforeAfterTestAttribute> classBeforeAfterAttributes)
Parameters
testMethodMethodInfoThe test method
classBeforeAfterAttributesIReadOnlyCollection<IBeforeAfterTestAttribute>The before after attributes from the test class, to be merged into the result.
Returns
GetMethodDataAttributes(MethodInfo)
Gets the IDataAttributes attached to the given test method.
public static IReadOnlyCollection<IDataAttribute> GetMethodDataAttributes(MethodInfo testMethod)
Parameters
testMethodMethodInfoThe test method
Returns
GetMethodFactAttributes(MethodInfo)
Gets the IFactAttributes attached to the given test method.
public static IReadOnlyCollection<IFactAttribute> GetMethodFactAttributes(MethodInfo testMethod)
Parameters
testMethodMethodInfoThe test method
Returns
GetMethodTraits(MethodInfo, IReadOnlyDictionary<string, IReadOnlyCollection<string>>?)
Gets the traits that are attached to the test method via ITraitAttributes.
public static IReadOnlyDictionary<string, IReadOnlyCollection<string>> GetMethodTraits(MethodInfo testMethod, IReadOnlyDictionary<string, IReadOnlyCollection<string>>? testClassTraits)
Parameters
testMethodMethodInfoThe test method
testClassTraitsIReadOnlyDictionary<string, IReadOnlyCollection<string>>The traits inherited from the test class
Returns
GetTestFramework(Assembly)
Gets the test framework object for the given test assembly. It is important that callers to this function have called SetForInitialization(IMessageSink?, bool, bool) before calling this, so that the test framework and any ancillary helper classes have access to the diagnostic and internal diagnostic message sinks.
public static ITestFramework GetTestFramework(Assembly testAssembly)
Parameters
testAssemblyAssemblyThe test assembly to get the test framework for
Returns
- ITestFramework
The test framework object
GetXunitTestCaseDiscoverer(Type)
Gets an xUnit.net v3 test discoverer.
public static IXunitTestCaseDiscoverer? GetXunitTestCaseDiscoverer(Type testCaseDiscovererType)
Parameters
testCaseDiscovererTypeTypeThe test case discoverer type
Returns
GetXunitTestCollectionFactory(Type?, IXunitTestAssembly)
Gets an xUnit.net v3 test collection factory.
public static IXunitTestCollectionFactory? GetXunitTestCollectionFactory(Type? testCollectionFactoryType, IXunitTestAssembly testAssembly)
Parameters
testCollectionFactoryTypeTypeThe test collection factory type
testAssemblyIXunitTestAssemblyThe test assembly under test
Returns
Get<TInterface>(Type?, object?[]?)
Gets an instance of the given type, casting it to TInterface, using the provided
constructor arguments.
public static TInterface? Get<TInterface>(Type? type, object?[]? ctorArgs = null) where TInterface : class
Parameters
typeTypeThe implementation type.
ctorArgsobject[]The constructor arguments. Since diagnostic message sinks are optional, the code first looks for a type that takes the given arguments plus the message sink, and only falls back to the message sink-less constructor if none was found.
Returns
- TInterface
The instance of the type.
Type Parameters
TInterfaceThe interface type.