C#11preview: Type-safe interchangeable units

In a previous post, I discussed static abstracts in interfaces, and while it is quite a nice feature, it falls short in some corner cases – particularly in implicit type-conversions. I’m not sure if it should, but… it’s complicated. As an example, I will consider the concept of interchangeable units. Wouldn’t it be neat, if … Read more

C#11pre: static abstract interface members

C#10 was just released, but included in this years release is an early preview of C#11, and it contains quite an exciting change: static abstract members in interfaces. You might think, what’s the fuzz? Static members in interfaces is nothing new and was introduced in C#8! In this post I present a few more fruitful, … Read more

XUnit: Using TheoryData with Theory

In a previous post, we looked the newly introduced Assert.Multiple in the XUnit 2.4.2 assertion library. In this post, we will dive deeper into different ways of expressing tests and especially, test input. Facts are the simplest possible test-case in XUnit. They are self contained in that they contain the arrangement, act ,and assertion, but … Read more

Mapping deserialized objects to their JSON source using Json.NET

I am rewriting a part of an application written in python. It queries a json api, extracts relevant information and stores this information in an SQL database. It has served me well for a number of years now, and have changed quite a lot during its lifetime, and so has the relevant information. The data … Read more