Class MockModel
Contains provider-agnostic mock and Type information.
Inherited Members
Namespace: FastMoq.Models
Assembly: FastMoq.Core.dll
Syntax
public class MockModel : IComparable<MockModel>, IComparable, IEquatable<MockModel>, IEqualityComparer<MockModel>
Properties
FastMock
Provider-agnostic abstraction for the mock instance.
Declaration
public IFastMock FastMock { get; }
Property Value
| Type | Description |
|---|---|
| IFastMock |
Instance
The mocked instance (object under test substitute) from the provider abstraction.
Declaration
public object Instance { get; }
Property Value
| Type | Description |
|---|---|
| object |
NativeMock
Native provider object used to arrange or inspect behavior with the active mocking library. For Moq this is a FastMoq.Models.MockModel.Mock; for providers like NSubstitute or Reflection this is typically the provider-native instance.
Declaration
public object NativeMock { get; }
Property Value
| Type | Description |
|---|---|
| object |
NonPublic
Indicates whether the mock was created allowing non-public constructors.
Declaration
public bool NonPublic { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Type
Mocked type exposed by the current IFastMock instance.
Declaration
public virtual Type Type { get; }
Property Value
| Type | Description |
|---|---|
| Type |
Methods
CompareTo(MockModel?)
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 int CompareTo(MockModel? other)
Parameters
| Type | Name | Description |
|---|---|---|
| MockModel | 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:
|
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 virtual 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:
|
Exceptions
| Type | Condition |
|---|---|
| ArgumentException |
|
Equals(MockModel?)
Indicates whether the current object is equal to another object of the same type.
Declaration
[ExcludeFromCodeCoverage]
public bool Equals(MockModel? other)
Parameters
| Type | Name | Description |
|---|---|---|
| MockModel | other | An object to compare with this object. |
Returns
| Type | Description |
|---|---|
| bool | true if the current object is equal to the |
Equals(MockModel?, MockModel?)
Determines whether the specified objects are equal.
Declaration
[ExcludeFromCodeCoverage]
public bool Equals(MockModel? x, MockModel? y)
Parameters
| Type | Name | Description |
|---|---|---|
| MockModel | x | The first object of type |
| MockModel | y | The second object of type |
Returns
| Type | Description |
|---|---|
| bool |
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
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
GetHashCode(MockModel)
Returns a hash code for the specified object.
Declaration
[ExcludeFromCodeCoverage]
public int GetHashCode(MockModel obj)
Parameters
| Type | Name | Description |
|---|---|---|
| MockModel | 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 |
IsEqual<TModel>(TModel?, TModel?)
Declaration
public static bool IsEqual<TModel>(TModel? x, TModel? y) where TModel : MockModel
Parameters
| Type | Name | Description |
|---|---|---|
| TModel | x | |
| TModel | y |
Returns
| Type | Description |
|---|---|
| bool |
Type Parameters
| Name | Description |
|---|---|
| TModel |
ToString()
Returns a string that represents the current object.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string | A string that represents the current object. |
Overrides
Operators
operator ==(MockModel?, MockModel?)
Declaration
[ExcludeFromCodeCoverage]
public static bool operator ==(MockModel? a, MockModel? b)
Parameters
| Type | Name | Description |
|---|---|---|
| MockModel | a | |
| MockModel | b |
Returns
| Type | Description |
|---|---|
| bool |
operator !=(MockModel?, MockModel?)
Declaration
[ExcludeFromCodeCoverage]
public static bool operator !=(MockModel? a, MockModel? b)
Parameters
| Type | Name | Description |
|---|---|---|
| MockModel | a | |
| MockModel | b |
Returns
| Type | Description |
|---|---|
| bool |