public void IsAliveReturnsFalseForBogusAddress() { INetworkStatusStrategy strategy = new HttpPingStatusStrategy(); bool isAlive = strategy.IsAlive("http://thereisnosuchcomputer/"); Assert.IsFalse(isAlive); }
public void IsAliveReturnsFalseForBadIPAddress() { INetworkStatusStrategy strategy = new HttpPingStatusStrategy(); bool isAlive = strategy.IsAlive("http://123.456.789.098/"); Assert.IsFalse(isAlive); }
public void IsAliveReturnsTrueForMissingPageAtGoodAddress() { INetworkStatusStrategy strategy = new HttpPingStatusStrategy(); bool isAlive = false; // This test case will randomly fail for no reason. Try 3 times just to be sure. for (int i = 0; i < 3; i++) { if (strategy.IsAlive("http://127.0.0.1/myPage.aspx")) { isAlive = true; } } Assert.IsTrue(isAlive); }
public void IsAliveReturnsFalseForAddressWithoutHttpPrefix() { INetworkStatusStrategy strategy = new HttpPingStatusStrategy(); bool isAlive = strategy.IsAlive("productsweb"); }
public void IsAliveReturnsFalseForBadlyFormedAddress() { INetworkStatusStrategy strategy = new HttpPingStatusStrategy(); bool isAlive = strategy.IsAlive("123789.098"); }