Skip to content

Assert 時に期待した例外 (expectedException) が無かった場合のアサートエラーが判り難い #17

@in-async

Description

@in-async

改善案のイメージ:

// Act
TestActual<T> actual = TestAA.Act(() => ...);

// Assert - Exception
if (expectedException is { }) {
    if (actual.Exception is { } ex) {
        if (ex.GetType() == expectedException) { return; }
        throw ex;
    }
    else {
        throw new PrimitiveAssertFailedException("期待した例外が生じませんでした: " + expectedException.FullName);
    }
}

// Assert - Return

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions