Class MockModel<T>
Generic mock model wrapper (provider-first, Moq legacy compatible).
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
Properties
Instance
Declaration
public T Instance { get; }
Property Value
Type
Mocked type exposed by the current IFastMock instance.
Declaration
public override Type Type { get; }
Property Value
Overrides
TypedFastMock
Declaration
public IFastMock<T> TypedFastMock { get; }
Property Value
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
Exceptions
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
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<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
Operators
operator ==(MockModel<T>?, MockModel<T>?)
Declaration
[ExcludeFromCodeCoverage]
public static bool operator ==(MockModel<T>? a, MockModel<T>? b)
Parameters
Returns
operator !=(MockModel<T>?, MockModel<T>?)
Declaration
[ExcludeFromCodeCoverage]
public static bool operator !=(MockModel<T>? a, MockModel<T>? b)
Parameters
Returns
Implements
Extension Methods