Repository: dotnet/roslyn
File: src/Compilers/CSharp/Test/Syntax/Syntax/SyntaxFactoryTests.cs (C#)

Code before:
            var bracketedArgList = SyntaxFactory.ParseBracketedArgumentList("", options: parseOptions);
            Assert.Same(parseOptions, bracketedArgList.SyntaxTree.Options);

            var bracketedParamList = SyntaxFactory.ParseBracketedParameterList("", options: parseOptions);
            Assert.Same(parseOptions, bracketedParamList.SyntaxTree.Options);

            var compUnit = SyntaxFactory.ParseCompilationUnit("", options: parseOptions);
            Assert.Same(parseOptions, compUnit.SyntaxTree.Options);

            var expr = SyntaxFactory.ParseExpression("", options: parseOptions);
            Assert.Same(parseOptions, expr.SyntaxTree.Options);

            var memberDecl = SyntaxFactory.ParseMemberDeclaration("public", options: parseOptions);
            Assert.Same(parseOptions, memberDecl.SyntaxTree.Options);

            var paramList = SyntaxFactory.ParseParameterList("", options: parseOptions);
            Assert.Same(parseOptions, paramList.SyntaxTree.Options);

            var statement = SyntaxFactory.ParseStatement("", options: parseOptions);
            Assert.Same(parseOptions, statement.SyntaxTree.Options);

            var typeName = SyntaxFactory.ParseTypeName("", options: parseOptions);
            Assert.Same(parseOptions, typeName.SyntaxTree.Options);
        }

        [Fact, WorkItem(17637, "https://github.com/dotnet/roslyn/issues/17637")]
        public void Identifier_Null_ThrowsArgumentNullException()
        {
            Assert.Throws<ArgumentNullException>(() => SyntaxFactory.Identifier(null));
        }

        [Fact, WorkItem(17637, "https://github.com/dotnet/roslyn/issues/17637")]
        public void Identifier_WithTrivia_NullText_ThrowsArgumentNullException()
        {
            Assert.Throws<ArgumentNullException>(() => 
                SyntaxFactory.Identifier(SyntaxFactory.TriviaList(), null, SyntaxFactory.TriviaList()));
        }

        [Fact, WorkItem(17637, "https://github.com/dotnet/roslyn/issues/17637")]
        public void Identifier_WithContextualKind_NullText_ThrowsArgumentNullException()
        {
            Assert.Throws<ArgumentNullException>(() => 
                SyntaxFactory.Identifier(SyntaxFactory.TriviaList(), SyntaxKind.IdentifierName, null, "value", SyntaxFactory.TriviaList()));
        }

        [Fact, WorkItem(17637, "https://github.com/dotnet/roslyn/issues/17637")]
        public void Identifier_WithContextualKind_NullValueText_ThrowsArgumentNullException()
        {
            Assert.Throws<ArgumentNullException>(() => 
                SyntaxFactory.Identifier(SyntaxFactory.TriviaList(), SyntaxKind.IdentifierName, "text", null, SyntaxFactory.TriviaList()));
        }

Review comment (suggestion):
@copilot you don't need the initial number argument with `WorkItem(num, "...")`.  It's already in the url string.  Please remove the first argument from all of these workitem attributes. #Closed

Code after:
            var bracketedArgList = SyntaxFactory.ParseBracketedArgumentList("", options: parseOptions);
            Assert.Same(parseOptions, bracketedArgList.SyntaxTree.Options);

            var bracketedParamList = SyntaxFactory.ParseBracketedParameterList("", options: parseOptions);
            Assert.Same(parseOptions, bracketedParamList.SyntaxTree.Options);

            var compUnit = SyntaxFactory.ParseCompilationUnit("", options: parseOptions);
            Assert.Same(parseOptions, compUnit.SyntaxTree.Options);

            var expr = SyntaxFactory.ParseExpression("", options: parseOptions);
            Assert.Same(parseOptions, expr.SyntaxTree.Options);

            var memberDecl = SyntaxFactory.ParseMemberDeclaration("public", options: parseOptions);
            Assert.Same(parseOptions, memberDecl.SyntaxTree.Options);

            var paramList = SyntaxFactory.ParseParameterList("", options: parseOptions);
            Assert.Same(parseOptions, paramList.SyntaxTree.Options);

            var statement = SyntaxFactory.ParseStatement("", options: parseOptions);
            Assert.Same(parseOptions, statement.SyntaxTree.Options);

            var typeName = SyntaxFactory.ParseTypeName("", options: parseOptions);
            Assert.Same(parseOptions, typeName.SyntaxTree.Options);
        }

        [Fact, WorkItem("https://github.com/dotnet/roslyn/issues/17637")]
        public void Identifier_Null_ThrowsArgumentNullException()
        {
            Assert.Throws<ArgumentNullException>(() => SyntaxFactory.Identifier(text: null));
            Assert.Throws<ArgumentNullException>(() =>
                SyntaxFactory.Identifier(SyntaxFactory.TriviaList(), text: null, SyntaxFactory.TriviaList()));
            Assert.Throws<ArgumentNullException>(() =>
                SyntaxFactory.Identifier(SyntaxFactory.TriviaList(), SyntaxKind.IdentifierName, text: null, valueText: "value", SyntaxFactory.TriviaList()));
            Assert.Throws<ArgumentNullException>(() =>
                SyntaxFactory.Identifier(SyntaxFactory.TriviaList(), SyntaxKind.IdentifierName, text: "text", valueText: null, SyntaxFactory.TriviaList()));
            Assert.Throws<ArgumentNullException>(() =>
                SyntaxFactory.VerbatimIdentifier(SyntaxFactory.TriviaList(), text: null, valueText: "value", SyntaxFactory.TriviaList()));
            Assert.Throws<ArgumentNullException>(() =>
                SyntaxFactory.VerbatimIdentifier(SyntaxFactory.TriviaList(), text: "text", valueText: null, SyntaxFactory.TriviaList()));
        }
    }
}