Table of Contents

Class AssertionResult

Namespace
NUnit.Framework.Interfaces
Assembly
nunit.framework.dll

The AssertionResult class represents the result of a single assertion.

public class AssertionResult : IEquatable<AssertionResult>
Inheritance
AssertionResult
Implements
Inherited Members

Constructors

AssertionResult(AssertionStatus, string, string?)

Construct an AssertionResult

public AssertionResult(AssertionStatus status, string message, string? stackTrace)

Parameters

status AssertionStatus
message string
stackTrace string

Properties

Message

The message produced by the assertion, or null

public string Message { get; }

Property Value

string

StackTrace

The stack trace associated with the assertion, or null

public string? StackTrace { get; }

Property Value

string

Status

The pass/fail status of the assertion

public AssertionStatus Status { get; }

Property Value

AssertionStatus

Methods

Equals(AssertionResult?)

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

public bool Equals(AssertionResult? other)

Parameters

other AssertionResult

An object to compare with this object.

Returns

bool

Equals(object?)

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

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current object.

Returns

bool

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

ToString()

ToString Override

public override string ToString()

Returns

string