Repository navigation
Design FAQ
This page provides the rationale of (NFluent's) design decisions that are often challenged.
We (NFluent's team) make clear that we are proponent of TDD and other test first practices. This impacts API design decision in more or less subtle ways. The following entries provide clarification on what this means.
IsEqualTo is the cornerstone of test first development, as the developer provides the results she/he expects (hopes?) the code will provide when run in specified conditions. On the other hand, TDD implies writing the test first, as in even before any production code is written. This means the object/value that will hold the result may not be decided yet.
When using NUnit's Assert.AreEqual, this implies you provide the expected value as the first parameter, and the outcome value/objects as the second one. A nice side effect of this, is that the IDE can guess the type of second parameter (same as the first parameter's) helping with autocompletion feature. Sadly, this design is also difficult to read. That's why we decided in favour of what we felt was more readable, i.e.: Check.That(sut)....
- Welcome
- How to start
- Customising error messages
-
Check.That
- All (Equality, Type)
- Reference types
- Members based
- IEnumerable (Properties, Content, Elements)
- String (Properties, Content, RegExp )
- Numeric Type(Properties, Comparisons, Floating)
- Dictionary
- Char (Properties, Value)
- IComparable
- DateTime
- DateTimeOffset
- Misc: Boolean, TimeSpan, Stream, Enum, EventWaitHandle
- Check.ThatCode
- Check.ThatDynamic
- Extensibility
- Auxiliary types (TimeUnit)
- Mocks