In this post I'll be looking at an F# ASP.NET Core web app and a technique for ensuring correctness when taking a contract-first approach with OpenAPI, using property based testing with Expecto and FsCheck. There's…
fsharp
A collection of 5 posts
Pro Tip: using static Microsoft.AspNetCore.Http.StatusCodes
When building a web server in ASP.NET Core, the APIs that deal with status codes are int based, there are multiple ways to express a status code in your code, in this post I will share my favourite. // Stop…
Testing with HttpClient Interception
In my last post [https://stu.dev/generating-typed-client-for-httpclientfactory-with-nswag/] I showed how to automatically generate a typed client for use with HttpClientFactory from a swagger file. Now I want to make changes to the client's behaviour and need unit…
BigInteger to String in Any Base with F#
In this post I share a snippet of code to print a .NET BigInteger to a string in any base, not just the usual binary, decimal and hex, and explore some of F# along the way.
Pattern Matching F# Union Types in C# 7
Starting with C# 7.0, there is basic pattern matching support. I want to look at using this to interop with F# Discriminated Unions, and see what consuming F# code from C# could look like at it's best.…