Skip to content

Capture and report context in AssertEx.WaitUntil if the actionAsync throws #37

@michael-sterling

Description

@michael-sterling

Example test code:

using (AssertEx.Context(() => "baz"))
	await AssertEx.WaitUntil<object>(() => throw new Exception("Foo"));

Current output:

System.Exception : Foo
  at [stack trace]

Expected output consistent with the DoesNotThrow extension:

Expected:
	value

Context:
	timeoutSeconds = 30
	totalRetries = 11
	"baz" = "baz"

System.Exception: Foo
   at [stack trace]

(with as good of an "Expected" as we can get; perhaps inferred from CallerArgumentExpression or the parameter for any follow-up expressions?)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions