I’m developing a framework to be used by several projects. The framework will have integration methods implemented similar to unit tests on MSTest base. The core part of the integration tests will be part of the framework as a separate assembly, let’s call it Fr.IntegrationTests.dll.
All projects using the framework will have to implement their own integration tests in a new assembly, let’s call it Project.IntegrationTests.dll. This assembly only extends the tests in Fr.IntegrationTests.dll by some specific tests.
The problem I have is that I must perform two separate initializations for both Fr.IntegrationTests.dll and Project.IntegrationTests.dll. I do that by means of AssemblyInitialize in both assemblies. But it seams to me that only the initialization of Project is done.
Can you tell me if more than one initialization methods may use AssemblyInitialize? For me is important to know whether a method in a referenced assembly (Fr.IntegrationTests.dll) decorated with AssemblyInitialize will be invoked, too.
Thank you in advance!
You would probably be better off using ClassInitialize and organizing your tests by class. Also, I’m fairly certain MSTest does not respect any of the typical attributes in a referenced assembly, you would want to directly execute MSTest against that assembly instead.