Пример #1
0
        public void ValidatingEmptyIpAddressFails()
        {
            var sut = new ClassWithIpAddressAttribute()
            {
                Property = string.Empty
            };

            Assert.IsFalse(sut.IsValid());
        }
Пример #2
0
        public void ValidatingNullIpAddressFails()
        {
            var sut = new ClassWithIpAddressAttribute()
            {
                Property = default(string)
            };

            Assert.IsFalse(sut.IsValid());
        }
Пример #3
0
        public void ValidatingIpAddressV6Succeeds()
        {
            var sut = new ClassWithIpAddressAttribute()
            {
                Property = "fe80::295c:c42d:80ce:ba26%17"
            };

            Assert.IsTrue(sut.IsValid());
        }
Пример #4
0
        public void ValidatingIpAddressFails()
        {
            var sut = new ClassWithIpAddressAttribute()
            {
                Property = "XYZ"
            };

            Assert.IsFalse(sut.IsValid());
        }
Пример #5
0
        public void ValidatingIpAddressV4Succeeds()
        {
            var sut = new ClassWithIpAddressAttribute()
            {
                Property = "127.0.0.1"
            };

            Assert.IsTrue(sut.IsValid());
        }