static bool IsDisable() { var variable = EnvironmentEx.GetEnvironmentVariable("DiffEngine_Disabled"); return(string.Equals(variable, "true", StringComparison.OrdinalIgnoreCase) || BuildServerDetector.Detected || ContinuousTestingDetector.Detected); }
public void Found() { Environment.SetEnvironmentVariable("AB", "Value1"); Environment.SetEnvironmentVariable("A.B", "Value2"); Environment.SetEnvironmentVariable("A_C", "Value3"); Assert.Equal("Value1", EnvironmentEx.GetEnvironmentVariable("AB")); Assert.Equal("Value2", EnvironmentEx.GetEnvironmentVariable("A_B")); Assert.Equal("Value3", EnvironmentEx.GetEnvironmentVariable("A_C")); }
static int GetMaxInstances() { var variable = EnvironmentEx.GetEnvironmentVariable("DiffEngine_MaxInstances"); if (string.IsNullOrEmpty(variable)) { return(5); } if (ushort.TryParse(variable, out var result)) { return(result); } throw new Exception($"Could not parse the DiffEngine_MaxInstances environment variable: {variable}"); }
static ClipboardEnabled() { var disabledText = EnvironmentEx.GetEnvironmentVariable("Verify_DisableClipboard"); clipboardDisabled = ParseEnvironmentVariable(disabledText); }
public void NotFound() { Assert.Null(EnvironmentEx.GetEnvironmentVariable("Foo")); Assert.Null(EnvironmentEx.GetEnvironmentVariable("Foo.Bar")); Assert.Null(EnvironmentEx.GetEnvironmentVariable("Foo_Bar")); }