Skip to content

Commit 09277cc

Browse files
committed
fix docs
1 parent 0649fc3 commit 09277cc

File tree

2 files changed

+26
-15
lines changed

2 files changed

+26
-15
lines changed

README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,19 @@
22

33
![alt text](docs/img/ApiStub.FSharp.png)
44

5-
[![Ceasefire Now](https://badge.techforpalestine.org/ceasefire-now)](https://techforpalestine.org/learn-more)
6-
[![Stand With Ukraine](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/badges/StandWithUkraine.svg)](https://stand-with-ukraine.pp.ua)
75
<a href='https://juststopoil.org/' target="_blank"><img alt='JUST_STOP_OIL' src='https://img.shields.io/badge/Just_STOP OIL-100000?style=plastic&logo=JUST_STOP_OIL&logoColor=white&labelColor=FFA600&color=000000'/></a>
6+
[![Stand With Ukraine](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/badges/StandWithUkraine.svg)](https://stand-with-ukraine.pp.ua)
7+
[![Ceasefire Now](https://badge.techforpalestine.org/ceasefire-now)](https://techforpalestine.org/learn-more)
88

99
## Easy API Testing 🧞‍♀️
1010

11-
This library makes use of [F# computation expressions](https://learn.microsoft.com/en-us/dotnet/fsharp/language-reference/computation-expressions) to hide some complexity of `WebApplicationFactory` and provide the user with a *domain specific language* (DSL) for integration tests.
11+
This library makes use of [F# computation expressions](https://learn.microsoft.com/en-us/dotnet/fsharp/language-reference/computation-expressions) 🪔✨ to hide some complexity of `WebApplicationFactory` and provide the user with a *domain specific language* (DSL) for integration tests.
12+
13+
An "antique" C# API (👴🏽🦖🦕) is also available since v.1.1 for enhanced accessibility 😺.
14+
15+
## Documentation
1216

13-
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.
17+
Access the [documentation website](https://jkone27.github.io/fsharp-integration-tests/) for more info on how to use this library.
1418

1519
## Scenario
1620

docs/index.md

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
1-
# ApiStub.FSharp
1+
<!-- # ApiStub.FSharp -->
22

33
![alt text](img/ApiStub.FSharp.png)
44

55
## Easy API Testing 🧞‍♀️
66

7-
You have an ASP NET NET6+ (NET6 is LTS in 2023) aspnetcore API, and you want to simplify HTTP stubs for [integration
8-
testing](https://learn.microsoft.com/en-us/aspnet/core/test/integration-tests?view=aspnetcore-9.0) using `WebApplicationFactory`,
9-
but you find that a bit cumbersome sometimes?
10-
11-
this library is here to help you!
7+
This library makes use of [F# computation expressions](https://learn.microsoft.com/en-us/dotnet/fsharp/language-reference/computation-expressions) or CEs to wrap some complexities of `WebApplicationFactory<T>` when setting up `integration tests` for a `.NET` Web app. It comes with a *domain specific language* (DSL) for "mocking" HttpClient factory in integration tests, and more.
128

139
### Test .NET C# 🤝 from F#
1410

@@ -36,11 +32,12 @@ sequenceDiagram
3632
App-->>Test: Response
3733
</div>
3834
<br>
35+
3936
### HTTP Mocks 🤡
4037

4138
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.
4239

43-
## F#
40+
## F# 🦔 ✨
4441

4542
* `Program`: to be able to make use of `Program.fs` (e.g. minimal api) as `TestClient<Program>()`, make sure to declare an empty `type Program = end class` on top of your Program module containing the `[<EntryPoint>] main args` method.
4643

@@ -75,7 +72,7 @@ module Tests =
7572
}
7673
```
7774

78-
## C# - v.1.1.0
75+
## C# 🤖 for 👴🏽🦖🦕
7976

8077
if you prefer to use C# for testing, some extension methods are provided to use with C# as well:
8178

@@ -96,9 +93,12 @@ var webAppFactory = new CE.TestClient<Web.Sample.Program>()
9693
9794
```
9895

99-
## Mechanics
96+
## Mechanics 👨🏽‍🔧⚙️
97+
98+
This library makes use of [F# computation expressions](https://learn.microsoft.com/en-us/dotnet/fsharp/language-reference/computation-expressions) to hide some complexity of `WebApplicationFactory` and provide the user with a *domain specific language* (DSL) for integration tests in aspnetcore apps.
99+
100+
🪆📦 > The main "idea" behind this library is having a CE builder that wraps the creation of a `russian doll` or `chinese boxes` of HttpHandlers to handle mocking requests to http client instances in your application under test or SUT.
100101

101-
This library makes use of [F# computation expressions](https://learn.microsoft.com/en-us/dotnet/fsharp/language-reference/computation-expressions) to hide some complexity of `WebApplicationFactory` and provide the user with a *domain specific language* (DSL) for integration tests in aspnetcore apps.
102102
The best way to understand how it all works is checking the [code](https://github.com/jkone27/fsharp-integration-tests/blob/249c3244cd7e20e2168b82a49b6e7e14f2ad1004/ApiStub.FSharp/CE.fs#L176) and this member CE method `GetFactory()` in scope.
103103

104104
If you have ideas for improvements feel free to open an issue/discussion!
@@ -287,8 +287,15 @@ module Tests =
287287
* feel free to get in touch, to fork and check out the repo
288288
* test and find use cases for this library, testing in F# is awesome!!!!
289289

290-
### References
290+
### References 📚
291291

292292
* more info on [F# xunit testing](https://learn.microsoft.com/en-us/dotnet/core/testing/unit-testing-fsharp-with-dotnet-test).
293293
* 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.
294294
* [aspnetcore integration testing](https://learn.microsoft.com/en-us/aspnet/core/test/integration-tests?view=aspnetcore-7.0) docs in C#
295+
296+
### if you want to donate
297+
298+
<a href='https://juststopoil.org/' target="_blank"><img alt='JUST_STOP_OIL' src='https://img.shields.io/badge/Just_STOP OIL-100000?style=plastic&logo=JUST_STOP_OIL&logoColor=white&labelColor=FFA600&color=000000'/></a>
299+
[![Stand With Ukraine](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/badges/StandWithUkraine.svg)](https://stand-with-ukraine.pp.ua)
300+
[![Ceasefire Now](https://badge.techforpalestine.org/ceasefire-now)](https://techforpalestine.org/learn-more)
301+

0 commit comments

Comments
 (0)