Just release V2 of NCheck, my test object comparision helper which tidies up a few things that simplify custom comparisions and excluding properties.
Reworked the ITypeCompareTargter/IPropertyCompareTargeter into a a more generic IConvention<Source, Target> Introduced custom comparers and use convention-based registration for them. Retired Exclude, you can now use Compare(x => x.PropertyName).Ignore, unifies the syntax compared to other options.
With unit testing one of the precepts is to check one thing in your test, but when you have objects this is difficult to express, since you want to check that the your business process has updated all of the expected properties (positive testing) and also that has not modified things that are not expected to have changed (negative testing).
This becomes even more problematic when you have an object graph, e.
A number of years ago Sebasiten Lorion wrote a very good CSV parser for .NET with the code and an accompanying article on Code Project - A Fast CSV Reader. I’d used this in a number of projects but recently I needed to make some changes to the code for my trading system project, and there wasn’t a public repository available; there’s a version on NuGet but it doesn’t point back to the source.
I was working on the design of a small site where we have public display of information in one format and a set of administrative screens that allow authorised users to create and edit the information.
“I know”, I thought, “this is a perfect case for MVC Areas” – and boy was I wrong! I should have realised that the problems had started when all the routing started playing up..
I’ve been using the MvcContrib.TestHelper class for a while now to get rather nice fluent testing of the routes in my MVC applications.
A typical test class would look like this
public class CategoryRoutesFixture : RoutesFixture { private const int categoryId = 34; private static string BaseUrl { get { return "~/admin/Category"; } } [Test] public void Index() { BaseUrl.ShouldMapTo&lt;CategoryController&gt;(x =&gt; x.Index()); } [Test] public void Create() { (BaseUrl + "/create").