Ejemplo n.º 1
0
        bool ValidateNamespace()
        {
            if (String.IsNullOrEmpty(defaultNameSpace))
            {
                ServiceDescriptionMessage = "No namespace specified.";
                return(false);
            }

            if (!WebReference.IsValidNamespace(defaultNameSpace) || !WebReference.IsValidReferenceName(defaultNameSpace))
            {
                ServiceDescriptionMessage = "Namespace contains invalid characters.";
            }
            return(true);
        }
 public void InvalidReferenceName()
 {
     Assert.IsFalse(WebReference.IsValidNamespace("Test.10.4.4.4"));
 }
 public void SecondCharacterCanBeADot()
 {
     Assert.IsTrue(WebReference.IsValidNamespace("a.b"));
 }
 public void FirstCharacterCanBeAnUnderscore()
 {
     Assert.IsTrue(WebReference.IsValidNamespace("_aa"));
 }
 public void SecondCharacterCanBeAnUnderscore()
 {
     Assert.IsTrue(WebReference.IsValidNamespace("a_"));
 }
 public void SecondCharacterCanBeANumber()
 {
     Assert.IsTrue(WebReference.IsValidNamespace("a8"));
 }
 public void FirstCharacterCannotBeANumber()
 {
     Assert.IsFalse(WebReference.IsValidNamespace("8abc"));
 }
 public void EmptyStringIsNotValid()
 {
     Assert.IsFalse(WebReference.IsValidNamespace(String.Empty));
 }
 public void ValidWebReferenceName()
 {
     Assert.IsTrue(WebReference.IsValidNamespace("a"));
 }