Table of Contents

Class TArray_HasLength_Int_Assertion<T>

Namespace
TUnit.Assertions.Extensions
Assembly
MathAssertions.TUnit.dll

Generated assertion for HasLength

[UnconditionalSuppressMessage("Trimming", "IL2091", Justification = "Generic type parameter is only used for property access, not instantiation")]
public sealed class TArray_HasLength_Int_Assertion<T> : Assertion<T[]>, IAssertion

Type Parameters

T
Inheritance
Assertion<T[]>
TArray_HasLength_Int_Assertion<T>
Implements
IAssertion
Inherited Members
Assertion<T[]>.AssertAsync()
Assertion<T[]>.GetAwaiter()
Assertion<T[]>.And
Assertion<T[]>.Or

Constructors

TArray_HasLength_Int_Assertion(AssertionContext<T[]>, int)

public TArray_HasLength_Int_Assertion(AssertionContext<T[]> context, int expected)

Parameters

context AssertionContext<T[]>
expected int

Methods

CheckAsync(EvaluationMetadata<T[]>)

Implements the specific check logic for this assertion. Called after the context has been evaluated. Override this method if your assertion uses the default AssertAsync() flow. If you override AssertAsync() with custom logic (like AndAssertion/OrAssertion), you don't need to implement this.

protected override Task<AssertionResult> CheckAsync(EvaluationMetadata<T[]> metadata)

Parameters

metadata EvaluationMetadata<T[]>

Metadata about the evaluation including value, exception, and timing information

Returns

Task<AssertionResult>

The result of the assertion check

GetExpectation()

Gets a human-readable description of what this assertion expects. Used in error messages.

protected override string GetExpectation()

Returns

string