96 writes to Text
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (96)
LexicalAndXml\PreprocessorTests.cs (96)
2400
VerifyDirectivesSpecial(node, new DirectiveInfo { Kind = SyntaxKind.DefineDirectiveTrivia, Status = NodeStatus.IsActive,
Text
= defSym });
2416
VerifyDirectivesSpecial(node, new DirectiveInfo { Kind = SyntaxKind.DefineDirectiveTrivia, Status = NodeStatus.IsActive,
Text
= "XXX" });
2447
new DirectiveInfo { Kind = SyntaxKind.DefineDirectiveTrivia, Status = NodeStatus.IsActive,
Text
= "XXX" },
2466
new DirectiveInfo { Kind = SyntaxKind.DefineDirectiveTrivia, Status = NodeStatus.IsNotActive,
Text
= "XXX" },
2485
new DirectiveInfo { Kind = SyntaxKind.DefineDirectiveTrivia, Status = NodeStatus.IsNotActive,
Text
= defSym },
2506
new DirectiveInfo { Kind = SyntaxKind.DefineDirectiveTrivia, Status = NodeStatus.IsActive,
Text
= defSym },
2521
new DirectiveInfo { Kind = SyntaxKind.DefineDirectiveTrivia, Status = NodeStatus.IsActive,
Text
= string.Empty });
2534
new DirectiveInfo { Kind = SyntaxKind.DefineDirectiveTrivia, Status = NodeStatus.IsActive,
Text
= string.Empty });
2547
new DirectiveInfo { Kind = SyntaxKind.DefineDirectiveTrivia, Status = NodeStatus.IsActive,
Text
= "GOO" });
2561
VerifyDirectivesSpecial(node, new DirectiveInfo { Kind = SyntaxKind.UndefDirectiveTrivia, Status = NodeStatus.IsActive,
Text
= defSym });
2577
VerifyDirectivesSpecial(node, new DirectiveInfo { Kind = SyntaxKind.UndefDirectiveTrivia, Status = NodeStatus.IsActive,
Text
= "XXX" });
2608
new DirectiveInfo { Kind = SyntaxKind.UndefDirectiveTrivia, Status = NodeStatus.IsActive,
Text
= "XXX" },
2629
new DirectiveInfo { Kind = SyntaxKind.DefineDirectiveTrivia, Status = NodeStatus.IsNotActive,
Text
= "Z" },
2658
new DirectiveInfo { Kind = SyntaxKind.DefineDirectiveTrivia, Status = NodeStatus.IsNotActive,
Text
= "A" },
2660
new DirectiveInfo { Kind = SyntaxKind.DefineDirectiveTrivia, Status = NodeStatus.IsNotActive,
Text
= "B" },
2689
new DirectiveInfo { Kind = SyntaxKind.DefineDirectiveTrivia, Status = NodeStatus.IsNotActive,
Text
= "Z" },
2691
new DirectiveInfo { Kind = SyntaxKind.DefineDirectiveTrivia, Status = NodeStatus.IsNotActive,
Text
= "Z" },
2720
new DirectiveInfo { Kind = SyntaxKind.DefineDirectiveTrivia, Status = NodeStatus.IsNotActive,
Text
= "Z" },
2723
new DirectiveInfo { Kind = SyntaxKind.DefineDirectiveTrivia, Status = NodeStatus.IsNotActive,
Text
= "Z" },
2746
new DirectiveInfo { Kind = SyntaxKind.UndefDirectiveTrivia, Status = NodeStatus.IsNotActive,
Text
= "XXX" },
2764
new DirectiveInfo { Kind = SyntaxKind.UndefDirectiveTrivia, Status = NodeStatus.IsNotActive,
Text
= "ZZZ" },
2784
new DirectiveInfo { Kind = SyntaxKind.UndefDirectiveTrivia, Status = NodeStatus.IsActive,
Text
= defSym },
2798
VerifyDirectivesSpecial(node, new DirectiveInfo { Kind = SyntaxKind.UndefDirectiveTrivia, Status = NodeStatus.IsActive,
Text
= string.Empty });
2809
VerifyDirectivesSpecial(node, new DirectiveInfo { Kind = SyntaxKind.UndefDirectiveTrivia, Status = NodeStatus.IsActive,
Text
= string.Empty });
2820
VerifyDirectivesSpecial(node, new DirectiveInfo { Kind = SyntaxKind.UndefDirectiveTrivia, Status = NodeStatus.IsActive,
Text
= "GOO" });
2833
VerifyDirectivesSpecial(node, new DirectiveInfo { Kind = SyntaxKind.DefineDirectiveTrivia, Status = NodeStatus.IsActive,
Text
= "A_1" });
2844
VerifyDirectivesSpecial(node, new DirectiveInfo { Kind = SyntaxKind.UndefDirectiveTrivia, Status = NodeStatus.IsActive,
Text
= "" });
2863
VerifyErrorSpecial(node, new DirectiveInfo { Number = (int)ErrorCode.WRN_WarningDirective,
Text
= "#warning: 'W1'" });
2865
new DirectiveInfo { Kind = SyntaxKind.DefineDirectiveTrivia, Status = NodeStatus.IsActive,
Text
= "error" },
2870
new DirectiveInfo { Kind = SyntaxKind.UndefDirectiveTrivia, Status = NodeStatus.IsActive,
Text
= "error" },
2897
new DirectiveInfo { Kind = SyntaxKind.DefineDirectiveTrivia, Status = NodeStatus.IsActive,
Text
= "if" },
2898
new DirectiveInfo { Kind = SyntaxKind.DefineDirectiveTrivia, Status = NodeStatus.IsActive,
Text
= "else" },
2899
new DirectiveInfo { Kind = SyntaxKind.DefineDirectiveTrivia, Status = NodeStatus.IsActive,
Text
= "elif" },
2900
new DirectiveInfo { Kind = SyntaxKind.DefineDirectiveTrivia, Status = NodeStatus.IsActive,
Text
= "endif" },
2901
new DirectiveInfo { Kind = SyntaxKind.DefineDirectiveTrivia, Status = NodeStatus.IsActive,
Text
= "region" },
2902
new DirectiveInfo { Kind = SyntaxKind.DefineDirectiveTrivia, Status = NodeStatus.IsActive,
Text
= "endregion" },
2903
new DirectiveInfo { Kind = SyntaxKind.DefineDirectiveTrivia, Status = NodeStatus.IsActive,
Text
= "define" },
2904
new DirectiveInfo { Kind = SyntaxKind.DefineDirectiveTrivia, Status = NodeStatus.IsActive,
Text
= "undef" },
2905
new DirectiveInfo { Kind = SyntaxKind.DefineDirectiveTrivia, Status = NodeStatus.IsActive,
Text
= "warning" },
2906
new DirectiveInfo { Kind = SyntaxKind.DefineDirectiveTrivia, Status = NodeStatus.IsActive,
Text
= "error" },
2907
new DirectiveInfo { Kind = SyntaxKind.DefineDirectiveTrivia, Status = NodeStatus.IsActive,
Text
= "line" },
2908
new DirectiveInfo { Kind = SyntaxKind.DefineDirectiveTrivia, Status = NodeStatus.IsActive,
Text
= "pragma" },
2909
new DirectiveInfo { Kind = SyntaxKind.DefineDirectiveTrivia, Status = NodeStatus.IsActive,
Text
= "reference" });
2935
new DirectiveInfo { Kind = SyntaxKind.DefineDirectiveTrivia, Status = NodeStatus.IsActive,
Text
= "" },
2936
new DirectiveInfo { Kind = SyntaxKind.DefineDirectiveTrivia, Status = NodeStatus.IsActive,
Text
= "" },
2937
new DirectiveInfo { Kind = SyntaxKind.DefineDirectiveTrivia, Status = NodeStatus.IsActive,
Text
= "" },
2938
new DirectiveInfo { Kind = SyntaxKind.DefineDirectiveTrivia, Status = NodeStatus.IsActive,
Text
= "" },
2939
new DirectiveInfo { Kind = SyntaxKind.DefineDirectiveTrivia, Status = NodeStatus.IsActive,
Text
= "" },
2940
new DirectiveInfo { Kind = SyntaxKind.DefineDirectiveTrivia, Status = NodeStatus.IsActive,
Text
= "" },
2941
new DirectiveInfo { Kind = SyntaxKind.DefineDirectiveTrivia, Status = NodeStatus.IsActive,
Text
= "" });
2955
VerifyErrorSpecial(node, new DirectiveInfo { Number = (int)ErrorCode.ERR_ErrorDirective,
Text
= "#error: 'Your monkey is alive'" });
2966
VerifyErrorSpecial(node, new DirectiveInfo { Number = (int)ErrorCode.WRN_WarningDirective,
Text
= "#warning: 'Your monkey is alive'" });
3019
VerifyErrorSpecial(node, new DirectiveInfo { Number = (int)ErrorCode.WRN_WarningDirective,
Text
= "#warning: 'W4'" });
3111
VerifyErrorSpecial(node, new DirectiveInfo { Number = (int)ErrorCode.ERR_ErrorDirective,
Text
= "#error: ''" });
3122
VerifyErrorSpecial(node, new DirectiveInfo { Number = (int)ErrorCode.WRN_WarningDirective,
Text
= "#warning: ''" });
3133
VerifyErrorSpecial(node, new DirectiveInfo { Number = (int)ErrorCode.ERR_ErrorDirective,
Text
= "#error: 'abc def'" });
3144
VerifyErrorSpecial(node, new DirectiveInfo { Number = (int)ErrorCode.ERR_ErrorDirective,
Text
= "#error: 'abc def '" });
3155
VerifyErrorSpecial(node, new DirectiveInfo { Number = (int)ErrorCode.ERR_ErrorDirective,
Text
= "#error: '/*abc def*/ '" });
3166
VerifyErrorSpecial(node, new DirectiveInfo { Number = (int)ErrorCode.ERR_ErrorDirective,
Text
= "#error: '/*abc def*/ '" });
3177
VerifyErrorSpecial(node, new DirectiveInfo { Number = (int)ErrorCode.ERR_ErrorDirective,
Text
= "#error: '/*abc def '" });
3190
VerifyErrorSpecial(node, new DirectiveInfo { Number = (int)ErrorCode.ERR_ErrorDirective,
Text
= string.Format("#error: '{0}'", errorText) });
3238
Text
= "version"
3261
Text
= "version:7.1"
3284
Text
= "version:A.B"
3301
VerifyErrorSpecial(node, new DirectiveInfo { Number = (int)ErrorCode.ERR_ErrorDirective,
Text
= "#error: '\"'" });
3312
VerifyErrorSpecial(node, new DirectiveInfo { Number = (int)ErrorCode.ERR_ErrorDirective,
Text
= "#error: '\"goo\"'" });
3323
VerifyErrorSpecial(node, new DirectiveInfo { Number = (int)ErrorCode.ERR_ErrorDirective,
Text
= "#error: '\"\"'" });
3334
VerifyErrorSpecial(node, new DirectiveInfo { Number = (int)ErrorCode.ERR_ErrorDirective,
Text
= "#error: '\"\"\"'" });
3359
VerifyDirectivesSpecial(node, new DirectiveInfo { Kind = SyntaxKind.LineDirectiveTrivia, Status = NodeStatus.IsActive, Number = 1000,
Text
= "bogus.cs" });
3454
VerifyDirectivesSpecial(node, new DirectiveInfo { Kind = SyntaxKind.LineDirectiveTrivia, Status = NodeStatus.IsActive,
Text
= "bogus.cs" });
3465
VerifyDirectivesSpecial(node, new DirectiveInfo { Kind = SyntaxKind.LineDirectiveTrivia, Status = NodeStatus.IsActive, Number = 16707566,
Text
= "XYZ" });
3527
VerifyDirectivesSpecial(node, new DirectiveInfo { Kind = SyntaxKind.LineDirectiveTrivia, Status = NodeStatus.IsActive, Number = 1000,
Text
= "bogus.cs" });
3537
VerifyDirectivesSpecial(node, new DirectiveInfo { Kind = SyntaxKind.LineDirectiveTrivia, Status = NodeStatus.IsActive, Number = 12345,
Text
= "bogus.cs" });
3555
VerifyDirectivesSpecial(tree.GetCompilationUnitRoot(), new DirectiveInfo { Kind = SyntaxKind.LineDirectiveTrivia, Status = NodeStatus.IsActive, Number = 100,
Text
= "test.cs" });
4306
Text
= "bogus"
4321
Text
= "bogus"
4409
Text
= "bogus"
4439
Text
= ""
4453
Text
= "bogus"
4469
VerifyDirectivesSpecial(node, new DirectiveInfo { Kind = SyntaxKind.NullableDirectiveTrivia, Status = NodeStatus.IsActive,
Text
= "enable" });
4480
VerifyDirectivesSpecial(node, new DirectiveInfo { Kind = SyntaxKind.NullableDirectiveTrivia, Status = NodeStatus.IsActive,
Text
= "restore" });
4491
VerifyDirectivesSpecial(node, new DirectiveInfo { Kind = SyntaxKind.NullableDirectiveTrivia, Status = NodeStatus.IsActive,
Text
= "enable" });
4502
VerifyDirectivesSpecial(node, new DirectiveInfo { Kind = SyntaxKind.NullableDirectiveTrivia, Status = NodeStatus.IsActive,
Text
= "disable" });
4513
VerifyDirectivesSpecial(node, new DirectiveInfo { Kind = SyntaxKind.NullableDirectiveTrivia, Status = NodeStatus.IsActive,
Text
= "enable warnings" });
4524
VerifyDirectivesSpecial(node, new DirectiveInfo { Kind = SyntaxKind.NullableDirectiveTrivia, Status = NodeStatus.IsActive,
Text
= "enable annotations" });
4535
VerifyDirectivesSpecial(node, new DirectiveInfo { Kind = SyntaxKind.NullableDirectiveTrivia, Status = NodeStatus.IsActive,
Text
= "disable warnings" });
4546
VerifyDirectivesSpecial(node, new DirectiveInfo { Kind = SyntaxKind.NullableDirectiveTrivia, Status = NodeStatus.IsActive,
Text
= "disable" });
4565
VerifyDirectivesSpecial(root, new DirectiveInfo { Kind = SyntaxKind.NullableDirectiveTrivia, Status = NodeStatus.IsActive,
Text
= "enable" });
4582
VerifyDirectivesSpecial(node, new DirectiveInfo { Kind = SyntaxKind.NullableDirectiveTrivia, Status = NodeStatus.IsActive,
Text
= "" });
4593
VerifyDirectivesSpecial(node, new DirectiveInfo { Kind = SyntaxKind.NullableDirectiveTrivia, Status = NodeStatus.IsActive,
Text
= "disable" });
4604
VerifyDirectivesSpecial(node, new DirectiveInfo { Kind = SyntaxKind.NullableDirectiveTrivia, Status = NodeStatus.IsActive,
Text
= "" });
4615
VerifyDirectivesSpecial(node, new DirectiveInfo { Kind = SyntaxKind.NullableDirectiveTrivia, Status = NodeStatus.IsActive,
Text
= "" });
4632
new DirectiveInfo { Kind = SyntaxKind.NullableDirectiveTrivia, Status = NodeStatus.IsActive,
Text
= "enable" },
4634
new DirectiveInfo { Kind = SyntaxKind.NullableDirectiveTrivia, Status = NodeStatus.IsNotActive,
Text
= "enable" },
4636
new DirectiveInfo { Kind = SyntaxKind.NullableDirectiveTrivia, Status = NodeStatus.IsActive,
Text
= "disable" });
4652
new DirectiveInfo { Kind = SyntaxKind.NullableDirectiveTrivia, Status = NodeStatus.IsNotActive,
Text
= "" },
17 references to Text
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (17)
LexicalAndXml\PreprocessorTests.cs (17)
192
if (null != exp.
Text
)
194
Assert.Equal(exp.
Text
, ((DefineDirectiveTriviaSyntax)dt).Name.ValueText); // Text
198
if (null != exp.
Text
)
200
Assert.Equal(exp.
Text
, ((ErrorDirectiveTriviaSyntax)dt).EndOfDirectiveToken.ToFullString());
204
if (null != exp.
Text
)
206
Assert.Equal(exp.
Text
, ((LoadDirectiveTriviaSyntax)dt).File.ValueText);
210
if (null != exp.
Text
)
212
Assert.Equal(exp.
Text
, ((UndefDirectiveTriviaSyntax)dt).Name.ValueText);
216
if (null != exp.
Text
)
218
Assert.Equal(exp.
Text
, ((ReferenceDirectiveTriviaSyntax)dt).File.ValueText);
245
if (null == exp.
Text
)
252
Assert.Equal(exp.
Text
, ld.File.Value);
259
if (null == exp.
Text
)
272
Assert.Equal(exp.
Text
, actualText);
284
if (null != exp.
Text
)
426
if (expected.
Text
!= null)
428
Assert.Equal(expected.
Text
, actual.GetMessage(CultureInfo.InvariantCulture));