/// <summary> /// Method gets called once at the end of running the tests /// </summary> public override void AfterTest(NUnit.Framework.TestDetails testDetails) { if (Environment.OSVersion.Platform != PlatformID.Unix && !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("BUILDAGENT_SUBKEY"))) { // End redirection. Otherwise test might fail when we run them multiple // times in NUnit. RegOverridePredefKey(HKEY_CURRENT_USER, UIntPtr.Zero); } base.AfterTest(testDetails); }
/// <summary> /// Method gets called once at the very start of running the tests /// </summary> public override void BeforeTest(NUnit.Framework.TestDetails testDetails) { base.BeforeTest(testDetails); if (!MiscUtils.IsUnix && !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("BUILDAGENT_SUBKEY"))) { UIntPtr hKey; RegCreateKey(HKEY_CURRENT_USER, TmpRegistryKey, out hKey); RegOverridePredefKey(HKEY_CURRENT_USER, hKey); RegCloseKey(hKey); } }