Ejemplo n.º 1
0
        public void SerialzeAndDeserilize(String input)
        {
            IPv6Address address = IPv6Address.FromString(input);

            JSONBasedSerializer serializer = new JSONBasedSerializer();

            var serilizedValue = serializer.Seralize(address);

            Assert.Equal(serilizedValue, "\"" + input + "\"");
            IPv6Address actual = serializer.Deserialze <IPv6Address>(serilizedValue);

            Assert.Equal(address, actual);
        }
Ejemplo n.º 2
0
        public void SerialzeAndDeserilize()
        {
            JSONBasedSerializer serializer = new JSONBasedSerializer();

            for (Byte i = 0; i <= 128; i++)
            {
                IPv6SubnetMask mask = new IPv6SubnetMask(new IPv6SubnetMaskIdentifier(i));

                var serilizedValue = serializer.Seralize(mask);
                Assert.Equal($"\"{i}\"", serilizedValue);
                IPv6SubnetMask actual = serializer.Deserialze <IPv6SubnetMask>(serilizedValue);

                Assert.Equal(mask, actual);
            }
        }