public void IsHostAvailableTest() { var sw = PerformanceStopwatch.StartNew(); var result = NetworkHelper.IsHostAvailable("www.google.com", timeout: 500); var pingTime = sw.StopReset(); Debug.WriteLine($"Ping Time = {pingTime.TotalMilliseconds}"); Assert.IsTrue(result); result = NetworkHelper.IsHostAvailable(RandomData.GenerateUrl(), 500); Assert.IsFalse(result); //Google result = NetworkHelper.IsHostAvailable("8.8.4.4", timeout: 500); Assert.IsTrue(result); result = NetworkHelper.IsHostAvailable("8.8.4.4"); Assert.IsTrue(result); }
public void GenerateUrlTest() { var stringValue = RandomData.GenerateUrl(); Assert.IsNotNull(stringValue); }