mirror of
https://github.com/oliverbooth/X10D
synced 2024-11-09 22:55:42 +00:00
Add unsupported EndPoint tests
Satisfies 100% coverage
This commit is contained in:
parent
199b82b9a6
commit
2c2de1e30e
@ -22,37 +22,55 @@ public class EndPointTests
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void DnsEndPointGetHostLocalhost()
|
||||
public void DnsEndPointGetHostShouldBeLocalhost()
|
||||
{
|
||||
var endPoint = new DnsEndPoint("localhost", 1234);
|
||||
Assert.AreEqual("localhost", endPoint.GetHost());
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void DnsEndPointGetPort1234()
|
||||
public void DnsEndPointGetPortShouldBe1234()
|
||||
{
|
||||
var endPoint = new DnsEndPoint("localhost", 1234);
|
||||
Assert.AreEqual(1234, endPoint.GetPort());
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void IPEndPointIPv4LoopbackGetHost127001()
|
||||
public void IPEndPointIPv4LoopbackGetHostShouldBe127_0_0_1()
|
||||
{
|
||||
var endPoint = new IPEndPoint(IPAddress.Loopback, 1234);
|
||||
Assert.AreEqual("127.0.0.1", endPoint.GetHost());
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void IPEndPointIPv6LoopbackGetHostColonColon1()
|
||||
public void IPEndPointIPv6LoopbackGetHostShouldBeColonColon1()
|
||||
{
|
||||
var endPoint = new IPEndPoint(IPAddress.IPv6Loopback, 1234);
|
||||
Assert.AreEqual("::1", endPoint.GetHost());
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void IPEndPointGetPort1234()
|
||||
public void IPEndPointGetPortShouldBe1234()
|
||||
{
|
||||
var endPoint = new IPEndPoint(IPAddress.Loopback, 1234);
|
||||
Assert.AreEqual(1234, endPoint.GetPort());
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void DummyEndPointGetHostShouldBeEmptyString()
|
||||
{
|
||||
var endPoint = new DummyEndPoint();
|
||||
Assert.AreEqual(string.Empty, endPoint.GetHost());
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void DummyEndPointGetPortShouldBe0()
|
||||
{
|
||||
var endPoint = new DummyEndPoint();
|
||||
Assert.AreEqual(0, endPoint.GetPort());
|
||||
}
|
||||
|
||||
private class DummyEndPoint : EndPoint
|
||||
{
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user