Ejemplo n.º 1
0
 public void ParseStringAddress_InvalidPortAddress_Throws()
 {
     Assert.Throws <ArgumentException>(() => EpoxyTransport.ParseStringAddress("10.1.2.3:"));
     Assert.Throws <ArgumentException>(() => EpoxyTransport.ParseStringAddress("10.1.2.3::"));
     Assert.Throws <ArgumentException>(() => EpoxyTransport.ParseStringAddress("10.1.2.3:not a port"));
 }
Ejemplo n.º 2
0
 public void ParseStringAddress_InvalidIpAddress_Throws()
 {
     Assert.Throws <ArgumentException>(() => EpoxyTransport.ParseStringAddress("not an ip"));
     Assert.Throws <ArgumentException>(() => EpoxyTransport.ParseStringAddress("not an ip:12345"));
     Assert.Throws <ArgumentException>(() => EpoxyTransport.ParseStringAddress("not an ip:no a port"));
 }
Ejemplo n.º 3
0
        public void ParseStringAddress_ValidIpNoPort_ReturnsIpEndpoint()
        {
            var result = EpoxyTransport.ParseStringAddress(AnyIpAddressString);

            Assert.AreEqual(new IPEndPoint(AnyIpAddress, EpoxyTransport.DefaultPort), result);
        }
Ejemplo n.º 4
0
        public void ParseStringAddress_ValidIpWithPort_ReturnsIpEndpoint()
        {
            var result = EpoxyTransport.ParseStringAddress(AnyIpAddressString + ":" + AnyPort);

            Assert.AreEqual(new IPEndPoint(AnyIpAddress, AnyPort), result);
        }
Ejemplo n.º 5
0
 public void ParseStringAddress_NullOrEmpty_Throws()
 {
     Assert.Throws <ArgumentException>(() => EpoxyTransport.ParseStringAddress(null));
     Assert.Throws <ArgumentException>(() => EpoxyTransport.ParseStringAddress(string.Empty));
 }