public void TestSubtractAddress()
        {
            var bcast      = new IPv4Address(new byte[] { 255, 255, 255, 255 });
            var any        = new IPv4Address(new byte[] { 0, 0, 0, 0 });
            var subtracted = bcast - bcast;

            Assert.Equal(0u, subtracted);
            Assert.Equal(IPAddress.Any, (IPv4Address)subtracted);
            Assert.Equal(any, (IPv4Address)subtracted);
        }
        public void TestEmptyAddress()
        {
            var  address = new IPv4Address(new byte[] { 0, 0, 0, 0 });
            uint val     = address;
            long val2    = address;

            Assert.Equal(0u, val);
            Assert.Equal(0L, val2);
            Assert.Equal(address, IPAddress.Any);
        }
        public void TestIncrementAddress()
        {
            var address     = new IPv4Address(new byte[] { 255, 255, 255, 255 });
            var any         = new IPv4Address(new byte[] { 0, 0, 0, 0 });
            var incremented = address + 1;

            address++;
            Assert.Equal(0u, (uint)incremented);
            Assert.Equal(IPAddress.Any, incremented);
            Assert.Equal(any, incremented);
            Assert.Equal(0u, (uint)address);
            Assert.Equal(IPAddress.Any, address);
            Assert.Equal(any, address);
        }
        public void TestDecrementAddress()
        {
            var address     = new IPv4Address(new byte[] { 0, 0, 0, 0 });
            var bcast       = new IPv4Address(new byte[] { 255, 255, 255, 255 });
            var decremented = address - 1;

            address--;
            Assert.Equal((uint)bcast, (uint)decremented);
            Assert.Equal(IPAddress.Broadcast, decremented);
            Assert.Equal(bcast, decremented);
            Assert.Equal(-1, (int)decremented);
            Assert.Equal((uint)bcast, (uint)address);
            Assert.Equal(bcast, address);
            Assert.Equal(IPAddress.Broadcast, address);
            Assert.Equal(-1, (int)address);
        }
 /// <summary>
 /// Tests contains address
 /// </summary>
 /// <param name="value"></param>
 /// <returns></returns>
 public bool Contains(IPv4Address value)
 {
     return(value >= Low && value <= High);
 }