public void PortFoundButUnassigned() { //Prepare const Int32 PORT = 4; const System.Net.Sockets.ProtocolType PROTOCOL = System.Net.Sockets.ProtocolType.Udp; //Act var result = NetworkHelpers.GetKnownPort(PORT, PROTOCOL); //Assert Assert.IsNull(result); }
public void WrongProtocol() { //Prepare const Int32 PORT = 111; const System.Net.Sockets.ProtocolType PROTOCOL = System.Net.Sockets.ProtocolType.Icmp; //Act var result = NetworkHelpers.GetKnownPort(PORT, PROTOCOL); //Assert Assert.Fail(); }
public void PortFound() { //Prepare const Int32 PORT = 1433; const System.Net.Sockets.ProtocolType PROTOCOL = System.Net.Sockets.ProtocolType.Tcp; //Act var result = NetworkHelpers.GetKnownPort(PORT, PROTOCOL); //Assert Assert.IsNotNull(result); Assert.AreEqual(PORT, result.Port); Assert.AreEqual(PROTOCOL, result.Protocol); }