public void TryPingExistingHostExceptionOnError() { try { TcpPing.Send(CorrectHost, Port, ThrowOnError).Should().BeTrue(); } catch (Exception ex) { var socketException = ex as SocketException; socketException.Should().NotBeNull(); socketException?.ErrorCode.Should().Be(11001); } }
public void TryPingWrongHostExceptionOnError() { Action action = () => TcpPing.Send(WrongDomain, Port, ThrowOnError); action.Should().Throw <SocketException>().And.ErrorCode.Should().Be(11001); }
public void TryPingWrongHostFalseOnError() { TcpPing.Send(WrongDomain).Should().BeFalse(); }
public void TryPingExistingHostFalseOnError() { Action action = () => TcpPing.Send(CorrectHost); action.Should().NotThrow(); }