Skip to content

AsyncFunctionAssertions has duplicate implementations of ActionAssertions methods #1053

@davidomid

Description

@davidomid

Resolved in PR #1054

Description

AsyncFunctionAssertions has non-async methods in common with ActionAssertions (i.e. Throw, NotThrow). However, these are implemented separately for AsyncFunctionAssertions and this has lead to:

  • Redundant code from duplicate logic
  • Inconsistent error messages between the similar methods. I.e. Throw for AsyncFunctionAssertions may output a slightly different error message to the same method contained within ActionAssertions.
  • Overhead of a developer when modifying the behaviour of one of these common methods, as the implementation has to be duplicated.

My proposal is to make AsyncFunctionAssertions a subclass of ActionAssertions. This ensures that any methods available for an Action are also available for a synchronous call to a Func<Task>.

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