Archives / 2017
  • Avoid Excessively Nested Code and be Loved

    Tags: Clean Code

    Nesting for birds is great, but nesting your code is not. In this post we will consider two types of excessive nesting that should be avoided: statement nesting and method nesting.

    Statement … more

  • Clean Code Saves Lives

    Tags: Clean Code

    Back in September 2007, Toyota Camrys began unexpectedly and unstoppably accelerating. Cars crashed. People were killed. Toyota put the blame on the physical causes like floormats and sticky … more

  • Unit Testing Don’ts

    Tags: Unit Testing

    Unit testing has many benefits in modern software development. Here are a few: increased software quality, facilitating refactoring, driving SOLID design, and faster development cycles. To realize … more

  • Testing Async Methods with Xunit

    Tags: C#, Unit Testing, Xunit

    Previously, when testing asynchronous methods such as the one below, I used synchronous tests and forced the method invocation to be synchronous by using .Result.

    public class AsyncTestClass … more

  • Installing MongoDB as a Service on Windows

    Tags: MongoDB

    I was a little surprised that MongoDB doesn't install itself as a windows service when you run the installation package.  So here's a command to install it as a service.  It will be set to … more

  • Embedded Resources with .Net Core

    Tags: ASP.NET, .Net Core

    I was writing some tests today and had a need to use an embedded resource as I did not want to have huge strings inside my test methods.  The embedded resource file is compiled along with the … more

  • Null Reference Exceptions Should Not be Happening

    Tags: C#

    Null Reference Exceptions Should Not be Happening!  Errors like this - Object reference not set to an instance of an object - should never show up in your error logs.  These uninformative … more