public void NetmaskIsValid( )
        {
            var result = SUTest.NetmaskIsValid(new NetIpAddress(255, 255, 255, 255));

            Assert.AreEqual(true, result);

            result = SUTest.NetmaskIsValid(new NetIpAddress(0, 0, 0, 0));
            Assert.AreEqual(true, result);

            result = SUTest.NetmaskIsValid(new NetIpAddress(255, 255, 254, 0));
            Assert.AreEqual(true, result);

            result = SUTest.NetmaskIsValid(new NetIpAddress(255, 254, 0, 0));
            Assert.AreEqual(true, result);

            result = SUTest.NetmaskIsValid(new NetIpAddress(254, 0, 0, 0));
            Assert.AreEqual(true, result);

            result = SUTest.NetmaskIsValid(new NetIpAddress(0, 0, 0, 0));
            Assert.AreEqual(true, result);

            result = SUTest.NetmaskIsValid(new NetIpAddress(255, 255, 254, 255));
            Assert.AreEqual(false, result);

            result = SUTest.NetmaskIsValid(new NetIpAddress(253, 0, 0, 0));
            Assert.AreEqual(false, result);
        }
        public void NetmaskIsValid_FromDataSourceTestXml( )
        {
            // Access the data
            byte x1 = Convert.ToByte(TestContext.DataRow["x1"]);
            byte x2 = Convert.ToByte(TestContext.DataRow["x2"]);
            byte x3 = Convert.ToByte(TestContext.DataRow["x3"]);
            byte x4 = Convert.ToByte(TestContext.DataRow["x4"]);

            bool expected = Convert.ToBoolean(TestContext.DataRow["IsValid"]);
            bool actual   = SUTest.NetmaskIsValid(new NetIpAddress(x1, x2, x3, x4));

            Assert.AreEqual(expected, actual, "{0}.{1}.{2}.{3}", x1, x2, x3, x4);
        }