Skip to content

DelegatingConstraintResult does not use its _innerResult for WriteMessageTo  #4545

Description

@metoule

The DelegatingConstraintResult should override the WriteMessageTo to call the _innerResult.WriteMessageTo method, otherwise it's not writing the expected message to the output.

WriteActualValueTo and WriteAdditionalLinesTo are already properly forwarded to the _innerResult.

private class DelegatingConstraintResult : ConstraintResult
{
private readonly ConstraintResult _innerResult;
public DelegatingConstraintResult(IConstraint constraint, ConstraintResult innerResult)
: base(constraint, innerResult.ActualValue, innerResult.Status)
{
_innerResult = innerResult;
}
public override void WriteActualValueTo(MessageWriter writer) => _innerResult.WriteActualValueTo(writer);
public override void WriteAdditionalLinesTo(MessageWriter writer) => _innerResult.WriteAdditionalLinesTo(writer);
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions