In a previous post, I described MemoryChannel and how I used TDD to implement it. After the 25th commit, 20 unit tests later, I had a fully functional but single-threaded implementation. Simply by inspection, I knew that this code would…
TDD + async: Introducing MemoryChannel
Can you use test-driven development and unit testing with asynchronous code? Yes, with a few caveats. Above all, unit tests should be deterministic and fast. This means you should stick to single-threaded workflows as much as possible and never sleep.…
Initialize projects script
I have a preferred Visual Studio solution layout. It is basically as follows, using MyProj as a sample name: MyProj: Solution root. bin: All built binaries go here. external: External binary dependencies (e.g. unit test runners). source: Root of source…
Async coding guidelines
Here are some basic guidelines for writing async C# code (.NET 4.5+). These are adapted from guidance I have given my colleagues and should be useful primarily to those new to Task, async/await, and the like. To keep things interesting,…