System.NullReferenceException with WhoCanHelpMe Unit Test
Posted
by tlum
on Stack Overflow
See other posts from Stack Overflow
or by tlum
Published on 2010-05-06T22:15:51Z
Indexed on
2010/05/06
22:18 UTC
Read the original article
Hit count: 189
c#
I'm working with a test project based on WhoCanHelpMe, which is based on Sharp Architecture, NHibernateValidator, etc. As its written the when_the_profile_tasks_is_asked_to_create_a_profile unit test creates the profile object and saves it without issue.
Now the profile object is a CreateProfileDetails type that derives from their own ValidatableValueObject which inherits the IValidatable interface.
The problem surfaces when my class is based on an Entity rather than their ValidatableValueObject. When the test is run a System.NullReferenceException because Validate() is null.
I'm afraid that I'm at a loss to resolve this bad behavior. Does anyone have some suggestions to get to the bottom of this?
Thanks,
-Ted-
© Stack Overflow or respective owner