Class StaticMethod

Namespace: AutoFixture.Kernel
Assembly: AutoFixture.dll

Encapsulates a static method.

public class StaticMethod : IMethod, IEquatable<StaticMethod>

Inheritance

objectStaticMethod

Implements

IMethod, IEquatable<StaticMethod>

Inherited Members

object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Constructors

StaticMethod(MethodInfo)

Initializes a new instance of the StaticMethod class.

public StaticMethod(MethodInfo methodInfo)

Parameters

methodInfo MethodInfo

The methodInfo.

StaticMethod(MethodInfo, ParameterInfo[])

Initializes a new instance of the StaticMethod class.

public StaticMethod(MethodInfo methodInfo, ParameterInfo[] methodParameters)

Parameters

methodInfo MethodInfo

The method info.

methodParameters ParameterInfo[]

The method parameters.

Properties

Method

Gets the method.

public MethodInfo Method { get; }

Property Value

MethodInfo

Parameters

Gets information about the parameters of the method.

public IEnumerable<ParameterInfo> Parameters { get; }

Property Value

IEnumerable<ParameterInfo>

Methods

Equals(object)

Determines whether the specified Object is equal to this instance.

public override bool Equals(object obj)

Parameters

obj object

The Object to compare with this instance.

Returns

bool

true if the specified Object is equal to this instance; otherwise, false.

Exceptions

NullReferenceException

The obj parameter is null.

Equals(StaticMethod)

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

public bool Equals(StaticMethod other)

Parameters

other StaticMethod

An object to compare with this object.

Returns

bool

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

GetHashCode()

Returns a hash code for this instance.

public override int GetHashCode()

Returns

int

A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.

Invoke(IEnumerable<object>)

Invokes the method with the supplied parameters.

public object Invoke(IEnumerable<object> parameters)

Parameters

parameters IEnumerable<object>

The parameters.

Returns

object

The result of the method call.