UnitOfWork attribute and NUnit tests

33 views
Skip to first unread message

Paul

unread,
Aug 9, 2012, 12:52:01 AM8/9/12
to sharp-arc...@googlegroups.com
Hi Everyone,

I have a NUnit test project which works with the database.  The test I've created inserts a parent record into the database (which is housed in it's own function with a [UnitOfWork] attribute inside a utility class) and then proceeds to insert child records (also in it's own function with a [UnitOfWork] attribute in the utility clas).  I have my parent object setup such that it contains a list of the child objects.  The records insert fine.  However, when I retrieve the parent object, the child objects are null.  Other applications I built that retrieve this parent object also retrieve the list of child objects.

I have injected the utility class via Windsor and I made sure the actual methods are marked virtual to support [UnitOfWork].  The utility class is resolved in a [TestFixtureSetup] marked attribute in the test.

 Has anyone come across this before?  Is there some possible interaction with NUnit that would cause this?  Am I missing something or doing something wrong?  Any help/insight is greatly appreciated!

Thanks!
Reply all
Reply to author
Forward
0 new messages