System.Net.NetworkInformation.Tests.NetworkInterfaceBasicTest.BasicTest_AccessInstanceProperties_NoExceptions_Osx C# (CSharp) Method

BasicTest_AccessInstanceProperties_NoExceptions_Osx() private method

        public void BasicTest_AccessInstanceProperties_NoExceptions_Osx()
        {
            foreach (NetworkInterface nic in NetworkInterface.GetAllNetworkInterfaces())
            {
                _log.WriteLine("- NetworkInterface -");
                _log.WriteLine("Name: " + nic.Name);
                string description = nic.Description;
                Assert.False(string.IsNullOrEmpty(description), "NetworkInterface.Description should not be null or empty.");
                _log.WriteLine("Description: " + description);
                string id = nic.Id;
                Assert.False(string.IsNullOrEmpty(id), "NetworkInterface.Id should not be null or empty.");
                _log.WriteLine("ID: " + id);
                Assert.Throws<PlatformNotSupportedException>(() => nic.IsReceiveOnly);
                _log.WriteLine("Type: " + nic.NetworkInterfaceType);
                _log.WriteLine("Status: " + nic.OperationalStatus);
                _log.WriteLine("Speed: " + nic.Speed);
                Assert.InRange(nic.Speed, 0, long.MaxValue);
                _log.WriteLine("SupportsMulticast: " + nic.SupportsMulticast);
                _log.WriteLine("GetPhysicalAddress(): " + nic.GetPhysicalAddress());
            }
        }