Skip to content

Wrong error message when an exception is thrown #2503

@blastrock

Description

@blastrock

Hi,

I have an issue when asserting the result of a call that returns a boolean. If the call throws an exception, the error message says it returned false, which is wrong.

Here's a test snippet:

        await Assert.That(() => { throw new Exception("No"); return true; }).IsEqualTo(true);

This is the error message:

  Expected () => { throw new Exception("No"); return true; } to be equal to True
  
  but found False

The message should not say that my lambda returned false, and the message should print the exception I have thrown.

EDIT: TUnit 0.24.0, .NET 9.0.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions