Skip to content

Commit b571f7e

Browse files
authored
Merge pull request #53 from jkone27/add-mermaid-to-docs
Add mermaid to docs
2 parents 332ace0 + 8550342 commit b571f7e

File tree

2 files changed

+21
-16
lines changed

2 files changed

+21
-16
lines changed

docs/_body.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<script type="module">
2+
import mermaid from "https://esm.sh/[email protected]";
3+
mermaid.initialize({
4+
startOnLoad: true,
5+
theme: "base",
6+
themeVariables: {
7+
primaryColor: '#BB83E8',
8+
textColor: '#BB83E8'
9+
}
10+
});
11+
</script>

docs/index.md

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,17 @@ 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
28+
<br>
29+
<div class="mermaid text-center">
2930
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-
31+
Test->>App: GET /Hello
32+
App->>ApiDep1: GET /externalApi
33+
ApiDep1-->>App: Response
34+
App->>ApiDep2: POST /anotherApi
35+
ApiDep2-->>App: Response
36+
App-->>Test: Response
37+
</div>
38+
<br>
4439
### HTTP Mocks 🤡
4540

4641
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.
@@ -297,4 +292,3 @@ module Tests =
297292
* more info on [F# xunit testing](https://learn.microsoft.com/en-us/dotnet/core/testing/unit-testing-fsharp-with-dotnet-test).
298293
* 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.
299294
* [aspnetcore integration testing](https://learn.microsoft.com/en-us/aspnet/core/test/integration-tests?view=aspnetcore-7.0) docs in C#
300-

0 commit comments

Comments
 (0)