{"id":26866336,"url":"https://github.com/jkone27/fsharp-integration-tests","last_synced_at":"2025-04-07T12:08:02.183Z","repository":{"id":42080067,"uuid":"478286152","full_name":"jkone27/fsharp-integration-tests","owner":"jkone27","description":"DSL wrapper around .NET test WebApplicationFactory to simplify integration tests in aspnetcore using F#","archived":false,"fork":false,"pushed_at":"2025-02-27T21:11:19.000Z","size":357,"stargazers_count":40,"open_issues_count":13,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-26T23:36:39.117Z","etag":null,"topics":["api-client","aspnetcore","dotnet","fsharp","http","integration","integration-test","mock","stub","test"],"latest_commit_sha":null,"homepage":"https://jkone27.github.io/fsharp-integration-tests/","language":"F#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jkone27.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-04-05T20:14:38.000Z","updated_at":"2025-03-21T02:38:07.000Z","dependencies_parsed_at":"2024-12-16T13:38:20.713Z","dependency_job_id":"96bae6f3-1409-4f03-89e3-bc8734c7ba18","html_url":"https://github.com/jkone27/fsharp-integration-tests","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jkone27%2Ffsharp-integration-tests","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jkone27%2Ffsharp-integration-tests/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jkone27%2Ffsharp-integration-tests/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jkone27%2Ffsharp-integration-tests/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jkone27","download_url":"https://codeload.github.com/jkone27/fsharp-integration-tests/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247648977,"owners_count":20972945,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-client","aspnetcore","dotnet","fsharp","http","integration","integration-test","mock","stub","test"],"created_at":"2025-03-31T04:54:18.898Z","updated_at":"2025-04-07T12:08:02.162Z","avatar_url":"https://github.com/jkone27.png","language":"F#","readme":"# ApiStub.FSharp [![NuGet Badge](https://img.shields.io/nuget/v/ApiStub.FSharp)](https://www.nuget.org/packages/ApiStub.FSharp) 🦔\n\n![alt text](docs/img/ApiStub.FSharp.png)\n\n\u003ca href='https://juststopoil.org/' target=\"_blank\"\u003e\u003cimg alt='JUST_STOP_OIL' src='https://img.shields.io/badge/Just_STOP OIL-100000?style=plastic\u0026logo=JUST_STOP_OIL\u0026logoColor=white\u0026labelColor=FFA600\u0026color=000000'/\u003e\u003c/a\u003e  \n[![Stand With Ukraine](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/badges/StandWithUkraine.svg)](https://stand-with-ukraine.pp.ua)  \n[![Ceasefire Now](https://badge.techforpalestine.org/ceasefire-now)](https://techforpalestine.org/learn-more)  \n\n## Easy API Testing 🧞‍♀️\n\nThis library makes use of [F# computation expressions](https://learn.microsoft.com/en-us/dotnet/fsharp/language-reference/computation-expressions) 🪔✨  to hide some complexity of `WebApplicationFactory` and provide the user with a *domain specific language* (DSL) for integration tests. \n\nAn \"antique\" C# API (👴🏽🦖🦕) is also available since v.1.1 for enhanced accessibility 😺.\n\n## Documentation\n\nAccess the [documentation website](https://jkone27.github.io/fsharp-integration-tests/)  for more info on how to use this library.  \n\n## Scenario\n\n```mermaid\nsequenceDiagram\n    participant TestClient as Test\n    participant MainApp as App\n    participant DependencyApp as Dep\n\n    TestClient-\u003e\u003eMainApp: GET /Hello\n    MainApp-\u003e\u003eDependencyApp: GET /externalApi\n    DependencyApp--\u003e\u003eMainApp: Response\n    MainApp--\u003e\u003eTestClient: Response\n\n```\n\n## Test\n\n```fsharp\nopen ApiStub.FSharp.CE\nopen ApiStub.FSharp.BuilderExtensions\nopen ApiStub.FSharp.HttpResponseHelpers\nopen Xunit\n\nmodule Tests =\n\n    // build your aspnetcore integration testing CE\n    let test = new TestClient\u003cStartup\u003e()\n\n    [\u003cFact\u003e]\n    let ``Calls Hello and returns OK`` () =\n\n        task {\n\n            let client = \n                test { \n                    GETJ \"/externalApi\" {| Ok = \"yeah\" |}\n                }\n                |\u003e _.GetFactory()\n                |\u003e _.CreateClient()\n\n            let! r = client.GetAsync(\"/Hello\")\n\n        }\n```\n\n### Test .NET C# 🤝 from F#\n\nF# is a great language, but it doesn't have to be scary to try it. Integration and Unit tests are a great way to introduce F# to your team if you are already using .NET or ASPNETCORE. \n\nIn fact you can add an `.fsproj` within a C# aspnetcore solution `.sln`, and just have a single F# assembly test your C# application from F#, referencing a `.csproj` file is easy! just use regular [dotnet add reference command](https://learn.microsoft.com/bs-latn-ba/dotnet/core/tools/dotnet-add-reference).\n\n## How to Contribute ✍️\n\n* Search for an open issue or report one, and check if a similar issue was reported first\n* feel free to get in touch, to fork and check out the repo\n* test and find use cases for this library, testing in F# is awesome!!!!\n\n### References\n\n* more info on [F# xunit testing](https://learn.microsoft.com/en-us/dotnet/core/testing/unit-testing-fsharp-with-dotnet-test).\n* more general info on aspnetcore integration testing if you use [Nunit](https://learn.microsoft.com/en-us/dotnet/core/testing/unit-testing-fsharp-with-nunit) instead.\n* [aspnetcore integration testing](https://learn.microsoft.com/en-us/aspnet/core/test/integration-tests?view=aspnetcore-7.0) docs in C#\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjkone27%2Ffsharp-integration-tests","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjkone27%2Ffsharp-integration-tests","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjkone27%2Ffsharp-integration-tests/lists"}