Make BrowserFile testable
- Dominant language
- C#
- Stars
- 38.4k
- Forks
- 10.9k
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 290
Description
### Is there an existing issue for this?
- [X] I have searched the existing issues
### Is your feature request related to a problem? Please describe the problem.
In its current state `BrowserFile` is an `internal sealed class` which makes it impossible to unit-test from the outside world.
Especially if you have functions like [`BrowserFileExtensions.RequestImageFileAsync`](https://github.com/dotnet/aspnetcore/blob/main/src/Components/Web/src/Forms/InputFile/BrowserFileExtensions.cs#L29) which takes an `IBrowserFile` but throws exceptions when invoked with everything besides the concrete **internal** `BrowserFile` type.
### Describe the solution you'd like
The easiest and least invasive solution would be to make the `BrowserFile` type `public` and not `sealed`.
### Additional context
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.