Hi,
I have been recently been putting together a test
environment for a
mutiple Project Visual Studio Solution. The test
environment is
declared as a separate Project 'TestEnvironment' and
within this I have
a folder representing each Project of the Solution.
e.g.
<pre>
TestEnvironment
|
|__DalFixture
| |_____BaseDalFixture.vb
|
|__BusinessRulesFixture
| |
| |_____BaseBusinessRulesFixture.vb
| |
| |_____Users
| |___UsersFixture.vb
|
|__BaseTestEnvironmentFixture.vb
</pre>
Under each folder i then have a base fixture class each
of which
inherit from a BaseTestEnvironmentFixture.
I was hoping that using this structure each subsequent
fixture that i
define (i.e. see UsersFixture.vb in the above diagram)
would be able to
inherit any setup/disposal information using the
<FixtureSetup><FixtureTeardown> attributes. However when
i compile and
run my tests i get errors regarding reflection and the
tests all fail.
Currently the 'BaseTest...' classes are not marked with
the <Fixture>
attribute. However they do have <FixtureSetup> in them on
an Init()
method ... of which I am calling using mybase.Init()
within the
UsersFixture.Init() method (which is marked as <Fixture>
and with
<FixtureSetup> respectively).
My assumption was that when NUnit invokes a test fixture
it calls some
kind of setup routine for each of the test fixtures and
calling into
their base each time would have a knock on effect of
instantiating a
whole test environment ... clearly i am either doing this
wrong or
taking a wrong approach? I have tried similarly using the
<Setup>
attribute. Ideally i would like to omit the mybase.calls
so that the
environment initialises correctly for all the " Project
Fixture ". Can
anyone help i would really appreciate it as I am bit
stuck and seeking
some advice?
Thanks in advance,
Best Regards
Nick Ford