Class FastMoqRegisterProviderAttribute
Registers a FastMoq provider for the current assembly.
Inherited Members
Namespace: FastMoq.Providers
Assembly: FastMoq.Abstractions.dll
Syntax
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
public sealed class FastMoqRegisterProviderAttribute : Attribute
Remarks
Use this when the provider must be registered before selection, for example for custom providers, aliases, or explicit first-party package bootstrap.
Set SetAsDefault to true to make the registered provider the assembly default.
Examples
using FastMoq.Providers;
using FastMoq.Providers.MoqProvider;
[assembly: FastMoqRegisterProvider("moq", typeof(MoqMockingProvider), SetAsDefault = true)]
Constructors
FastMoqRegisterProviderAttribute(string, Type)
Initializes a new instance of the FastMoqRegisterProviderAttribute class.
Declaration
public FastMoqRegisterProviderAttribute(string providerName, Type providerType)
Parameters
| Type | Name | Description |
|---|---|---|
| string | providerName | The provider name to register. |
| Type | providerType | The provider implementation type. |
Properties
ProviderName
Gets the provider name to register.
Declaration
public string ProviderName { get; }
Property Value
| Type | Description |
|---|---|
| string |
ProviderType
Gets the provider implementation type.
Declaration
public Type ProviderType { get; }
Property Value
| Type | Description |
|---|---|
| Type |
SetAsDefault
Gets or sets a value indicating whether this registration should also become the assembly default.
Declaration
public bool SetAsDefault { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |