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