NUnitFormsTest.ExpectModal uses uninitialized variable modal
Brought to you by:
charliepoole,
lukemaxon
According to reflector ExpectModal (from NUnitFormsTest) is:
protected void ExpectModal(string name, ModalFormActivated handler, bool expected)
{
this.modal.ExpectModal(name, handler, expected);
}
Unfortunately private variable modal is not initialized in NUnitFormsTest, which results in exception (Object reference not set to ...).
NUnitForms assembly version is 2.0.2327.4786.
The documentation said to use NUnitFormsTest as a base type for my tests. However, after chaning base type to ModalFormTester (and ExpectModal call accordingly) the test works ok.
Logged In: YES
user_id=1636255
Originator: NO
Can you include a .sln that reproduces this problem?
Thanks.
Logged In: NO
I had a similar problem. You probably have assigned the [SetUp] attribute to one of the functions in your test class. This overrides the [SetUp] tag (not sure why) for NUnitFormsTest.init() which is the method that initializes modal. It looks like we're supposed to override the NUnitFormsTest.Setup() method instead of using the [SetUp] tag. This seems a bit clunky and we ought to be able to use [SetUp] without breaking things.