45 references to ReturnOperationTestVariant
Mvc.Api.Analyzers.Test (45)
ActualApiResponseMetadataFactoryTest.cs (45)
91
[InlineData(
ReturnOperationTestVariant
.Default)]
92
[InlineData(
ReturnOperationTestVariant
.SwitchExpression)]
93
public async Task InspectReturnExpression_ReturnsStatusCodeFromDefaultStatusCodeAttributeOnActionResult(
ReturnOperationTestVariant
variant)
105
[InlineData(
ReturnOperationTestVariant
.Default)]
106
[InlineData(
ReturnOperationTestVariant
.SwitchExpression)]
107
public async Task InspectReturnExpression_ReturnsDefaultResponseMetadata_IfReturnedTypeIsNotActionResult(
ReturnOperationTestVariant
variant)
119
[InlineData(
ReturnOperationTestVariant
.Default)]
120
[InlineData(
ReturnOperationTestVariant
.SwitchExpression)]
121
public async Task InspectReturnExpression_ReturnsStatusCodeFromStatusCodePropertyAssignment(
ReturnOperationTestVariant
variant)
133
[InlineData(
ReturnOperationTestVariant
.Default)]
134
[InlineData(
ReturnOperationTestVariant
.SwitchExpression)]
135
public async Task InspectReturnExpression_ReturnsStatusCodeFromConstructorAssignment(
ReturnOperationTestVariant
variant)
147
[InlineData(
ReturnOperationTestVariant
.Default)]
148
[InlineData(
ReturnOperationTestVariant
.SwitchExpression)]
149
public async Task InspectReturnExpression_ReturnsStatusCodeFromHelperMethod(
ReturnOperationTestVariant
variant)
161
[InlineData(
ReturnOperationTestVariant
.Default)]
162
[InlineData(
ReturnOperationTestVariant
.SwitchExpression)]
163
public async Task InspectReturnExpression_UsesExplicitlySpecifiedStatusCode_ForActionResultWithDefaultStatusCode(
ReturnOperationTestVariant
variant)
175
[InlineData(
ReturnOperationTestVariant
.Default)]
176
[InlineData(
ReturnOperationTestVariant
.SwitchExpression)]
177
public async Task InspectReturnExpression_ReadsStatusCodeConstant(
ReturnOperationTestVariant
variant)
189
[InlineData(
ReturnOperationTestVariant
.Default)]
190
[InlineData(
ReturnOperationTestVariant
.SwitchExpression)]
191
public async Task InspectReturnExpression_DoesNotReadLocalFieldWithConstantValue(
ReturnOperationTestVariant
variant)
203
[InlineData(
ReturnOperationTestVariant
.Default)]
204
[InlineData(
ReturnOperationTestVariant
.SwitchExpression)]
205
public async Task InspectReturnExpression_FallsBackToDefaultStatusCode_WhenAppliedStatusCodeCannotBeRead(
ReturnOperationTestVariant
variant)
218
[InlineData(
ReturnOperationTestVariant
.Default)]
219
[InlineData(
ReturnOperationTestVariant
.SwitchExpression)]
220
public async Task InspectReturnExpression_SetsReturnType_WhenLiteralTypeIsSpecifiedInConstructor(
ReturnOperationTestVariant
variant)
232
[InlineData(
ReturnOperationTestVariant
.Default)]
233
[InlineData(
ReturnOperationTestVariant
.SwitchExpression)]
234
public async Task InspectReturnExpression_SetsReturnType_WhenLocalValueIsSpecifiedInConstructor(
ReturnOperationTestVariant
variant)
246
[InlineData(
ReturnOperationTestVariant
.Default)]
247
[InlineData(
ReturnOperationTestVariant
.SwitchExpression)]
248
public async Task InspectReturnExpression_SetsReturnType_WhenValueIsReturned(
ReturnOperationTestVariant
variant)
260
[InlineData(
ReturnOperationTestVariant
.Default)]
261
[InlineData(
ReturnOperationTestVariant
.SwitchExpression)]
262
public async Task InspectReturnExpression_ReturnsNullReturnType_IfValueIsNotSpecified(
ReturnOperationTestVariant
variant)
382
private async Task<ActualApiResponseMetadata?[]> RunInspectReturnStatementSyntax(
ReturnOperationTestVariant
variant =
ReturnOperationTestVariant
.Default, [CallerMemberName] string test = null)
430
private string GetTestClassName(
ReturnOperationTestVariant
variant)
434
ReturnOperationTestVariant
.SwitchExpression => "InspectReturnExpressionTestsForSwitchExpression",
439
private string GetControllerTypeName(
ReturnOperationTestVariant
variant)
443
ReturnOperationTestVariant
.SwitchExpression => typeof(TestFiles.InspectReturnExpressionTestsForSwitchExpression.TestController),