Tim Van Wassenhove

Passionate geek, interested in Technology. Proud father of two

13 Oct 2008

Revisited the int and string ValueObject templates

After reading The Compare Contract last week i realized that my templates for int and string ValueObjects did not comply with the contract so i decided to add a unittest that reproduces the faulty behavior (and then corrected the implementation)

[TestMethod]
public void ShouldReturnPositiveWhenComparedWithNull()
{
	$classname$ value = new $classname$("0");
	Assert.IsTrue(value.CompareTo(null) > 0);
}

Anyway, feel free to download the corrected IntValueObject and StringValueObject templates.