/// <summary> /// Constructor. /// </summary> /// <exception cref="InvalidOperationException">Thrown if another test manager instance is active.</exception> public KubeTestManager() { lock (syncLock) { if (Current != null) { throw new InvalidOperationException("Another test manager is active."); } try { tempFolder = new TempFolder(); Current = this; KubeHelper.SetTestMode(tempFolder.Path); Environment.SetEnvironmentVariable(KubeConst.TestModeFolderVar, tempFolder.Path); } catch { Environment.SetEnvironmentVariable(KubeConst.TestModeFolderVar, null); Current = null; throw; } } }