dotnet / dotnet/fsharp

WebApplicationFactory<Program> can only be used with workaround in F# aspnet integration tests

Open
#18,302 3 comments 0 reactions 0 assignees View on GitHub
Bug Needs-Triage
Dominant language
F#
Stars
4.3k
Forks
876
Avg merge
4d 22h
Merged PRs (30d)
144

Description

the only way to make use of [integration tests for aspnetcore](https://learn.microsoft.com/en-us/aspnet/core/test/integration-tests?view=aspnetcore-9.0) from F# code , is either use the old `Startup` class setup (not valid for minimal api), or use this setup which makes use of a "trick" of declaring both a type and a module right after for `Program` as else the Program static class is not visible for unit/integration tests in the minimal api form?

Image

then it can be used by `WebApplicationFactory` in F# unit tests

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.