示例#1
0
        public void IdentifierSanitizationOfGraphqlName(GraphqlName s)
        {
            var sanitized = NameSanitizer.SanitizeCsharpName(s.Name, null);

            Assert.True(SyntaxFacts.IsValidIdentifier(sanitized));
            Assert.True(SyntaxFacts.IsValidIdentifier(s.Name));
            Assert.Equal(sanitized, s.Name);
        }
示例#2
0
        public void IdentifierSanitization(AnyString anyString)
        {
            var sanitized = NameSanitizer.SanitizeCsharpName(anyString.Val, null);

            Assert.True(SyntaxFacts.IsValidIdentifier(sanitized));
            if (SyntaxFacts.IsValidIdentifier(anyString.Val))
            {
                Assert.Equal(sanitized, anyString.Val);
            }
        }