Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rars/restapitestwebapi
F# and Entity Framework Core proof of concept Web API for testing other REST APIs.
https://github.com/rars/restapitestwebapi
Last synced: about 2 hours ago
JSON representation
F# and Entity Framework Core proof of concept Web API for testing other REST APIs.
- Host: GitHub
- URL: https://github.com/rars/restapitestwebapi
- Owner: rars
- Created: 2019-10-13T13:13:44.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-08T06:19:50.000Z (about 2 years ago)
- Last Synced: 2024-11-26T01:47:23.856Z (2 months ago)
- Language: F#
- Size: 14.6 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# RestApiTestWebApi
## About
This is a proof of concept for using F# to create a WebApi using AspNetCore and Entity Framework Core.
The project is based on the idea of having a WebApi for testing other RestApis. E.g. it allows keeping track of a list of
RestApi locations and then user specified tests against those locations where each test captures:- Requests defined as a request path and body
- Expected responses are recorded as status code and JSON schemaA front end may then be created that uses this API for quickly adding regression tests using this framework and updating their expected responses as they change.
## Running
From the solution directory:
```
dotnet build .
cp testing-framework.db RestApiTestWebApi\bin\Debug\netcoreapp3.0\testing-framework.db
cd RestApiTestWebApi\bin\Debug\netcoreapp3.0\
dotnet RestApiTestWebApi.dll
```Then go to https://localhost:5001/swagger/ to interact with the API.
Generating migration scripts:
```
# Only install the tool if you don't have it already
dotnet tool install --global dotnet-ef# Generate new migration scripts as follows:
cd RestApiTestWebApi
dotnet ef migrations add MigrationName --project ..\DatabaseMigrations\DatabaseMigrations.csproj --context RestApiTestRepositories.DatabaseContexts.RestApiTestDataContext
# This will update the testing-framework.db in this folder only - if you need to update a different file then adjust accordingly
dotnet ef database update
```