diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common/Language/IntegrationTests/IntegrationTestBase.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common/Language/IntegrationTests/IntegrationTestBase.cs index fa8d6cf1a5..4cb0df598b 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common/Language/IntegrationTests/IntegrationTestBase.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common/Language/IntegrationTests/IntegrationTestBase.cs @@ -1,6 +1,8 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +#nullable enable + using System; using System.Collections.Generic; using System.IO; @@ -117,7 +119,7 @@ namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests { } - protected CSharpSyntaxTree AddCSharpSyntaxTree(string text, string filePath = null) + protected CSharpSyntaxTree AddCSharpSyntaxTree(string text, string? filePath = null) { var syntaxTree = (CSharpSyntaxTree)CSharpSyntaxTree.ParseText(text, CSharpParseOptions, path: filePath); CSharpSyntaxTrees.Add(syntaxTree); @@ -164,7 +166,7 @@ namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests return projectItem; } - protected RazorProjectItem CreateProjectItemFromFile(string filePath = null, string fileKind = null) + protected RazorProjectItem CreateProjectItemFromFile(string? filePath = null, string? fileKind = null) { if (FileName == null) { @@ -297,14 +299,14 @@ namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests return compilation; } - protected RazorProjectEngine CreateProjectEngine(Action configure = null) + protected RazorProjectEngine CreateProjectEngine(Action? configure = null) { var compilation = CreateCompilation(); var references = compilation.References.Concat(new[] { compilation.ToMetadataReference(), }).ToArray(); return CreateProjectEngine(Configuration, references, configure); } - private RazorProjectEngine CreateProjectEngine(RazorConfiguration configuration, MetadataReference[] references, Action configure) + private RazorProjectEngine CreateProjectEngine(RazorConfiguration configuration, MetadataReference[] references, Action? configure) { return RazorProjectEngine.Create(configuration, FileSystem, b => {