APIFlow 1.2.0
dotnet add package APIFlow --version 1.2.0
NuGet\Install-Package APIFlow -Version 1.2.0
<PackageReference Include="APIFlow" Version="1.2.0" />
<PackageVersion Include="APIFlow" Version="1.2.0" />
<PackageReference Include="APIFlow" />
paket add APIFlow --version 1.2.0
#r "nuget: APIFlow, 1.2.0"
#:package APIFlow@1.2.0
#addin nuget:?package=APIFlow&version=1.2.0
#tool nuget:?package=APIFlow&version=1.2.0
APIFlow
The ultimate solution for quick API Integration testing.
This library allows developers and test engineers to quickly build API Integration tests without having to repeatedly wire up endpoints. Instead, it utilizes a simple context configuration to specify inputs and automatically forward-feeds inputs from previous requests.
(It feels very similar to Entity Framework -- but for APIs)
Check out the wiki for a more in-depth overview!
Forward-Feeding Endpoints
The main purpose of this library is to allow sequential API execution and testing without the necessity of re-writing code to wire up ModelA to ModelB.
This forward-feeding implementation is simple, yet creating complete end-to-end workflows can be done very quickly since wiring up of models only needs to happen once.
Scenario
You have two endpoints.
- Fetch Users /api/Users
- Fetch User Account Information by Id /api/Users?Id={Users.Id}
Traditionally, if you had to execute these endpoints in succession, you would need to
- Create each model.
- Make Http Requests.
- Wire up inputs for next endpoint payload.
- Repeat for remaining endpoints.
With APIFlow, step 2 & 3 is removed as the forward-feed capabilities is automatic with a one-time configuration setup.
Example Context
public class UserContext : ApiContext<List<User>, HTTPDataExtender>
{
[HttpGet()]
[Route("https://aef3c493-6ff3-47a2-be7f-150688405f7e.mock.pstmn.io/Users")]
public override void ApplyContext(EndpointInputModel model)
{
}
public override void ConfigureClient(ref HttpClientWrapper wrapper)
{
base.ConfigureClient(ref wrapper);
// Add necessary headers etc.
}
public UserContext(List<User> baseObject,
EndpointInputModel inputModel) : base(baseObject, inputModel)
{
}
}
public class UserInformationContext : ApiContext<UserInformation, HTTPDataExtender>
{
public override void ConfigureEndpoint(ref string endpoint, EndpointInputModel inputModel, bool randomizedInput = false)
{
base.ConfigureEndpoint(ref endpoint, inputModel, randomizedInput);
base.ConfigureEndpoint<UserContext>("Id", (u) => u.Value?[0].Id??0);
}
[HttpGet()]
[Route("https://aef3c493-6ff3-47a2-be7f-150688405f7e.mock.pstmn.io/UserInformation")]
public override void ApplyContext(EndpointInputModel inputModel)
{
base.ConfigureModel<UserContext>((u, o) => o.Id = u.Value?[0].Id??0);
base.ConfigureEndpoint<UserContext>("Id", (u) => u.Value?[0].Id??0);
}
public UserInformationContext(UserInformation baseObject, EndpointInputModel inputModel) : base(baseObject, inputModel)
{
}
}
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 is compatible. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net5.0
- Microsoft.AspNet.WebApi.Core (>= 5.2.9)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Initial Release