Exemple #1
0
        void test_method_hostmask()
        {
            var prefix = Prefix32.create(8).unwrap();

            Xunit.Assert.Equal("0.255.255.255",
                               IpV4.from_u32((UInt32)prefix.host_mask(), 0).unwrap().to_s());
        }
Exemple #2
0
 void test_classmethod_parse_u32()
 {
     foreach (var kp in setup().decimal_values)
     {
         var addr     = kp.Key;
         var value    = kp.Value;
         var ip       = IpV4.from_u32(value, 32).unwrap();
         var splitted = addr.Split(new string[] { "/" }, StringSplitOptions.None);
         var ip2      = ip.change_prefix(uint.Parse(splitted[1])).unwrap();
         Assert.Equal(ip2.to_string(), addr);
     }
 }