Class AssertionResult
The AssertionResult class represents the result of a single assertion.
Implements
Inherited Members
Namespace: NUnit.Framework.Interfaces
Assembly: nunit.framework.dll
Syntax
public class AssertionResult : IEquatable<AssertionResult>
Constructors
View SourceAssertionResult(AssertionStatus, string, string?)
Construct an AssertionResult
Declaration
public AssertionResult(AssertionStatus status, string message, string? stackTrace)
Parameters
Type | Name | Description |
---|---|---|
AssertionStatus | status | |
string | message | |
string | stackTrace |
Properties
View SourceMessage
The message produced by the assertion, or null
Declaration
public string Message { get; }
Property Value
Type | Description |
---|---|
string |
StackTrace
The stack trace associated with the assertion, or null
Declaration
public string? StackTrace { get; }
Property Value
Type | Description |
---|---|
string |
Status
The pass/fail status of the assertion
Declaration
public AssertionStatus Status { get; }
Property Value
Type | Description |
---|---|
AssertionStatus |
Methods
View SourceEquals(AssertionResult?)
Indicates whether the current object is equal to another object of the same type.
Declaration
public bool Equals(AssertionResult? other)
Parameters
Type | Name | Description |
---|---|---|
AssertionResult | other | An object to compare with this object. |
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 |
Overrides
View SourceGetHashCode()
Serves as the default hash function.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int |
Overrides
View SourceToString()
ToString Override
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string |