• /r/csharp
  • Which syntax is better for unit tests?

    I can't decide between the following two lines of code. Thinking about it there are probably a dozen more ways of doing the following. Assert.That(result, Has.Length.EqualTo(2)); Assert.AreEqual(result.Length, 2); I just need to check if result (an array in this case but applies to other things) has a length of 2. I'm using NUnit if that's […]