258 references to TestMode
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (256)
TypeInferrer\TypeInferrerTests.cs (256)
25
protected override async Task TestWorkerAsync(Document document, TextSpan textSpan, string expectedType,
TestMode
mode)
33
if (mode ==
TestMode
.Position)
47
private async Task TestInClassAsync(string text, string expectedType,
TestMode
mode)
58
private async Task TestInMethodAsync(string text, string expectedType,
TestMode
mode)
96
TestMode
.Node);
100
public async Task TestConditional2(
TestMode
mode)
107
public async Task TestConditional3(
TestMode
mode)
114
public async Task TestVariableDeclarator1(
TestMode
mode)
121
public async Task TestVariableDeclarator2(
TestMode
mode)
128
public async Task TestVariableDeclaratorNullableReferenceType(
TestMode
mode)
141
@"var q = [|Goo()|] ?? 1;", "global::System.Int32?",
TestMode
.Node);
145
public async Task TestCoalesce2(
TestMode
mode)
155
public async Task TestCoalesce3(
TestMode
mode)
168
@"var q = [|Goo()|] ?? string.Empty;", "global::System.String?",
TestMode
.Node);
181
""", "ErrorType",
TestMode
.Node);
185
public async Task TestBinaryExpression1(
TestMode
mode)
195
public async Task TestBinaryExpression2(
TestMode
mode)
205
public async Task TestBinaryOperator1(
TestMode
mode)
212
public async Task TestBinaryOperator2(
TestMode
mode)
219
public async Task TestBinaryOperator3(
TestMode
mode)
226
public async Task TestAssignmentOperator3(
TestMode
mode)
233
public async Task TestAssignmentOperator4(
TestMode
mode)
241
public async Task TestOverloadedConditionalLogicalOperatorsInferBool(
TestMode
mode)
274
public async Task TestConditionalLogicalOrOperatorAlwaysInfersBool(
TestMode
mode)
291
public async Task TestConditionalLogicalAndOperatorAlwaysInfersBool(
TestMode
mode)
319
await TestAsync(text, "global::System.Boolean",
TestMode
.Node);
335
await TestAsync(text, "global::System.Boolean",
TestMode
.Node);
340
public async Task TestLogicalOrOperatorInference3(
TestMode
mode)
372
await TestAsync(text, "Program",
TestMode
.Node);
377
public async Task TestLogicalOrOperatorInference5(
TestMode
mode)
409
await TestAsync(text, "global::System.Int32",
TestMode
.Node);
414
public async Task TestLogicalOrOperatorInference7(
TestMode
mode)
442
await TestAsync(text, "global::System.Boolean",
TestMode
.Node);
458
await TestAsync(text, "global::System.Boolean",
TestMode
.Node);
463
public async Task TestLogicalAndOperatorInference3(
TestMode
mode)
495
await TestAsync(text, "Program",
TestMode
.Node);
500
public async Task TestLogicalAndOperatorInference5(
TestMode
mode)
532
await TestAsync(text, "global::System.Int32",
TestMode
.Node);
537
public async Task TestLogicalAndOperatorInference7(
TestMode
mode)
565
await TestAsync(text, "global::System.Boolean",
TestMode
.Node);
581
await TestAsync(text, "global::System.Boolean",
TestMode
.Node);
586
public async Task TestLogicalXorOperatorInference3(
TestMode
mode)
618
await TestAsync(text, "Program",
TestMode
.Node);
623
public async Task TestLogicalXorOperatorInference5(
TestMode
mode)
655
await TestAsync(text, "global::System.Int32",
TestMode
.Node);
660
public async Task TestLogicalXorOperatorInference7(
TestMode
mode)
677
public async Task TestLogicalOrEqualsOperatorInference1(
TestMode
mode)
694
public async Task TestLogicalOrEqualsOperatorInference2(
TestMode
mode)
711
public async Task TestLogicalAndEqualsOperatorInference1(
TestMode
mode)
728
public async Task TestLogicalAndEqualsOperatorInference2(
TestMode
mode)
745
public async Task TestLogicalXorEqualsOperatorInference1(
TestMode
mode)
762
public async Task TestLogicalXorEqualsOperatorInference2(
TestMode
mode)
778
public async Task TestReturnInConstructor(
TestMode
mode)
790
public async Task TestReturnInDestructor(
TestMode
mode)
802
public async Task TestReturnInMethod(
TestMode
mode)
814
public async Task TestReturnInMethodNullableReference(
TestMode
mode)
827
public async Task TestReturnInVoidMethod(
TestMode
mode)
839
public async Task TestReturnInAsyncTaskOfTMethod(
TestMode
mode)
851
public async Task TestReturnInAsyncTaskOfTMethodNestedNullability(
TestMode
mode)
863
public async Task TestReturnInAsyncTaskMethod(
TestMode
mode)
875
public async Task TestReturnInAsyncVoidMethod(
TestMode
mode)
887
public async Task TestReturnInOperator(
TestMode
mode)
899
public async Task TestReturnInConversionOperator(
TestMode
mode)
911
public async Task TestReturnInPropertyGetter(
TestMode
mode)
926
public async Task TestReturnInPropertyGetterNullableReference(
TestMode
mode)
942
public async Task TestReturnInPropertySetter(
TestMode
mode)
957
public async Task TestReturnInIndexerGetter(
TestMode
mode)
972
public async Task TestReturnInIndexerGetterNullableReference(
TestMode
mode)
988
public async Task TestReturnInIndexerSetter(
TestMode
mode)
1003
public async Task TestReturnInEventAdder(
TestMode
mode)
1019
public async Task TestReturnInEventRemover(
TestMode
mode)
1035
public async Task TestReturnInLocalFunction(
TestMode
mode)
1050
public async Task TestReturnInLocalFunctionNullableReference(
TestMode
mode)
1066
public async Task TestReturnInAsyncTaskOfTLocalFunction(
TestMode
mode)
1081
public async Task TestReturnInAsyncTaskLocalFunction(
TestMode
mode)
1096
public async Task TestReturnInAsyncVoidLocalFunction(
TestMode
mode)
1111
public async Task TestExpressionBodiedConstructor(
TestMode
mode)
1118
public async Task TestExpressionBodiedDestructor(
TestMode
mode)
1125
public async Task TestExpressionBodiedMethod(
TestMode
mode)
1132
public async Task TestExpressionBodiedVoidMethod(
TestMode
mode)
1139
public async Task TestExpressionBodiedAsyncTaskOfTMethod(
TestMode
mode)
1146
public async Task TestExpressionBodiedAsyncTaskOfTMethodNullableReference(
TestMode
mode)
1156
public async Task TestExpressionBodiedAsyncTaskMethod(
TestMode
mode)
1163
public async Task TestExpressionBodiedAsyncVoidMethod(
TestMode
mode)
1170
public async Task TestExpressionBodiedOperator(
TestMode
mode)
1177
public async Task TestExpressionBodiedConversionOperator(
TestMode
mode)
1184
public async Task TestExpressionBodiedProperty(
TestMode
mode)
1191
public async Task TestExpressionBodiedIndexer(
TestMode
mode)
1198
public async Task TestExpressionBodiedPropertyGetter(
TestMode
mode)
1205
public async Task TestExpressionBodiedPropertySetter(
TestMode
mode)
1212
public async Task TestExpressionBodiedIndexerGetter(
TestMode
mode)
1219
public async Task TestExpressionBodiedIndexerSetter(
TestMode
mode)
1226
public async Task TestExpressionBodiedEventAdder(
TestMode
mode)
1233
public async Task TestExpressionBodiedEventRemover(
TestMode
mode)
1240
public async Task TestExpressionBodiedLocalFunction(
TestMode
mode)
1252
public async Task TestExpressionBodiedAsyncTaskOfTLocalFunction(
TestMode
mode)
1264
public async Task TestExpressionBodiedAsyncTaskLocalFunction(
TestMode
mode)
1276
public async Task TestExpressionBodiedAsyncVoidLocalFunction(
TestMode
mode)
1289
public async Task TestYieldReturnInMethod([CombinatorialValues("IEnumerable", "IEnumerator", "InvalidGenericType")] string returnTypeName,
TestMode
mode)
1305
public async Task TestYieldReturnInMethodNullableReference([CombinatorialValues("IEnumerable", "IEnumerator", "InvalidGenericType")] string returnTypeName,
TestMode
mode)
1322
public async Task TestYieldReturnInAsyncMethod([CombinatorialValues("IAsyncEnumerable", "IAsyncEnumerator", "InvalidGenericType")] string returnTypeName,
TestMode
mode)
1340
public async Task TestYieldReturnInvalidTypeInMethod([CombinatorialValues("int[]", "InvalidNonGenericType", "InvalidGenericType<int, int>")] string returnType,
TestMode
mode)
1355
public async Task TestYieldReturnInLocalFunction(
TestMode
mode)
1376
public async Task TestYieldReturnInPropertyGetter(
TestMode
mode)
1397
public async Task TestYieldReturnInPropertySetter(
TestMode
mode)
1418
public async Task TestYieldReturnAsGlobalStatement(
TestMode
mode)
1425
public async Task TestReturnInSimpleLambda(
TestMode
mode)
1437
public async Task TestReturnInParenthesizedLambda(
TestMode
mode)
1449
public async Task TestReturnInLambdaWithNullableReturn(
TestMode
mode)
1462
public async Task TestReturnInAnonymousMethod(
TestMode
mode)
1474
public async Task TestReturnInAnonymousMethodWithNullableReturn(
TestMode
mode)
1487
public async Task TestReturnInAsyncTaskOfTSimpleLambda(
TestMode
mode)
1499
public async Task TestReturnInAsyncTaskOfTParenthesizedLambda(
TestMode
mode)
1511
public async Task TestReturnInAsyncTaskOfTAnonymousMethod(
TestMode
mode)
1523
public async Task TestReturnInAsyncTaskOfTAnonymousMethodWithNullableReference(
TestMode
mode)
1536
public async Task TestReturnInAsyncTaskSimpleLambda(
TestMode
mode)
1548
public async Task TestReturnInAsyncTaskParenthesizedLambda(
TestMode
mode)
1560
public async Task TestReturnInAsyncTaskAnonymousMethod(
TestMode
mode)
1572
public async Task TestReturnInAsyncVoidSimpleLambda(
TestMode
mode)
1584
public async Task TestReturnInAsyncVoidParenthesizedLambda(
TestMode
mode)
1596
public async Task TestReturnInAsyncVoidAnonymousMethod(
TestMode
mode)
1608
public async Task TestReturnAsGlobalStatement(
TestMode
mode)
1615
public async Task TestSimpleLambda(
TestMode
mode)
1622
public async Task TestParenthesizedLambda(
TestMode
mode)
1630
public async Task TestAsyncTaskOfTSimpleLambda(
TestMode
mode)
1637
public async Task TestAsyncTaskOfTSimpleLambdaWithNullableReturn(
TestMode
mode)
1648
public async Task TestAsyncTaskOfTParenthesizedLambda(
TestMode
mode)
1656
public async Task TestAsyncTaskSimpleLambda(
TestMode
mode)
1663
public async Task TestAsyncTaskParenthesizedLambda(
TestMode
mode)
1670
public async Task TestAsyncVoidSimpleLambda(
TestMode
mode)
1677
public async Task TestAsyncVoidParenthesizedLambda(
TestMode
mode)
1684
public async Task TestExpressionTreeSimpleLambda(
TestMode
mode)
1691
public async Task TestExpressionTreeParenthesizedLambda(
TestMode
mode)
1698
public async Task TestThrow(
TestMode
mode)
1705
public async Task TestCatch(
TestMode
mode)
1709
public async Task TestIf(
TestMode
mode)
1713
public async Task TestWhile(
TestMode
mode)
1717
public async Task TestDo(
TestMode
mode)
1721
public async Task TestFor1(
TestMode
mode)
1732
public async Task TestFor2(
TestMode
mode)
1736
public async Task TestFor3(
TestMode
mode)
1740
public async Task TestForNullableReference(
TestMode
mode)
1750
public async Task TestUsing1(
TestMode
mode)
1754
public async Task TestUsing2(
TestMode
mode)
1758
public async Task TestUsing3(
TestMode
mode)
1762
public async Task TestForEach(
TestMode
mode)
1766
public async Task TestForEachNullableElements(
TestMode
mode)
1776
public async Task TestPrefixExpression1(
TestMode
mode)
1783
public async Task TestPrefixExpression2(
TestMode
mode)
1790
public async Task TestPrefixExpression3(
TestMode
mode)
1797
public async Task TestPrefixExpression4(
TestMode
mode)
1804
public async Task TestPrefixExpression5(
TestMode
mode)
1811
public async Task TestArrayRankSpecifier(
TestMode
mode)
1818
public async Task TestSwitch1(
TestMode
mode)
1822
public async Task TestSwitch2(
TestMode
mode)
1826
public async Task TestSwitch3(
TestMode
mode)
1830
public async Task TestMethodCall1(
TestMode
mode)
1837
public async Task TestMethodCall2(
TestMode
mode)
1851
public async Task TestMethodCall3(
TestMode
mode)
1865
public async Task TestMethodCall4(
TestMode
mode)
1879
public async Task TestMethodCall5(
TestMode
mode)
1893
public async Task TestMethodCallNullableReference(
TestMode
mode)
1907
public async Task TestConstructorCall1(
TestMode
mode)
1914
public async Task TestConstructorCall2(
TestMode
mode)
1930
public async Task TestConstructorCall3(
TestMode
mode)
1946
public async Task TestConstructorCall4(
TestMode
mode)
1962
public async Task TestConstructorCall5(
TestMode
mode)
1978
public async Task TestConstructorCallNullableParameter(
TestMode
mode)
1996
public async Task TestThisConstructorInitializer1(
TestMode
mode)
2010
public async Task TestThisConstructorInitializer2(
TestMode
mode)
2024
public async Task TestThisConstructorInitializerNullableParameter(
TestMode
mode)
2040
public async Task TestBaseConstructorInitializer(
TestMode
mode)
2061
public async Task TestBaseConstructorInitializerNullableParameter(
TestMode
mode)
2084
public async Task TestIndexAccess1(
TestMode
mode)
2095
public async Task TestIndexerCall1(
TestMode
mode)
2099
public async Task TestIndexerCall2(
TestMode
mode)
2113
public async Task TestIndexerCall3(
TestMode
mode)
2127
public async Task TestIndexerCall5(
TestMode
mode)
2141
public async Task TestArrayInitializerInImplicitArrayCreationSimple(
TestMode
mode)
2160
public async Task TestArrayInitializerInImplicitArrayCreation1(
TestMode
mode)
2182
public async Task TestArrayInitializerInImplicitArrayCreation2(
TestMode
mode)
2203
public async Task TestArrayInitializerInImplicitArrayCreation3(
TestMode
mode)
2222
public async Task TestArrayInitializerInImplicitArrayCreationInferredAsNullable(
TestMode
mode)
2245
public async Task TestArrayInitializerInEqualsValueClauseSimple(
TestMode
mode)
2264
public async Task TestArrayInitializerInEqualsValueClause(
TestMode
mode)
2285
public async Task TestArrayInitializerInEqualsValueClauseNullableElement(
TestMode
mode)
2307
public async Task TestCollectionInitializer1(
TestMode
mode)
2326
public async Task TestCollectionInitializerNullableElement(
TestMode
mode)
2348
public async Task TestCollectionInitializer2(
TestMode
mode)
2368
public async Task TestCollectionInitializer3(
TestMode
mode)
2408
await TestAsync(text, "global::System.Int32",
TestMode
.Node);
2413
public async Task TestCustomCollectionInitializerAddMethod2(
TestMode
mode)
2439
public async Task TestCustomCollectionInitializerAddMethod3(
TestMode
mode)
2464
public async Task TestCustomCollectionInitializerAddMethodWithNullableParameter(
TestMode
mode)
2502
await TestAsync(text, "global::A",
TestMode
.Node);
2519
await TestAsync(text, "global::A[]",
TestMode
.Position);
2536
await TestAsync(text, "global::A",
TestMode
.Node);
2553
await TestAsync(text, "global::A[][]",
TestMode
.Position);
2570
await TestAsync(text, "global::A[]",
TestMode
.Node);
2587
await TestAsync(text, "global::A[][]",
TestMode
.Position);
2591
public async Task TestArrayInference4(
TestMode
mode)
2610
public async Task TestInsideLambda2(
TestMode
mode)
2628
public async Task TestInsideLambdaNullableReturn(
TestMode
mode)
2649
public async Task TestPointer1(
TestMode
mode)
2667
public async Task TestDynamic1(
TestMode
mode)
2684
public async Task TestChecked1(
TestMode
mode)
2702
public async Task TestAwaitTaskOfT(
TestMode
mode)
2720
public async Task TestAwaitTaskOfTNullableValue(
TestMode
mode)
2741
public async Task TestAwaitTaskOfTaskOfT(
TestMode
mode)
2760
public async Task TestAwaitTask(
TestMode
mode)
2779
public async Task TestLockStatement(
TestMode
mode)
2799
public async Task TestAwaitExpressionInLockStatement(
TestMode
mode)
2819
public async Task TestReturnFromAsyncTaskOfT(
TestMode
mode)
2838
public async Task TestAttributeArguments1(
TestMode
mode)
2859
public async Task TestAttributeArguments2(
TestMode
mode)
2880
public async Task TestAttributeArguments3(
TestMode
mode)
2901
public async Task TestReturnStatementWithinDelegateWithinAMethodCall(
TestMode
mode)
2927
public async Task TestCatchFilterClause(
TestMode
mode)
2941
public async Task TestCatchFilterClause1(
TestMode
mode)
2963
await TestInMethodAsync(text, "global::System.Object",
TestMode
.Node);
2982
await TestAsync(text, "global::System.Threading.Tasks.Task<global::System.Boolean>",
TestMode
.Node);
3001
await TestAsync(text, "global::System.Threading.Tasks.Task<global::System.Object>",
TestMode
.Node);
3021
await TestAsync(text, "global::System.Boolean",
TestMode
.Node);
3026
public async Task TestAwaitExpressionWithGenericMethod2(
TestMode
mode)
3047
public async Task TestNullCoalescingOperator1(
TestMode
mode)
3061
await TestAsync(text, mode ==
TestMode
.Node ? "global::System.Object?" : "global::System.Object", mode);
3066
public async Task TestNullCoalescingOperator2(
TestMode
mode)
3080
await TestAsync(text, mode ==
TestMode
.Node ? "global::System.Object?" : "global::System.Object", mode);
3085
public async Task TestNullCoalescingOperator3(
TestMode
mode)
3100
await TestAsync(text, mode ==
TestMode
.Node ? "global::System.Object?" : "global::System.Object", mode);
3119
await TestAsync(text, "global::System.Object",
TestMode
.Node);
3138
await TestAsync(text, "global::System.String",
TestMode
.Node);
3143
public async Task TestSelectLambda3(
TestMode
mode)
3176
await TestAsync(text, "global::System.ConsoleModifiers",
TestMode
.Position);
3192
await TestAsync(text, "global::System.ConsoleModifiers",
TestMode
.Position);
3209
await TestAsync(text, "global::System.Collections.Generic.IEnumerable<global::System.Int32>",
TestMode
.Node);
3226
await TestAsync(text, "global::System.Collections.Generic.IEnumerable<global::System.Object>",
TestMode
.Node);
3246
await TestAsync(text, "global::C",
TestMode
.Position);
3254
@"[|(int i, _)|] =", "(global::System.Int32 i, global::System.Object _)",
TestMode
.Node);
3262
@"(int i, _) = [||]", "(global::System.Int32 i, global::System.Object _)",
TestMode
.Position);
3269
@"[|(string? s, _)|] =", "(global::System.String? s, global::System.Object _)",
TestMode
.Node);
3287
await TestAsync(text, "global::Program",
TestMode
.Position);
3291
public async Task TestInferringThroughGenericFunctionWithNullableReturn(
TestMode
mode)
3327
await TestAsync(text, "global::System.String",
TestMode
.Position);
3331
public async Task TestInferringThroughGenericFunctionTooManyArguments(
TestMode
mode)
3350
public async Task TestValueInNestedTuple1(
TestMode
mode)
3357
public async Task TestValueInNestedTuple2(
TestMode
mode)
3367
@"(int, string) x = (1, [||]);", "global::System.String",
TestMode
.Position);
3371
public async Task TestInferringInEnumHasFlags(
TestMode
mode)
3423
await TestAsync(markup, expectedType,
TestMode
.Position);
3454
await TestAsync(markup, "global::Color",
TestMode
.Position);
3479
await TestAsync(markup, "global::Color",
TestMode
.Position);
3504
await TestAsync(markup, "global::Color",
TestMode
.Position);
3530
await TestAsync(markup, "global::Color",
TestMode
.Position);
3556
await TestAsync(markup, "global::Color",
TestMode
.Position);
3566
await TestAsync(markup, "global::System.Int32",
TestMode
.Position);
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (2)
TypeInferrer\TypeInferrerTestBase.cs (2)
50
protected async Task TestAsync(string text, string expectedType,
TestMode
mode,
67
protected abstract Task TestWorkerAsync(Document document, TextSpan textSpan, string expectedType,
TestMode
mode);