public void IsValidCsdlNamespaceName_returns_false_for_invalid_Csdl_namespace()
 {
     Assert.False(EscherAttributeContentValidator.IsValidCsdlNamespaceName(new string('a', 513)));
     Assert.False(EscherAttributeContentValidator.IsValidCsdlNamespaceName("Name\u0000space"));
     Assert.False(EscherAttributeContentValidator.IsValidCsdlNamespaceName(""));
     Assert.False(EscherAttributeContentValidator.IsValidCsdlNamespaceName(".Namespace"));
     Assert.False(EscherAttributeContentValidator.IsValidCsdlNamespaceName("Namespace."));
 }
        /// <summary>
        ///     Returns the static instance of the EscherAttributeContentValidator
        /// </summary>
        internal static EscherAttributeContentValidator GetInstance(Version schemaVersion)
        {
            if (_instances == null)
            {
                _instances = new Dictionary <Version, EscherAttributeContentValidator>(3);
            }

            if (!_instances.ContainsKey(schemaVersion))
            {
                _instances[schemaVersion] = new EscherAttributeContentValidator();
            }
            return(_instances[schemaVersion]);
        }
        /// <summary>
        ///     Returns the static instance of the EscherAttributeContentValidator
        /// </summary>
        internal static EscherAttributeContentValidator GetInstance(Version schemaVersion)
        {
            if (_instances == null)
            {
                _instances = new Dictionary<Version, EscherAttributeContentValidator>(3);
            }

            if (!_instances.ContainsKey(schemaVersion))
            {
                _instances[schemaVersion] = new EscherAttributeContentValidator();
            }
            return _instances[schemaVersion];
        }
 public void IsValidCsdlNamespaceName_returns_true_for_valid_Csdl_namespace()
 {
     Assert.True(EscherAttributeContentValidator.IsValidCsdlNamespaceName("Model1.Namespace.Edm"));
     Assert.True(EscherAttributeContentValidator.IsValidCsdlNamespaceName("Model1NamespaceEdm"));
     Assert.True(EscherAttributeContentValidator.IsValidCsdlNamespaceName(new string('a', 512)));
 }
 public void IsValidAttributeValue_returns_true_if_the_value_contains_only_valid_xml_characters()
 {
     Assert.True(EscherAttributeContentValidator.IsValidXmlAttributeValue("<>&AAA"));
 }
 public void IsValidAttributeValue_returns_false_if_the_value_contains_invalid_xml_characters()
 {
     Assert.False(EscherAttributeContentValidator.IsValidXmlAttributeValue("\u0000"));
 }