-
Intro This is just a really quick post on how to write async test methods in C# with XUnit and NSubstitute. Thankfully its quite simple these days, and is very useful to know as async calls become more and more...
-
Introduction This is the first post on category theory terms, which is sort of like a mathematical version of design patterns in the functional world, but as you might expect they are at a much lower level than the OO...
-
Introduction
A little bit of magic from the functional world…
-
Intro
For my second post on F# I’m sticking with simple examples, and I’m going to write a really basic prime number calculator. Again I’m writing this in linqpad as an “F# program”.
-
lets(learn(fsharp(“”)))
-
How to..
This is quite frankly a bit weird so I thought I’d document it….
-
Intro I got a message from the guys at NDepend asking me to try out a full version of their software, and I do like a good tool to simplify some of the more complicated development tasks, so heres a...
-
Intro Linq in c# is a great abstraction, it massively reduces the amount of code to do fairly basic operations, using TypeScript doesn’t mean you lose this functionality, its just a little different to achieve many of the operations. In...
-
Intro This was blogged about all the way back in 2007 by Nat Price here. Its one of my favourite patterns when tests start to get more complicated, I’m going to keep the examples simple in this explanation, but hopefully...
-
Intro Dapper is an awesome Micro ORM and generally works the way I’d expect it to, and very quickly, but I fell into a little rabbit hole recently when using Dapper with async in C#, and I thought I’d document...
-
The Problem There are loads of cases where this applies, but a simple one is: You have a target class that spawns a thread which updates a field with its result and you want to test that the result is...
-
I’ve decided to write a bunch of patterns and practices up in a concise way that help to make unit testing in .Net a better, lower friction experience. Getting started unit testing can be quite painful, and its not usually...
-
The Problem Your class has a dependency on something that is outside of your control. A simple scenario for this is the DateTime object, its quite common to need to simulate a different “Now” in your tests to the one...
-
The Problem Anyone who’s written unit tests that have had to change will probably be familiar with this, objects that tend to interface to other classes tend to take in more parameters during the development cycle every now and then,...
-
I was intrigued to see how a table with System_Versioning enabled would behave if it had a rowversion on the primary table, and how it would get inserted to the history table.
-
Heres a distillation of a bunch of disparate information on async await in .Net, hopefully this will work as a fairly decent primer for the core async await functionality.
-
What do you do when you need to test a class that accepts a non-trivial dependency? Thats right, you just give up and don’t test it…
-
This is going to be an opinionated view as to the most efficient way I’ve personally found create a software design, heavily based on core OO & XP principles, allowing software to grow naturally, TDD and refactoring. It may not...
-
I’m going to try to do a few posts on test driven development in the .Net world. Yeah its been covered quite heavily already, but I think more information out there can only be a good thing, can’t it?
-
Unit testing is hard, you aren’t going to learn it overnight, you may not reap the benefits of it immediately, you may not have a code base that supports them, but persist and long term, the benefits will start to...
-
Comments imply the code does not speak for itself. Code with a lot of comments, usually has them because the code itself doesn’t adequately represent what its doing, and in most cases it could be changed so that it does...
-
So this is it.. blog post number 0. Not really sure how or what to write, but I’ve got a shiny new github pages repository… so lets have a go.