Skip to content

xunit: define codefixes for ExceptionAsserts #137

Closed
@Meir017

Description

@Meir017

The asserts defined in https://github.com/xunit/assert.xunit/blob/main/ExceptionAsserts.cs

  • Exception Throws(Type exceptionType, Action testCode);
  • Exception Throws(Type exceptionType, Func<object?> testCode);
  • T Throws<T>(Action testCode) where T : Exception;
  • T Throws<T>(Func<object?> testCode) where T : Exception;
  • T Throws<T>(string? paramName, Action testCode) where T : ArgumentException;
  • T Throws<T>(string? paramName, Func<object?> testCode);

  • T ThrowsAny<T>(Action testCode) where T : Exception;
  • T ThrowsAny<T>(Func<object?> testCode) where T : Exception;

  • async Task<T> ThrowsAnyAsync<T>(Func<Task> testCode) where T : Exception;

  • async Task<Exception> ThrowsAsync(Type exceptionType, Func<Task> testCode);
  • async Task<T> ThrowsAsync<T>(Func<Task> testCode) where T : Exception;
  • async Task<T> ThrowsAsync<T>(string? paramName, string paramName, Func<Task> testCode) where T : ArgumentException;

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