I found another reason to love open source NUnit over MSTest, NUnitEx. NUnitEx provides a fluent DSL to write NUnit assertions where Visual Studio intellisense is your guiding friend. I’m sure you’re thinking, “Yeah whatever, show me some code.”
[Test] public void AdjacencyGraph_is_directed_by_default() { var graph = new AdjacencyGraph<Task, TaskDependency>(DoNotAllowParallelEdges); graph.IsDirected.Should().Be.True(); }
Nice eh? graph.IsDirected is the property I want to test. Everything after that is the NUnitEx extension methods. I know I find it much more readable than this:
[Test] public void AdjacencyGraph_is_directed_by_default() { var graph = new AdjacencyGraph<Task, TaskDependency>(DoNotAllowParallelEdges); Assert.IsTrue(graph.IsDirected); }
I would also like to add that this syntax is likely to be included in NUnit 3, which would be excellent!
Remember Me
a@href@title, strike
Powered by: newtelligence dasBlog 2.1.8102.813
Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.
© Copyright 2010, Shawn Neal
E-mail