Skip to content

Commit 332ace0

Browse files
authored
Merge pull request #52 from jkone27/add-mermaid-to-docs
Add mermaid to docs
2 parents 2cae53d + 1bb717f commit 332ace0

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,23 @@ This library makes use of [F# computation expressions](https://learn.microsoft.c
1313

1414
A C# API is also available, access the [documentation](https://jkone27.github.io/fsharp-integration-tests/) website for more info on how to use this library.
1515

16+
## Scenario
17+
18+
```mermaid
19+
sequenceDiagram
20+
participant TestClient as Test
21+
participant MainApp as App
22+
participant DependencyApp as Dep
23+
24+
TestClient->>MainApp: GET /Hello
25+
MainApp->>DependencyApp: GET /externalApi
26+
DependencyApp-->>MainApp: Response
27+
MainApp-->>TestClient: Response
28+
29+
```
30+
31+
## Test
32+
1633
```fsharp
1734
open ApiStub.FSharp.CE
1835
open ApiStub.FSharp.BuilderExtensions

docs/index.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,22 @@ To use the CE, you must build your CE object first by passing the generic `Progr
2525
Suppose in your main app (`Program` or `Startup`) you call `Services.AddApiClient`(or its variants) twice, registering 2 API clients to make calls to other services, say to the outbound routes `/externalApi` and `/anotherApi` (let's skip the base address for now).
2626
suppose `ExternalApiClient` invokes an http `GET` method and the other client makes a `POST` http call, inside your API client code.
2727

28+
```mermaid
29+
sequenceDiagram
30+
participant TestClient as Test
31+
participant MainApp as App
32+
participant DependencyApp1 as ApiDep1
33+
participant DependencyApp2 as ApiDep2
34+
35+
TestClient->>MainApp: GET /Hello
36+
MainApp->>DependencyApp1: GET /externalApi
37+
DependencyApp1-->>MainApp: Response
38+
MainApp->>DependencyApp2: POST /anotherApi
39+
DependencyApp2-->>MainApp: Response
40+
MainApp-->>TestClient: Response
41+
42+
```
43+
2844
### HTTP Mocks 🤡
2945

3046
It's easy to **mock** those http clients dependencies (with data stubs) during integration tests making use of `ApiStub.FSharp` lib, saving quite some code compared to manually implementing the `WebApplicationFactory<T>` pattern, let's see how below.

0 commit comments

Comments
 (0)