FastMoq
Search Results for

    Show / Hide Table of Contents

    Class MockModel<T>

    Generic mock model wrapper (provider-first, Moq legacy compatible).

    Inheritance
    object
    MockModel
    MockModel<T>
    Implements
    IComparable<MockModel>
    IComparable
    IEquatable<MockModel>
    IEqualityComparer<MockModel>
    IComparable<MockModel<T>>
    IEquatable<MockModel<T>>
    IEqualityComparer<MockModel<T>>
    Inherited Members
    MockModel.FastMock
    MockModel.NativeMock
    MockModel.NonPublic
    MockModel.IsEqual<TModel>(TModel, TModel)
    MockModel.ToString()
    MockModel.CompareTo(MockModel)
    MockModel.Equals(MockModel, MockModel)
    MockModel.GetHashCode(MockModel)
    MockModel.Equals(MockModel)
    object.Equals(object, object)
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: FastMoq.Models
    Assembly: FastMoq.Core.dll
    Syntax
    public class MockModel<T> : MockModel, IComparable<MockModel>, IComparable, IEquatable<MockModel>, IEqualityComparer<MockModel>, IComparable<MockModel<T>>, IEquatable<MockModel<T>>, IEqualityComparer<MockModel<T>> where T : class
    Type Parameters
    Name Description
    T

    Properties

    Instance

    Declaration
    public T Instance { get; }
    Property Value
    Type Description
    T

    Type

    Mocked type exposed by the current IFastMock instance.

    Declaration
    public override Type Type { get; }
    Property Value
    Type Description
    Type
    Overrides
    MockModel.Type

    TypedFastMock

    Declaration
    public IFastMock<T> TypedFastMock { get; }
    Property Value
    Type Description
    IFastMock<T>

    Methods

    CompareTo(MockModel<T>?)

    Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.

    Declaration
    [ExcludeFromCodeCoverage]
    public int CompareTo(MockModel<T>? other)
    Parameters
    Type Name Description
    MockModel<T> other

    An object to compare with this instance.

    Returns
    Type Description
    int

    A value that indicates the relative order of the objects being compared. The return value has these meanings:

    Value Meaning
    Less than zero This instance precedes other in the sort order.
    Zero This instance occurs in the same position in the sort order as other.
    Greater than zero This instance follows other in the sort order.

    CompareTo(object?)

    Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.

    Declaration
    public override int CompareTo(object? obj)
    Parameters
    Type Name Description
    object obj

    An object to compare with this instance.

    Returns
    Type Description
    int

    A value that indicates the relative order of the objects being compared. The return value has these meanings:

    Value Meaning
    Less than zero This instance precedes obj in the sort order.
    Zero This instance occurs in the same position in the sort order as obj.
    Greater than zero This instance follows obj in the sort order.
    Overrides
    MockModel.CompareTo(object?)
    Exceptions
    Type Condition
    ArgumentException

    obj is not the same type as this instance.

    Equals(MockModel<T>?)

    Indicates whether the current object is equal to another object of the same type.

    Declaration
    [ExcludeFromCodeCoverage]
    public bool Equals(MockModel<T>? other)
    Parameters
    Type Name Description
    MockModel<T> other

    An object to compare with this object.

    Returns
    Type Description
    bool

    true if the current object is equal to the other parameter; otherwise, false.

    Equals(MockModel<T>?, MockModel<T>?)

    Determines whether the specified objects are equal.

    Declaration
    [ExcludeFromCodeCoverage]
    public bool Equals(MockModel<T>? x, MockModel<T>? y)
    Parameters
    Type Name Description
    MockModel<T> x

    The first object of type T to compare.

    MockModel<T> y

    The second object of type T to compare.

    Returns
    Type Description
    bool

    true if the specified objects are equal; otherwise, false.

    Equals(object?)

    Determines whether the specified object is equal to the current object.

    Declaration
    public override bool Equals(object? obj)
    Parameters
    Type Name Description
    object obj

    The object to compare with the current object.

    Returns
    Type Description
    bool

    true if the specified object is equal to the current object; otherwise, false.

    Overrides
    MockModel.Equals(object?)

    GetHashCode()

    Serves as the default hash function.

    Declaration
    [ExcludeFromCodeCoverage]
    public override int GetHashCode()
    Returns
    Type Description
    int

    A hash code for the current object.

    Overrides
    MockModel.GetHashCode()

    GetHashCode(MockModel<T>)

    Returns a hash code for the specified object.

    Declaration
    [ExcludeFromCodeCoverage]
    public int GetHashCode(MockModel<T> obj)
    Parameters
    Type Name Description
    MockModel<T> obj

    The object for which a hash code is to be returned.

    Returns
    Type Description
    int

    A hash code for the specified object.

    Exceptions
    Type Condition
    ArgumentNullException

    The type of obj is a reference type and obj is null.

    Operators

    operator ==(MockModel<T>?, MockModel<T>?)

    Declaration
    [ExcludeFromCodeCoverage]
    public static bool operator ==(MockModel<T>? a, MockModel<T>? b)
    Parameters
    Type Name Description
    MockModel<T> a
    MockModel<T> b
    Returns
    Type Description
    bool

    operator !=(MockModel<T>?, MockModel<T>?)

    Declaration
    [ExcludeFromCodeCoverage]
    public static bool operator !=(MockModel<T>? a, MockModel<T>? b)
    Parameters
    Type Name Description
    MockModel<T> a
    MockModel<T> b
    Returns
    Type Description
    bool

    Implements

    IComparable<T>
    IComparable
    IEquatable<T>
    IEqualityComparer<T>
    IComparable<T>
    IEquatable<T>
    IEqualityComparer<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 12:38 UTC