Exemplo n.º 1
0
 // [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}");
         }
     }
 }
Exemplo n.º 2
0
 public void GetComputerName_NetBIOS()
 {
     SystemInformationMethods.GetComputerName(COMPUTER_NAME_FORMAT.ComputerNameNetBIOS)
     .Should().Be(SystemInformationMethods.GetComputerName());
 }
 public void GetComputerName()
 {
     SystemInformationMethods.GetComputerName().Should().Be(Environment.GetEnvironmentVariable("COMPUTERNAME"));
 }