APIFlow 1.2.0

dotnet add package APIFlow --version 1.2.0
                    
NuGet\Install-Package APIFlow -Version 1.2.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="APIFlow" Version="1.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="APIFlow" Version="1.2.0" />
                    
Directory.Packages.props
<PackageReference Include="APIFlow" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add APIFlow --version 1.2.0
                    
#r "nuget: APIFlow, 1.2.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package APIFlow@1.2.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=APIFlow&version=1.2.0
                    
Install as a Cake Addin
#tool nuget:?package=APIFlow&version=1.2.0
                    
Install as a Cake Tool

alt text

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.

  1. Fetch Users /api/Users
  2. 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

  1. Create each model.
  2. Make Http Requests.
  3. Wire up inputs for next endpoint payload.
  4. Repeat for remaining endpoints.

With APIFlow, step 2 & 3 is removed as the forward-feed capabilities is automatic with a one-time configuration setup.

alt text

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.2.0 582 1/28/2023
1.1.1 390 1/28/2023
1.1.0 390 1/28/2023
1.0.0 374 1/27/2023

Initial Release