StrataFrame Forum

nUnit ...

http://forum.strataframe.net/Topic14073.aspx

By Charles Thomas Blankenship - 2/6/2008

Currently I'm using nUnit successfully but in order to do so I must make a call to the SetDataSources() method in the AppMain.cs program ... nUnit tests are located in the BOLibrary proejct.  My first stab at accomplishing this was to add a reference to the BOLibrary project referencing the WinForms project then make the call.  Unfortunately this results in a cyclical reference error when nUnit testing is over and I'm dropping BOs on the forms.  I got around this by using VB6's method of inheritence (Ctrl+C) but would prefer not to duplicate code.

So, how do I make a call to FMG_CC.AppMain.SetDataSources() from the BOLibrary project... without including a reference to that project ...

Thanks,

CT

By Trent L. Taylor - 2/6/2008

First, we use unit testing as well (Team Foundation)....and we take a different approach.  We have a an entry point for unit testing that sets up the data sources....the only way that you call call the SetDataSources from a BO which is more than likely referenced by the entry point assembly (this would cause a circular reference) is to either create an interface that you apply to the AppMain class that just as a SetDataSources method ... or use reflection and invoke the method.