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); }
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); } }