In the Microsoft UnitTesting namespace ( Microsoft.VisualStudio.TestTools.UnitTesting ) there are AssemblyInitialize and AssemblyCleanup attributes that you can apply to static methods, and they will be called before and after all tests, respectively.
[AssemblyInitialize] static public void AssemblyInitialize(TestContext testCtx) {
My question is: is it possible and safe to access TestContext inside AssemblyCleanup() ? If not, stores resource references as static members as a reasonable alternative or can cause problems?
Additionally / optional: what is explained by the fact that you do not pass a reference to TestContext methods for cleaning?
source share