using System.Diagnostics.CodeAnalysis; namespace TUnit.Core.Interfaces; /// /// Defines a constructor for test classes, allowing custom instantiation strategies. /// public interface IClassConstructor { /// /// Creates an instance of the specified type using custom instantiation logic. /// /// The type to instantiate. Must have accessible public constructors. /// Metadata containing the test session ID and builder context for the test being executed. /// /// A task that represents the asynchronous creation operation. The value of the TResult parameter contains /// a new instance of the specified type. The implementation is responsible for resolving constructor /// parameters and dependencies. /// /// /// Called by the test framework to create instances of test classes. /// It allows for custom dependency injection or specialized test class instantiation. /// Implementations can use the provided from the /// to access shared data and event subscriptions for the current test execution. /// Task Create([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type type, ClassConstructorMetadata classConstructorMetadata); }