In my last two posts, I’ve been building up the infrastructure needed to write request tests for a C# Azure Functions API: Setting Up an Azure Functions Dependency Injection Context for Request Tests Testing JSON Input/Output in Azure Functions Request Tests My goal is to write tests that are as close to end-to-end as I […]
I’ve been trying to figure out how to do some request testing on an Azure Functions project. My goal is to submit HTTP requests with JSON bodies, have them handled by the Functions running through as much of the real production code as possible, and then get back an HTTP response with a JSON payload. […]
While trying to figure out the best way to structure my “reducer” functions in a Redux-style Xamarin app, I found out that C# 7.0 introduced pattern matching support in switch statements!
I’ve done a lot of C# development over the past three years. I’m very happy with how the language has evolved. During that time, my coding style in C# has also evolved. Here are some simple techniques I’ve found that have increased the quality of my C# code.
In part 2 of this series I made a case that switching from Stateless Single-Responsibility Objects to delegates and static methods lets us write simple, pure functions and lets us remove a lot of boilerplate. Nevertheless, there was still one bit of boilerplate I hadn’t yet removed. It dealt with encapsulating dependencies to a method […]
In my previous post on the Stateless Single-Responsibility Object (SSRO) approach to C# application composition I reviewed the concept and its shortcomings. To recap: You end up with a ton of classes splitting up semi-related logic across multiple files. This is necessary to conform to the classname == filename convention. In order to mock, you […]
Functional code is easier to test than code with state or side effects. However, most developers spend the majority of their time in traditional, imperative languages. There’s plenty of value in those imperative languages, but these days when I use one, I also try to bring in applicable functional concepts. In this post I will […]