Skip to content

Commit 93b39e5

Browse files
committed
chore: readme changes
1 parent 4982062 commit 93b39e5

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

README.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ sequenceDiagram
3232
```
3333

3434
## Test 🧪
35+
36+
using `F#`
3537

3638
```fsharp
3739
open ApiStub.FSharp.CE
@@ -42,7 +44,7 @@ open Xunit
4244
module Tests =
4345
4446
// build your aspnetcore integration testing CE
45-
let test = new TestClient<Startup>()
47+
let test = new TestClient<Program>()
4648
4749
[<Fact>]
4850
let ``Calls Hello and returns OK`` () =
@@ -58,9 +60,31 @@ module Tests =
5860
5961
let! r = client.GetAsync("/Hello")
6062
63+
// rest of your tests...
64+
6165
}
6266
```
6367

68+
or in `C#` if you prefer
69+
70+
```csharp
71+
using ApiStub.FSharp;
72+
using static ApiStub.Fsharp.CsharpExtensions;
73+
74+
async Task CallsHelloAndReturnsOk () {
75+
76+
var client =
77+
new CE.TestClient<Web.Sample.Program>()
78+
.GETJ("/externalApi", new { Ok = "Yeah" })
79+
.GetFactory()
80+
.CreateClient();
81+
82+
var r = await client.GetAsync("/Hello");
83+
84+
// rest of your tests...
85+
86+
```
87+
6488
### Test .NET C# 🤝 from F#
6589

6690
F# is a great language, but it doesn't have to be scary to try it. Integration and Unit tests are a great way to introduce F# to your team if you are already using .NET or ASPNETCORE.

0 commit comments

Comments
 (0)