FastMoq
Search Results for

    Show / Hide Table of Contents

    Class MockCreationOptions

    Options to influence mock creation in a provider agnostic manner.

    Inheritance
    object
    MockCreationOptions
    Implements
    IEquatable<MockCreationOptions>
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: FastMoq.Providers
    Assembly: FastMoq.Abstractions.dll
    Syntax
    public sealed record MockCreationOptions : IEquatable<MockCreationOptions>

    Constructors

    MockCreationOptions(bool, bool, object?[]?, bool)

    Initializes a new instance of the MockCreationOptions record.

    Declaration
    public MockCreationOptions(bool Strict = false, bool CallBase = true, object?[]? ConstructorArgs = null, bool AllowNonPublic = false)
    Parameters
    Type Name Description
    bool Strict

    True to request strict mock behavior; otherwise false.

    bool CallBase

    True to allow base implementation calls when the provider supports it; otherwise false.

    object[] ConstructorArgs

    Optional constructor arguments to use when creating the mock target.

    bool AllowNonPublic

    True to allow non-public constructors during mock creation; otherwise false.

    Properties

    AllowNonPublic

    Gets a value indicating whether non-public constructors may be used during mock creation.

    Declaration
    public bool AllowNonPublic { get; init; }
    Property Value
    Type Description
    bool

    CallBase

    Gets a value indicating whether base implementation calls are allowed when supported.

    Declaration
    public bool CallBase { get; init; }
    Property Value
    Type Description
    bool

    ConstructorArgs

    Gets the constructor arguments to use when the provider creates the mock target.

    Declaration
    public object?[]? ConstructorArgs { get; init; }
    Property Value
    Type Description
    object[]

    Strict

    Gets a value indicating whether strict mock behavior should be used.

    Declaration
    public bool Strict { get; init; }
    Property Value
    Type Description
    bool

    Implements

    IEquatable<T>

    Extension Methods

    ObjectExtensions.RaiseIfNull<T>(T?, string?, string?, int?, string?)
    TestClassExtensions.GetFieldValue<TObject>(TObject, string, TObject?)
    TestClassExtensions.GetField<TObject>(TObject, string)
    TestClassExtensions.GetMemberName<T, TValue>(T, Expression<Func<T, TValue>>)
    TestClassExtensions.GetMember<T, TValue>(T, Expression<Func<T, TValue>>)
    TestClassExtensions.GetMethodValue<TObject>(TObject, string, object?, params object[])
    TestClassExtensions.GetMethod<TObject>(TObject, string)
    TestClassExtensions.GetPropertyValue<TObject>(TObject, string, object?)
    TestClassExtensions.GetProperty<TObject>(TObject, string)
    TestClassExtensions.SetFieldValue<TObject>(TObject, string, object?)
    TestClassExtensions.SetPropertyValue<TObject>(TObject, string, object?)
    MockerHttpMoqExtensions.SetupHttpMessage(object, Func<HttpResponseMessage>, Expression?, Expression?)
    MockerHttpMoqExtensions.SetupMessageAsync<TMock, TReturn>(object, Expression<Func<TMock, Task<TReturn>>>, Func<TReturn>)
    MockerHttpMoqExtensions.SetupMessageProtectedAsync<TMock, TReturn>(object, string, Func<TReturn>, params object?[]?)
    MockerHttpMoqExtensions.SetupMessageProtected<TMock, TReturn>(object, string, Func<TReturn>, params object?[]?)
    MockerHttpMoqExtensions.SetupMessage<TMock, TReturn>(object, Expression<Func<TMock, TReturn>>, Func<TReturn>)
    TestClassExtensions.GetFieldInfo<TType>(object, string)
    TestClassExtensions.GetFieldValue<T>(object?, FieldInfo)
    TestClassExtensions.GetFieldValue<T, TType>(object, string)
    In this article
    Back to top
    Generated 2026-04-08 00:16 UTC