// [Fact] private void DumpComputerNameFormats() { foreach (COMPUTER_NAME_FORMAT format in Enum.GetValues(typeof(COMPUTER_NAME_FORMAT))) { try { string name = SystemInformationMethods.GetComputerName(format) ?? "<null>"; Debug.WriteLine($"{format}: '{name}'"); } catch (Exception e) { Debug.WriteLine($"{format}: FAILED- {e.Message}"); } } }
public void GetComputerName_NetBIOS() { SystemInformationMethods.GetComputerName(COMPUTER_NAME_FORMAT.ComputerNameNetBIOS) .Should().Be(SystemInformationMethods.GetComputerName()); }
public void GetComputerName() { SystemInformationMethods.GetComputerName().Should().Be(Environment.GetEnvironmentVariable("COMPUTERNAME")); }