public void IsValid()
 {
     var v = new EANAttribute();
     Assert.IsTrue(v.IsValid("9782266156066" , null));
     Assert.IsTrue(v.IsValid(9782266156066, null));
     Assert.IsTrue(v.IsValid(9782266156066U, null));
     Assert.IsTrue(v.IsValid(9782266156066D, null));
     Assert.IsTrue(v.IsValid(null, null));
     Assert.IsTrue(v.IsValid(new Ean13("97","822661","5606"), null));
     Assert.IsFalse(v.IsValid("", null));
     Assert.IsFalse(v.IsValid("9782266156067", null));
     Assert.IsFalse(v.IsValid("12345678901234", null));
     Assert.IsFalse(v.IsValid(9782266156067, null));
 }
        private static Attribute ConvertToEAN(XmlNhvmRuleConverterArgs rule)
        {
            NhvmEan eanRule = (NhvmEan)rule.schemaRule;
            EANAttribute thisAttribute = new EANAttribute();
            log.Info("Converting to EANAttribute");

            if (eanRule.message != null)
            {
                thisAttribute.Message = eanRule.message;
            }
            AssignTagsFromString(thisAttribute, eanRule.tags);

            return thisAttribute;
        }