Skip to content

void actual に対する Assert Action の検討 #14

Description

@in-async

この API の追加を検討:

public partial struct TestActual {
    public void Assert(Action @return, Action<Exception> exception) {
        if (@return == null) { throw new ArgumentNullException(nameof(@return)); }
        if (exception == null) { throw new ArgumentNullException(nameof(exception)); }

        exception(Exception);

        if (Exception == null) {
            @return();
        }
    }
}

動機

正常終了時 (非例外時) にのみ追加アサートしたいケースのカバー。
その追加アサートは本当は例外時にも検証すべきだと思うので悩む。

Activity

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

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions