8 types derived from Task
Microsoft.AspNetCore.Mvc.Core.Test (1)
Infrastructure\ControllerActionInvokerTest.cs (1)
1938public class TaskDerivedType : Task
System.Private.CoreLib (7)
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\ConcurrentExclusiveSchedulerPair.cs (1)
471private sealed class CompletionState : Task
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Future.cs (1)
59public class Task<TResult> : Task
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs (2)
5745private class DelayPromise : Task 5980private sealed class WhenAllPromise : Task, ITaskCompletionAction
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskContinuation.cs (2)
10internal sealed class ContinuationTaskFromTask : Task 102internal sealed class ContinuationTaskFromResultTask<TAntecedentResult> : Task
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\ValueTask.cs (1)
232private sealed class ValueTaskSourceAsTask : Task
31 instantiations of Task
Microsoft.AspNetCore.Owin.Tests (1)
OwinExtensionTests.cs (1)
22static readonly AppFunc notFound = env => new Task(() => { env["owin.ResponseStatusCode"] = 404; });
System.Linq.Parallel (6)
System\Linq\Parallel\Scheduling\OrderPreservingPipeliningSpoolingTask.cs (1)
171Task rootTask = new Task(
System\Linq\Parallel\Scheduling\OrderPreservingSpoolingTask.cs (1)
87Task rootTask = new Task(
System\Linq\Parallel\Scheduling\QueryTask.cs (1)
64Task task = new Task(s_runTaskSynchronouslyDelegate, this, TaskCreationOptions.AttachedToParent);
System\Linq\Parallel\Scheduling\SpoolingTask.cs (3)
40Task rootTask = new Task( 98Task rootTask = new Task( 139Task rootTask = new Task(
System.Private.CoreLib (12)
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\ConcurrentExclusiveSchedulerPair.cs (2)
293processingTask = new Task(thisPair => ((ConcurrentExclusiveSchedulerPair)thisPair!).ProcessExclusiveTasks(), this, 323processingTask = new Task(thisPair => ((ConcurrentExclusiveSchedulerPair)thisPair!).ProcessConcurrentTasks(), this,
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\FutureFactory.cs (1)
659Task t = new Task(new Action<object>(delegate
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs (4)
1153Task t = new Task(action, state, creatingTask, cancellationToken, options, internalOptions | InternalTaskOptions.QueuedByRuntime, scheduler); 5399var task = new Task(); 5426return new Task(true, TaskCreationOptions.None, cancellationToken); 5447var task = new Task();
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskCompletionSource.cs (2)
34public TaskCompletionSource() => _task = new Task(); 64_task = new Task(state, creationOptions, promiseStyle: true);
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskContinuation.cs (1)
552return new Task(
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\ValueTask.cs (1)
213var task = new Task();
src\libraries\System.Private.CoreLib\src\System\Threading\Timer.cs (1)
657var t = new Task((object?)null, TaskCreationOptions.RunContinuationsAsynchronously, true);
System.Threading.Tasks.Dataflow (9)
Blocks\BatchBlock.cs (1)
641_nonGreedyState!.TaskForInputProcessing = new Task(static thisBatchTarget => ((BatchBlockTargetCore)thisBatchTarget!).ProcessMessagesLoopCore(), this,
Blocks\BroadcastBlock.cs (2)
260new Task(static state => ((BroadcastBlock<T>)state!).ConsumeMessagesLoopCore(), this, 837_taskForOutputProcessing = new Task(static thisSourceCore => ((BroadcastingSourceCore<TOutput>)thisSourceCore!).OfferMessagesLoopCore(), this,
Blocks\BufferBlock.cs (1)
261new Task(static state => ((BufferBlock<T>)state!).ConsumeMessagesLoopCore(), this,
Blocks\JoinBlock.cs (1)
1282_taskForInputProcessing = new Task(static thisSharedResources => ((JoinBlockTargetSharedResources)thisSharedResources!).ProcessMessagesLoopCore(), this,
Blocks\WriteOnceBlock.cs (1)
123var taskForOutputProcessing = new Task(static state => ((WriteOnceBlock<T>)state!).OfferToTargetsAndCompleteBlock(), this,
Internal\SourceCore.cs (1)
759_taskForOutputProcessing = new Task(static thisSourceCore => ((SourceCore<TOutput>)thisSourceCore!).OfferMessagesLoopCore(), this,
Internal\SpscTargetCore.cs (1)
166var newConsumer = new Task(
Internal\TargetCore.cs (1)
372var taskForInputProcessing = new Task(static thisTargetCore => ((TargetCore<TInput>)thisTargetCore!).ProcessMessagesLoopCore(), this,
System.Threading.Tasks.Parallel (3)
System\Threading\Tasks\Parallel.cs (1)
343tasks[0] = new Task(actionsCopy[0], parallelOptions.CancellationToken, TaskCreationOptions.None);
System\Threading\Tasks\TaskReplicator.cs (2)
37_pendingTask = new Task(s => ((Replica)s!).Execute(), this); 79_pendingTask = new Task(s => ((Replica)s!).Execute(), this, CancellationToken.None, TaskCreationOptions.None);
25172 references to Task
ApiExplorerWebSite (10)
Controllers\ApiExplorerResponseTypeWithAttributeController.cs (3)
39public Task GetTaskWithExplicitResponseTypeStatusCode() 41return Task.FromResult(true); 46public Task GetTask()
Controllers\ApiExplorerResponseTypeWithoutAttributeController.cs (7)
50public Task GetTask() 52return Task.FromResult(true); 58return Task.FromResult<object>(null); 64return Task.FromResult<IActionResult>(new EmptyResult()); 70return Task.FromResult(new ObjectResult(null)); 76return Task.FromResult<Product>(null); 82return Task.FromResult<int>(0);
AuthSamples.FunctionalTests (31)
ClaimsTransformTests.cs (2)
22public async Task DefaultReturns200() 33public async Task MyClaimsRedirectsToLoginPageWhenNotLoggedIn()
CookiesTests.cs (6)
21public async Task DefaultReturns200() 32public async Task MyClaimsRedirectsToLoginPageWhenNotLoggedIn() 44public async Task MyClaimsShowsClaimsWhenLoggedIn() 52public async Task LogoutClearsCookie() 70internal async Task CheckMyClaims(string userName) 79internal async Task SignIn(string userName)
CustomAuthorizationFailureResponseTests.cs (2)
22public async Task SampleGetWithCustomPolicyWithCustomForbiddenMessage_Returns403WithCustomMessage() 32public async Task SampleGetWithCustomPolicy_Returns404WithCustomMessage()
CustomPolicyProviderTests.cs (7)
25public async Task DefaultReturns200() 36public async Task MinimumAge10RedirectsWhenNotLoggedIn() 48public async Task MinimumAge10WorksIfOldEnough() 64public async Task MinimumAge10FailsIfNotOldEnough() 79public async Task MinimumAge50WorksIfOldEnough() 95public async Task MinimumAge50FailsIfNotOldEnough() 110public async Task MinimumAge50RedirectsWhenNotLoggedIn()
DynamicSchemeTests.cs (2)
23public async Task DefaultReturns200() 34public async Task CanAddUpdateRemoveSchemes()
IdentityExternalClaimsTests.cs (2)
22public async Task DefaultReturns200() 33public async Task MyClaimsRedirectsToLoginPageWhenNotLoggedIn()
PathSchemeSelectionTests.cs (8)
23public async Task DefaultReturns200() 34public async Task ApiDefaultReturns200() 45public async Task MyClaimsRedirectsToLoginPageWhenNotLoggedIn() 57public async Task ApiMyClaimsReturnsClaim() 70public async Task MyClaimsShowsClaimsWhenLoggedIn() 78public async Task LogoutClearsCookie() 96internal async Task CheckMyClaims(string userName) 105internal async Task SignIn(string userName)
StaticFilesAuthTests.cs (2)
22public async Task DefaultReturns200() 33public async Task EndpointRedirectsToLoginPageWhenNotLoggedIn(string scenario)
AutobahnTestApp (2)
Program.cs (1)
10public static Task Main(string[] args)
Startup.cs (1)
39private async Task Echo(WebSocket webSocket, CancellationToken cancellationToken)
AzureAppServicesHostingStartupSample (1)
Startup.cs (1)
57public static Task Main(string[] args)
AzureAppServicesSample (1)
Startup.cs (1)
68public static Task Main(string[] args)
BasicLinkedApp (1)
Startup.cs (1)
26public Task InvokeAsync(HttpContext context)
BasicTestApp (59)
InteropTest\ByteArrayInterop.cs (2)
19return Task.FromResult(byteArray); 31return Task.FromResult(byteArrayWrapper);
InteropTest\DotNetStreamReferenceInterop.cs (2)
27return Task.FromResult(GetDotNetStreamReference()); 46return Task.FromResult(GetDotNetStreamWrapperReference());
InteropTest\JavaScriptInterop.cs (34)
17public static Task AsyncThrowSyncException() 21public static async Task AsyncThrowAsyncException() 23await Task.Yield(); 204public static Task VoidParameterlessAsync() 207return Task.CompletedTask; 211public static Task VoidWithOneParameterAsync(ComplexParameter parameter1) 214return Task.CompletedTask; 218public static Task VoidWithTwoParametersAsync( 223return Task.CompletedTask; 227public static Task VoidWithThreeParametersAsync( 233return Task.CompletedTask; 237public static Task VoidWithFourParametersAsync( 244return Task.CompletedTask; 248public static Task VoidWithFiveParametersAsync( 256return Task.CompletedTask; 260public static Task VoidWithSixParametersAsync( 269return Task.CompletedTask; 273public static Task VoidWithSevenParametersAsync( 283return Task.CompletedTask; 287public static Task VoidWithEightParametersAsync( 298return Task.CompletedTask; 304return Task.FromResult(new decimal[] { 0.1M, 0.2M }); 310return Task.FromResult(new object[] { parameter1 }); 318return Task.FromResult(new object[] { parameter1, parameter2 }); 327return Task.FromResult(new object[] { parameter1, parameter2, parameter3.Value.GetNonSerializedValue() }); 337return Task.FromResult(new object[] { parameter1, parameter2, parameter3.Value.GetNonSerializedValue(), parameter4 }); 348return Task.FromResult(new object[] { parameter1, parameter2, parameter3.Value.GetNonSerializedValue(), parameter4, parameter5 }); 359return Task.FromResult(new object[] { parameter1, parameter2, parameter3.Value.GetNonSerializedValue(), parameter4, parameter5, parameter6 }); 372return Task.FromResult(new object[] { parameter1, parameter2, parameter3.Value.GetNonSerializedValue(), parameter4, parameter5, parameter6, parameter7 }); 386return Task.FromResult(new object[] { parameter1, parameter2, parameter3.Value.GetNonSerializedValue(), parameter4, parameter5, parameter6, parameter7, parameter8 }); 401await Task.Yield(); 423await Task.Yield(); 476await Task.Yield(); 519await Task.Yield();
PreserveStateService.cs (2)
39private Task PersistState() 42return Task.CompletedTask;
Program.cs (3)
21public static async Task Main(string[] args) 86private static async Task SimulateErrorsIfNeededForTest() 94await Task.Yield();
ServerReliability\ThrowingAttachComponent.cs (1)
15public Task SetParametersAsync(ParameterView parameters)
ServerReliability\ThrowingConstructorComponent.cs (1)
20public Task SetParametersAsync(ParameterView parameters)
ServerReliability\ThrowingDisposeComponent.cs (2)
23public Task SetParametersAsync(ParameterView parameters) 25return Task.CompletedTask;
ServerReliability\ThrowingOnAfterRenderAsyncComponent.cs (4)
18public async Task OnAfterRenderAsync() 20await Task.Yield(); 24public Task SetParametersAsync(ParameterView parameters) 26return Task.CompletedTask;
ServerReliability\ThrowingOnAfterRenderSyncComponent.cs (3)
18public Task OnAfterRenderAsync() 23public Task SetParametersAsync(ParameterView parameters) 25return Task.CompletedTask;
ServerReliability\ThrowingRenderComponent.cs (2)
18public Task SetParametersAsync(ParameterView parameters) 20return Task.CompletedTask;
ServerReliability\ThrowingSetParametersAsyncComponent.cs (2)
14public async Task SetParametersAsync(ParameterView parameters) 16await Task.Yield();
ServerReliability\ThrowingSetParametersSyncComponent.cs (1)
14public Task SetParametersAsync(ParameterView parameters)
BasicWebSite (44)
BasicAuthenticationHandler.cs (2)
21return Task.FromResult(AuthenticateResult.NoResult()); 34return Task.FromResult(AuthenticateResult.Success(new AuthenticationTicket(
Controllers\ActionResultOfTController.cs (1)
25await Task.Delay(0);
Controllers\AsyncActionsController.cs (14)
27await Task.Yield(); 33return Task.FromResult<IActionResult>(View()); 38await Task.Delay(SimulateDelayMilliseconds); 41public Task TaskAction() 43return Task.Delay(SimulateDelayMilliseconds); 46public async Task TaskExceptionAction() 48await Task.Delay(SimulateDelayMilliseconds); 54await Task.Delay(SimulateDelayMilliseconds); 60await Task.Delay(SimulateDelayMilliseconds); 66await Task.Delay(SimulateDelayMilliseconds); 72await Task.Delay(SimulateDelayMilliseconds); 78await Task.Delay(SimulateDelayMilliseconds); 84await Task.Delay(SimulateDelayMilliseconds); 202Task.Factory.StartNew(() =>
Controllers\AsyncDisposableController.cs (1)
37await Task.Yield();
Controllers\BindPropertiesController.cs (2)
29public Task BindModelAsync(ModelBindingContext bindingContext) 32return Task.CompletedTask;
Controllers\ContactApiController.cs (2)
145public Task BindModelAsync(ModelBindingContext bindingContext) 149return Task.CompletedTask;
Controllers\ContentNegotiation\NoContentController.cs (4)
12return Task.FromResult<string>(null); 17return Task.FromResult<object>(null); 30public Task ReturnTask() 32return Task.FromResult<bool>(true);
Controllers\ContentNegotiation\NoContentDoNotTreatNullValueAsNoContentController.cs (2)
26return Task.FromResult<string>(null); 31return Task.FromResult<object>(null);
Controllers\ContentNegotiation\TextPlainController.cs (3)
12return Task.FromResult<string>("ReturnTaskOfString"); 17return Task.FromResult<object>("ReturnTaskOfObject_StringValue"); 22return Task.FromResult(new object());
Controllers\HomeController.cs (2)
71public Task ActionReturningTask() 74return Task.FromResult(true);
Controllers\TempDataController.cs (1)
63public async Task SetTempDataResponseWrite()
Formatters\CustomFormatter.cs (1)
34public override async Task WriteResponseBodyAsync(OutputFormatterWriteContext context, Encoding selectedEncoding)
Formatters\PlainTextFormatter.cs (1)
32public override async Task WriteResponseBodyAsync(OutputFormatterWriteContext context, Encoding selectedEncoding)
Formatters\VCardFormatter_V3.cs (1)
29public override async Task WriteResponseBodyAsync(OutputFormatterWriteContext context, Encoding selectedEncoding)
Formatters\VCardFormatter_V4.cs (1)
30public override async Task WriteResponseBodyAsync(OutputFormatterWriteContext context, Encoding selectedEncoding)
ManagerHandler.cs (2)
11protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, OperationAuthorizationRequirement requirement) 17return Task.FromResult(0);
RequestIdMiddleware.cs (1)
16public Task Invoke(HttpContext context)
StoreIntoTempDataActionResult.cs (1)
11public Task ExecuteResultAsync(ActionContext context)
ValueProviders\CustomValueProviderFactory.cs (2)
11public Task CreateValueProviderAsync(ValueProviderFactoryContext context) 14return Task.CompletedTask;
Benchmarks (1)
Program.cs (1)
10public static Task Main(string[] args)
BlazorServerApp (1)
Data\WeatherForecastService.cs (1)
15return Task.FromResult(Enumerable.Range(1, 5).Select(index => new WeatherForecast
BlazorUnitedApp (1)
Data\WeatherForecastService.cs (1)
15return Task.FromResult(Enumerable.Range(1, 5).Select(index => new WeatherForecast
Certificate.Optional.Sample (1)
Startup.cs (1)
29return Task.CompletedTask;
Certificate.Sample (1)
Startup.cs (1)
31return Task.CompletedTask;
ClaimsTransformation (1)
ClaimsTransformer.cs (1)
23return Task.FromResult(transformed);
ClientSample (19)
HubSample.cs (2)
75return Task.CompletedTask; 144await Task.Delay(5000);
RawSample.cs (2)
75private static async Task ReceiveLoop(TextWriter output, PipeReader input) 101private static async Task SendLoop(TextReader input, PipeWriter output)
Tcp\SocketAwaitable.cs (1)
53Task.Run(continuation);
Tcp\TcpConnection.cs (6)
73private async Task ExecuteAsync() 79var receiveTask = DoReceive(); 85if (await Task.WhenAny(receiveTask, sendTask) == sendTask) 108private async Task DoReceive() 157private async Task ProcessReceives() 216private async Task ProcessSends()
UploadSample.cs (8)
42public static async Task BasicInvoke(HubConnection connection) 50await Task.Delay(1000); 58public static async Task ScoreTrackerExample(HubConnection connection) 68async Task WriteItemsAsync(ChannelWriter<int> source, IEnumerable<int> scores) 70await Task.Delay(1000); 74await Task.Delay(250); 83public static async Task StreamingEcho(HubConnection connection) 87_ = Task.Run(async () =>
ConcurrencyLimiterSample (2)
Startup.cs (2)
24Task.Delay(100).Wait(); // 100ms sync-over-async 30public static Task Main(string[] args)
CookiePolicySample (2)
Program.cs (1)
8public static Task Main(string[] args)
Startup.cs (1)
77private async Task HomePage(HttpContext context)
CookieSample (1)
Program.cs (1)
30return Task.CompletedTask;
CookieSessionSample (6)
MemoryCacheTicketStore.cs (5)
28public Task RenewAsync(string key, AuthenticationTicket ticket) 40return Task.FromResult(0); 47return Task.FromResult(ticket); 50public Task RemoveAsync(string key) 53return Task.FromResult(0);
Program.cs (1)
8public static Task Main(string[] args)
CorsMiddlewareWebSite (3)
EchoMiddleware.cs (2)
22/// <returns>A <see cref="Task"/> that completes when writing to the response is done.</returns> 23public Task Invoke(HttpContext context)
Startup.cs (1)
18public static Task Main(string[] args)
CustomAuthorizationFailureResponse (8)
Authentication\SampleAuthenticationHandler.cs (1)
21=> Task.FromResult(AuthenticateResult.Success(new AuthenticationTicket(_id, "Api")));
Authorization\Handlers\SampleRequirementHandler.cs (2)
12protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, SampleRequirement requirement) 15return Task.CompletedTask;
Authorization\Handlers\SampleWithCustomMessageRequirementHandler.cs (2)
12protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, SampleWithCustomMessageRequirement requirement) 15return Task.CompletedTask;
Authorization\Handlers\SampleWithFailureReasonRequirementHandler.cs (2)
12protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, SampleFailReasonRequirement requirement) 15return Task.CompletedTask;
Authorization\SampleAuthorizationMiddlewareResultHandler.cs (1)
25public async Task HandleAsync(
CustomPolicyProvider (3)
Authorization\MinimumAgeAuthorizationHandler.cs (2)
25protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, MinimumAgeRequirement requirement) 62return Task.CompletedTask;
Authorization\MinimumAgePolicyProvider.cs (1)
46return Task.FromResult(policy.Build());
DatabaseErrorPageSample (2)
Startup.cs (2)
25return Task.FromResult(0); 29public static Task Main(string[] args)
DefaultBuilder.SampleApp (1)
Startup.cs (1)
52private static async Task ShowConfig(HttpResponse response, IConfiguration config)
DeveloperExceptionPageSample (1)
Startup.cs (1)
48public static Task Main(string[] args)
Diagnostics.EFCore.FunctionalTests (31)
DatabaseErrorPageMiddlewareTest.cs (22)
24public async Task Successful_requests_pass_thru() 53public virtual async Task Invoke(HttpContext context) 61public async Task Non_database_exceptions_pass_thru() 90public virtual Task Invoke(HttpContext context) 99public async Task Existing_database_not_using_migrations_exception_passes_thru() 117public virtual Task Invoke(HttpContext context) 132public async Task Error_page_displayed_no_migrations() 155public virtual Task Invoke(HttpContext context) 167public async Task No_exception_on_diagnostic_event_received_when_null_state() 193public async Task Error_page_displayed_pending_migrations() 220public virtual Task Invoke(HttpContext context) 232public async Task Error_page_displayed_pending_model_changes() 258public virtual Task Invoke(HttpContext context) 272public async Task Error_page_then_apply_migrations() 316public virtual async Task Invoke(HttpContext context) 328public async Task Customize_migrations_end_point() 373public async Task Pass_thru_when_context_not_in_services() 417public virtual Task Invoke(HttpContext context) 436public async Task Pass_thru_when_exception_in_logic() 466public virtual Task Invoke(HttpContext context) 478public async Task Error_page_displayed_when_exception_wrapped() 500public virtual Task Invoke(HttpContext context)
MigrationsEndPointMiddlewareTest.cs (9)
24public async Task Non_migration_requests_pass_thru() 51public virtual async Task Invoke(HttpContext context) 61public async Task Migration_request_default_path() 69public async Task Migration_request_custom_path() 74private async Task Migration_request(bool useCustomPath) 142public async Task Context_type_not_specified() 170public async Task Invalid_context_type_specified() 202public async Task Context_not_registered_in_services() 233public async Task Exception_while_applying_migrations()
Diagnostics.FunctionalTests (12)
DatabaseErrorPageSampleTest.cs (1)
22public async Task DatabaseErrorPage_ShowsError()
DeveloperExceptionPageSampleTest.cs (2)
23public async Task DeveloperExceptionPage_ShowsError() 38public async Task DeveloperExceptionPage_ShowsProblemDetails_WhenHtmlNotAccepted()
ExceptionHandlerSampleTest.cs (1)
19public async Task ExceptionHandlerPage_ShowsError()
MiddlewareAnalysisSampleTest.cs (1)
19public async Task MiddlewareAnalysisPage_ShowsAnalysis()
ProblemDetailsExceptionHandlerSampleTest.cs (1)
22public async Task ExceptionHandlerPage_ProducesProblemDetails()
StatusCodeSampleTest.cs (5)
24public async Task StatusCodePage_ShowsError() 39public async Task StatusCodePageOptions_ExcludesSemicolon_WhenReasonPhrase_IsUnknown() 56public async Task StatusCodePageOptions_IncludesSemicolon__AndReasonPhrase_WhenReasonPhrase_IsKnown() 77public async Task StatusCodePage_ProducesProblemDetails() 95public async Task StatusCodePage_ProducesProblemDetails_WithoutAcceptHeader()
WelcomePageSampleTest.cs (1)
19public async Task WelcomePage_ShowsWelcome()
dotnet-openapi (8)
Commands\AddCommand.cs (1)
26return Task.FromResult(0);
Commands\BaseCommand.cs (6)
145internal async Task AddOpenAPIReference( 190private async Task EnsurePackagesInProjectAsync(FileInfo projectFile, CodeGenerator? codeGenerator) 204private async Task TryAddPackage(string packageId, string packageVersion, FileInfo projectFile) 256internal async Task DownloadToFileAsync(string url, string destinationPath, bool overwrite) 331await Task.Delay(1 * 1000, cancellationToken); // Wait for a while before retry. 507private async Task WriteToFileAsync(Stream content, string destinationPath, bool overwrite)
Commands\RemoveCommand.cs (1)
48return Task.FromResult(0);
ErrorPageMiddlewareWebSite (7)
AggregateExceptionController.cs (7)
13var firstException = ThrowNullReferenceException(); 14var secondException = ThrowIndexOutOfRangeException(); 15Task.WaitAll(firstException, secondException); 19private static async Task ThrowNullReferenceException() 21await Task.Delay(0); 25private static async Task ThrowIndexOutOfRangeException() 27await Task.Delay(0);
ExceptionHandlerSample (2)
Program.cs (1)
8public static Task Main(string[] args)
StartupWithWebSocket.cs (1)
25app.Use(async (HttpContext context, Func<Task> next) =>
FormatterWebSite (8)
Controllers\AsyncEnumerableController.cs (2)
19await Task.Yield(); 29await Task.Delay(5);
Controllers\DataContractSerializerController.cs (2)
40return Task.FromResult(new Person(name)); 48return Task.FromResult<object>(new Person(name));
Controllers\XmlSerializerController.cs (2)
51return Task.FromResult(new DummyClass { SampleInt = 10 }); 57return Task.FromResult<object>(new DummyClass { SampleInt = 10 });
PolymorphicBinder.cs (2)
11public Task BindModelAsync(ModelBindingContext bindingContext) 20return Task.CompletedTask;
GenericWebHost (1)
Program.cs (1)
13public static async Task Main(string[] args)
GetDocument.Insider (3)
Commands\GetDocumentCommandWorker.cs (3)
41private static readonly Type GenerateMethodReturnType = typeof(Task); 286using var resultTask = (Task)InvokeMethod(generateMethod, service, arguments);
HealthChecksSample (7)
CustomWriterStartup.cs (1)
41private static Task WriteResponse(HttpContext httpContext, HealthReport result)
GCInfoHealthCheck.cs (1)
72return Task.FromResult(new HealthCheckResult(
Program.cs (1)
24public static Task Main(string[] args)
SlowDependencyHealthCheck.cs (4)
14private readonly Task _task; 18_task = Task.Delay(15 * 1000); 25return Task.FromResult(HealthCheckResult.Healthy("Dependency is ready")); 28return Task.FromResult(new HealthCheckResult(
HelixTestRunner (12)
ProcessUtil.cs (11)
23public static Task CaptureDumpAsync() 29return Task.CompletedTask; 38public static Task CaptureDumpAsync(int pid) 44return Task.CompletedTask; 53public static Task CaptureDumpAsync(int pid, string dumpFilePath) 59return Task.CompletedTask; 65return Task.CompletedTask; 175var result = await Task.WhenAny(processLifetimeTask.Task, canceledTcs.Task); 192await Task.WhenAny(processLifetimeTask.Task, Task.Delay(TimeSpan.FromSeconds(5), cancel.Token));
Program.cs (1)
12static async Task Main(string[] args)
HostedBlazorWebassemblyApp.Client (1)
Program.cs (1)
20public static async Task Main(string[] args)
HostedBlazorWebassemblyApp.Server (1)
Data\WeatherForecastService.cs (1)
21return Task.FromResult(Enumerable.Range(1, 5).Select(index => new WeatherForecast
HostFilteringSample (1)
Program.cs (1)
8public static Task Main(string[] args)
HotAddSample (1)
Startup.cs (1)
104public static Task Main(string[] args)
HtmlGenerationWebSite (1)
TestCacheTagHelper.cs (1)
26public override Task ProcessAsync(TagHelperContext context, TagHelperOutput output)
http2cat (58)
Program.cs (2)
16public static async Task Main(string[] args) 29internal static async Task RunTestCase(Http2Utilities h2Connection)
src\Shared\Http2cat\Http2CatHostedService.cs (5)
29private Task _backgroundTask; 43public Task StartAsync(CancellationToken cancellationToken) 46return Task.CompletedTask; 49public Task StopAsync(CancellationToken cancellationToken) 55private async Task RunAsync()
src\Shared\Http2cat\Http2CatIHostBuilderExtensions.cs (1)
13public static IHostBuilder UseHttp2Cat(this IHostBuilder hostBuilder, string address, Func<Http2Utilities, Task> scenario)
src\Shared\Http2cat\Http2CatOptions.cs (1)
12public Func<Http2Utilities, Task> Scenaro { get; set; }
src\Shared\Http2cat\Http2Utilities.cs (42)
153public async Task InitializeConnectionAsync(int expectedSettingsCount = 3) 174public Task StartStreamAsync(int streamId, IEnumerable<KeyValuePair<string, string>> headers, bool endStream) 272public Task SendHeadersWithPaddingAsync(int streamId, IEnumerable<KeyValuePair<string, string>> headers, byte padLength, bool endStream) 312public Task SendHeadersWithPriorityAsync(int streamId, IEnumerable<KeyValuePair<string, string>> headers, byte priority, int streamDependency, bool endStream) 355public Task SendHeadersWithPaddingAndPriorityAsync(int streamId, IEnumerable<KeyValuePair<string, string>> headers, byte padLength, byte priority, int streamDependency, bool endStream) 389public Task SendAsync(ReadOnlySpan<byte> span) 396public static async Task FlushAsync(PipeWriter writableBuffer) 401public Task SendPreambleAsync() => SendAsync(ClientPreface); 403public async Task SendSettingsAsync() 426public async Task SendSettingsAckWithInvalidLengthAsync(int length) 436public async Task SendSettingsWithInvalidStreamIdAsync(int streamId) 450public async Task SendSettingsWithInvalidLengthAsync(int length) 462internal async Task SendSettingsWithInvalidParameterValueAsync(Http2SettingsParameter parameter, uint value) 480public Task SendPushPromiseFrameAsync() 508internal async Task SendHeadersAsync(int streamId, Http2HeadersFrameFlags flags, byte[] headerBlock) 520public async Task SendInvalidHeadersFrameAsync(int streamId, int payloadLength, byte padLength) 539public async Task SendIncompleteHeadersFrameAsync(int streamId) 573internal async Task SendContinuationAsync(int streamId, Http2ContinuationFrameFlags flags, byte[] payload) 601internal Task SendEmptyContinuationFrameAsync(int streamId, Http2ContinuationFrameFlags flags) 613public async Task SendIncompleteContinuationFrameAsync(int streamId) 631public Task SendDataAsync(int streamId, Memory<byte> data, bool endStream) 644public async Task SendDataWithPaddingAsync(int streamId, Memory<byte> data, byte padLength, bool endStream) 664public Task SendInvalidDataFrameAsync(int streamId, int frameLength, byte padLength) 684internal Task SendPingAsync(Http2PingFrameFlags flags) 693public Task SendPingWithInvalidLengthAsync(int length) 703public Task SendPingWithInvalidStreamIdAsync(int streamId) 722public Task SendPriorityAsync(int streamId, int streamDependency = 0) 736public Task SendInvalidPriorityFrameAsync(int streamId, int length) 752public Task SendRstStreamAsync(int streamId) 764public Task SendInvalidRstStreamFrameAsync(int streamId, int length) 774public Task SendGoAwayAsync() 783public Task SendInvalidGoAwayFrameAsync() 793public Task SendWindowUpdateAsync(int streamId, int sizeIncrement) 805public Task SendInvalidWindowUpdateAsync(int streamId, int sizeIncrement, int length) 815public Task SendUnknownFrameTypeAsync(int streamId, int frameType) 877public async Task StopConnectionAsync(int expectedLastStreamId, bool ignoreNonGoAwayFrames) 885public Task WaitForConnectionStopAsync(int expectedLastStreamId, bool ignoreNonGoAwayFrames) 890internal Task ReceiveHeadersAsync(int expectedStreamId, Action<IDictionary<string, string>> verifyHeaders = null) 893internal async Task ReceiveHeadersAsync(int expectedStreamId, bool endStream = false, Action<IDictionary<string, string>> verifyHeaders = null) 934internal async Task WaitForConnectionErrorAsync<TException>(bool ignoreNonGoAwayFrames, int expectedLastStreamId, Http2ErrorCode expectedErrorCode) 941internal async Task WaitForConnectionErrorAsyncDoNotCloseTransport<TException>(bool ignoreNonGoAwayFrames, int expectedLastStreamId, Http2ErrorCode expectedErrorCode) 957internal async Task WaitForStreamErrorAsync(int expectedStreamId, Http2ErrorCode expectedErrorCode)
src\Shared\ServerInfrastructure\DuplexPipeStream.cs (2)
96public override Task WriteAsync(byte[]? buffer, int offset, int count, CancellationToken cancellationToken) 111public override Task FlushAsync(CancellationToken cancellationToken)
src\Shared\TaskToApm.cs (3)
32public static IAsyncResult Begin(Task task, AsyncCallback? callback, object? state) => 69internal readonly Task _task; 77internal TaskAsyncResult(Task task, object? state, AsyncCallback? callback)
src\Shared\ValueTaskExtensions\ValueTaskExtensions.cs (2)
13public static Task GetAsTask(this in ValueTask<FlushResult> valueTask) 20return Task.CompletedTask;
Http2SampleApp (1)
TimingMiddleware.cs (1)
21public async Task Invoke(HttpContext httpContext)
HttpOverridesSample (1)
Startup.cs (1)
33public static Task Main(string[] args)
HttpsPolicySample (1)
Startup.cs (1)
43public static Task Main(string[] args)
HttpStress (13)
Program.cs (13)
115Func<ClientContext, Task> TestAbort(string path) 168var clientOperations = new (string, Func<ClientContext, Task>)[] 219await Task.Delay(1); 307await Task.Delay(1); 465var writeTask = context.Response.WriteAsync(contentSource.Substring(0, contentSource.Length)); 466await Task.Yield(); 496return Task.CompletedTask; 579Task.WaitAll(Enumerable.Range(0, concurrentRequests).Select(taskNum => Task.Run(async () => 586(string operation, Func<ClientContext, Task> func) = clientOperations[opIndex]; 669protected override async Task SerializeToStreamAsync(Stream stream, TransportContext context) 696protected override Task SerializeToStreamAsync(Stream stream, TransportContext context) => 713protected override async Task SerializeToStreamAsync(Stream stream, TransportContext context)
Identity.DefaultUI.WebSite (76)
Services\ContosoAuthenticationHandler.cs (3)
23Task.FromResult(AuthenticateResult.NoResult()); 25protected override Task HandleChallengeAsync(AuthenticationProperties properties) 35return Task.CompletedTask;
Services\ContosoEmailSender.cs (2)
12public Task SendEmailAsync(string email, string subject, string htmlMessage) 15return Task.CompletedTask;
src\Identity\test\InMemory.Test\InMemoryUserStore.cs (71)
36return Task.FromResult<IList<Claim>>(claims); 39public Task AddClaimsAsync(TUser user, IEnumerable<Claim> claims, CancellationToken cancellationToken = default(CancellationToken)) 45return Task.FromResult(0); 48public Task ReplaceClaimAsync(TUser user, Claim claim, Claim newClaim, CancellationToken cancellationToken = default(CancellationToken)) 56return Task.FromResult(0); 59public Task RemoveClaimsAsync(TUser user, IEnumerable<Claim> claims, CancellationToken cancellationToken = default(CancellationToken)) 71return Task.FromResult(0); 74public Task SetEmailAsync(TUser user, string email, CancellationToken cancellationToken = default(CancellationToken)) 77return Task.FromResult(0); 82return Task.FromResult(user.Email); 87return Task.FromResult(user.NormalizedEmail); 90public Task SetNormalizedEmailAsync(TUser user, string normalizedEmail, CancellationToken cancellationToken = default(CancellationToken)) 93return Task.FromResult(0); 98return Task.FromResult(user.EmailConfirmed); 101public Task SetEmailConfirmedAsync(TUser user, bool confirmed, CancellationToken cancellationToken = default(CancellationToken)) 104return Task.FromResult(0); 110Task.FromResult( 116return Task.FromResult(user.LockoutEnd); 119public Task SetLockoutEndDateAsync(TUser user, DateTimeOffset? lockoutEnd, CancellationToken cancellationToken = default(CancellationToken)) 122return Task.FromResult(0); 128return Task.FromResult(user.AccessFailedCount); 131public Task ResetAccessFailedCountAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken)) 134return Task.FromResult(0); 139return Task.FromResult(user.AccessFailedCount); 144return Task.FromResult(user.LockoutEnabled); 147public Task SetLockoutEnabledAsync(TUser user, bool enabled, CancellationToken cancellationToken = default(CancellationToken)) 150return Task.FromResult(0); 158public virtual Task AddLoginAsync(TUser user, UserLoginInfo login, 169return Task.FromResult(0); 172public Task RemoveLoginAsync(TUser user, string loginProvider, string providerKey, 185return Task.FromResult(0); 192return Task.FromResult(result); 200return Task.FromResult(_logins[key]); 202return Task.FromResult<TUser>(null); 207return Task.FromResult(user.Id); 212return Task.FromResult(user.UserName); 215public Task SetUserNameAsync(TUser user, string userName, CancellationToken cancellationToken = default(CancellationToken)) 218return Task.FromResult(0); 224return Task.FromResult(IdentityResult.Success); 230return Task.FromResult(IdentityResult.Success); 237return Task.FromResult(_users[userId]); 239return Task.FromResult<TUser>(null); 249Task.FromResult( 260return Task.FromResult(IdentityResult.Success); 263public Task SetPasswordHashAsync(TUser user, string passwordHash, CancellationToken cancellationToken = default(CancellationToken)) 266return Task.FromResult(0); 271return Task.FromResult(user.PasswordHash); 276return Task.FromResult(user.PasswordHash != null); 279public Task SetPhoneNumberAsync(TUser user, string phoneNumber, CancellationToken cancellationToken = default(CancellationToken)) 282return Task.FromResult(0); 287return Task.FromResult(user.PhoneNumber); 292return Task.FromResult(user.PhoneNumberConfirmed); 295public Task SetPhoneNumberConfirmedAsync(TUser user, bool confirmed, CancellationToken cancellationToken = default(CancellationToken)) 298return Task.FromResult(0); 301public Task SetSecurityStampAsync(TUser user, string stamp, CancellationToken cancellationToken = default(CancellationToken)) 304return Task.FromResult(0); 309return Task.FromResult(user.SecurityStamp); 312public Task SetTwoFactorEnabledAsync(TUser user, bool enabled, CancellationToken cancellationToken = default(CancellationToken)) 315return Task.FromResult(0); 320return Task.FromResult(user.TwoFactorEnabled); 325return Task.FromResult(user.NormalizedUserName); 328public Task SetNormalizedUserNameAsync(TUser user, string userName, CancellationToken cancellationToken = default(CancellationToken)) 331return Task.FromResult(0); 342return Task.FromResult<IList<TUser>>(query.ToList()); 345public Task SetTokenAsync(TUser user, string loginProvider, string name, string value, CancellationToken cancellationToken) 366return Task.FromResult(0); 369public Task RemoveTokenAsync(TUser user, string loginProvider, string name, CancellationToken cancellationToken) 380return Task.FromResult(0); 390return Task.FromResult(tokenEntity?.TokenValue); 397public Task SetAuthenticatorKeyAsync(TUser user, string key, CancellationToken cancellationToken) 407public Task ReplaceCodesAsync(TUser user, IEnumerable<string> recoveryCodes, CancellationToken cancellationToken)
Identity.ExternalClaims (8)
Extensions\EmailSenderExtensions.cs (2)
15public static Task SendEmailConfirmationAsync(this IEmailSender emailSender, string email, string link) 21public static Task SendResetPasswordAsync(this IEmailSender emailSender, string email, string callbackUrl)
Pages\Account\Login.cshtml.cs (1)
53public async Task OnGetAsync(string returnUrl = null)
Pages\Account\Manage\EnableAuthenticator.cshtml.cs (1)
105private async Task LoadSharedKeyAndQrCodeUriAsync(ApplicationUser user)
Services\EmailSender.cs (2)
15public Task SendEmailAsync(string email, string subject, string message) 17return Task.CompletedTask;
Services\IEmailSender.cs (1)
13Task SendEmailAsync(string email, string subject, string message);
Startup.cs (1)
56return Task.CompletedTask;
IdentitySample.DefaultUI (2)
Areas\Identity\Pages\Account\Register.cshtml.cs (1)
70public async Task OnGetAsync(string returnUrl = null)
Startup.cs (1)
15return Task.FromResult(false);
IdentitySample.Mvc (10)
MessageServices.cs (4)
8public static Task SendEmailAsync(string email, string subject, string message) 11return Task.FromResult(0); 14public static Task SendSmsAsync(string number, string message) 17return Task.FromResult(0);
Services\IEmailSender.cs (1)
8Task SendEmailAsync(string email, string subject, string message);
Services\ISmsSender.cs (1)
8Task SendSmsAsync(string number, string message);
Services\MessageServices.cs (4)
11public Task SendEmailAsync(string email, string subject, string message) 14return Task.FromResult(0); 17public Task SendSmsAsync(string number, string message) 20return Task.FromResult(0);
IIS.Common.TestLib (5)
TestConnections.cs (5)
64public async Task Send(params string[] lines) 110public async Task ReceiveChunk(string expected) 115public async Task Receive(params string[] lines) 158public async Task ReceiveStartsWith(string prefix, int maxLineLength = 1024) 208public Task WaitForConnectionClose()
IIS.FunctionalTests (238)
Http2TrailersResetTests.cs (20)
47public async Task ResponseTrailers_HTTP2_TrailersAvailable() 58public async Task ResponseTrailers_ProhibitedTrailers_Blocked() 69public async Task ResponseTrailers_NoBody_TrailersSent() 81public async Task ResponseTrailers_WithBody_TrailersSent() 94public async Task ResponseTrailers_WithContentLengthBody_TrailersSent() 109public async Task ResponseTrailers_WithTrailersBeforeContentLengthBody_TrailersSent() 127public async Task ResponseTrailers_WithContentLengthBodyAndDeclared_TrailersSent() 146public async Task ResponseTrailers_MultipleValues_SentAsSeparateHeaders() 159public async Task ResponseTrailers_CompleteAsyncNoBody_TrailersSent() 175public async Task ResponseTrailers_CompleteAsyncWithBody_TrailersSent() 193public async Task AppException_AfterHeaders_ResetInternalError() 221public async Task Reset_BeforeResponse_Resets() 248public async Task RequestClose_SendsGoAway() 282public async Task Reset_BeforeResponse_Zero_Resets() 309public async Task Reset_AfterResponseHeaders_Resets() 341public async Task Reset_DuringResponseBody_Resets() 377public async Task Reset_BeforeRequestBody_Resets() 402public async Task Reset_DuringRequestBody_Resets() 427public async Task Reset_AfterCompleteAsync_NoReset() 456public async Task Reset_CompleteAsyncDuringRequestBody_Resets()
Http3Tests.cs (8)
45public async Task Http3_Direct() 58public async Task Http3_AltSvcHeader_UpgradeFromHttp1() 82public async Task Http3_AltSvcHeader_UpgradeFromHttp2() 103public async Task Http3_ResponseTrailers() 117public async Task Http3_ResetBeforeHeaders() 130public async Task Http3_ResetAfterHeaders() 146public async Task Http3_AppExceptionAfterHeaders_InternalError() 163public async Task Http3_Abort_Cancel()
src\Servers\IIS\IIS\test\Common.FunctionalTests\AspNetCorePortTests.cs (4)
55public async Task EnvVarInWebConfig_Valid(TestVariant variant) 71public async Task EnvVarInWebConfig_Empty(TestVariant variant) 87public async Task EnvVarInWebConfig_Invalid(TestVariant variant, string port) 103public async Task ShutdownMultipleTimesWorks(TestVariant variant)
src\Servers\IIS\IIS\test\Common.FunctionalTests\BasicAuthTests.cs (1)
48public async Task BasicAuthTest(TestVariant variant)
src\Servers\IIS\IIS\test\Common.FunctionalTests\CompressionTests.cs (3)
41public async Task BufferingDisabledWithCompressedRequest() 83public async Task BufferingDisabledWithoutCompressedRequest() 125public async Task DynamicResponsesAreCompressed()
src\Servers\IIS\IIS\test\Common.FunctionalTests\FrebTests.cs (4)
54public async Task CheckCommonFrebEvents() 68public async Task FrebIncludesHResultFailures() 83public async Task CheckFailedRequestEvents() 96public async Task CheckFrebDisconnect()
src\Servers\IIS\IIS\test\Common.FunctionalTests\GlobalVersionTests.cs (7)
44public async Task GlobalVersion_DefaultWorks() 60public async Task GlobalVersion_EnvironmentVariableWorks() 92public async Task GlobalVersion_NewVersionNumber_Fails(string version) 110public async Task GlobalVersion_NewVersionNumber(string version) 133public async Task GlobalVersion_MultipleRequestHandlers_PicksHighestOne(string version) 158public async Task GlobalVersion_MultipleRequestHandlers_UpgradeWorks(string version) 191public async Task DoesNotCrashWhenNoVersionsAvailable()
src\Servers\IIS\IIS\test\Common.FunctionalTests\Http2Tests.cs (9)
62public async Task Http2_MethodsRequestWithoutData_Success(string method) 99public async Task Http2_PostRequestWithoutData_LengthRequired(string method) 142public async Task Http2_RequestWithDataAndContentLength_Success(string method) 212public async Task Http2_RequestWithDataAndNoContentLength_Success(string method) 274public async Task Http2_ResponseWithData_Success() 318public async Task ResponseTrailers_HTTP1_TrailersNotAvailable() 330public async Task AppException_BeforeResponseHeaders_500() 356public async Task Reset_Http1_NotSupported() 370public async Task Reset_PriorOSVersions_NotSupported()
src\Servers\IIS\IIS\test\Common.FunctionalTests\HttpsTests.cs (3)
53public Task HttpsNoClientCert_NoClientCert(TestVariant variant) 61public Task HttpsClientCert_GetCertInformation(TestVariant variant) 66private async Task ClientCertTest(TestVariant variant, bool sendClientCert)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (16)
26public static async Task AssertStarts(this IISDeploymentResult deploymentResult, string path = "/HelloWorld") 41public static async Task StressLoad(HttpClient httpClient, string path, Action<HttpResponseMessage> action) 43async Task RunRequests() 58List<Task> tasks = new List<Task>(); 61tasks.Add(Task.Run(RunRequests)); 64await Task.WhenAll(tasks); 107return RetryRequestAsync(client, uri, message => Task.FromResult(predicate(message))); 118await Task.Delay(delay); 131public static Task Retry(Func<Task> func, TimeSpan maxTime) 136public static async Task Retry(Func<Task> func, int attempts, int msDelay) 151await Task.Delay(msDelay); 168public static async Task AssertRecycledAsync(this IISDeploymentResult deploymentResult, Func<Task> verificationAction = null)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\IISFunctionalTestBase.cs (2)
51public async Task AssertAppOffline(IISDeploymentResult deploymentResult, string expectedResponse = "The app is offline.") 66public static async Task AssertRunning(IISDeploymentResult deploymentResult)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\PublishedApplicationPublisher.cs (1)
40return Task.FromResult(new PublishedApplication(target.FullName, logger));
src\Servers\IIS\IIS\test\Common.FunctionalTests\Inprocess\HttpSysRequestInfoTests.cs (1)
30public async Task TimingInfo()
src\Servers\IIS\IIS\test\Common.FunctionalTests\Inprocess\MaxRequestBodySizeTests.cs (6)
37public async Task MaxRequestBodySizeE2EWorks() 50public async Task SetIISLimitMaxRequestBodySizeE2EWorks() 73public async Task SetIISLimitMaxRequestBodySizeE2EWorksWithLargerLimit() 94public async Task SetIISLimitMaxRequestBodySizeE2EWorksWithIntMaxValue() 115public async Task IISRejectsContentLengthTooLargeByDefault() 136public async Task SetIISLimitMaxRequestBodyLogsWarning()
src\Servers\IIS\IIS\test\Common.FunctionalTests\Latin1Tests.cs (3)
39public async Task Latin1Works() 57public async Task Latin1ReplacedWithoutAppContextSwitch() 75public async Task Latin1InvalidCharacters_HttpSysRejects()
src\Servers\IIS\IIS\test\Common.FunctionalTests\LoggingTests.cs (16)
53public async Task CheckStdoutLoggingToFile(TestVariant variant) 60public async Task CheckStdoutErrLoggingToFile(TestVariant variant) 65private async Task CheckStdoutToFile(TestVariant variant, string path) 86public async Task InvalidFilePathForLogs_ServerStillRuns(TestVariant variant) 110public async Task StartupMessagesAreLoggedIntoDebugLogFile(TestVariant variant) 125public async Task StartupMessagesAreLoggedIntoDefaultDebugLogFile(TestVariant variant) 140public async Task StartupMessagesAreLoggedIntoDefaultDebugLogFileWhenEnabledWithEnvVar(TestVariant variant) 156public async Task StartupMessagesLogFileSwitchedWhenLogFilePresentInWebConfig(TestVariant variant) 187public async Task DebugLogsAreWrittenToEventLog(TestVariant variant) 199public async Task CheckUTF8File(TestVariant variant) 224public async Task OnlyOneFileCreatedWithProcessStartTime(TestVariant variant) 239public async Task CaptureLogsForOutOfProcessWhenProcessFailsToStart() 254public async Task DisableRedirectionNoLogs() 269public async Task CaptureLogsForOutOfProcessWhenProcessFailsToStart30KbMax() 285public async Task CheckStdoutLoggingToPipeWithFirstWrite(string path) 307public async Task LogsContainTimestampAndPID()
src\Servers\IIS\IIS\test\Common.FunctionalTests\MaxRequestBodySizeTests.cs (6)
38public async Task MaxRequestBodySizeE2EWorks() 51public async Task SetIISLimitMaxRequestBodySizeE2EWorks() 74public async Task SetIISLimitMaxRequestBodySizeE2EWorksWithLargerLimit() 95public async Task SetIISLimitMaxRequestBodySizeE2EWorksWithIntMaxValue() 116public async Task IISRejectsContentLengthTooLargeByDefault() 137public async Task SetIISLimitMaxRequestBodyLogsWarning()
src\Servers\IIS\IIS\test\Common.FunctionalTests\MultiApplicationTests.cs (3)
42public async Task RunsTwoOutOfProcessApps() 53public async Task FailsAndLogsWhenRunningTwoInProcessApps() 76public async Task FailsAndLogsEventLogForMixedHostingModel(HostingModel firstApp)
src\Servers\IIS\IIS\test\Common.FunctionalTests\RequestPathBaseTests.cs (2)
46public async Task RequestPathBase_Split(string url, string expectedPathBase, string expectedPath) 76public async Task RequestPathBase_WithDoubleSlashes_Split(string url, string expectedPathBase, string expectedPath)
src\Servers\IIS\IIS\test\Common.FunctionalTests\RequestResponseTests.cs (59)
45public async Task RequestPath_UrlUnescaping() 67public async Task Request_WithDoubleSlashes_LeftAlone() 79public async Task Request_WithNavigation_Removed(string input, string expectedPath) 90public async Task Request_WithEscapedNavigation_Removed(string input, string expectedPath) 99public async Task Request_ControlCharacters_400() 114public async Task Request_EscapedControlCharacters_400() 125public async Task PassesThroughCompressionOutOfProcess() 143public async Task PassesThroughCompressionInProcess() 160public async Task ReadAndWriteSynchronously() 173public async Task ReadAndWriteEcho() 184public async Task ReadAndWriteCopyToAsync() 195public async Task ReadAndWriteEchoTwice() 206public async Task ReadSetHeaderWrite() 218public async Task ReadAndWriteSlowConnection() 231await Task.Delay(10); 245await Task.Delay(10); 252public async Task ReadAndWriteInterleaved() 289public async Task ConsumePartialBody() 334public async Task AsyncChunkedPostIsAccepted() 373public async Task ResponseBodyTest_UnflushedPipe_AutoFlushed() 380public async Task ResponseBodyTest_FlushedPipeAndThenUnflushedPipe_AutoFlushed() 387public async Task ResponseBodyTest_GettingHttpContextFieldsWork() 395public async Task ResponseBodyTest_CompleteAsyncWorks() 407public async Task ProvidesAccessToServerVariables() 415public async Task ReturnsNullForUndefinedServerVariable() 421public async Task CanSetAndReadVariable() 427public async Task BasePathIsNotPrefixedBySlashSlashQuestionMark() 433public async Task GetServerVariableDoesNotCrash() 444public async Task TestStringValuesEmptyForMissingHeaders() 451public async Task TestReadOffsetWorks() 463public async Task TestInvalidReadOperations(string operation) 472public async Task TestValidReadOperations(string operation) 481public async Task TestValidReadOperationsPost(string operation) 493public async Task TestInvalidWriteOperations(string operation) 500public async Task TestValidWriteOperations() 507public async Task TestValidWriteOperationsPost() 514public async Task AddEmptyHeaderSkipped() 523public async Task AddResponseHeaders_HeaderValuesAreSetCorrectly() 543public async Task ErrorCodeIsSetForExceptionDuringRequest() 566public async Task CustomErrorCodeWorks(int code, string reason, string expectedReason, string body) 580public async Task TransferEncodingNotSetForStatusCodes(int code, string method) 589public async Task ServerHeaderIsOverriden() 598public async Task ResponseInvalidOrderingTests_ExpectFailure(string path) 605public async Task HostingEnvironmentIsCorrect() 617public async Task IISEnvironmentFeatureIsAvailable(string endpoint) 641public async Task LargeResponseBodyTest_CheckAllResponseBodyBytesWritten(int query) 647public async Task LargeResponseBodyFromFile_CheckAllResponseBodyBytesWritten() 656public async Task FeatureCollectionTest_SetHttpContextFeatures(string path) 664public async Task ExposesIServerAddressesFeature() 670public async Task ServerWorksAfterClientDisconnect() 697public async Task RequestAbortedTokenFires() 717public async Task ClientDisconnectStress() 721async Task RunRequests() 742List<Task> tasks = new List<Task>(); 745tasks.Add(Task.Run(RunRequests)); 748await Task.WhenAll(tasks); 753public async Task SendTransferEncodingHeadersWithMultipleValues() 773public async Task SendTransferEncodingAndContentLength_ContentLengthShouldBeRemoved()
src\Servers\IIS\IIS\test\Common.FunctionalTests\WindowsAuthTests.cs (1)
45public async Task WindowsAuthTest(TestVariant variant)
src\Servers\IIS\IIS\test\IIS.Shared.FunctionalTests\ApplicationInitializationTests.cs (2)
45public async Task ApplicationPreloadStartsApp(HostingModel hostingModel, bool delayShutdown) 83public async Task ApplicationInitializationPageIsRequested(HostingModel hostingModel)
src\Servers\IIS\IIS\test\IIS.Shared.FunctionalTests\StdOutRedirectionTests.cs (5)
37public async Task FrameworkNotFoundExceptionLogged_Pipe() 58public async Task FrameworkNotFoundExceptionLogged_File() 87public async Task EnableCoreHostTraceLogging_TwoLogFilesCreated() 117public async Task EnableCoreHostTraceLogging_PipeCaptureNativeLogs(string path) 141public async Task EnableCoreHostTraceLogging_FileCaptureNativeLogs(string path)
src\Shared\Http2cat\Http2CatHostedService.cs (5)
29private Task _backgroundTask; 43public Task StartAsync(CancellationToken cancellationToken) 46return Task.CompletedTask; 49public Task StopAsync(CancellationToken cancellationToken) 55private async Task RunAsync()
src\Shared\Http2cat\Http2CatIHostBuilderExtensions.cs (1)
13public static IHostBuilder UseHttp2Cat(this IHostBuilder hostBuilder, string address, Func<Http2Utilities, Task> scenario)
src\Shared\Http2cat\Http2CatOptions.cs (1)
12public Func<Http2Utilities, Task> Scenaro { get; set; }
src\Shared\Http2cat\Http2Utilities.cs (42)
153public async Task InitializeConnectionAsync(int expectedSettingsCount = 3) 174public Task StartStreamAsync(int streamId, IEnumerable<KeyValuePair<string, string>> headers, bool endStream) 272public Task SendHeadersWithPaddingAsync(int streamId, IEnumerable<KeyValuePair<string, string>> headers, byte padLength, bool endStream) 312public Task SendHeadersWithPriorityAsync(int streamId, IEnumerable<KeyValuePair<string, string>> headers, byte priority, int streamDependency, bool endStream) 355public Task SendHeadersWithPaddingAndPriorityAsync(int streamId, IEnumerable<KeyValuePair<string, string>> headers, byte padLength, byte priority, int streamDependency, bool endStream) 389public Task SendAsync(ReadOnlySpan<byte> span) 396public static async Task FlushAsync(PipeWriter writableBuffer) 401public Task SendPreambleAsync() => SendAsync(ClientPreface); 403public async Task SendSettingsAsync() 426public async Task SendSettingsAckWithInvalidLengthAsync(int length) 436public async Task SendSettingsWithInvalidStreamIdAsync(int streamId) 450public async Task SendSettingsWithInvalidLengthAsync(int length) 462internal async Task SendSettingsWithInvalidParameterValueAsync(Http2SettingsParameter parameter, uint value) 480public Task SendPushPromiseFrameAsync() 508internal async Task SendHeadersAsync(int streamId, Http2HeadersFrameFlags flags, byte[] headerBlock) 520public async Task SendInvalidHeadersFrameAsync(int streamId, int payloadLength, byte padLength) 539public async Task SendIncompleteHeadersFrameAsync(int streamId) 573internal async Task SendContinuationAsync(int streamId, Http2ContinuationFrameFlags flags, byte[] payload) 601internal Task SendEmptyContinuationFrameAsync(int streamId, Http2ContinuationFrameFlags flags) 613public async Task SendIncompleteContinuationFrameAsync(int streamId) 631public Task SendDataAsync(int streamId, Memory<byte> data, bool endStream) 644public async Task SendDataWithPaddingAsync(int streamId, Memory<byte> data, byte padLength, bool endStream) 664public Task SendInvalidDataFrameAsync(int streamId, int frameLength, byte padLength) 684internal Task SendPingAsync(Http2PingFrameFlags flags) 693public Task SendPingWithInvalidLengthAsync(int length) 703public Task SendPingWithInvalidStreamIdAsync(int streamId) 722public Task SendPriorityAsync(int streamId, int streamDependency = 0) 736public Task SendInvalidPriorityFrameAsync(int streamId, int length) 752public Task SendRstStreamAsync(int streamId) 764public Task SendInvalidRstStreamFrameAsync(int streamId, int length) 774public Task SendGoAwayAsync() 783public Task SendInvalidGoAwayFrameAsync() 793public Task SendWindowUpdateAsync(int streamId, int sizeIncrement) 805public Task SendInvalidWindowUpdateAsync(int streamId, int sizeIncrement, int length) 815public Task SendUnknownFrameTypeAsync(int streamId, int frameType) 877public async Task StopConnectionAsync(int expectedLastStreamId, bool ignoreNonGoAwayFrames) 885public Task WaitForConnectionStopAsync(int expectedLastStreamId, bool ignoreNonGoAwayFrames) 890internal Task ReceiveHeadersAsync(int expectedStreamId, Action<IDictionary<string, string>> verifyHeaders = null) 893internal async Task ReceiveHeadersAsync(int expectedStreamId, bool endStream = false, Action<IDictionary<string, string>> verifyHeaders = null) 934internal async Task WaitForConnectionErrorAsync<TException>(bool ignoreNonGoAwayFrames, int expectedLastStreamId, Http2ErrorCode expectedErrorCode) 941internal async Task WaitForConnectionErrorAsyncDoNotCloseTransport<TException>(bool ignoreNonGoAwayFrames, int expectedLastStreamId, Http2ErrorCode expectedErrorCode) 957internal async Task WaitForStreamErrorAsync(int expectedStreamId, Http2ErrorCode expectedErrorCode)
src\Shared\ServerInfrastructure\DuplexPipeStream.cs (2)
96public override Task WriteAsync(byte[]? buffer, int offset, int count, CancellationToken cancellationToken) 111public override Task FlushAsync(CancellationToken cancellationToken)
src\Shared\TaskToApm.cs (3)
32public static IAsyncResult Begin(Task task, AsyncCallback? callback, object? state) => 69internal readonly Task _task; 77internal TaskAsyncResult(Task task, object? state, AsyncCallback? callback)
src\Shared\ValueTaskExtensions\ValueTaskExtensions.cs (2)
13public static Task GetAsTask(this in ValueTask<FlushResult> valueTask) 20return Task.CompletedTask;
IIS.LongTests (185)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (16)
26public static async Task AssertStarts(this IISDeploymentResult deploymentResult, string path = "/HelloWorld") 41public static async Task StressLoad(HttpClient httpClient, string path, Action<HttpResponseMessage> action) 43async Task RunRequests() 58List<Task> tasks = new List<Task>(); 61tasks.Add(Task.Run(RunRequests)); 64await Task.WhenAll(tasks); 107return RetryRequestAsync(client, uri, message => Task.FromResult(predicate(message))); 118await Task.Delay(delay); 131public static Task Retry(Func<Task> func, TimeSpan maxTime) 136public static async Task Retry(Func<Task> func, int attempts, int msDelay) 151await Task.Delay(msDelay); 168public static async Task AssertRecycledAsync(this IISDeploymentResult deploymentResult, Func<Task> verificationAction = null)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\IISFunctionalTestBase.cs (2)
51public async Task AssertAppOffline(IISDeploymentResult deploymentResult, string expectedResponse = "The app is offline.") 66public static async Task AssertRunning(IISDeploymentResult deploymentResult)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\PublishedApplicationPublisher.cs (1)
40return Task.FromResult(new PublishedApplication(target.FullName, logger));
src\Servers\IIS\IIS\test\Common.LongTests\ShutdownTests.cs (33)
39public async Task ShutdownTimeoutIsApplied() 60public async Task CallStopAsyncOnRequestThread_DoesNotHangIndefinitely(string path) 79public async Task AppOfflineDroppedWhileSiteIsDown_SiteReturns503_InProcess() 91public async Task AppOfflineDroppedWhileSiteIsDown_SiteReturns503_OutOfProcess() 102public async Task LockedAppOfflineDroppedWhileSiteIsDown_SiteReturns503_InProcess() 120public async Task LockedAppOfflineDroppedWhileSiteIsDown_SiteReturns503_OutOfProcess() 137public async Task AppOfflineDroppedWhileSiteFailedToStartInShim_AppOfflineServed_InProcess() 156public async Task AppOfflineDroppedWhileSiteFailedToStartInShim_AppOfflineServed_OutOfProcess() 174public async Task AppOfflineDroppedWhileSiteFailedToStartInRequestHandler_SiteStops_InProcess() 191public async Task GracefulShutdownWorksWithMultipleRequestsInFlight_InProcess() 265public async Task RequestsWhileRestartingAppFromConfigChangeAreProcessed() 289await Task.Delay(1); 302public async Task RequestsWhileRecyclingAppAreProcessed() 326await Task.Delay(1); 338public async Task AppOfflineDroppedWhileSiteRunning_SiteShutsDown_InProcess() 349public async Task AppOfflineDroppedWhileSiteRunning_SiteShutsDown_OutOfProcess() 364public async Task AppOfflineDropped_CanRemoveAppOfflineAfterAddingAndSiteWorks_InProcess() 379public async Task AppOfflineDropped_CanRemoveAppOfflineAfterAddingAndSiteWorks_OutOfProcess() 395public async Task AppOfflineAddedAndRemovedStress_InProcess() 402public async Task AppOfflineAddedAndRemovedStress_OutOfProcess() 407private async Task AppOfflineAddAndRemovedStress(HostingModel hostingModel) 411var load = Helpers.StressLoad(deploymentResult.HttpClient, "/HelloWorld", response => 449public async Task ConfigurationChangeStopsInProcess() 465public async Task ConfigurationChangeForcesChildProcessRestart() 482public async Task ConfigurationChangeCanBeIgnoredInProcess() 502public async Task AppHostConfigurationChangeIsIgnoredInProcess() 523public async Task ConfigurationChangeCanBeIgnoredOutOfProcess() 541public async Task OutOfProcessToInProcessHostingModelSwitchWorks() 563public async Task ConfigurationTouchedStress_InProcess() 568private async Task ConfigurationTouchedStress(HostingModel hostingModel) 573var load = Helpers.StressLoad(deploymentResult.HttpClient, "/HelloWorld", response => 605public async Task ClosesConnectionOnServerAbortOutOfProcess() 633public async Task ClosesConnectionOnServerAbortInProcess()
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (77)
45public async Task ExpandEnvironmentVariableInWebConfig() 60public async Task InvalidProcessPath_ExpectServerError(string path, string arguments, string subError) 86public async Task StartsWithDotnetLocationWithoutExe() 97public async Task StartsWithDotnetLocationUppercase() 111public async Task StartsWithDotnetOnThePath(string path) 130public async Task StartsWithDotnetInstallLocation() 163public async Task DoesNotStartIfDisabled() 195public async Task HelloWorld(TestVariant variant) 203public async Task StartsWithPortableAndBootstraperExe() 222public async Task DetectsOverriddenServer() 239public async Task LogsStartupExceptionExitError() 257public async Task LogsUnexpectedThreadExitError() 274public async Task RemoveHostfxrFromApp_InProcessHostfxrAPIAbsent() 298public async Task PublishWithWrongBitness() 339public async Task RemoveHostfxrFromApp_InProcessHostfxrLoadFailure() 361public async Task TargetDifferenceSharedFramework_FailedToFindNativeDependencies() 382public async Task WrongApplicationPath_FailedToRun() 400public async Task SingleExecutable_FailedToFindNativeDependencies() 418public async Task TargedDifferenceSharedFramework_FailedToFindNativeDependenciesErrorInResponse() 441public async Task RemoveInProcessReference_FailedToFindRequestHandler() 465public async Task StartupTimeoutIsApplied() 498public async Task StartupTimeoutIsApplied_DisableRecycleOnStartupTimeout() 530public async Task CheckInvalidHostingModelParameter() 553public async Task ReportsWebConfigAuthoringErrors(string scenario) 598public async Task StartsWithWebConfigVariationsPortable(string scenario) 668public async Task StartsWithWebConfigVariationsStandalone(string scenario) 706public async Task SetCurrentDirectoryHandlerSettingWorks() 723public async Task StartupIsSuspendedWhenEventIsUsed() 736var request = deploymentResult.AssertStarts(); 762public async Task ExceptionIsLoggedToEventLogAndPutInResponseWhenDeveloperExceptionPageIsEnabled(string environmentVariable, string value) 786public async Task ExceptionIsLoggedToEventLogAndPutInResponseWhenDeveloperExceptionPageIsEnabledViaWebConfig() 813public async Task ExceptionIsLoggedToEventLogAndPutInResponseDuringHostingStartupProcess(string startupType) 835public async Task ExceptionIsNotLoggedToResponseWhenStartupHookIsDisabled() 857public async Task ExceptionIsLoggedToEventLogDoesNotWriteToResponse() 879public async Task CanAddCustomStartupHook() 896public async Task CanAddCustomStartupHookWhenIISOneIsDisabled() 914public async Task StackOverflowIsAvoidedBySettingLargerStack() 924public async Task StackOverflowCanBeSetBySettingLargerStackViaHandlerSetting() 940public async Task EnvironmentVariableForLauncherPathIsPreferred(HostingModel hostingModel) 956public async Task EnvironmentVariableForLauncherArgsIsPreferred(HostingModel hostingModel) 969public async Task OnCompletedDoesNotFailRequest() 992public async Task CheckStdoutWithLargeWrites_TestSink(string mode) 1015public async Task CheckStdoutWithLargeWrites_LogFile(string mode) 1039public async Task CheckValidConsoleFunctions() 1052public async Task Gets500_30_ErrorPage() 1069public async Task IncludesAdditionalErrorPageTextInProcessHandlerLoadFailure_CorrectString() 1088public async Task IncludesAdditionalErrorPageTextOutOfProcessStartupFailure_CorrectString() 1107public async Task IncludesAdditionalErrorPageTextOutOfProcessHandlerLoadFailure_CorrectString() 1130public async Task IncludesAdditionalErrorPageTextInProcessStartupFailure_CorrectString() 1151public async Task GetLongEnvironmentVariable_InProcess() 1170public async Task GetLongEnvironmentVariable_OutOfProcess() 1189public Task AuthHeaderEnvironmentVariableRemoved_InProcess() => AuthHeaderEnvironmentVariableRemoved(HostingModel.InProcess); 1192public Task AuthHeaderEnvironmentVariableRemoved_OutOfProcess() => AuthHeaderEnvironmentVariableRemoved(HostingModel.OutOfProcess); 1194private async Task AuthHeaderEnvironmentVariableRemoved(HostingModel hostingModel) 1205public Task WebConfigOverridesGlobalEnvironmentVariables_InProcess() => WebConfigOverridesGlobalEnvironmentVariables(HostingModel.InProcess); 1210public Task WebConfigOverridesGlobalEnvironmentVariables_OutOfProcess() => WebConfigOverridesGlobalEnvironmentVariables(HostingModel.OutOfProcess); 1212private async Task WebConfigOverridesGlobalEnvironmentVariables(HostingModel hostingModel) 1223public Task WebConfigAppendsHostingStartup_InProcess() => WebConfigAppendsHostingStartup(HostingModel.InProcess); 1228public Task WebConfigAppendsHostingStartup_OutOfProcess() => WebConfigAppendsHostingStartup(HostingModel.OutOfProcess); 1230private async Task WebConfigAppendsHostingStartup(HostingModel hostingModel) 1247public Task WebConfigOverridesHostingStartup_InProcess() => WebConfigOverridesHostingStartup(HostingModel.InProcess); 1252public Task WebConfigOverridesHostingStartup_OutOfProcess() => WebConfigOverridesHostingStartup(HostingModel.OutOfProcess); 1254private async Task WebConfigOverridesHostingStartup(HostingModel hostingModel) 1265public Task WebConfigExpandsVariables_InProcess() => WebConfigExpandsVariables(HostingModel.InProcess); 1270public Task WebConfigExpandsVariables_OutOfProcess() => WebConfigExpandsVariables(HostingModel.OutOfProcess); 1272private async Task WebConfigExpandsVariables(HostingModel hostingModel) 1286public async Task PreferEnvironmentVariablesOverWebConfigWhenConfigured(HostingModel hostingModel) 1301public async Task ServerAddressesIncludesBaseAddress() 1325public async Task AncmHttpsPortCanBeOverriden() 1349public async Task HttpsRedirectionWorksIn30AndNot22() 1396public async Task MultipleHttpsPortsProduceNoEnvVar() 1426public async Task SetsConnectionCloseHeader() 1485private static async Task AssertLink(HttpResponseMessage response) 1502private async Task AssertFailsToStart(IISDeploymentResult deploymentResult) 1566private Task AssertSiteFailsToStartWithInProcessStaticContent(IISDeploymentResult deploymentResult) 1571private async Task AssertSiteFailsToStartWithInProcessStaticContent(IISDeploymentResult deploymentResult, string error) 1586private async Task AssertSiteFailsToStartWithInProcessStaticContent(IISDeploymentResult deploymentResult, params string[] errors)
src\Shared\Http2cat\Http2CatHostedService.cs (5)
29private Task _backgroundTask; 43public Task StartAsync(CancellationToken cancellationToken) 46return Task.CompletedTask; 49public Task StopAsync(CancellationToken cancellationToken) 55private async Task RunAsync()
src\Shared\Http2cat\Http2CatIHostBuilderExtensions.cs (1)
13public static IHostBuilder UseHttp2Cat(this IHostBuilder hostBuilder, string address, Func<Http2Utilities, Task> scenario)
src\Shared\Http2cat\Http2CatOptions.cs (1)
12public Func<Http2Utilities, Task> Scenaro { get; set; }
src\Shared\Http2cat\Http2Utilities.cs (42)
153public async Task InitializeConnectionAsync(int expectedSettingsCount = 3) 174public Task StartStreamAsync(int streamId, IEnumerable<KeyValuePair<string, string>> headers, bool endStream) 272public Task SendHeadersWithPaddingAsync(int streamId, IEnumerable<KeyValuePair<string, string>> headers, byte padLength, bool endStream) 312public Task SendHeadersWithPriorityAsync(int streamId, IEnumerable<KeyValuePair<string, string>> headers, byte priority, int streamDependency, bool endStream) 355public Task SendHeadersWithPaddingAndPriorityAsync(int streamId, IEnumerable<KeyValuePair<string, string>> headers, byte padLength, byte priority, int streamDependency, bool endStream) 389public Task SendAsync(ReadOnlySpan<byte> span) 396public static async Task FlushAsync(PipeWriter writableBuffer) 401public Task SendPreambleAsync() => SendAsync(ClientPreface); 403public async Task SendSettingsAsync() 426public async Task SendSettingsAckWithInvalidLengthAsync(int length) 436public async Task SendSettingsWithInvalidStreamIdAsync(int streamId) 450public async Task SendSettingsWithInvalidLengthAsync(int length) 462internal async Task SendSettingsWithInvalidParameterValueAsync(Http2SettingsParameter parameter, uint value) 480public Task SendPushPromiseFrameAsync() 508internal async Task SendHeadersAsync(int streamId, Http2HeadersFrameFlags flags, byte[] headerBlock) 520public async Task SendInvalidHeadersFrameAsync(int streamId, int payloadLength, byte padLength) 539public async Task SendIncompleteHeadersFrameAsync(int streamId) 573internal async Task SendContinuationAsync(int streamId, Http2ContinuationFrameFlags flags, byte[] payload) 601internal Task SendEmptyContinuationFrameAsync(int streamId, Http2ContinuationFrameFlags flags) 613public async Task SendIncompleteContinuationFrameAsync(int streamId) 631public Task SendDataAsync(int streamId, Memory<byte> data, bool endStream) 644public async Task SendDataWithPaddingAsync(int streamId, Memory<byte> data, byte padLength, bool endStream) 664public Task SendInvalidDataFrameAsync(int streamId, int frameLength, byte padLength) 684internal Task SendPingAsync(Http2PingFrameFlags flags) 693public Task SendPingWithInvalidLengthAsync(int length) 703public Task SendPingWithInvalidStreamIdAsync(int streamId) 722public Task SendPriorityAsync(int streamId, int streamDependency = 0) 736public Task SendInvalidPriorityFrameAsync(int streamId, int length) 752public Task SendRstStreamAsync(int streamId) 764public Task SendInvalidRstStreamFrameAsync(int streamId, int length) 774public Task SendGoAwayAsync() 783public Task SendInvalidGoAwayFrameAsync() 793public Task SendWindowUpdateAsync(int streamId, int sizeIncrement) 805public Task SendInvalidWindowUpdateAsync(int streamId, int sizeIncrement, int length) 815public Task SendUnknownFrameTypeAsync(int streamId, int frameType) 877public async Task StopConnectionAsync(int expectedLastStreamId, bool ignoreNonGoAwayFrames) 885public Task WaitForConnectionStopAsync(int expectedLastStreamId, bool ignoreNonGoAwayFrames) 890internal Task ReceiveHeadersAsync(int expectedStreamId, Action<IDictionary<string, string>> verifyHeaders = null) 893internal async Task ReceiveHeadersAsync(int expectedStreamId, bool endStream = false, Action<IDictionary<string, string>> verifyHeaders = null) 934internal async Task WaitForConnectionErrorAsync<TException>(bool ignoreNonGoAwayFrames, int expectedLastStreamId, Http2ErrorCode expectedErrorCode) 941internal async Task WaitForConnectionErrorAsyncDoNotCloseTransport<TException>(bool ignoreNonGoAwayFrames, int expectedLastStreamId, Http2ErrorCode expectedErrorCode) 957internal async Task WaitForStreamErrorAsync(int expectedStreamId, Http2ErrorCode expectedErrorCode)
src\Shared\ServerInfrastructure\DuplexPipeStream.cs (2)
96public override Task WriteAsync(byte[]? buffer, int offset, int count, CancellationToken cancellationToken) 111public override Task FlushAsync(CancellationToken cancellationToken)
src\Shared\TaskToApm.cs (3)
32public static IAsyncResult Begin(Task task, AsyncCallback? callback, object? state) => 69internal readonly Task _task; 77internal TaskAsyncResult(Task task, object? state, AsyncCallback? callback)
src\Shared\ValueTaskExtensions\ValueTaskExtensions.cs (2)
13public static Task GetAsTask(this in ValueTask<FlushResult> valueTask) 20return Task.CompletedTask;
IIS.Microbenchmarks (4)
PlaintextBenchmark.cs (3)
36public async Task Plaintext() 54public Task Invoke(HttpContext httpContext) 64public static Task WriteResponse(HttpResponse response)
StartupTimeBenchmark.cs (1)
48public async Task SendFirstRequest()
IIS.NewHandler.FunctionalTests (186)
NewHandlerTests.cs (1)
23public async Task CheckNewHandlerIsUsed()
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (16)
26public static async Task AssertStarts(this IISDeploymentResult deploymentResult, string path = "/HelloWorld") 41public static async Task StressLoad(HttpClient httpClient, string path, Action<HttpResponseMessage> action) 43async Task RunRequests() 58List<Task> tasks = new List<Task>(); 61tasks.Add(Task.Run(RunRequests)); 64await Task.WhenAll(tasks); 107return RetryRequestAsync(client, uri, message => Task.FromResult(predicate(message))); 118await Task.Delay(delay); 131public static Task Retry(Func<Task> func, TimeSpan maxTime) 136public static async Task Retry(Func<Task> func, int attempts, int msDelay) 151await Task.Delay(msDelay); 168public static async Task AssertRecycledAsync(this IISDeploymentResult deploymentResult, Func<Task> verificationAction = null)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\IISFunctionalTestBase.cs (2)
51public async Task AssertAppOffline(IISDeploymentResult deploymentResult, string expectedResponse = "The app is offline.") 66public static async Task AssertRunning(IISDeploymentResult deploymentResult)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\PublishedApplicationPublisher.cs (1)
40return Task.FromResult(new PublishedApplication(target.FullName, logger));
src\Servers\IIS\IIS\test\Common.LongTests\ShutdownTests.cs (33)
39public async Task ShutdownTimeoutIsApplied() 60public async Task CallStopAsyncOnRequestThread_DoesNotHangIndefinitely(string path) 79public async Task AppOfflineDroppedWhileSiteIsDown_SiteReturns503_InProcess() 91public async Task AppOfflineDroppedWhileSiteIsDown_SiteReturns503_OutOfProcess() 102public async Task LockedAppOfflineDroppedWhileSiteIsDown_SiteReturns503_InProcess() 120public async Task LockedAppOfflineDroppedWhileSiteIsDown_SiteReturns503_OutOfProcess() 137public async Task AppOfflineDroppedWhileSiteFailedToStartInShim_AppOfflineServed_InProcess() 156public async Task AppOfflineDroppedWhileSiteFailedToStartInShim_AppOfflineServed_OutOfProcess() 174public async Task AppOfflineDroppedWhileSiteFailedToStartInRequestHandler_SiteStops_InProcess() 191public async Task GracefulShutdownWorksWithMultipleRequestsInFlight_InProcess() 265public async Task RequestsWhileRestartingAppFromConfigChangeAreProcessed() 289await Task.Delay(1); 302public async Task RequestsWhileRecyclingAppAreProcessed() 326await Task.Delay(1); 338public async Task AppOfflineDroppedWhileSiteRunning_SiteShutsDown_InProcess() 349public async Task AppOfflineDroppedWhileSiteRunning_SiteShutsDown_OutOfProcess() 364public async Task AppOfflineDropped_CanRemoveAppOfflineAfterAddingAndSiteWorks_InProcess() 379public async Task AppOfflineDropped_CanRemoveAppOfflineAfterAddingAndSiteWorks_OutOfProcess() 395public async Task AppOfflineAddedAndRemovedStress_InProcess() 402public async Task AppOfflineAddedAndRemovedStress_OutOfProcess() 407private async Task AppOfflineAddAndRemovedStress(HostingModel hostingModel) 411var load = Helpers.StressLoad(deploymentResult.HttpClient, "/HelloWorld", response => 449public async Task ConfigurationChangeStopsInProcess() 465public async Task ConfigurationChangeForcesChildProcessRestart() 482public async Task ConfigurationChangeCanBeIgnoredInProcess() 502public async Task AppHostConfigurationChangeIsIgnoredInProcess() 523public async Task ConfigurationChangeCanBeIgnoredOutOfProcess() 541public async Task OutOfProcessToInProcessHostingModelSwitchWorks() 563public async Task ConfigurationTouchedStress_InProcess() 568private async Task ConfigurationTouchedStress(HostingModel hostingModel) 573var load = Helpers.StressLoad(deploymentResult.HttpClient, "/HelloWorld", response => 605public async Task ClosesConnectionOnServerAbortOutOfProcess() 633public async Task ClosesConnectionOnServerAbortInProcess()
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (77)
45public async Task ExpandEnvironmentVariableInWebConfig() 60public async Task InvalidProcessPath_ExpectServerError(string path, string arguments, string subError) 86public async Task StartsWithDotnetLocationWithoutExe() 97public async Task StartsWithDotnetLocationUppercase() 111public async Task StartsWithDotnetOnThePath(string path) 130public async Task StartsWithDotnetInstallLocation() 163public async Task DoesNotStartIfDisabled() 195public async Task HelloWorld(TestVariant variant) 203public async Task StartsWithPortableAndBootstraperExe() 222public async Task DetectsOverriddenServer() 239public async Task LogsStartupExceptionExitError() 257public async Task LogsUnexpectedThreadExitError() 274public async Task RemoveHostfxrFromApp_InProcessHostfxrAPIAbsent() 298public async Task PublishWithWrongBitness() 339public async Task RemoveHostfxrFromApp_InProcessHostfxrLoadFailure() 361public async Task TargetDifferenceSharedFramework_FailedToFindNativeDependencies() 382public async Task WrongApplicationPath_FailedToRun() 400public async Task SingleExecutable_FailedToFindNativeDependencies() 418public async Task TargedDifferenceSharedFramework_FailedToFindNativeDependenciesErrorInResponse() 441public async Task RemoveInProcessReference_FailedToFindRequestHandler() 465public async Task StartupTimeoutIsApplied() 498public async Task StartupTimeoutIsApplied_DisableRecycleOnStartupTimeout() 530public async Task CheckInvalidHostingModelParameter() 553public async Task ReportsWebConfigAuthoringErrors(string scenario) 598public async Task StartsWithWebConfigVariationsPortable(string scenario) 668public async Task StartsWithWebConfigVariationsStandalone(string scenario) 706public async Task SetCurrentDirectoryHandlerSettingWorks() 723public async Task StartupIsSuspendedWhenEventIsUsed() 736var request = deploymentResult.AssertStarts(); 762public async Task ExceptionIsLoggedToEventLogAndPutInResponseWhenDeveloperExceptionPageIsEnabled(string environmentVariable, string value) 786public async Task ExceptionIsLoggedToEventLogAndPutInResponseWhenDeveloperExceptionPageIsEnabledViaWebConfig() 813public async Task ExceptionIsLoggedToEventLogAndPutInResponseDuringHostingStartupProcess(string startupType) 835public async Task ExceptionIsNotLoggedToResponseWhenStartupHookIsDisabled() 857public async Task ExceptionIsLoggedToEventLogDoesNotWriteToResponse() 879public async Task CanAddCustomStartupHook() 896public async Task CanAddCustomStartupHookWhenIISOneIsDisabled() 914public async Task StackOverflowIsAvoidedBySettingLargerStack() 924public async Task StackOverflowCanBeSetBySettingLargerStackViaHandlerSetting() 940public async Task EnvironmentVariableForLauncherPathIsPreferred(HostingModel hostingModel) 956public async Task EnvironmentVariableForLauncherArgsIsPreferred(HostingModel hostingModel) 969public async Task OnCompletedDoesNotFailRequest() 992public async Task CheckStdoutWithLargeWrites_TestSink(string mode) 1015public async Task CheckStdoutWithLargeWrites_LogFile(string mode) 1039public async Task CheckValidConsoleFunctions() 1052public async Task Gets500_30_ErrorPage() 1069public async Task IncludesAdditionalErrorPageTextInProcessHandlerLoadFailure_CorrectString() 1088public async Task IncludesAdditionalErrorPageTextOutOfProcessStartupFailure_CorrectString() 1107public async Task IncludesAdditionalErrorPageTextOutOfProcessHandlerLoadFailure_CorrectString() 1130public async Task IncludesAdditionalErrorPageTextInProcessStartupFailure_CorrectString() 1151public async Task GetLongEnvironmentVariable_InProcess() 1170public async Task GetLongEnvironmentVariable_OutOfProcess() 1189public Task AuthHeaderEnvironmentVariableRemoved_InProcess() => AuthHeaderEnvironmentVariableRemoved(HostingModel.InProcess); 1192public Task AuthHeaderEnvironmentVariableRemoved_OutOfProcess() => AuthHeaderEnvironmentVariableRemoved(HostingModel.OutOfProcess); 1194private async Task AuthHeaderEnvironmentVariableRemoved(HostingModel hostingModel) 1205public Task WebConfigOverridesGlobalEnvironmentVariables_InProcess() => WebConfigOverridesGlobalEnvironmentVariables(HostingModel.InProcess); 1210public Task WebConfigOverridesGlobalEnvironmentVariables_OutOfProcess() => WebConfigOverridesGlobalEnvironmentVariables(HostingModel.OutOfProcess); 1212private async Task WebConfigOverridesGlobalEnvironmentVariables(HostingModel hostingModel) 1223public Task WebConfigAppendsHostingStartup_InProcess() => WebConfigAppendsHostingStartup(HostingModel.InProcess); 1228public Task WebConfigAppendsHostingStartup_OutOfProcess() => WebConfigAppendsHostingStartup(HostingModel.OutOfProcess); 1230private async Task WebConfigAppendsHostingStartup(HostingModel hostingModel) 1247public Task WebConfigOverridesHostingStartup_InProcess() => WebConfigOverridesHostingStartup(HostingModel.InProcess); 1252public Task WebConfigOverridesHostingStartup_OutOfProcess() => WebConfigOverridesHostingStartup(HostingModel.OutOfProcess); 1254private async Task WebConfigOverridesHostingStartup(HostingModel hostingModel) 1265public Task WebConfigExpandsVariables_InProcess() => WebConfigExpandsVariables(HostingModel.InProcess); 1270public Task WebConfigExpandsVariables_OutOfProcess() => WebConfigExpandsVariables(HostingModel.OutOfProcess); 1272private async Task WebConfigExpandsVariables(HostingModel hostingModel) 1286public async Task PreferEnvironmentVariablesOverWebConfigWhenConfigured(HostingModel hostingModel) 1301public async Task ServerAddressesIncludesBaseAddress() 1325public async Task AncmHttpsPortCanBeOverriden() 1349public async Task HttpsRedirectionWorksIn30AndNot22() 1396public async Task MultipleHttpsPortsProduceNoEnvVar() 1426public async Task SetsConnectionCloseHeader() 1485private static async Task AssertLink(HttpResponseMessage response) 1502private async Task AssertFailsToStart(IISDeploymentResult deploymentResult) 1566private Task AssertSiteFailsToStartWithInProcessStaticContent(IISDeploymentResult deploymentResult) 1571private async Task AssertSiteFailsToStartWithInProcessStaticContent(IISDeploymentResult deploymentResult, string error) 1586private async Task AssertSiteFailsToStartWithInProcessStaticContent(IISDeploymentResult deploymentResult, params string[] errors)
src\Shared\Http2cat\Http2CatHostedService.cs (5)
29private Task _backgroundTask; 43public Task StartAsync(CancellationToken cancellationToken) 46return Task.CompletedTask; 49public Task StopAsync(CancellationToken cancellationToken) 55private async Task RunAsync()
src\Shared\Http2cat\Http2CatIHostBuilderExtensions.cs (1)
13public static IHostBuilder UseHttp2Cat(this IHostBuilder hostBuilder, string address, Func<Http2Utilities, Task> scenario)
src\Shared\Http2cat\Http2CatOptions.cs (1)
12public Func<Http2Utilities, Task> Scenaro { get; set; }
src\Shared\Http2cat\Http2Utilities.cs (42)
153public async Task InitializeConnectionAsync(int expectedSettingsCount = 3) 174public Task StartStreamAsync(int streamId, IEnumerable<KeyValuePair<string, string>> headers, bool endStream) 272public Task SendHeadersWithPaddingAsync(int streamId, IEnumerable<KeyValuePair<string, string>> headers, byte padLength, bool endStream) 312public Task SendHeadersWithPriorityAsync(int streamId, IEnumerable<KeyValuePair<string, string>> headers, byte priority, int streamDependency, bool endStream) 355public Task SendHeadersWithPaddingAndPriorityAsync(int streamId, IEnumerable<KeyValuePair<string, string>> headers, byte padLength, byte priority, int streamDependency, bool endStream) 389public Task SendAsync(ReadOnlySpan<byte> span) 396public static async Task FlushAsync(PipeWriter writableBuffer) 401public Task SendPreambleAsync() => SendAsync(ClientPreface); 403public async Task SendSettingsAsync() 426public async Task SendSettingsAckWithInvalidLengthAsync(int length) 436public async Task SendSettingsWithInvalidStreamIdAsync(int streamId) 450public async Task SendSettingsWithInvalidLengthAsync(int length) 462internal async Task SendSettingsWithInvalidParameterValueAsync(Http2SettingsParameter parameter, uint value) 480public Task SendPushPromiseFrameAsync() 508internal async Task SendHeadersAsync(int streamId, Http2HeadersFrameFlags flags, byte[] headerBlock) 520public async Task SendInvalidHeadersFrameAsync(int streamId, int payloadLength, byte padLength) 539public async Task SendIncompleteHeadersFrameAsync(int streamId) 573internal async Task SendContinuationAsync(int streamId, Http2ContinuationFrameFlags flags, byte[] payload) 601internal Task SendEmptyContinuationFrameAsync(int streamId, Http2ContinuationFrameFlags flags) 613public async Task SendIncompleteContinuationFrameAsync(int streamId) 631public Task SendDataAsync(int streamId, Memory<byte> data, bool endStream) 644public async Task SendDataWithPaddingAsync(int streamId, Memory<byte> data, byte padLength, bool endStream) 664public Task SendInvalidDataFrameAsync(int streamId, int frameLength, byte padLength) 684internal Task SendPingAsync(Http2PingFrameFlags flags) 693public Task SendPingWithInvalidLengthAsync(int length) 703public Task SendPingWithInvalidStreamIdAsync(int streamId) 722public Task SendPriorityAsync(int streamId, int streamDependency = 0) 736public Task SendInvalidPriorityFrameAsync(int streamId, int length) 752public Task SendRstStreamAsync(int streamId) 764public Task SendInvalidRstStreamFrameAsync(int streamId, int length) 774public Task SendGoAwayAsync() 783public Task SendInvalidGoAwayFrameAsync() 793public Task SendWindowUpdateAsync(int streamId, int sizeIncrement) 805public Task SendInvalidWindowUpdateAsync(int streamId, int sizeIncrement, int length) 815public Task SendUnknownFrameTypeAsync(int streamId, int frameType) 877public async Task StopConnectionAsync(int expectedLastStreamId, bool ignoreNonGoAwayFrames) 885public Task WaitForConnectionStopAsync(int expectedLastStreamId, bool ignoreNonGoAwayFrames) 890internal Task ReceiveHeadersAsync(int expectedStreamId, Action<IDictionary<string, string>> verifyHeaders = null) 893internal async Task ReceiveHeadersAsync(int expectedStreamId, bool endStream = false, Action<IDictionary<string, string>> verifyHeaders = null) 934internal async Task WaitForConnectionErrorAsync<TException>(bool ignoreNonGoAwayFrames, int expectedLastStreamId, Http2ErrorCode expectedErrorCode) 941internal async Task WaitForConnectionErrorAsyncDoNotCloseTransport<TException>(bool ignoreNonGoAwayFrames, int expectedLastStreamId, Http2ErrorCode expectedErrorCode) 957internal async Task WaitForStreamErrorAsync(int expectedStreamId, Http2ErrorCode expectedErrorCode)
src\Shared\ServerInfrastructure\DuplexPipeStream.cs (2)
96public override Task WriteAsync(byte[]? buffer, int offset, int count, CancellationToken cancellationToken) 111public override Task FlushAsync(CancellationToken cancellationToken)
src\Shared\TaskToApm.cs (3)
32public static IAsyncResult Begin(Task task, AsyncCallback? callback, object? state) => 69internal readonly Task _task; 77internal TaskAsyncResult(Task task, object? state, AsyncCallback? callback)
src\Shared\ValueTaskExtensions\ValueTaskExtensions.cs (2)
13public static Task GetAsTask(this in ValueTask<FlushResult> valueTask) 20return Task.CompletedTask;
IIS.NewShim.FunctionalTests (186)
NewShimTests.cs (1)
21public async Task CheckNewShimIsUsed()
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (16)
26public static async Task AssertStarts(this IISDeploymentResult deploymentResult, string path = "/HelloWorld") 41public static async Task StressLoad(HttpClient httpClient, string path, Action<HttpResponseMessage> action) 43async Task RunRequests() 58List<Task> tasks = new List<Task>(); 61tasks.Add(Task.Run(RunRequests)); 64await Task.WhenAll(tasks); 107return RetryRequestAsync(client, uri, message => Task.FromResult(predicate(message))); 118await Task.Delay(delay); 131public static Task Retry(Func<Task> func, TimeSpan maxTime) 136public static async Task Retry(Func<Task> func, int attempts, int msDelay) 151await Task.Delay(msDelay); 168public static async Task AssertRecycledAsync(this IISDeploymentResult deploymentResult, Func<Task> verificationAction = null)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\IISFunctionalTestBase.cs (2)
51public async Task AssertAppOffline(IISDeploymentResult deploymentResult, string expectedResponse = "The app is offline.") 66public static async Task AssertRunning(IISDeploymentResult deploymentResult)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\PublishedApplicationPublisher.cs (1)
40return Task.FromResult(new PublishedApplication(target.FullName, logger));
src\Servers\IIS\IIS\test\Common.LongTests\ShutdownTests.cs (33)
39public async Task ShutdownTimeoutIsApplied() 60public async Task CallStopAsyncOnRequestThread_DoesNotHangIndefinitely(string path) 79public async Task AppOfflineDroppedWhileSiteIsDown_SiteReturns503_InProcess() 91public async Task AppOfflineDroppedWhileSiteIsDown_SiteReturns503_OutOfProcess() 102public async Task LockedAppOfflineDroppedWhileSiteIsDown_SiteReturns503_InProcess() 120public async Task LockedAppOfflineDroppedWhileSiteIsDown_SiteReturns503_OutOfProcess() 137public async Task AppOfflineDroppedWhileSiteFailedToStartInShim_AppOfflineServed_InProcess() 156public async Task AppOfflineDroppedWhileSiteFailedToStartInShim_AppOfflineServed_OutOfProcess() 174public async Task AppOfflineDroppedWhileSiteFailedToStartInRequestHandler_SiteStops_InProcess() 191public async Task GracefulShutdownWorksWithMultipleRequestsInFlight_InProcess() 265public async Task RequestsWhileRestartingAppFromConfigChangeAreProcessed() 289await Task.Delay(1); 302public async Task RequestsWhileRecyclingAppAreProcessed() 326await Task.Delay(1); 338public async Task AppOfflineDroppedWhileSiteRunning_SiteShutsDown_InProcess() 349public async Task AppOfflineDroppedWhileSiteRunning_SiteShutsDown_OutOfProcess() 364public async Task AppOfflineDropped_CanRemoveAppOfflineAfterAddingAndSiteWorks_InProcess() 379public async Task AppOfflineDropped_CanRemoveAppOfflineAfterAddingAndSiteWorks_OutOfProcess() 395public async Task AppOfflineAddedAndRemovedStress_InProcess() 402public async Task AppOfflineAddedAndRemovedStress_OutOfProcess() 407private async Task AppOfflineAddAndRemovedStress(HostingModel hostingModel) 411var load = Helpers.StressLoad(deploymentResult.HttpClient, "/HelloWorld", response => 449public async Task ConfigurationChangeStopsInProcess() 465public async Task ConfigurationChangeForcesChildProcessRestart() 482public async Task ConfigurationChangeCanBeIgnoredInProcess() 502public async Task AppHostConfigurationChangeIsIgnoredInProcess() 523public async Task ConfigurationChangeCanBeIgnoredOutOfProcess() 541public async Task OutOfProcessToInProcessHostingModelSwitchWorks() 563public async Task ConfigurationTouchedStress_InProcess() 568private async Task ConfigurationTouchedStress(HostingModel hostingModel) 573var load = Helpers.StressLoad(deploymentResult.HttpClient, "/HelloWorld", response => 605public async Task ClosesConnectionOnServerAbortOutOfProcess() 633public async Task ClosesConnectionOnServerAbortInProcess()
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (77)
45public async Task ExpandEnvironmentVariableInWebConfig() 60public async Task InvalidProcessPath_ExpectServerError(string path, string arguments, string subError) 86public async Task StartsWithDotnetLocationWithoutExe() 97public async Task StartsWithDotnetLocationUppercase() 111public async Task StartsWithDotnetOnThePath(string path) 130public async Task StartsWithDotnetInstallLocation() 163public async Task DoesNotStartIfDisabled() 195public async Task HelloWorld(TestVariant variant) 203public async Task StartsWithPortableAndBootstraperExe() 222public async Task DetectsOverriddenServer() 239public async Task LogsStartupExceptionExitError() 257public async Task LogsUnexpectedThreadExitError() 274public async Task RemoveHostfxrFromApp_InProcessHostfxrAPIAbsent() 298public async Task PublishWithWrongBitness() 339public async Task RemoveHostfxrFromApp_InProcessHostfxrLoadFailure() 361public async Task TargetDifferenceSharedFramework_FailedToFindNativeDependencies() 382public async Task WrongApplicationPath_FailedToRun() 400public async Task SingleExecutable_FailedToFindNativeDependencies() 418public async Task TargedDifferenceSharedFramework_FailedToFindNativeDependenciesErrorInResponse() 441public async Task RemoveInProcessReference_FailedToFindRequestHandler() 465public async Task StartupTimeoutIsApplied() 498public async Task StartupTimeoutIsApplied_DisableRecycleOnStartupTimeout() 530public async Task CheckInvalidHostingModelParameter() 553public async Task ReportsWebConfigAuthoringErrors(string scenario) 598public async Task StartsWithWebConfigVariationsPortable(string scenario) 668public async Task StartsWithWebConfigVariationsStandalone(string scenario) 706public async Task SetCurrentDirectoryHandlerSettingWorks() 723public async Task StartupIsSuspendedWhenEventIsUsed() 736var request = deploymentResult.AssertStarts(); 762public async Task ExceptionIsLoggedToEventLogAndPutInResponseWhenDeveloperExceptionPageIsEnabled(string environmentVariable, string value) 786public async Task ExceptionIsLoggedToEventLogAndPutInResponseWhenDeveloperExceptionPageIsEnabledViaWebConfig() 813public async Task ExceptionIsLoggedToEventLogAndPutInResponseDuringHostingStartupProcess(string startupType) 835public async Task ExceptionIsNotLoggedToResponseWhenStartupHookIsDisabled() 857public async Task ExceptionIsLoggedToEventLogDoesNotWriteToResponse() 879public async Task CanAddCustomStartupHook() 896public async Task CanAddCustomStartupHookWhenIISOneIsDisabled() 914public async Task StackOverflowIsAvoidedBySettingLargerStack() 924public async Task StackOverflowCanBeSetBySettingLargerStackViaHandlerSetting() 940public async Task EnvironmentVariableForLauncherPathIsPreferred(HostingModel hostingModel) 956public async Task EnvironmentVariableForLauncherArgsIsPreferred(HostingModel hostingModel) 969public async Task OnCompletedDoesNotFailRequest() 992public async Task CheckStdoutWithLargeWrites_TestSink(string mode) 1015public async Task CheckStdoutWithLargeWrites_LogFile(string mode) 1039public async Task CheckValidConsoleFunctions() 1052public async Task Gets500_30_ErrorPage() 1069public async Task IncludesAdditionalErrorPageTextInProcessHandlerLoadFailure_CorrectString() 1088public async Task IncludesAdditionalErrorPageTextOutOfProcessStartupFailure_CorrectString() 1107public async Task IncludesAdditionalErrorPageTextOutOfProcessHandlerLoadFailure_CorrectString() 1130public async Task IncludesAdditionalErrorPageTextInProcessStartupFailure_CorrectString() 1151public async Task GetLongEnvironmentVariable_InProcess() 1170public async Task GetLongEnvironmentVariable_OutOfProcess() 1189public Task AuthHeaderEnvironmentVariableRemoved_InProcess() => AuthHeaderEnvironmentVariableRemoved(HostingModel.InProcess); 1192public Task AuthHeaderEnvironmentVariableRemoved_OutOfProcess() => AuthHeaderEnvironmentVariableRemoved(HostingModel.OutOfProcess); 1194private async Task AuthHeaderEnvironmentVariableRemoved(HostingModel hostingModel) 1205public Task WebConfigOverridesGlobalEnvironmentVariables_InProcess() => WebConfigOverridesGlobalEnvironmentVariables(HostingModel.InProcess); 1210public Task WebConfigOverridesGlobalEnvironmentVariables_OutOfProcess() => WebConfigOverridesGlobalEnvironmentVariables(HostingModel.OutOfProcess); 1212private async Task WebConfigOverridesGlobalEnvironmentVariables(HostingModel hostingModel) 1223public Task WebConfigAppendsHostingStartup_InProcess() => WebConfigAppendsHostingStartup(HostingModel.InProcess); 1228public Task WebConfigAppendsHostingStartup_OutOfProcess() => WebConfigAppendsHostingStartup(HostingModel.OutOfProcess); 1230private async Task WebConfigAppendsHostingStartup(HostingModel hostingModel) 1247public Task WebConfigOverridesHostingStartup_InProcess() => WebConfigOverridesHostingStartup(HostingModel.InProcess); 1252public Task WebConfigOverridesHostingStartup_OutOfProcess() => WebConfigOverridesHostingStartup(HostingModel.OutOfProcess); 1254private async Task WebConfigOverridesHostingStartup(HostingModel hostingModel) 1265public Task WebConfigExpandsVariables_InProcess() => WebConfigExpandsVariables(HostingModel.InProcess); 1270public Task WebConfigExpandsVariables_OutOfProcess() => WebConfigExpandsVariables(HostingModel.OutOfProcess); 1272private async Task WebConfigExpandsVariables(HostingModel hostingModel) 1286public async Task PreferEnvironmentVariablesOverWebConfigWhenConfigured(HostingModel hostingModel) 1301public async Task ServerAddressesIncludesBaseAddress() 1325public async Task AncmHttpsPortCanBeOverriden() 1349public async Task HttpsRedirectionWorksIn30AndNot22() 1396public async Task MultipleHttpsPortsProduceNoEnvVar() 1426public async Task SetsConnectionCloseHeader() 1485private static async Task AssertLink(HttpResponseMessage response) 1502private async Task AssertFailsToStart(IISDeploymentResult deploymentResult) 1566private Task AssertSiteFailsToStartWithInProcessStaticContent(IISDeploymentResult deploymentResult) 1571private async Task AssertSiteFailsToStartWithInProcessStaticContent(IISDeploymentResult deploymentResult, string error) 1586private async Task AssertSiteFailsToStartWithInProcessStaticContent(IISDeploymentResult deploymentResult, params string[] errors)
src\Shared\Http2cat\Http2CatHostedService.cs (5)
29private Task _backgroundTask; 43public Task StartAsync(CancellationToken cancellationToken) 46return Task.CompletedTask; 49public Task StopAsync(CancellationToken cancellationToken) 55private async Task RunAsync()
src\Shared\Http2cat\Http2CatIHostBuilderExtensions.cs (1)
13public static IHostBuilder UseHttp2Cat(this IHostBuilder hostBuilder, string address, Func<Http2Utilities, Task> scenario)
src\Shared\Http2cat\Http2CatOptions.cs (1)
12public Func<Http2Utilities, Task> Scenaro { get; set; }
src\Shared\Http2cat\Http2Utilities.cs (42)
153public async Task InitializeConnectionAsync(int expectedSettingsCount = 3) 174public Task StartStreamAsync(int streamId, IEnumerable<KeyValuePair<string, string>> headers, bool endStream) 272public Task SendHeadersWithPaddingAsync(int streamId, IEnumerable<KeyValuePair<string, string>> headers, byte padLength, bool endStream) 312public Task SendHeadersWithPriorityAsync(int streamId, IEnumerable<KeyValuePair<string, string>> headers, byte priority, int streamDependency, bool endStream) 355public Task SendHeadersWithPaddingAndPriorityAsync(int streamId, IEnumerable<KeyValuePair<string, string>> headers, byte padLength, byte priority, int streamDependency, bool endStream) 389public Task SendAsync(ReadOnlySpan<byte> span) 396public static async Task FlushAsync(PipeWriter writableBuffer) 401public Task SendPreambleAsync() => SendAsync(ClientPreface); 403public async Task SendSettingsAsync() 426public async Task SendSettingsAckWithInvalidLengthAsync(int length) 436public async Task SendSettingsWithInvalidStreamIdAsync(int streamId) 450public async Task SendSettingsWithInvalidLengthAsync(int length) 462internal async Task SendSettingsWithInvalidParameterValueAsync(Http2SettingsParameter parameter, uint value) 480public Task SendPushPromiseFrameAsync() 508internal async Task SendHeadersAsync(int streamId, Http2HeadersFrameFlags flags, byte[] headerBlock) 520public async Task SendInvalidHeadersFrameAsync(int streamId, int payloadLength, byte padLength) 539public async Task SendIncompleteHeadersFrameAsync(int streamId) 573internal async Task SendContinuationAsync(int streamId, Http2ContinuationFrameFlags flags, byte[] payload) 601internal Task SendEmptyContinuationFrameAsync(int streamId, Http2ContinuationFrameFlags flags) 613public async Task SendIncompleteContinuationFrameAsync(int streamId) 631public Task SendDataAsync(int streamId, Memory<byte> data, bool endStream) 644public async Task SendDataWithPaddingAsync(int streamId, Memory<byte> data, byte padLength, bool endStream) 664public Task SendInvalidDataFrameAsync(int streamId, int frameLength, byte padLength) 684internal Task SendPingAsync(Http2PingFrameFlags flags) 693public Task SendPingWithInvalidLengthAsync(int length) 703public Task SendPingWithInvalidStreamIdAsync(int streamId) 722public Task SendPriorityAsync(int streamId, int streamDependency = 0) 736public Task SendInvalidPriorityFrameAsync(int streamId, int length) 752public Task SendRstStreamAsync(int streamId) 764public Task SendInvalidRstStreamFrameAsync(int streamId, int length) 774public Task SendGoAwayAsync() 783public Task SendInvalidGoAwayFrameAsync() 793public Task SendWindowUpdateAsync(int streamId, int sizeIncrement) 805public Task SendInvalidWindowUpdateAsync(int streamId, int sizeIncrement, int length) 815public Task SendUnknownFrameTypeAsync(int streamId, int frameType) 877public async Task StopConnectionAsync(int expectedLastStreamId, bool ignoreNonGoAwayFrames) 885public Task WaitForConnectionStopAsync(int expectedLastStreamId, bool ignoreNonGoAwayFrames) 890internal Task ReceiveHeadersAsync(int expectedStreamId, Action<IDictionary<string, string>> verifyHeaders = null) 893internal async Task ReceiveHeadersAsync(int expectedStreamId, bool endStream = false, Action<IDictionary<string, string>> verifyHeaders = null) 934internal async Task WaitForConnectionErrorAsync<TException>(bool ignoreNonGoAwayFrames, int expectedLastStreamId, Http2ErrorCode expectedErrorCode) 941internal async Task WaitForConnectionErrorAsyncDoNotCloseTransport<TException>(bool ignoreNonGoAwayFrames, int expectedLastStreamId, Http2ErrorCode expectedErrorCode) 957internal async Task WaitForStreamErrorAsync(int expectedStreamId, Http2ErrorCode expectedErrorCode)
src\Shared\ServerInfrastructure\DuplexPipeStream.cs (2)
96public override Task WriteAsync(byte[]? buffer, int offset, int count, CancellationToken cancellationToken) 111public override Task FlushAsync(CancellationToken cancellationToken)
src\Shared\TaskToApm.cs (3)
32public static IAsyncResult Begin(Task task, AsyncCallback? callback, object? state) => 69internal readonly Task _task; 77internal TaskAsyncResult(Task task, object? state, AsyncCallback? callback)
src\Shared\ValueTaskExtensions\ValueTaskExtensions.cs (2)
13public static Task GetAsTask(this in ValueTask<FlushResult> valueTask) 20return Task.CompletedTask;
IIS.ShadowCopy.Tests (36)
ShadowCopyTests.cs (10)
18public async Task ShadowCopyDoesNotLockFiles() 44public async Task ShadowCopyRelativeInSameDirectoryWorks() 74public async Task ShadowCopyRelativeOutsideDirectoryWorks() 107public async Task ShadowCopySingleFileChangedWorks() 142public async Task ShadowCopyDeleteFolderDuringShutdownWorks() 173public async Task ShadowCopyE2EWorksWithFolderPresent() 199public async Task ShadowCopyE2EWorksWithOldFoldersPresent() 238public async Task ShadowCopyCleansUpOlderFolders() 283public async Task ShadowCopyIgnoresItsOwnDirectoryWithRelativePathSegmentWhenCopying() 313public async Task ShadowCopyIgnoresItsOwnDirectoryWhenCopying()
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (16)
26public static async Task AssertStarts(this IISDeploymentResult deploymentResult, string path = "/HelloWorld") 41public static async Task StressLoad(HttpClient httpClient, string path, Action<HttpResponseMessage> action) 43async Task RunRequests() 58List<Task> tasks = new List<Task>(); 61tasks.Add(Task.Run(RunRequests)); 64await Task.WhenAll(tasks); 107return RetryRequestAsync(client, uri, message => Task.FromResult(predicate(message))); 118await Task.Delay(delay); 131public static Task Retry(Func<Task> func, TimeSpan maxTime) 136public static async Task Retry(Func<Task> func, int attempts, int msDelay) 151await Task.Delay(msDelay); 168public static async Task AssertRecycledAsync(this IISDeploymentResult deploymentResult, Func<Task> verificationAction = null)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\IISFunctionalTestBase.cs (2)
51public async Task AssertAppOffline(IISDeploymentResult deploymentResult, string expectedResponse = "The app is offline.") 66public static async Task AssertRunning(IISDeploymentResult deploymentResult)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\PublishedApplicationPublisher.cs (1)
40return Task.FromResult(new PublishedApplication(target.FullName, logger));
src\Shared\ServerInfrastructure\DuplexPipeStream.cs (2)
96public override Task WriteAsync(byte[]? buffer, int offset, int count, CancellationToken cancellationToken) 111public override Task FlushAsync(CancellationToken cancellationToken)
src\Shared\TaskToApm.cs (3)
32public static IAsyncResult Begin(Task task, AsyncCallback? callback, object? state) => 69internal readonly Task _task; 77internal TaskAsyncResult(Task task, object? state, AsyncCallback? callback)
src\Shared\ValueTaskExtensions\ValueTaskExtensions.cs (2)
13public static Task GetAsTask(this in ValueTask<FlushResult> valueTask) 20return Task.CompletedTask;
IIS.Tests (40)
ClientDisconnectTests.cs (10)
22public async Task WritesSucceedAfterClientDisconnect() 59public async Task WritesCanceledWhenUsingAbortedToken() 75await Task.Delay(10); // Small delay to not constantly call WriteAsync. 102public async Task ReadThrowsAfterClientDisconnect() 141public async Task WriterThrowsCanceledException() 183public async Task ReaderThrowsCanceledException() 229public async Task ReaderThrowsResetExceptionOnInvalidBody() 280public async Task ReadsAlwaysGoAsync() 320public async Task RequestAbortedIsTrippedWithoutIO() 349private static async Task SendContentLength1Post(TestConnection connection)
ConnectionIdFeatureTests.cs (2)
17public async Task ProvidesConnectionId() 24return Task.CompletedTask;
HttpBodyControlFeatureTests.cs (2)
18public async Task ThrowsOnSyncReadOrWrite() 46return Task.CompletedTask;
MaxRequestBodySizeTests.cs (10)
25public async Task RequestBodyTooLargeContentLengthExceedsGlobalLimit() 62public async Task RequestBodyTooLargeContentLengthExceedingPerRequestLimit() 105public async Task DoesNotRejectRequestWithContentLengthHeaderExceedingGlobalLimitIfLimitDisabledPerRequest() 132public async Task DoesNotRejectRequestWithChunkedExceedingGlobalLimitIfLimitDisabledPerRequest() 162public async Task DoesNotRejectBodylessGetRequestWithZeroMaxRequestBodySize() 185public async Task DoesNotRejectBodylessPostWithZeroContentLengthRequestWithZeroMaxRequestBodySize() 209public async Task DoesNotRejectBodylessPostWithEmptyChunksRequestWithZeroMaxRequestBodySize() 235public async Task SettingMaxRequestBodySizeAfterReadingFromRequestBodyThrows() 271public async Task RequestBodyTooLargeChunked() 315public async Task EveryReadFailsWhenContentLengthHeaderExceedsGlobalLimit()
ResponseAbortTests.cs (10)
20public async Task ClosesWithoutSendingAnything() 26return Task.CompletedTask; 38public async Task ClosesAfterDataSent() 67public async Task ReadsThrowAfterAbort() 97public async Task WritesNoopAfterAbort() 126public async Task RequestAbortedIsTrippedAfterAbort() 134return Task.CompletedTask; 148public async Task CancellationTokenIsUsableAfterAbortingRequest() 161await Task.CompletedTask; 172private static async Task SendContentLength1Post(TestConnection connection)
ResponseBodySizeTests.cs (1)
15public async Task WriteAsyncShouldCorrectlyHandleBigBuffers()
TestServerTest.cs (1)
18public async Task SingleProcessTestServer_HelloWorld()
TlsHandshakeFeatureTests.cs (4)
18public async Task SetsTlsHandshakeFeatureForHttps() 24return Task.CompletedTask; 62public async Task DoesNotSetTlsHandshakeFeatureForHttp() 68return Task.CompletedTask;
IISExpress.FunctionalTests (339)
InProcess\AppOfflineIISExpressTests.cs (3)
22public async Task AppOfflineDroppedWhileSiteStarting_SiteShutsDown_InProcess() 33var runningTask = AssertAppOffline(deploymentResult); 42await Task.Delay(RetryDelay);
InProcess\AuthenticationTests.cs (1)
24public async Task Authentication_InProcess()
InProcess\IISExpressShutdownTests.cs (5)
27public async Task ServerShutsDownWhenMainExits() 49public async Task ServerShutsDownWhenMainExitsStress() 54var load = Helpers.StressLoad(deploymentResult.HttpClient, "/HelloWorld", response => 79public async Task GracefulShutdown_DoesNotCrashProcess() 91public async Task ForcefulShutdown_DoesCrashProcess()
InProcess\WebSocketTests.cs (10)
34public async Task RequestWithBody_NotUpgradable() 42public async Task RequestWithoutBody_Upgradable() 51public async Task OnStartedCalledForWebSocket() 61public async Task WebReadBeforeUpgrade() 70public async Task CanSendAndReceieveData() 84public async Task Http1_0_Request_NotUpgradable() 104public async Task Http1_0_Request_UpgradeErrors() 123private async Task SendHttp10Request(NetworkStream stream, Uri uri) 144private async Task SendMessage(ClientWebSocket webSocket, string message) 149private async Task ReceiveMessage(ClientWebSocket webSocket, string expectedMessage)
OutOfProcess\MultipleAppTests.cs (1)
26public async Task Startup()
OutOfProcess\NtlmAuthentationTest.cs (1)
37public async Task NtlmAuthentication(TestVariant variant)
src\Servers\IIS\IIS\test\Common.FunctionalTests\AspNetCorePortTests.cs (4)
55public async Task EnvVarInWebConfig_Valid(TestVariant variant) 71public async Task EnvVarInWebConfig_Empty(TestVariant variant) 87public async Task EnvVarInWebConfig_Invalid(TestVariant variant, string port) 103public async Task ShutdownMultipleTimesWorks(TestVariant variant)
src\Servers\IIS\IIS\test\Common.FunctionalTests\BasicAuthTests.cs (1)
48public async Task BasicAuthTest(TestVariant variant)
src\Servers\IIS\IIS\test\Common.FunctionalTests\CompressionTests.cs (3)
41public async Task BufferingDisabledWithCompressedRequest() 83public async Task BufferingDisabledWithoutCompressedRequest() 125public async Task DynamicResponsesAreCompressed()
src\Servers\IIS\IIS\test\Common.FunctionalTests\FrebTests.cs (4)
54public async Task CheckCommonFrebEvents() 68public async Task FrebIncludesHResultFailures() 83public async Task CheckFailedRequestEvents() 96public async Task CheckFrebDisconnect()
src\Servers\IIS\IIS\test\Common.FunctionalTests\GlobalVersionTests.cs (7)
44public async Task GlobalVersion_DefaultWorks() 60public async Task GlobalVersion_EnvironmentVariableWorks() 92public async Task GlobalVersion_NewVersionNumber_Fails(string version) 110public async Task GlobalVersion_NewVersionNumber(string version) 133public async Task GlobalVersion_MultipleRequestHandlers_PicksHighestOne(string version) 158public async Task GlobalVersion_MultipleRequestHandlers_UpgradeWorks(string version) 191public async Task DoesNotCrashWhenNoVersionsAvailable()
src\Servers\IIS\IIS\test\Common.FunctionalTests\Http2Tests.cs (9)
62public async Task Http2_MethodsRequestWithoutData_Success(string method) 99public async Task Http2_PostRequestWithoutData_LengthRequired(string method) 142public async Task Http2_RequestWithDataAndContentLength_Success(string method) 212public async Task Http2_RequestWithDataAndNoContentLength_Success(string method) 274public async Task Http2_ResponseWithData_Success() 318public async Task ResponseTrailers_HTTP1_TrailersNotAvailable() 330public async Task AppException_BeforeResponseHeaders_500() 356public async Task Reset_Http1_NotSupported() 370public async Task Reset_PriorOSVersions_NotSupported()
src\Servers\IIS\IIS\test\Common.FunctionalTests\HttpsTests.cs (3)
53public Task HttpsNoClientCert_NoClientCert(TestVariant variant) 61public Task HttpsClientCert_GetCertInformation(TestVariant variant) 66private async Task ClientCertTest(TestVariant variant, bool sendClientCert)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (16)
26public static async Task AssertStarts(this IISDeploymentResult deploymentResult, string path = "/HelloWorld") 41public static async Task StressLoad(HttpClient httpClient, string path, Action<HttpResponseMessage> action) 43async Task RunRequests() 58List<Task> tasks = new List<Task>(); 61tasks.Add(Task.Run(RunRequests)); 64await Task.WhenAll(tasks); 107return RetryRequestAsync(client, uri, message => Task.FromResult(predicate(message))); 118await Task.Delay(delay); 131public static Task Retry(Func<Task> func, TimeSpan maxTime) 136public static async Task Retry(Func<Task> func, int attempts, int msDelay) 151await Task.Delay(msDelay); 168public static async Task AssertRecycledAsync(this IISDeploymentResult deploymentResult, Func<Task> verificationAction = null)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\IISFunctionalTestBase.cs (2)
51public async Task AssertAppOffline(IISDeploymentResult deploymentResult, string expectedResponse = "The app is offline.") 66public static async Task AssertRunning(IISDeploymentResult deploymentResult)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\PublishedApplicationPublisher.cs (1)
40return Task.FromResult(new PublishedApplication(target.FullName, logger));
src\Servers\IIS\IIS\test\Common.FunctionalTests\Inprocess\HttpSysRequestInfoTests.cs (1)
30public async Task TimingInfo()
src\Servers\IIS\IIS\test\Common.FunctionalTests\Inprocess\MaxRequestBodySizeTests.cs (6)
37public async Task MaxRequestBodySizeE2EWorks() 50public async Task SetIISLimitMaxRequestBodySizeE2EWorks() 73public async Task SetIISLimitMaxRequestBodySizeE2EWorksWithLargerLimit() 94public async Task SetIISLimitMaxRequestBodySizeE2EWorksWithIntMaxValue() 115public async Task IISRejectsContentLengthTooLargeByDefault() 136public async Task SetIISLimitMaxRequestBodyLogsWarning()
src\Servers\IIS\IIS\test\Common.FunctionalTests\Latin1Tests.cs (3)
39public async Task Latin1Works() 57public async Task Latin1ReplacedWithoutAppContextSwitch() 75public async Task Latin1InvalidCharacters_HttpSysRejects()
src\Servers\IIS\IIS\test\Common.FunctionalTests\LoggingTests.cs (16)
53public async Task CheckStdoutLoggingToFile(TestVariant variant) 60public async Task CheckStdoutErrLoggingToFile(TestVariant variant) 65private async Task CheckStdoutToFile(TestVariant variant, string path) 86public async Task InvalidFilePathForLogs_ServerStillRuns(TestVariant variant) 110public async Task StartupMessagesAreLoggedIntoDebugLogFile(TestVariant variant) 125public async Task StartupMessagesAreLoggedIntoDefaultDebugLogFile(TestVariant variant) 140public async Task StartupMessagesAreLoggedIntoDefaultDebugLogFileWhenEnabledWithEnvVar(TestVariant variant) 156public async Task StartupMessagesLogFileSwitchedWhenLogFilePresentInWebConfig(TestVariant variant) 187public async Task DebugLogsAreWrittenToEventLog(TestVariant variant) 199public async Task CheckUTF8File(TestVariant variant) 224public async Task OnlyOneFileCreatedWithProcessStartTime(TestVariant variant) 239public async Task CaptureLogsForOutOfProcessWhenProcessFailsToStart() 254public async Task DisableRedirectionNoLogs() 269public async Task CaptureLogsForOutOfProcessWhenProcessFailsToStart30KbMax() 285public async Task CheckStdoutLoggingToPipeWithFirstWrite(string path) 307public async Task LogsContainTimestampAndPID()
src\Servers\IIS\IIS\test\Common.FunctionalTests\MaxRequestBodySizeTests.cs (6)
38public async Task MaxRequestBodySizeE2EWorks() 51public async Task SetIISLimitMaxRequestBodySizeE2EWorks() 74public async Task SetIISLimitMaxRequestBodySizeE2EWorksWithLargerLimit() 95public async Task SetIISLimitMaxRequestBodySizeE2EWorksWithIntMaxValue() 116public async Task IISRejectsContentLengthTooLargeByDefault() 137public async Task SetIISLimitMaxRequestBodyLogsWarning()
src\Servers\IIS\IIS\test\Common.FunctionalTests\MultiApplicationTests.cs (3)
42public async Task RunsTwoOutOfProcessApps() 53public async Task FailsAndLogsWhenRunningTwoInProcessApps() 76public async Task FailsAndLogsEventLogForMixedHostingModel(HostingModel firstApp)
src\Servers\IIS\IIS\test\Common.FunctionalTests\RequestPathBaseTests.cs (2)
46public async Task RequestPathBase_Split(string url, string expectedPathBase, string expectedPath) 76public async Task RequestPathBase_WithDoubleSlashes_Split(string url, string expectedPathBase, string expectedPath)
src\Servers\IIS\IIS\test\Common.FunctionalTests\RequestResponseTests.cs (59)
45public async Task RequestPath_UrlUnescaping() 67public async Task Request_WithDoubleSlashes_LeftAlone() 79public async Task Request_WithNavigation_Removed(string input, string expectedPath) 90public async Task Request_WithEscapedNavigation_Removed(string input, string expectedPath) 99public async Task Request_ControlCharacters_400() 114public async Task Request_EscapedControlCharacters_400() 125public async Task PassesThroughCompressionOutOfProcess() 143public async Task PassesThroughCompressionInProcess() 160public async Task ReadAndWriteSynchronously() 173public async Task ReadAndWriteEcho() 184public async Task ReadAndWriteCopyToAsync() 195public async Task ReadAndWriteEchoTwice() 206public async Task ReadSetHeaderWrite() 218public async Task ReadAndWriteSlowConnection() 231await Task.Delay(10); 245await Task.Delay(10); 252public async Task ReadAndWriteInterleaved() 289public async Task ConsumePartialBody() 334public async Task AsyncChunkedPostIsAccepted() 373public async Task ResponseBodyTest_UnflushedPipe_AutoFlushed() 380public async Task ResponseBodyTest_FlushedPipeAndThenUnflushedPipe_AutoFlushed() 387public async Task ResponseBodyTest_GettingHttpContextFieldsWork() 395public async Task ResponseBodyTest_CompleteAsyncWorks() 407public async Task ProvidesAccessToServerVariables() 415public async Task ReturnsNullForUndefinedServerVariable() 421public async Task CanSetAndReadVariable() 427public async Task BasePathIsNotPrefixedBySlashSlashQuestionMark() 433public async Task GetServerVariableDoesNotCrash() 444public async Task TestStringValuesEmptyForMissingHeaders() 451public async Task TestReadOffsetWorks() 463public async Task TestInvalidReadOperations(string operation) 472public async Task TestValidReadOperations(string operation) 481public async Task TestValidReadOperationsPost(string operation) 493public async Task TestInvalidWriteOperations(string operation) 500public async Task TestValidWriteOperations() 507public async Task TestValidWriteOperationsPost() 514public async Task AddEmptyHeaderSkipped() 523public async Task AddResponseHeaders_HeaderValuesAreSetCorrectly() 543public async Task ErrorCodeIsSetForExceptionDuringRequest() 566public async Task CustomErrorCodeWorks(int code, string reason, string expectedReason, string body) 580public async Task TransferEncodingNotSetForStatusCodes(int code, string method) 589public async Task ServerHeaderIsOverriden() 598public async Task ResponseInvalidOrderingTests_ExpectFailure(string path) 605public async Task HostingEnvironmentIsCorrect() 617public async Task IISEnvironmentFeatureIsAvailable(string endpoint) 641public async Task LargeResponseBodyTest_CheckAllResponseBodyBytesWritten(int query) 647public async Task LargeResponseBodyFromFile_CheckAllResponseBodyBytesWritten() 656public async Task FeatureCollectionTest_SetHttpContextFeatures(string path) 664public async Task ExposesIServerAddressesFeature() 670public async Task ServerWorksAfterClientDisconnect() 697public async Task RequestAbortedTokenFires() 717public async Task ClientDisconnectStress() 721async Task RunRequests() 742List<Task> tasks = new List<Task>(); 745tasks.Add(Task.Run(RunRequests)); 748await Task.WhenAll(tasks); 753public async Task SendTransferEncodingHeadersWithMultipleValues() 773public async Task SendTransferEncodingAndContentLength_ContentLengthShouldBeRemoved()
src\Servers\IIS\IIS\test\Common.FunctionalTests\WindowsAuthTests.cs (1)
45public async Task WindowsAuthTest(TestVariant variant)
src\Servers\IIS\IIS\test\Common.LongTests\ShutdownTests.cs (33)
39public async Task ShutdownTimeoutIsApplied() 60public async Task CallStopAsyncOnRequestThread_DoesNotHangIndefinitely(string path) 79public async Task AppOfflineDroppedWhileSiteIsDown_SiteReturns503_InProcess() 91public async Task AppOfflineDroppedWhileSiteIsDown_SiteReturns503_OutOfProcess() 102public async Task LockedAppOfflineDroppedWhileSiteIsDown_SiteReturns503_InProcess() 120public async Task LockedAppOfflineDroppedWhileSiteIsDown_SiteReturns503_OutOfProcess() 137public async Task AppOfflineDroppedWhileSiteFailedToStartInShim_AppOfflineServed_InProcess() 156public async Task AppOfflineDroppedWhileSiteFailedToStartInShim_AppOfflineServed_OutOfProcess() 174public async Task AppOfflineDroppedWhileSiteFailedToStartInRequestHandler_SiteStops_InProcess() 191public async Task GracefulShutdownWorksWithMultipleRequestsInFlight_InProcess() 265public async Task RequestsWhileRestartingAppFromConfigChangeAreProcessed() 289await Task.Delay(1); 302public async Task RequestsWhileRecyclingAppAreProcessed() 326await Task.Delay(1); 338public async Task AppOfflineDroppedWhileSiteRunning_SiteShutsDown_InProcess() 349public async Task AppOfflineDroppedWhileSiteRunning_SiteShutsDown_OutOfProcess() 364public async Task AppOfflineDropped_CanRemoveAppOfflineAfterAddingAndSiteWorks_InProcess() 379public async Task AppOfflineDropped_CanRemoveAppOfflineAfterAddingAndSiteWorks_OutOfProcess() 395public async Task AppOfflineAddedAndRemovedStress_InProcess() 402public async Task AppOfflineAddedAndRemovedStress_OutOfProcess() 407private async Task AppOfflineAddAndRemovedStress(HostingModel hostingModel) 411var load = Helpers.StressLoad(deploymentResult.HttpClient, "/HelloWorld", response => 449public async Task ConfigurationChangeStopsInProcess() 465public async Task ConfigurationChangeForcesChildProcessRestart() 482public async Task ConfigurationChangeCanBeIgnoredInProcess() 502public async Task AppHostConfigurationChangeIsIgnoredInProcess() 523public async Task ConfigurationChangeCanBeIgnoredOutOfProcess() 541public async Task OutOfProcessToInProcessHostingModelSwitchWorks() 563public async Task ConfigurationTouchedStress_InProcess() 568private async Task ConfigurationTouchedStress(HostingModel hostingModel) 573var load = Helpers.StressLoad(deploymentResult.HttpClient, "/HelloWorld", response => 605public async Task ClosesConnectionOnServerAbortOutOfProcess() 633public async Task ClosesConnectionOnServerAbortInProcess()
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (77)
45public async Task ExpandEnvironmentVariableInWebConfig() 60public async Task InvalidProcessPath_ExpectServerError(string path, string arguments, string subError) 86public async Task StartsWithDotnetLocationWithoutExe() 97public async Task StartsWithDotnetLocationUppercase() 111public async Task StartsWithDotnetOnThePath(string path) 130public async Task StartsWithDotnetInstallLocation() 163public async Task DoesNotStartIfDisabled() 195public async Task HelloWorld(TestVariant variant) 203public async Task StartsWithPortableAndBootstraperExe() 222public async Task DetectsOverriddenServer() 239public async Task LogsStartupExceptionExitError() 257public async Task LogsUnexpectedThreadExitError() 274public async Task RemoveHostfxrFromApp_InProcessHostfxrAPIAbsent() 298public async Task PublishWithWrongBitness() 339public async Task RemoveHostfxrFromApp_InProcessHostfxrLoadFailure() 361public async Task TargetDifferenceSharedFramework_FailedToFindNativeDependencies() 382public async Task WrongApplicationPath_FailedToRun() 400public async Task SingleExecutable_FailedToFindNativeDependencies() 418public async Task TargedDifferenceSharedFramework_FailedToFindNativeDependenciesErrorInResponse() 441public async Task RemoveInProcessReference_FailedToFindRequestHandler() 465public async Task StartupTimeoutIsApplied() 498public async Task StartupTimeoutIsApplied_DisableRecycleOnStartupTimeout() 530public async Task CheckInvalidHostingModelParameter() 553public async Task ReportsWebConfigAuthoringErrors(string scenario) 598public async Task StartsWithWebConfigVariationsPortable(string scenario) 668public async Task StartsWithWebConfigVariationsStandalone(string scenario) 706public async Task SetCurrentDirectoryHandlerSettingWorks() 723public async Task StartupIsSuspendedWhenEventIsUsed() 736var request = deploymentResult.AssertStarts(); 762public async Task ExceptionIsLoggedToEventLogAndPutInResponseWhenDeveloperExceptionPageIsEnabled(string environmentVariable, string value) 786public async Task ExceptionIsLoggedToEventLogAndPutInResponseWhenDeveloperExceptionPageIsEnabledViaWebConfig() 813public async Task ExceptionIsLoggedToEventLogAndPutInResponseDuringHostingStartupProcess(string startupType) 835public async Task ExceptionIsNotLoggedToResponseWhenStartupHookIsDisabled() 857public async Task ExceptionIsLoggedToEventLogDoesNotWriteToResponse() 879public async Task CanAddCustomStartupHook() 896public async Task CanAddCustomStartupHookWhenIISOneIsDisabled() 914public async Task StackOverflowIsAvoidedBySettingLargerStack() 924public async Task StackOverflowCanBeSetBySettingLargerStackViaHandlerSetting() 940public async Task EnvironmentVariableForLauncherPathIsPreferred(HostingModel hostingModel) 956public async Task EnvironmentVariableForLauncherArgsIsPreferred(HostingModel hostingModel) 969public async Task OnCompletedDoesNotFailRequest() 992public async Task CheckStdoutWithLargeWrites_TestSink(string mode) 1015public async Task CheckStdoutWithLargeWrites_LogFile(string mode) 1039public async Task CheckValidConsoleFunctions() 1052public async Task Gets500_30_ErrorPage() 1069public async Task IncludesAdditionalErrorPageTextInProcessHandlerLoadFailure_CorrectString() 1088public async Task IncludesAdditionalErrorPageTextOutOfProcessStartupFailure_CorrectString() 1107public async Task IncludesAdditionalErrorPageTextOutOfProcessHandlerLoadFailure_CorrectString() 1130public async Task IncludesAdditionalErrorPageTextInProcessStartupFailure_CorrectString() 1151public async Task GetLongEnvironmentVariable_InProcess() 1170public async Task GetLongEnvironmentVariable_OutOfProcess() 1189public Task AuthHeaderEnvironmentVariableRemoved_InProcess() => AuthHeaderEnvironmentVariableRemoved(HostingModel.InProcess); 1192public Task AuthHeaderEnvironmentVariableRemoved_OutOfProcess() => AuthHeaderEnvironmentVariableRemoved(HostingModel.OutOfProcess); 1194private async Task AuthHeaderEnvironmentVariableRemoved(HostingModel hostingModel) 1205public Task WebConfigOverridesGlobalEnvironmentVariables_InProcess() => WebConfigOverridesGlobalEnvironmentVariables(HostingModel.InProcess); 1210public Task WebConfigOverridesGlobalEnvironmentVariables_OutOfProcess() => WebConfigOverridesGlobalEnvironmentVariables(HostingModel.OutOfProcess); 1212private async Task WebConfigOverridesGlobalEnvironmentVariables(HostingModel hostingModel) 1223public Task WebConfigAppendsHostingStartup_InProcess() => WebConfigAppendsHostingStartup(HostingModel.InProcess); 1228public Task WebConfigAppendsHostingStartup_OutOfProcess() => WebConfigAppendsHostingStartup(HostingModel.OutOfProcess); 1230private async Task WebConfigAppendsHostingStartup(HostingModel hostingModel) 1247public Task WebConfigOverridesHostingStartup_InProcess() => WebConfigOverridesHostingStartup(HostingModel.InProcess); 1252public Task WebConfigOverridesHostingStartup_OutOfProcess() => WebConfigOverridesHostingStartup(HostingModel.OutOfProcess); 1254private async Task WebConfigOverridesHostingStartup(HostingModel hostingModel) 1265public Task WebConfigExpandsVariables_InProcess() => WebConfigExpandsVariables(HostingModel.InProcess); 1270public Task WebConfigExpandsVariables_OutOfProcess() => WebConfigExpandsVariables(HostingModel.OutOfProcess); 1272private async Task WebConfigExpandsVariables(HostingModel hostingModel) 1286public async Task PreferEnvironmentVariablesOverWebConfigWhenConfigured(HostingModel hostingModel) 1301public async Task ServerAddressesIncludesBaseAddress() 1325public async Task AncmHttpsPortCanBeOverriden() 1349public async Task HttpsRedirectionWorksIn30AndNot22() 1396public async Task MultipleHttpsPortsProduceNoEnvVar() 1426public async Task SetsConnectionCloseHeader() 1485private static async Task AssertLink(HttpResponseMessage response) 1502private async Task AssertFailsToStart(IISDeploymentResult deploymentResult) 1566private Task AssertSiteFailsToStartWithInProcessStaticContent(IISDeploymentResult deploymentResult) 1571private async Task AssertSiteFailsToStartWithInProcessStaticContent(IISDeploymentResult deploymentResult, string error) 1586private async Task AssertSiteFailsToStartWithInProcessStaticContent(IISDeploymentResult deploymentResult, params string[] errors)
src\Shared\Http2cat\Http2CatHostedService.cs (5)
29private Task _backgroundTask; 43public Task StartAsync(CancellationToken cancellationToken) 46return Task.CompletedTask; 49public Task StopAsync(CancellationToken cancellationToken) 55private async Task RunAsync()
src\Shared\Http2cat\Http2CatIHostBuilderExtensions.cs (1)
13public static IHostBuilder UseHttp2Cat(this IHostBuilder hostBuilder, string address, Func<Http2Utilities, Task> scenario)
src\Shared\Http2cat\Http2CatOptions.cs (1)
12public Func<Http2Utilities, Task> Scenaro { get; set; }
src\Shared\Http2cat\Http2Utilities.cs (42)
153public async Task InitializeConnectionAsync(int expectedSettingsCount = 3) 174public Task StartStreamAsync(int streamId, IEnumerable<KeyValuePair<string, string>> headers, bool endStream) 272public Task SendHeadersWithPaddingAsync(int streamId, IEnumerable<KeyValuePair<string, string>> headers, byte padLength, bool endStream) 312public Task SendHeadersWithPriorityAsync(int streamId, IEnumerable<KeyValuePair<string, string>> headers, byte priority, int streamDependency, bool endStream) 355public Task SendHeadersWithPaddingAndPriorityAsync(int streamId, IEnumerable<KeyValuePair<string, string>> headers, byte padLength, byte priority, int streamDependency, bool endStream) 389public Task SendAsync(ReadOnlySpan<byte> span) 396public static async Task FlushAsync(PipeWriter writableBuffer) 401public Task SendPreambleAsync() => SendAsync(ClientPreface); 403public async Task SendSettingsAsync() 426public async Task SendSettingsAckWithInvalidLengthAsync(int length) 436public async Task SendSettingsWithInvalidStreamIdAsync(int streamId) 450public async Task SendSettingsWithInvalidLengthAsync(int length) 462internal async Task SendSettingsWithInvalidParameterValueAsync(Http2SettingsParameter parameter, uint value) 480public Task SendPushPromiseFrameAsync() 508internal async Task SendHeadersAsync(int streamId, Http2HeadersFrameFlags flags, byte[] headerBlock) 520public async Task SendInvalidHeadersFrameAsync(int streamId, int payloadLength, byte padLength) 539public async Task SendIncompleteHeadersFrameAsync(int streamId) 573internal async Task SendContinuationAsync(int streamId, Http2ContinuationFrameFlags flags, byte[] payload) 601internal Task SendEmptyContinuationFrameAsync(int streamId, Http2ContinuationFrameFlags flags) 613public async Task SendIncompleteContinuationFrameAsync(int streamId) 631public Task SendDataAsync(int streamId, Memory<byte> data, bool endStream) 644public async Task SendDataWithPaddingAsync(int streamId, Memory<byte> data, byte padLength, bool endStream) 664public Task SendInvalidDataFrameAsync(int streamId, int frameLength, byte padLength) 684internal Task SendPingAsync(Http2PingFrameFlags flags) 693public Task SendPingWithInvalidLengthAsync(int length) 703public Task SendPingWithInvalidStreamIdAsync(int streamId) 722public Task SendPriorityAsync(int streamId, int streamDependency = 0) 736public Task SendInvalidPriorityFrameAsync(int streamId, int length) 752public Task SendRstStreamAsync(int streamId) 764public Task SendInvalidRstStreamFrameAsync(int streamId, int length) 774public Task SendGoAwayAsync() 783public Task SendInvalidGoAwayFrameAsync() 793public Task SendWindowUpdateAsync(int streamId, int sizeIncrement) 805public Task SendInvalidWindowUpdateAsync(int streamId, int sizeIncrement, int length) 815public Task SendUnknownFrameTypeAsync(int streamId, int frameType) 877public async Task StopConnectionAsync(int expectedLastStreamId, bool ignoreNonGoAwayFrames) 885public Task WaitForConnectionStopAsync(int expectedLastStreamId, bool ignoreNonGoAwayFrames) 890internal Task ReceiveHeadersAsync(int expectedStreamId, Action<IDictionary<string, string>> verifyHeaders = null) 893internal async Task ReceiveHeadersAsync(int expectedStreamId, bool endStream = false, Action<IDictionary<string, string>> verifyHeaders = null) 934internal async Task WaitForConnectionErrorAsync<TException>(bool ignoreNonGoAwayFrames, int expectedLastStreamId, Http2ErrorCode expectedErrorCode) 941internal async Task WaitForConnectionErrorAsyncDoNotCloseTransport<TException>(bool ignoreNonGoAwayFrames, int expectedLastStreamId, Http2ErrorCode expectedErrorCode) 957internal async Task WaitForStreamErrorAsync(int expectedStreamId, Http2ErrorCode expectedErrorCode)
src\Shared\ServerInfrastructure\DuplexPipeStream.cs (2)
96public override Task WriteAsync(byte[]? buffer, int offset, int count, CancellationToken cancellationToken) 111public override Task FlushAsync(CancellationToken cancellationToken)
src\Shared\TaskToApm.cs (3)
32public static IAsyncResult Begin(Task task, AsyncCallback? callback, object? state) => 69internal readonly Task _task; 77internal TaskAsyncResult(Task task, object? state, AsyncCallback? callback)
src\Shared\ValueTaskExtensions\ValueTaskExtensions.cs (2)
13public static Task GetAsTask(this in ValueTask<FlushResult> valueTask) 20return Task.CompletedTask;
UpgradeFeatureDetectionTests.cs (5)
27public Task UpgradeFeatureDetectionDisabled_InProcess() 36public Task UpgradeFeatureDetectionEnabled_InProcess() 44public Task UpgradeFeatureDetectionDisabled_OutOfProcess() 52public Task UpgradeFeatureDetectionEnabled_OutOfProcess() 59private async Task UpgradeFeatureDetectionDeployer(bool disableWebSocket, string expected, HostingModel hostingModel)
IISSample (1)
Startup.cs (1)
93public static Task Main(string[] args)
ILCompiler.DependencyAnalysisFramework (3)
src\coreclr\tools\Common\Sorting\MergeSortCore.cs (3)
31private static async Task ParallelSort(TDataStructure arrayToSort, int index, int length, TComparer comparer) 42Task rightSortTask = Task.Run(() => ParallelSort(arrayToSort, index + halfLen, length - halfLen, comparer));
ILLink.CodeFixProvider (6)
BaseAttributeCodeFixProvider.cs (1)
33 protected async Task BaseRegisterCodeFixesAsync (CodeFixContext context)
DynamicallyAccessedMembersCodeFixProvider.cs (1)
93 public override async Task RegisterCodeFixesAsync (CodeFixContext context)
RequiresAssemblyFilesCodeFixProvider.cs (1)
33 public sealed override Task RegisterCodeFixesAsync (CodeFixContext context) => BaseRegisterCodeFixesAsync (context);
RequiresDynamicCodeCodeFixProvider.cs (1)
30 public sealed override Task RegisterCodeFixesAsync (CodeFixContext context) => BaseRegisterCodeFixesAsync (context);
RequiresUnreferencedCodeCodeFixProvider.cs (1)
30 public sealed override Task RegisterCodeFixesAsync (CodeFixContext context) => BaseRegisterCodeFixesAsync (context);
UnconditionalSuppressMessageCodeFixProvider.cs (1)
38 public sealed override Task RegisterCodeFixesAsync (CodeFixContext context) => BaseRegisterCodeFixesAsync (context);
InMemory.FunctionalTests (1279)
BadHttpRequestTests.cs (26)
25public Task TestInvalidRequestLines(string request, string expectedExceptionMessage) 35public Task TestInvalidRequestLinesWithUnrecognizedVersion(string httpVersion) 45public Task TestInvalidHeaders(string rawHeaders, string expectedExceptionMessage) 71public Task BadRequestWhenHeaderNameContainsNonASCIIOrNullCharacters(string dataName) 86public Task BadRequestIfMethodRequiresLengthButNoContentLengthInHttp10Request(string method) 97public Task BadRequestIfContentLengthInvalid(string contentLength) 108public Task RejectsIncorrectMethods(string request, string allowedMethod) 118public Task BadRequestIfHostHeaderMissing() 127public Task BadRequestIfMultipleHostHeaders() 136public Task BadRequestIfHostHeaderDoesNotMatchRequestTarget(string requestTarget, string host) 147public async Task CanOptOutOfBadRequestIfHostHeaderDoesNotMatchRequestTarget(string hostHeader) 153return Task.CompletedTask; 171public Task BadRequestFor10BadHostHeaderFormat() 180public Task BadRequestFor11BadHostHeaderFormat() 189public async Task BadRequestLogsAreNotHigherThanDebug() 211public async Task TestRequestSplitting() 213await using (var server = new TestServer(context => Task.CompletedTask, new TestServiceContext(LoggerFactory))) 227public async Task BadRequestForHttp2() 229await using (var server = new TestServer(context => Task.CompletedTask, new TestServiceContext(LoggerFactory))) 244public Task BadRequestForAbsoluteFormTargetWithNonAsciiChars() 279private async Task TestBadRequest(string request, string expectedResponseStatusCode, string expectedExceptionMessage, string expectedAllowHeader = null) 306await using (var server = new TestServer(context => Task.CompletedTask, new TestServiceContext(LoggerFactory) { DiagnosticSource = diagListener })) 332public async Task ExtraLinesBetweenRequestsIgnored(string extraLines) 393public async Task ExtraLinesIgnoredBetweenAdjacentRequests() 463public async Task ExtraLinesAtEndOfConnectionIgnored(string extraLines) 509private async Task ReceiveBadRequestResponse(InMemoryConnection connection, string expectedResponseStatusCode, string expectedDateHeaderValue, string expectedAllowHeader = null)
ChunkedRequestTests.cs (22)
24private async Task App(HttpContext httpContext) 41private async Task PipeApp(HttpContext httpContext) 60private async Task AppChunked(HttpContext httpContext) 74public async Task Http10TransferEncoding() 103public async Task Http10TransferEncodingPipes() 132public async Task Http10KeepAliveTransferEncoding() 173public async Task RequestBodyIsConsumedAutomaticallyIfAppDoesntConsumeItFully() 228public async Task TrailingHeadersAreParsed() 356public async Task TrailingHeadersAreParsedWithPipe() 486public async Task TrailingHeadersCountTowardsHeadersTotalSizeLimit() 533public async Task TrailingHeadersCountTowardsHeaderCountLimit() 577public async Task ExtensionsAreIgnored() 661public async Task InvalidLengthResultsIn400() 705public async Task InvalidSizedDataResultsIn400() 750public async Task ChunkedNotFinalTransferCodingResultsIn400() 755return Task.CompletedTask; 853public async Task ClosingConnectionMidChunkPrefixThrows() 863var readTask = httpContext.Request.Body.CopyToAsync(Stream.Null); 904public async Task ChunkedRequestCallCancelPendingReadWorks() 961public async Task ChunkedRequestCallCompleteThrowsExceptionOnRead() 1011public async Task ChunkedRequestCallCompleteDoesNotCauseException() 1074public async Task ChunkedRequestCallCompleteWithExceptionCauses500()
ChunkedResponseTests.cs (30)
20public async Task ResponsesAreChunkedAutomatically() 55public async Task ResponsesAreNotChunkedAutomaticallyForHttp10Requests() 83public async Task IgnoresChangesToHttpProtocol() 119public async Task ResponsesAreChunkedAutomaticallyForHttp11NonKeepAliveRequests() 155public async Task ResponsesAreChunkedAutomaticallyLargeResponseWithOverloadedWriteAsync() 195public async Task ResponsesAreChunkedAutomaticallyLargeChunksLargeResponseWithOverloadedWriteAsync(int length) 237public async Task ResponsesAreChunkedAutomaticallyPartialWrite(int partialLength) 274public async Task SettingConnectionCloseHeaderInAppDoesNotDisableChunking() 310public async Task ZeroLengthWritesAreIgnored() 346public async Task ZeroLengthWritesFlushHeaders() 390public async Task EmptyResponseBodyHandledCorrectlyWithZeroLengthWrite() 420public async Task ConnectionClosedIfExceptionThrownAfterWrite() 453public async Task ConnectionClosedIfExceptionThrownAfterZeroLengthWrite() 485public async Task WritesAreFlushedPriorToResponseCompletion() 531public async Task ChunksCanBeWrittenManually() 569public async Task ChunksWithGetMemoryAfterStartAsyncBeforeFirstFlushStillFlushes() 613public async Task ChunksWithGetMemoryBeforeFirstFlushStillFlushes() 656public async Task ChunksWithGetMemoryLargeWriteBeforeFirstFlush() 710public async Task ChunksWithGetMemoryAndStartAsyncWithInitialFlushWorks() 766public async Task ChunksWithGetMemoryBeforeFlushEdgeCase() 823public async Task ChunkGetMemoryMultipleAdvance() 865public async Task ChunkGetSpanMultipleAdvance() 912public async Task ChunkGetMemoryAndWrite() 953public async Task ChunkGetMemoryAndWriteWithoutStart() 993public async Task GetMemoryWithSizeHint() 1032public async Task GetMemoryWithSizeHintWithoutStartAsync() 1046await Task.CompletedTask; 1069public async Task ChunkGetMemoryWithoutStartWithSmallerSizesWork(int writeSize) 1107public async Task ChunkGetMemoryWithStartWithSmallerSizesWork(int writeSize) 1144public async Task ChunkedWithBothPipeAndStreamWorks()
ConnectionLimitTests.cs (6)
27public async Task ResetsCountWhenConnectionClosed() 55public async Task UpgradedConnectionsCountsAgainstDifferentLimit() 66await Task.Delay(100); 103public async Task RejectsConnectionsWhenLimitReached() 156public async Task ConnectionCountingReturnsToZero() 182await using (var server = CreateServerWithMaxConnections(_ => Task.CompletedTask, counter))
ConnectionMiddlewareTests.cs (18)
33public async Task CanReadAndWriteWithRewritingConnectionAdapter(RequestDelegate requestDelegate) 68public async Task CanReadAndWriteWithAsyncConnectionMiddleware(RequestDelegate requestDelegate) 98public async Task CanReadWriteThroughAsyncConnectionMiddleware(RequestDelegate requestDelegate) 131public async Task ImmediateFinAfterOnConnectionAsyncClosesGracefully(RequestDelegate requestDelegate) 151public async Task ImmediateFinAfterThrowingClosesGracefully(RequestDelegate requestDelegate) 172public async Task ImmediateShutdownAfterOnConnectionAsyncDoesNotCrash(RequestDelegate requestDelegate) 181var stopTask = Task.CompletedTask; 198public async Task ImmediateShutdownDuringOnConnectionAsyncDoesNotCrash() 215Task stopTask; 230public async Task ThrowingSynchronousConnectionMiddlewareDoesNotCrashServer(RequestDelegate requestDelegate) 259public async Task CanFlushAsyncWithConnectionMiddleware() 290public async Task CanFlushAsyncWithConnectionMiddlewarePipeWriter() 330public async Task OnConnectionAsync(ConnectionContext context) 362public async Task OnConnectionAsync(ConnectionContext context) 364await Task.Yield(); 420public override Task FlushAsync(CancellationToken cancellationToken) 466public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
DefaultHeaderTests.cs (2)
14public async Task TestDefaultHeaders() 21await using (var server = new TestServer(ctx => Task.CompletedTask, testContext))
EventSourceTests.cs (7)
32public async Task Http1_EmitsStartAndStopEventsWithActivityIds() 140public async Task Http2_EmitsStartAndStopEventsWithActivityIds() 153return Task.CompletedTask; 266public async Task TlsHandshakeFailure_EmitsStartAndStopEventsWithActivityIds() 271await using (var server = new TestServer(context => Task.CompletedTask, new TestServiceContext(LoggerFactory), 355public async Task ConnectionLimitExceeded_EmitsStartAndStopEventsWithActivityIds() 362await using (var server = new TestServer(context => Task.CompletedTask, serviceContext,
Http2\Http2ConnectionTests.cs (198)
31public async Task MaxConcurrentStreamsLogging_ReachLimit_MessageLogged() 53public async Task FlowControl_NoAvailability_ResponseHeadersStillFlushed() 85public async Task FlowControl_OneStream_CorrectlyAwaited() 163public async Task RequestHeaderStringReuse_MultipleStreams_KnownHeaderReused() 212public async Task RequestHeaderStringReuse_MultipleStreams_KnownHeaderClearedIfNotReused() 307public async Task ResponseTrailers_MultipleStreams_Reset() 336return Task.CompletedTask; 396public async Task StreamPool_SingleStream_ReturnedToPool() 430public async Task StreamPool_MultipleStreamsConcurrent_StreamsReturnedToPool() 479public async Task StreamPool_MultipleStreamsInSequence_PooledStreamReused() 554public async Task StreamPool_StreamIsInvalidState_DontReturnedToPool() 598public async Task StreamPool_EndedStreamErrorsOnStart_NotReturnedToPool() 620public async Task StreamPool_UnendedStreamErrorsOnStart_NotReturnedToPool() 649public async Task StreamPool_UnusedExpiredStream_RemovedFromPool() 690public async Task Frame_Received_OverMaxSize_FrameError() 707public async Task ServerSettings_ChangesRequestMaxFrameSize() 739public async Task DATA_Received_ReadByStream() 765public async Task DATA_Received_MaxSize_ReadByStream() 792public async Task DATA_Received_GreaterThanInitialWindowSize_ReadByStream() 893public async Task DATA_Received_RightAtWindowLimit_DoesNotPausePipe() 923public async Task DATA_Received_Multiple_ReadByStream() 955public async Task DATA_Received_Multiplexed_ReadByStreams() 1021public async Task DATA_Received_Multiplexed_GreaterThanInitialWindowSize_ReadByStream() 1137public async Task DATA_Received_Multiplexed_AppMustNotBlockOtherFrames() 1209public async Task DATA_Received_WithPadding_ReadByStream(byte padLength) 1238public async Task DATA_Received_WithPadding_CountsTowardsInputFlowControl(byte padLength) 1307public async Task DATA_Received_ButNotConsumedByApp_CountsTowardsInputFlowControl() 1345public async Task DATA_BufferRequestBodyLargerThanStreamSizeSmallerThanConnectionPipe_Works() 1443public async Task DATA_Received_StreamIdZero_ConnectionError() 1457public async Task DATA_Received_StreamIdEven_ConnectionError() 1471public async Task DATA_Received_PaddingEqualToFramePayloadLength_ConnectionError() 1486public async Task DATA_Received_PaddingGreaterThanFramePayloadLength_ConnectionError() 1501public async Task DATA_Received_FrameLengthZeroPaddingZero_ConnectionError() 1516public async Task DATA_Received_InterleavedWithHeaders_ConnectionError() 1531public async Task DATA_Received_StreamIdle_ConnectionError() 1545public async Task DATA_Received_StreamHalfClosedRemote_ConnectionError() 1562public async Task DATA_Received_StreamClosed_ConnectionError() 1587public async Task Frame_MultipleStreams_CanBeCreatedIfClientCountIsLessThanActualMaxStreamCount() 1621public async Task MaxTrackedStreams_SmallMaxConcurrentStreams_LowerLimitOf100Async() 1633public async Task MaxTrackedStreams_DefaultMaxConcurrentStreams_DoubleLimit() 1645public async Task MaxTrackedStreams_LargeMaxConcurrentStreams_DoubleLimit() 1667public Task Frame_MultipleStreams_RequestsNotFinished_LowMaxStreamsPerConnection_EnhanceYourCalmAfter100() 1675public Task Frame_MultipleStreams_RequestsNotFinished_DefaultMaxStreamsPerConnection_EnhanceYourCalmAfterDoubleMaxStreams() 1682public async Task AbortConnectionAfterTooManyEnhanceYourCalms() 1685await InitializeConnectionAsync(_ => Task.FromException(new InvalidOperationException("No requests should be processed"))); 1734private async Task RequestUntilEnhanceYourCalm(int maxStreamsPerConnection, int sentStreams) 1764public async Task DATA_Received_StreamClosedImplicitly_ConnectionError() 1792public async Task DATA_Received_NoStreamWindowSpace_ConnectionError() 1814public async Task DATA_Received_NoConnectionWindowSpace_ConnectionError() 1843public async Task DATA_Sent_DespiteConnectionOutputFlowControl_IfEmptyAndEndsStream() 1925public async Task OutputFlowControl_ConnectionAndRequestAborted_NoException() 1987public async Task DATA_Sent_DespiteStreamOutputFlowControl_IfEmptyAndEndsStream() 2008public async Task StreamWindow_BiggerThan_ConnectionWindow() 2060public async Task HEADERS_Received_Decoded() 2080public async Task HEADERS_Received_WithPadding_Decoded(byte padLength) 2097public async Task HEADERS_Received_WithPriority_Decoded() 2117public async Task HEADERS_Received_WithPriorityAndPadding_Decoded(byte padLength) 2136public async Task HEADERS_Received_WithTrailers_Available(bool sendData) 2180public async Task HEADERS_Received_ContainsExpect100Continue_100ContinueSent() 2212public async Task HEADERS_Received_AppCannotBlockOtherFrames() 2261public async Task HEADERS_HeaderTableSizeLimitZero_Received_DynamicTableUpdate() 2295public async Task HEADERS_ResponseSetsIgnoreIndexAndNeverIndexValues_HeadersParsed() 2303return Task.CompletedTask; 2389public async Task HEADERS_DisableDynamicHeaderCompression_HeadersNotCompressed() 2413public async Task HEADERS_OverMaxStreamLimit_Refused() 2439public async Task HEADERS_Received_StreamIdZero_ConnectionError() 2453public async Task HEADERS_Received_StreamIdEven_ConnectionError() 2467public async Task HEADERS_Received_StreamClosed_ConnectionError() 2493public async Task HEADERS_Received_StreamHalfClosedRemote_ConnectionError() 2510public async Task HEADERS_Received_StreamClosedImplicitly_ConnectionError() 2534public async Task HEADERS_Received_PaddingEqualToFramePayloadLength_ConnectionError(byte padLength) 2549public async Task HEADERS_Received_PaddingFieldMissing_ConnectionError() 2565public async Task HEADERS_Received_PaddingGreaterThanFramePayloadLength_ConnectionError(int frameLength, byte padLength) 2579public async Task HEADERS_Received_InterleavedWithHeaders_ConnectionError() 2594public async Task HEADERS_Received_WithPriority_StreamDependencyOnSelf_ConnectionError() 2608public async Task HEADERS_Received_IncompleteHeaderBlock_ConnectionError() 2622public async Task HEADERS_Received_IntegerOverLimit_ConnectionError() 2651public async Task HEADERS_Received_WithTrailers_ContainsIllegalTrailer_ConnectionError(byte[] trailers, string expectedErrorMessage) 2668public async Task HEADERS_Received_WithTrailers_EndStreamNotSet_ConnectionError(int intFlags) 2685public async Task HEADERS_Received_HeaderNameContainsUpperCaseCharacter_ConnectionError(byte[] headerBlock) 2698public Task HEADERS_Received_HeaderBlockContainsUnknownPseudoHeaderField_ConnectionError() 2712public Task HEADERS_Received_HeaderBlockContainsResponsePseudoHeaderField_ConnectionError() 2727public Task HEADERS_Received_HeaderBlockContainsDuplicatePseudoHeaderField_ConnectionError(IEnumerable<KeyValuePair<string, string>> headers) 2734public async Task HEADERS_Received_HeaderBlockDoesNotContainMandatoryPseudoHeaderField_MethodIsCONNECT_NoError(IEnumerable<KeyValuePair<string, string>> headers) 2750public Task HEADERS_Received_HeaderBlockContainsPseudoHeaderFieldAfterRegularHeaders_ConnectionError(IEnumerable<KeyValuePair<string, string>> headers) 2755private async Task HEADERS_Received_InvalidHeaderFields_ConnectionError(IEnumerable<KeyValuePair<string, string>> headers, string expectedErrorMessage) 2768public async Task HEADERS_Received_HeaderBlockDoesNotContainMandatoryPseudoHeaderField_StreamError(IEnumerable<KeyValuePair<string, string>> headers) 2788public Task HEADERS_Received_HeaderBlockOverLimit_ConnectionError() 2818public Task HEADERS_Received_TooManyHeaders_ConnectionError() 2837public Task HEADERS_Received_InvalidCharacters_ConnectionError() 2851public Task HEADERS_Received_HeaderBlockContainsConnectionHeader_ConnectionError() 2865public Task HEADERS_Received_HeaderBlockContainsTEHeader_ValueIsNotTrailers_ConnectionError() 2879public async Task HEADERS_Received_HeaderBlockContainsTEHeader_ValueIsTrailers_NoError() 2902public async Task HEADERS_Received_RequestLineLength_StreamError() 2920public async Task HEADERS_CookiesMergedIntoOne() 2947public async Task PRIORITY_Received_StreamIdZero_ConnectionError() 2961public async Task PRIORITY_Received_StreamIdEven_ConnectionError() 2977public async Task PRIORITY_Received_LengthNotFive_ConnectionError(int length) 2991public async Task PRIORITY_Received_InterleavedWithHeaders_ConnectionError() 3006public async Task PRIORITY_Received_StreamDependencyOnSelf_ConnectionError() 3020public async Task RST_STREAM_Received_ContinuesAppsAwaitingConnectionOutputFlowControl() 3022var writeTasks = new Task[4]; 3140public async Task RST_STREAM_Received_ContinuesAppsAwaitingStreamOutputFlowControl() 3142var writeTasks = new Task[6]; 3181async Task VerifyStreamBackpressure(int streamId, int headersLength) 3224public async Task RST_STREAM_Received_ReturnsSpaceToConnectionInputFlowControlWindow() 3258public async Task RST_STREAM_Received_StreamIdZero_ConnectionError() 3272public async Task RST_STREAM_Received_StreamIdEven_ConnectionError() 3286public async Task RST_STREAM_Received_StreamIdle_ConnectionError() 3302public async Task RST_STREAM_Received_LengthNotFour_ConnectionError(int length) 3319public async Task RST_STREAM_Received_InterleavedWithHeaders_ConnectionError() 3335public async Task RST_STREAM_IncompleteRequest_AdditionalDataFrames_ConnectionAborted() 3359public async Task RST_STREAM_IncompleteRequest_AdditionalTrailerFrames_ConnectionAborted() 3383public async Task RST_STREAM_IncompleteRequest_AdditionalResetFrame_IgnoreAdditionalReset() 3406public async Task RST_STREAM_IncompleteRequest_AdditionalWindowUpdateFrame_ConnectionAborted() 3429public async Task SETTINGS_KestrelDefaults_Sent() 3479public async Task SETTINGS_Custom_Sent() 3538public async Task SETTINGS_Received_Sends_ACK() 3546public async Task SETTINGS_ACK_Received_DoesNotSend_ACK() 3559public async Task SETTINGS_Received_StreamIdNotZero_ConnectionError() 3582public async Task SETTINGS_Received_InvalidParameterValue_ConnectionError(int intParameter, uint value, int intExpectedErrorCode) 3599public async Task SETTINGS_Received_InterleavedWithHeaders_ConnectionError() 3616public async Task SETTINGS_Received_WithACK_LengthNotZero_ConnectionError(int length) 3635public async Task SETTINGS_Received_LengthNotMultipleOfSix_ConnectionError(int length) 3649public async Task SETTINGS_Received_WithInitialWindowSizePushingStreamWindowOverMax_ConnectionError() 3673public async Task SETTINGS_Received_ChangesAllowedResponseMaxFrameSize() 3730public async Task SETTINGS_Received_ClientMaxFrameSizeCannotExceedServerMaxFrameSize() 3769public async Task SETTINGS_Received_ChangesHeaderTableSize() 3798public async Task SETTINGS_Received_WithLargeHeaderTableSizeLimit_ChangesHeaderTableSize() 3836public async Task PUSH_PROMISE_Received_ConnectionError() 3850public async Task PING_Received_SendsACK() 3864public async Task PING_Received_WithACK_DoesNotSendACK() 3874public async Task PING_Received_InterleavedWithHeaders_ConnectionError() 3889public async Task PING_Received_StreamIdNotZero_ConnectionError() 3907public async Task PING_Received_LengthNotEight_ConnectionError(int length) 3921public async Task GOAWAY_Received_ConnectionStops() 3931public async Task GOAWAY_Received_ConnectionLifetimeNotification_Cancelled() 3944public async Task GOAWAY_Received_SetsConnectionStateToClosingAndWaitForAllStreamsToComplete() 3989public async Task GOAWAY_Received_ContinuesAppsAwaitingConnectionOutputFlowControl() 3991var writeTasks = new Task[6]; 4092public async Task GOAWAY_Received_ContinuesAppsAwaitingStreamOutputFlowControl() 4094var writeTasks = new Task[6]; 4133async Task VerifyStreamBackpressure(int streamId, int headersLength) 4169public async Task GOAWAY_Received_StreamIdNotZero_ConnectionError() 4183public async Task GOAWAY_Received_InterleavedWithHeaders_ConnectionError() 4198public async Task WINDOW_UPDATE_Received_StreamIdEven_ConnectionError() 4212public async Task WINDOW_UPDATE_Received_InterleavedWithHeaders_ConnectionError() 4231public async Task WINDOW_UPDATE_Received_LengthNotFour_ConnectionError(int streamId, int length) 4245public async Task WINDOW_UPDATE_Received_OnConnection_SizeIncrementZero_ConnectionError() 4259public async Task WINDOW_UPDATE_Received_OnStream_SizeIncrementZero_ConnectionError() 4274public async Task WINDOW_UPDATE_Received_StreamIdle_ConnectionError() 4288public async Task WINDOW_UPDATE_Received_OnConnection_IncreasesWindowAboveMaxValue_ConnectionError() 4305public async Task WINDOW_UPDATE_Received_OnStream_IncreasesWindowAboveMaxValue_StreamError() 4324public async Task WINDOW_UPDATE_Received_OnConnection_Respected() 4352var lastWriteTask = context.Response.Body.WriteAsync(_maxData, 0, _maxData.Length); 4415public async Task WINDOW_UPDATE_Received_OnStream_Respected() 4456public async Task WINDOW_UPDATE_Received_OnStream_Respected_WhenInitialWindowSizeReducedMidStream() 4512public async Task CONTINUATION_Received_Decoded() 4531public async Task CONTINUATION_Received_WithTrailers_Available(bool sendData) 4586public async Task CONTINUATION_Received_StreamIdMismatch_ConnectionError() 4602public async Task CONTINUATION_Received_IncompleteHeaderBlock_ConnectionError() 4618public async Task CONTINUATION_Received_WithTrailers_ContainsIllegalTrailer_ConnectionError(byte[] trailers, string expectedErrorMessage) 4635public async Task CONTINUATION_Received_HeaderBlockDoesNotContainMandatoryPseudoHeaderField_StreamError(IEnumerable<KeyValuePair<string, string>> headers) 4658public async Task CONTINUATION_Received_HeaderBlockDoesNotContainMandatoryPseudoHeaderField_MethodIsCONNECT_NoError(IEnumerable<KeyValuePair<string, string>> headers) 4674public async Task CONTINUATION_Sent_WhenHeadersLargerThanFrameLength() 4714public async Task UnknownFrameType_Received_Ignored() 4731public async Task UnknownFrameType_Received_InterleavedWithHeaders_ConnectionError() 4746public async Task ConnectionErrorAbortsAllStreams() 4771public async Task ConnectionResetLoggedWithActiveStreams() 4784public async Task ConnectionResetNotLoggedWithNoActiveStreams() 4795public async Task OnInputOrOutputCompletedCompletesOutput() 4808public async Task AbortSendsFinalGOAWAY() 4819public async Task CompletionSendsFinalGOAWAY() 4831public async Task StopProcessingNextRequestSendsGracefulGOAWAYAndWaitsForStreamsToComplete() 4833var task = Task.CompletedTask; 4875public async Task StopProcessingNextRequestSendsGracefulGOAWAYThenFinalGOAWAYWhenAllStreamsComplete() 4907public async Task AcceptNewStreamsDuringClosingConnection() 4953public async Task IgnoreNewStreamsDuringClosedConnection() 4973public async Task IOExceptionDuringFrameProcessingIsNotLoggedHigherThanDebug() 4991public async Task UnexpectedExceptionDuringFrameProcessingLoggedAWarning() 5012public async Task AppDoesNotReadRequestBody_ResetsAndDrainsRequest(int intFinalFrameType) 5063public async Task AbortedStream_ResetsAndDrainsRequest(int intFinalFrameType) 5107public async Task ResetStream_ResetsAndDrainsRequest(int intFinalFrameType) 5151public async Task RefusedStream_Post_ResetsAndDrainsRequest(int intFinalFrameType) 5159var connectionTask = _connection.ProcessRequestsAsync(new DummyApplication(_noopApplication)); 5161async Task CompletePipeOnTaskCompletion() 5231public async Task RefusedStream_Post_2xLimitRefused() 5239var connectionTask = _connection.ProcessRequestsAsync(new DummyApplication(_ => requestBlock.Task)); 5241async Task CompletePipeOnTaskCompletion() 5301public async Task FramesInBatchAreStillProcessedAfterStreamError_WithoutHeartbeat() 5348public async Task AbortedStream_ResetsAndDrainsRequest_RefusesFramesAfterEndOfStream(int intFinalFrameType) 5422public async Task AbortedStream_ResetsAndDrainsRequest_RefusesFramesAfterClientReset(int intFinalFrameType) 5467public async Task StartConnection_SendPreface_ReturnSettings() 5482public async Task StartConnection_SendHttp1xRequest_ReturnHttp11Status400() 5495public async Task StartConnection_SendHttp1xRequest_ExceedsRequestLineLimit_ProtocolError() 5509public async Task StartTlsConnection_SendHttp1xRequest_NoError() 5525public async Task StartConnection_SendNothing_NoError()
Http2\Http2EndToEndTests.cs (1)
23public async Task MiddlewareIsRunWithConnectionLoggingScopeForHttp2Requests()
Http2\Http2KeepAliveTests.cs (12)
12public async Task KeepAlivePingDelay_InfiniteTimeSpan_KeepAliveNotEnabled() 24public async Task KeepAlivePingTimeout_InfiniteTimeSpan_NoGoAway() 53public async Task IntervalExceeded_WithoutActivity_PingSent() 74public async Task IntervalExceeded_WithActivity_NoPingSent() 96public async Task IntervalNotExceeded_NoPingSent() 112public async Task IntervalExceeded_MultipleTimes_PingsNotSentWhileAwaitingOnAck() 134public async Task IntervalExceeded_MultipleTimes_PingSentAfterAck() 171public async Task TimeoutExceeded_NoAck_GoAway() 201public async Task TimeoutExceeded_NonPingActivity_NoGoAway() 232public async Task IntervalExceeded_StreamStarted_NoPingSent() 255public async Task IntervalExceeded_ConnectionFlowControlUsedUpThenPings_NoPingSent() 308public async Task TimeoutExceeded_ConnectionFlowControlUsedUpThenPings_NoGoAway()
Http2\Http2StreamTests.cs (162)
34public async Task HEADERS_Received_NewLineCharactersInValue_ConnectionError(string headerValue) 52public async Task HEADERS_Received_EmptyMethod_Reset() 71public async Task HEADERS_Received_InvalidCustomMethod_Reset() 96public async Task HEADERS_Received_KnownOrCustomMethods_Accepted(string method) 145public async Task HEADERS_Received_HEADMethod_Accepted() 180public async Task HEADERS_Received_MethodsWithContentLength_Accepted(string method) 232public async Task HEADERS_Received_MethodsWithoutContentLength_Accepted(string method) 277public async Task HEADERS_Received_CONNECTMethod_Accepted() 301public async Task HEADERS_Received_OPTIONSStar_LeftOutOfPath() 332public async Task HEADERS_Received_OPTIONSSlash_Accepted() 363public async Task HEADERS_Received_PathAndQuery_Separated() 370return Task.CompletedTask; 409public async Task HEADERS_Received_Path_DecodedAndNormalized(string input, string expected) 415return Task.CompletedTask; 445public async Task HEADERS_Received_CONNECTMethod_WithSchemeOrPath_Reset(string headerName, string value) 462public async Task HEADERS_Received_SchemeMismatch_Reset(string scheme) 480public async Task HEADERS_Received_SchemeMismatchAllowed_Processed(string scheme) 488return Task.CompletedTask; 517public async Task HEADERS_Received_SchemeMismatchAllowed_InvalidScheme_Reset(string scheme) 538public async Task HEADERS_Received_MissingAuthority_200Status() 566public async Task HEADERS_Received_EmptyAuthority_200Status() 595public async Task HEADERS_Received_MissingAuthorityFallsBackToHost_200Status() 625public async Task HEADERS_Received_EmptyAuthorityIgnoredOverHost_200Status() 656public async Task HEADERS_Received_AuthorityOverridesHost_200Status() 687public async Task HEADERS_Received_AuthorityOverridesInvalidHost_200Status() 718public async Task HEADERS_Received_InvalidAuthority_Reset() 738public async Task HEADERS_Received_InvalidAuthorityWithValidHost_Reset() 759public async Task HEADERS_Received_TwoHosts_StreamReset() 780public async Task HEADERS_Received_MaxRequestLineSize_Reset() 802public async Task HEADERS_Received_MaxRequestHeadersTotalSize_431() 839public async Task HEADERS_Received_MaxRequestHeaderCount_431() 873public async Task ContentLength_Received_SingleDataFrame_Verified() 910public async Task ContentLength_ReceivedInContinuation_SingleDataFrame_Verified() 951public async Task ContentLength_Received_MultipleDataFrame_Verified() 994public async Task ContentLength_Received_MultipleDataFrame_ReadViaPipe_Verified() 1037public async Task ContentLength_Received_MultipleDataFrame_ReadViaPipeAndStream_Verified() 1090public async Task ContentLength_Received_NoDataFrames_Reset() 1106return Task.CompletedTask; 1119public async Task ContentLength_ReceivedInContinuation_NoDataFrames_Reset() 1142public async Task ContentLength_Received_SingleDataFrameOverSize_Reset() 1177public async Task ContentLength_Received_SingleDataFrameUnderSize_Reset() 1212public async Task ContentLength_Received_MultipleDataFramesOverSize_Reset() 1248public async Task ContentLength_Received_MultipleDataFramesUnderSize_Reset() 1284public async Task ContentLength_Received_ReadViaPipes() 1332public async Task ContentLength_Response_FirstWriteMoreBytesWritten_Throws_Sends500() 1370public async Task ContentLength_Response_MoreBytesWritten_ThrowsAndResetsStream() 1409public async Task ContentLength_Response_NoBytesWritten_Sends500() 1420return Task.CompletedTask; 1443public async Task StartAsync_Response_NoBytesWritten_Sends200() 1477public async Task StartAsync_ContentLength_Response_NoBytesWritten_Sends200() 1513public async Task StartAsync_OnStartingThrowsAfterStartAsyncIsCalled() 1526ex = Assert.Throws<InvalidOperationException>(() => context.Response.OnStarting(_ => Task.CompletedTask, null)); 1552public async Task StartAsync_StartsResponse() 1587public async Task StartAsync_WithoutFinalFlushDoesNotFlushUntilResponseEnd() 1602var res = await Task.WhenAny(tcs.Task, Task.Delay(1000)) == tcs.Task; 1637public async Task StartAsync_FlushStillFlushesBody() 1675public async Task StartAsync_WithContentLengthAndEmptyWriteCallsFinalFlush() 1712public async Task StartAsync_SingleWriteCallsFinalFlush() 1755public async Task StartAsync_ContentLength_ThrowsException_DataIsFlushed_ConnectionReset() 1790public async Task StartAsync_ThrowsException_DataIsFlushed() 1823public async Task ContentLength_Response_TooFewBytesWritten_Resets() 1861public async Task MaxRequestBodySize_ContentLengthUnder_200() 1899public async Task MaxRequestBodySize_ContentLengthOver_413() 1948public async Task MaxRequestBodySize_NoContentLength_Under_200() 1985public async Task MaxRequestBodySize_NoContentLength_Over_413() 2037public async Task MaxRequestBodySize_AppCanLowerLimit(bool includeContentLength) 2100public async Task MaxRequestBodySize_AppCanRaiseLimit(bool includeContentLength) 2147public async Task ResponseHeaders_WithNonAscii_Throws() 2185public async Task ResponseHeaders_WithNonAsciiAndCustomEncoder_Works() 2228public async Task ResponseHeaders_WithInvalidValuesAndCustomEncoder_AbortsConnection() 2246public async Task ResponseTrailers_WithoutData_Sent() 2251return Task.CompletedTask; 2284public async Task ResponseTrailers_WithExeption500_Cleared() 2310public async Task ResponseTrailers_WorksAcrossMultipleStreams_Cleared() 2320return Task.CompletedTask; 2362public async Task ResponseTrailers_WithData_Sent() 2404public async Task ResponseTrailers_WithContinuation_Sent() 2470public async Task ResponseTrailers_WithNonAscii_Throws() 2510public async Task ResponseTrailers_WithNonAsciiAndCustomEncoder_Works() 2562public async Task ResponseTrailers_WithInvalidValuesAndCustomEncoder_AbortsConnection() 2596public async Task ResponseTrailers_TooLong_Throws() 2631public async Task ResponseTrailers_WithLargeUnflushedData_DataExceedsFlowControlAvailableAndNotSentWithTrailers() 2700public async Task ResponseTrailers_WithUnflushedData_DataSentWithTrailers() 2752public async Task ApplicationException_BeforeFirstWrite_Sends500() 2785public async Task ApplicationException_AfterFirstWrite_Resets() 2822public async Task RST_STREAM_Received_AbortsStream() 2835public async Task RST_STREAM_Received_AbortsStream_StreamFlushedDataNotSent() 2868public async Task RST_STREAM_Received_AbortsStream_PipeWriterFlushedDataNotSent() 2903public async Task RST_STREAM_WaitingForRequestBody_RequestBodyThrows() 2945public async Task RST_STREAM_IncompleteRequest_RequestBodyThrows() 2989public async Task RequestAbort_SendsRstStream() 3029public async Task RequestAbort_AfterDataSent_SendsRstStream() 3081public async Task RequestAbort_ThrowsOperationCanceledExceptionFromSubsequentRequestBodyStreamRead() 3108public async Task RequestAbort_ThrowsOperationCanceledExceptionFromOngoingRequestBodyStreamRead() 3139public async Task Write_DoesNotBlockWriteLoop() 3186public async Task ResponseWithHeadersTooLarge_AbortsConnection() 3211public async Task WriteAsync_PreCancelledCancellationToken_DoesNotAbort() 3244public async Task WriteAsync_CancellationTokenTriggeredDueToFlowControl_SendRST() 3257var writeTask = context.Response.WriteAsync("hello,", cts.Token); 3292public async Task GetMemoryAdvance_Works() 3312return Task.CompletedTask; 3338public async Task GetMemoryAdvance_WithStartAsync_Works() 3384public async Task WriteAsync_GetMemoryLargeWriteBeforeFirstFlush() 3436public async Task WriteAsync_WithGetMemoryWithInitialFlushWorks() 3489public async Task WriteAsync_GetMemoryMultipleAdvance() 3535public async Task WriteAsync_GetSpanMultipleAdvance() 3585public async Task WriteAsync_GetMemoryAndWrite() 3630public async Task WriteAsync_GetMemoryWithSizeHintAlwaysReturnsSameSize() 3672public async Task WriteAsync_GetMemoryWithSizeHintAlwaysReturnsSameSizeStartAsync() 3690await Task.CompletedTask; 3711public async Task BodyWriterWriteAsync_OnAbortedRequest_ReturnsResultWithIsCompletedTrue() 3747public async Task BodyWriterWriteAsync_OnCanceledPendingFlush_ReturnsResultWithIsCanceled() 3789public async Task WriteAsync_BothPipeAndStreamWorks() 3853public async Task ContentLengthWithGetSpanWorks() 3865await Task.CompletedTask; 3904public async Task ContentLengthWithGetMemoryWorks() 3925return Task.CompletedTask; 3950public async Task ResponseBodyCanWrite() 3990public async Task ResponseBodyAndResponsePipeWorks() 4054public async Task ResponseBodyPipeCompleteWithoutExceptionDoesNotThrow() 4065await Task.CompletedTask; 4085public async Task ResponseBodyPipeCompleteWithoutExceptionWritesDoesThrow() 4119public async Task ResponseBodyPipeCompleteWithExceptionThrows() 4131await Task.CompletedTask; 4154public async Task CompleteAsync_BeforeBodyStarted_SendsHeadersWithEndStream() 4169context.Response.OnStarting(() => { startingTcs.SetResult(); return Task.CompletedTask; }); 4207public async Task CompleteAsync_BeforeBodyStarted_WithTrailers_SendsHeadersAndTrailersWithEndStream() 4222context.Response.OnStarting(() => { startingTcs.SetResult(); return Task.CompletedTask; }); 4274public async Task CompleteAsync_BeforeBodyStarted_WithTrailers_TruncatedContentLength_ThrowsAnd500() 4288context.Response.OnStarting(() => { startingTcs.SetResult(); return Task.CompletedTask; }); 4328public async Task CompleteAsync_AfterBodyStarted_SendsBodyWithEndStream() 4343context.Response.OnStarting(() => { startingTcs.SetResult(); return Task.CompletedTask; }); 4394public async Task CompleteAsync_WriteAfterComplete_Throws() 4409context.Response.OnStarting(() => { startingTcs.SetResult(); return Task.CompletedTask; }); 4450public async Task CompleteAsync_WriteAgainAfterComplete_Throws() 4465context.Response.OnStarting(() => { startingTcs.SetResult(); return Task.CompletedTask; }); 4518public async Task CompleteAsync_AdvanceAfterComplete_AdvanceThrows() 4564public async Task CompleteAsync_AfterPipeWrite_WithTrailers_SendsBodyAndTrailersWithEndStream() 4579context.Response.OnStarting(() => { startingTcs.SetResult(); return Task.CompletedTask; }); 4643public async Task CompleteAsync_AfterBodyStarted_WithTrailers_SendsBodyAndTrailersWithEndStream() 4658context.Response.OnStarting(() => { startingTcs.SetResult(); return Task.CompletedTask; }); 4717public async Task CompleteAsync_AfterBodyStarted_WithTrailers_TruncatedContentLength_ThrowsAndReset() 4732context.Response.OnStarting(() => { startingTcs.SetResult(); return Task.CompletedTask; }); 4787public async Task PipeWriterComplete_AfterBodyStarted_WithTrailers_TruncatedContentLength_ThrowsAndReset() 4803context.Response.OnStarting(() => { startingTcs.SetResult(); return Task.CompletedTask; }); 4858public async Task AbortAfterCompleteAsync_GETWithResponseBodyAndTrailers_ResetsAfterResponse() 4873context.Response.OnStarting(() => { startingTcs.SetResult(); return Task.CompletedTask; }); 4914await Task.WhenAny(WaitForStreamErrorAsync(1, Http2ErrorCode.INTERNAL_ERROR, expectedErrorMessage: null), appTcs.Task).Unwrap(); 4938public async Task AbortAfterCompleteAsync_POSTWithResponseBodyAndTrailers_RequestBodyThrows() 4955context.Response.OnStarting(() => { startingTcs.SetResult(); return Task.CompletedTask; }); 5022public async Task ResetAfterCompleteAsync_GETWithResponseBodyAndTrailers_ResetsAfterResponse() 5037context.Response.OnStarting(() => { startingTcs.SetResult(); return Task.CompletedTask; }); 5104public async Task ResetAfterCompleteAsync_POSTWithResponseBodyAndTrailers_RequestBodyThrows() 5121context.Response.OnStarting(() => { startingTcs.SetResult(); return Task.CompletedTask; }); 5202public async Task HEADERS_Received_Latin1_AcceptedWhenLatin1OptionIsConfigured() 5209return Task.CompletedTask; 5230public async Task HEADERS_Received_Latin1_RejectedWhenLatin1OptionIsNotConfigured() 5244public async Task HEADERS_Received_CustomEncoding_InvalidCharacters_AbortsConnection() 5253return Task.CompletedTask; 5263public async Task RemoveConnectionSpecificHeaders() 5309public async Task GetMemory_AfterAbort_GetsFakeMemory(int sizeHint)
Http2\Http2TestBase.cs (59)
158protected Task _connectionTask; 173Task.Run(() => 180_noopApplication = context => Task.CompletedTask; 195return Task.CompletedTask; 281return Task.CompletedTask; 352return Task.CompletedTask; 360return Task.CompletedTask; 369return Task.CompletedTask; 375return Task.CompletedTask; 383return Task.CompletedTask; 527var connectionTask = _connection.ProcessRequestsAsync(new DummyApplication(application)); 529async Task CompletePipeOnTaskCompletion() 545protected async Task InitializeConnectionAsync(RequestDelegate application, int expectedSettingsCount = 4, bool expectedWindowUpdate = true, bool addKestrelFeatures = false) 550await Task.CompletedTask.ConfigureAwait(ConfigureAwaitOptions.ForceYielding); 586protected Task StartStreamAsync(int streamId, IEnumerable<KeyValuePair<string, string>> headers, bool endStream, bool flushFrame = true) 598return Task.CompletedTask; 601protected Task StartStreamAsync(int streamId, Span<byte> headerData, bool endStream) 620protected Task SendHeadersWithPaddingAsync(int streamId, IEnumerable<KeyValuePair<string, string>> headers, byte padLength, bool endStream) 662protected Task SendHeadersWithPriorityAsync(int streamId, IEnumerable<KeyValuePair<string, string>> headers, byte priority, int streamDependency, bool endStream) 707protected Task SendHeadersWithPaddingAndPriorityAsync(int streamId, IEnumerable<KeyValuePair<string, string>> headers, byte padLength, byte priority, int streamDependency, bool endStream) 743protected Task WaitForStreamAsync(int streamId) 748protected Task WaitForAllStreamsAsync() 750return Task.WhenAll(_runningStreams.Values.Select(tcs => tcs.Task)).DefaultTimeout(); 753protected Task SendAsync(ReadOnlySpan<byte> span) 760protected static async Task FlushAsync(PipeWriter writableBuffer) 765protected Task SendPreambleAsync() => SendAsync(Http2Connection.ClientPreface); 767protected async Task SendSettingsAsync() 773protected async Task SendSettingsAckWithInvalidLengthAsync(int length) 783protected async Task SendSettingsWithInvalidStreamIdAsync(int streamId) 797protected async Task SendSettingsWithInvalidLengthAsync(int length) 809internal async Task SendSettingsWithInvalidParameterValueAsync(Http2SettingsParameter parameter, uint value) 827protected Task SendPushPromiseFrameAsync() 860internal async Task SendHeadersAsync(int streamId, Http2HeadersFrameFlags flags, byte[] headerBlock) 872protected async Task SendInvalidHeadersFrameAsync(int streamId, int payloadLength, byte padLength) 891protected async Task SendIncompleteHeadersFrameAsync(int streamId) 925internal async Task SendContinuationAsync(int streamId, Http2ContinuationFrameFlags flags, byte[] payload) 964internal Task SendEmptyContinuationFrameAsync(int streamId, Http2ContinuationFrameFlags flags) 976protected async Task SendIncompleteContinuationFrameAsync(int streamId) 994protected Task SendDataAsync(int streamId, Memory<byte> data, bool endStream, bool flushFrame = true) 1002return Task.CompletedTask; 1005protected async Task SendDataWithPaddingAsync(int streamId, Memory<byte> data, byte padLength, bool endStream) 1025protected Task SendInvalidDataFrameAsync(int streamId, int frameLength, byte padLength) 1045internal Task SendPingAsync(Http2PingFrameFlags flags) 1054protected Task SendPingWithInvalidLengthAsync(int length) 1064protected Task SendPingWithInvalidStreamIdAsync(int streamId) 1083protected Task SendPriorityAsync(int streamId, int streamDependency = 0) 1097protected Task SendInvalidPriorityFrameAsync(int streamId, int length) 1113protected Task SendRstStreamAsync(int streamId) 1125protected Task SendInvalidRstStreamFrameAsync(int streamId, int length) 1135protected Task SendGoAwayAsync() 1144protected Task SendInvalidGoAwayFrameAsync() 1154protected Task SendWindowUpdateAsync(int streamId, int sizeIncrement) 1161protected Task SendInvalidWindowUpdateAsync(int streamId, int sizeIncrement, int length) 1171protected Task SendUnknownFrameTypeAsync(int streamId, int frameType) 1250protected Task StopConnectionAsync(int expectedLastStreamId, bool ignoreNonGoAwayFrames) 1257protected Task WaitForConnectionStopAsync(int expectedLastStreamId, bool ignoreNonGoAwayFrames) 1272internal async Task WaitForConnectionErrorAsync<TException>(bool ignoreNonGoAwayFrames, int expectedLastStreamId, Http2ErrorCode expectedErrorCode, params string[] expectedErrorMessage) 1279internal async Task WaitForConnectionErrorAsyncDoNotCloseTransport<TException>(bool ignoreNonGoAwayFrames, int expectedLastStreamId, Http2ErrorCode expectedErrorCode, params string[] expectedErrorMessage) 1306internal async Task WaitForStreamErrorAsync(int expectedStreamId, Http2ErrorCode expectedErrorCode, string expectedErrorMessage)
Http2\Http2TimeoutTests.cs (25)
17public async Task Preamble_NotReceivedInitially_WithinKeepAliveTimeout_ClosesConnection() 39public async Task HEADERS_NotReceivedInitially_WithinKeepAliveTimeout_ClosesConnection() 59public async Task HEADERS_NotReceivedAfterFirstRequest_WithinKeepAliveTimeout_ClosesConnection() 107public async Task PING_WithinKeepAliveTimeout_ResetKeepAliveTimeout() 130public async Task PING_NoKeepAliveTimeout_DoesNotResetKeepAliveTimeout() 171public async Task HEADERS_ReceivedWithoutAllCONTINUATIONs_WithinRequestHeadersTimeout_AbortsConnection() 205public async Task ResponseDrain_SlowerThanMinimumDataRate_AbortsConnection() 237public async Task AbortedStream_ResetsAndDrainsRequest_RefusesFramesAfterCooldownExpires(int intFinalFrameType) 259async Task AdvanceClockAndSendFrames() 289await Task.Delay(1); 293var sendTask = AdvanceClockAndSendFrames(); 312public Task WriteStartedTask => _writeStartedTcs.Task; 314public async Task RunApp(HttpContext context) 322var writeTask = context.Response.Body.WriteAsync(buffer, 0, received); 331public async Task DATA_Sent_TooSlowlyDueToSocketBackPressureOnSmallWrite_AbortsConnectionAfterGracePeriod() 383public async Task DATA_Sent_TooSlowlyDueToSocketBackPressureOnLargeWrite_AbortsConnectionAfterRateTimeout() 437public async Task DATA_Sent_TooSlowlyDueToFlowControlOnSmallWrite_AbortsConnectionAfterGracePeriod() 488public async Task DATA_Sent_TooSlowlyDueToOutputFlowControlOnLargeWrite_AbortsConnectionAfterRateTimeout() 541public async Task DATA_Sent_TooSlowlyDueToOutputFlowControlOnMultipleStreams_AbortsConnectionAfterAdditiveRateTimeout() 606public async Task DATA_Received_TooSlowlyOnSmallRead_AbortsConnectionAfterGracePeriod() 652public async Task DATA_Received_TooSlowlyOnLargeRead_AbortsConnectionAfterRateTimeout() 702public async Task DATA_Received_TooSlowlyOnMultipleStreams_AbortsConnectionAfterAdditiveRateTimeout() 768public async Task DATA_Received_TooSlowlyOnSecondStream_AbortsConnectionAfterNonAdditiveRateTimeout() 835public async Task DATA_Received_SlowlyWhenRateLimitDisabledPerRequest_DoesNotAbortConnection() 886public async Task DATA_Received_SlowlyDueToConnectionFlowControl_DoesNotAbortConnection()
Http2\Http2WebSocketTests.cs (10)
18public async Task HEADERS_Received_ExtendedCONNECTMethod_Received() 77public async Task HEADERS_Received_ExtendedCONNECTMethod_Accepted() 155public async Task HEADERS_Received_SecondRequest_Accepted() 284public async Task HEADERS_Received_ExtendedCONNECTMethod_WithoutSchemeOrPath_Reset(string headerName, string value) 303public async Task HEADERS_Received_ProtocolWithoutCONNECTMethod_Reset() 323public async Task ExtendedCONNECT_AcceptAsyncStream_IsNotLimitedByMinRequestBodyDataRate() 385public async Task ExtendedCONNECT_AcceptAsyncStream_IsNotLimitedByMaxRequestBodySize() 449public async Task ExtendedCONNECTMethod_DoesNotProvideUsableBodyStreams() 517public async Task ExtendedCONNECTMethod_CanHaveNon200ResponseWithBody() 579public async Task HEADERS_Received_SecondRequest_ConnectProtocolReset()
Http2\PipeReaderFactory.cs (1)
30private static async Task CopyToAsync(Stream stream, Pipe pipe, CancellationToken cancellationToken)
Http2\TlsTests.cs (2)
34public async Task TlsHandshakeRejectsTlsLessThan12() 76private async Task WaitForConnectionErrorAsync(PipeReader reader, bool ignoreNonGoAwayFrames, int expectedLastStreamId, Http2ErrorCode expectedErrorCode)
Http3\Http3ConnectionTests.cs (19)
38public async Task CreateRequestStream_RequestCompleted_Disposed() 79public async Task HEADERS_Received_ContainsExpect100Continue_100ContinueSent() 127public async Task HEADERS_CookiesMergedIntoOne() 171public async Task GOAWAY_GracefulServerShutdown_SendsGoAway(int connectionRequests, int expectedStreamId) 196public async Task GOAWAY_GracefulServerShutdownWithActiveRequest_SendsMultipleGoAways() 230public async Task SETTINGS_ReservedSettingSent_ConnectionError(long settingIdentifier) 254public async Task InboundStreams_CreateMultiple_ConnectionError(int streamId, string name) 273public async Task ControlStream_ClientToServer_UnexpectedFrameType_ConnectionError(string frameType) 291public async Task ControlStream_ClientToServer_Completes_ConnectionError() 315public async Task GOAWAY_TriggersLifetimeNotification_ConnectionClosedRequested() 338public async Task ControlStream_ServerToClient_ErrorInitializing_ConnectionError() 358public async Task SETTINGS_MaxFieldSectionSizeSent_ServerReceivesValue() 386public async Task StreamPool_MultipleStreamsInSequence_PooledStreamReused() 405public async Task StreamPool_MultipleStreamsInSequence_KnownHeaderReused() 441public async Task RequestHeaderStringReuse_MultipleStreams_KnownHeaderClearedIfNotReused() 487public async Task StreamPool_VariableMultipleStreamsInSequence_PooledStreamReused(int count) 521public async Task VariableMultipleStreamsInSequence_Success(int count, bool sendData) 544public async Task ResponseTrailers_MultipleStreams_Reset() 571return Task.CompletedTask;
Http3\Http3StreamTests.cs (120)
28public async Task HelloWorldTest() 49public async Task UnauthorizedHttpStatusResponse() 62return Task.CompletedTask; 72public async Task EmptyMethod_Reset() 90public async Task InvalidCustomMethod_Reset() 108public async Task CustomMethod_Accepted() 130public async Task RequestHeadersMaxRequestHeaderFieldSize_EndsStream() 150public async Task ConnectMethod_Accepted() 166public async Task OptionsStar_LeftOutOfPath() 185public async Task OptionsSlash_Accepted() 204public async Task PathAndQuery_Separated() 216return Task.CompletedTask; 239public async Task Path_DecodedAndNormalized(string input, string expected) 250return Task.CompletedTask; 264public async Task ConnectMethod_WithSchemeOrPath_Reset(string headerName, string value) 281public async Task SchemeMismatch_Reset(string scheme) 298public async Task SchemeMismatchAllowed_Processed(string scheme) 309return Task.CompletedTask; 323public async Task SchemeMismatchAllowed_InvalidScheme_Reset(string scheme) 340public async Task MissingAuthority_200Status() 360public async Task EmptyAuthority_200Status() 380public async Task MissingAuthorityFallsBackToHost_200Status() 402public async Task EmptyAuthorityIgnoredOverHost_200Status() 425public async Task AuthorityOverridesHost_200Status() 448public async Task AuthorityOverridesInvalidHost_200Status() 471public async Task InvalidAuthority_Reset() 490public async Task InvalidAuthorityWithValidHost_Reset() 510public async Task TwoHosts_StreamReset() 530public async Task MaxRequestLineSize_Reset() 551public async Task ContentLength_Received_SingleDataFrame_Verified() 580public async Task ContentLength_Received_MultipleDataFrame_Verified() 616public async Task ContentLength_Received_MultipleDataFrame_ReadViaPipe_Verified() 651public async Task RemoveConnectionSpecificHeaders() 684public async Task ContentLength_Received_NoDataFrames_Reset() 700return Task.CompletedTask; 712public async Task EndRequestStream_ContinueReadingFromResponse() 733await Task.Delay(50); 754public async Task FlushPipeAsync_OnStoppedHttp3Stream_ReturnsFlushResultWithIsCompletedTrue() 789public async Task FlushPipeAsync_OnCanceledPendingFlush_ReturnsFlushResultWithIsCanceledTrue() 823public async Task ResponseTrailers_WithoutData_Sent() 840return Task.CompletedTask; 853public async Task ResponseHeaders_WithNonAscii_Throws() 884public async Task ResponseHeaders_WithNonAsciiAndCustomEncoder_Works() 920public async Task ResponseHeaders_WithInvalidValuesAndCustomEncoder_AbortsConnection() 947public async Task ResponseTrailers_WithData_Sent() 979public async Task ResponseTrailers_WithExeption500_Cleared() 1005public async Task ResponseTrailers_WithNonAscii_Throws() 1033public async Task ResponseTrailers_WithNonAsciiAndCustomEncoder_Works() 1071public async Task ResponseTrailers_WithInvalidValuesAndCustomEncoder_AbortsConnection() 1102public async Task ResetStream_ReturnStreamError() 1118return Task.CompletedTask; 1128public async Task CompleteAsync_BeforeBodyStarted_SendsHeadersWithEndStream() 1144context.Response.OnStarting(() => { startingTcs.SetResult(); return Task.CompletedTask; }); 1175public async Task CompleteAsync_BeforeBodyStarted_WithTrailers_SendsHeadersAndTrailersWithEndStream() 1190context.Response.OnStarting(() => { startingTcs.SetResult(); return Task.CompletedTask; }); 1228public async Task CompleteAsync_BeforeBodyStarted_WithTrailers_TruncatedContentLength_ThrowsAnd500() 1242context.Response.OnStarting(() => { startingTcs.SetResult(); return Task.CompletedTask; }); 1275public async Task CompleteAsync_AfterBodyStarted_SendsBodyWithEndStream() 1290context.Response.OnStarting(() => { startingTcs.SetResult(); return Task.CompletedTask; }); 1328public async Task CompleteAsync_WriteAfterComplete_Throws() 1343context.Response.OnStarting(() => { startingTcs.SetResult(); return Task.CompletedTask; }); 1377public async Task CompleteAsync_WriteAgainAfterComplete_Throws() 1392context.Response.OnStarting(() => { startingTcs.SetResult(); return Task.CompletedTask; }); 1431public async Task CompleteAsync_AdvanceAfterComplete_AdvanceThrows() 1470public async Task CompleteAsync_AfterPipeWrite_WithTrailers_SendsBodyAndTrailersWithEndStream() 1485context.Response.OnStarting(() => { startingTcs.SetResult(); return Task.CompletedTask; }); 1530public async Task CompleteAsync_AfterBodyStarted_WithTrailers_SendsBodyAndTrailersWithEndStream() 1545context.Response.OnStarting(() => { startingTcs.SetResult(); return Task.CompletedTask; }); 1585public async Task CompleteAsync_AfterBodyStarted_WithTrailers_TruncatedContentLength_ThrowsAndReset() 1600context.Response.OnStarting(() => { startingTcs.SetResult(); return Task.CompletedTask; }); 1642public async Task PipeWriterComplete_AfterBodyStarted_WithTrailers_TruncatedContentLength_ThrowsAndReset() 1658context.Response.OnStarting(() => { startingTcs.SetResult(); return Task.CompletedTask; }); 1700public async Task AbortAfterCompleteAsync_GETWithResponseBodyAndTrailers_ResetsAfterResponse() 1715context.Response.OnStarting(() => { startingTcs.SetResult(); return Task.CompletedTask; }); 1759public async Task AbortAfterCompleteAsync_POSTWithResponseBodyAndTrailers_RequestBodyThrows() 1776context.Response.OnStarting(() => { startingTcs.SetResult(); return Task.CompletedTask; }); 1823public async Task ResetAfterCompleteAsync_GETWithResponseBodyAndTrailers_ResetsAfterResponse() 1838context.Response.OnStarting(() => { startingTcs.SetResult(); return Task.CompletedTask; }); 1886public async Task ResetAfterCompleteAsync_POSTWithResponseBodyAndTrailers_RequestBodyThrows() 1903context.Response.OnStarting(() => { startingTcs.SetResult(); return Task.CompletedTask; }); 1956public async Task DataBeforeHeaders_UnexpectedFrameError(bool pendingStreamsEnabled) 1972public async Task RequestTrailers_CanReadTrailersFromRequest() 2003public async Task FrameAfterTrailers_UnexpectedFrameError() 2038public async Task TrailersWithoutEndingStream_ErrorAccessingTrailers() 2089public async Task UnexpectedRequestFrame(string frameType, bool pendingStreamsEnabled) 2114public async Task UnexpectedServerFrame(string frameType) 2136public async Task RequestIncomplete() 2148public Task HEADERS_Received_HeaderBlockContainsUnknownPseudoHeaderField_ConnectionError() 2162public Task HEADERS_Received_HeaderBlockContainsResponsePseudoHeaderField_ConnectionError() 2259public Task HEADERS_Received_HeaderBlockContainsDuplicatePseudoHeaderField_ConnectionError(IEnumerable<KeyValuePair<string, string>> headers) 2266public async Task HEADERS_Received_HeaderBlockDoesNotContainMandatoryPseudoHeaderField_MethodIsCONNECT_NoError(IEnumerable<KeyValuePair<string, string>> headers) 2277public Task HEADERS_Received_HeaderBlockContainsPseudoHeaderFieldAfterRegularHeaders_ConnectionError(IEnumerable<KeyValuePair<string, string>> headers) 2282private async Task HEADERS_Received_InvalidHeaderFields_StreamError(IEnumerable<KeyValuePair<string, string>> headers, string expectedErrorMessage, Http3ErrorCode? errorCode = null) 2294public async Task HEADERS_Received_HeaderBlockDoesNotContainMandatoryPseudoHeaderField_StreamError(IEnumerable<KeyValuePair<string, string>> headers) 2303public async Task HEADERS_Received_HeaderBlockOverLimit_431() 2334public Task HEADERS_Received_HeaderBlockOverLimitx2_ConnectionError() 2364public async Task HEADERS_Received_TooManyHeaders_431() 2392public Task HEADERS_Received_TooManyHeadersx2_ConnectionError() 2411public Task HEADERS_Received_InvalidCharacters_ConnectionError() 2425public Task HEADERS_Received_HeaderBlockContainsConnectionHeader_ConnectionError() 2439public Task HEADERS_Received_HeaderBlockContainsTEHeader_ValueIsNotTrailers_ConnectionError() 2453public async Task HEADERS_Received_HeaderBlockContainsTEHeader_ValueIsTrailers_NoError() 2471public async Task MaxRequestBodySize_ContentLengthUnder_200() 2502public async Task MaxRequestBodySize_ContentLengthOver_413() 2545public async Task MaxRequestBodySize_NoContentLength_Under_200() 2575public async Task MaxRequestBodySize_NoContentLength_Over_413() 2619public async Task MaxRequestBodySize_AppCanLowerLimit(bool includeContentLength) 2674public async Task MaxRequestBodySize_AppCanRaiseLimit(bool includeContentLength) 2714public Task HEADERS_Received_RequestLineLength_Error() 2730public async Task UnsupportedControlStreamType(int typeId) 2761public async Task HEADERS_ExceedsClientMaxFieldSectionSize_ErrorOnServer() 2766return Task.CompletedTask; 2795public async Task PostRequest_ServerReadsPartialAndFinishes_SendsBodyWithEndStream() 2855public async Task HEADERS_WriteLargeResponseHeaderSection_Success() 2880return Task.CompletedTask; 2895public async Task HEADERS_WriteLargeResponseHeaderSectionTrailers_Success() 2920return Task.CompletedTask; 2936public async Task HEADERS_NoResponseBody_RequestEndsOnHeaders() 2948return Task.CompletedTask; 2959public async Task GetMemory_AfterAbort_GetsFakeMemory(int sizeHint)
Http3\Http3TestBase.cs (4)
60_noopApplication = context => Task.CompletedTask; 98return Task.CompletedTask; 106return Task.CompletedTask; 113return Task.CompletedTask;
Http3\Http3TimeoutTests.cs (21)
19public async Task KeepAliveTimeout_ControlStreamNotReceived_ConnectionClosed() 34public async Task KeepAliveTimeout_RequestNotReceived_ConnectionClosed() 50public async Task KeepAliveTimeout_AfterRequestComplete_ConnectionClosed() 78public async Task KeepAliveTimeout_LongRunningRequest_KeepsConnectionAlive() 123public async Task HEADERS_IncompleteFrameReceivedWithinRequestHeadersTimeout_StreamError() 156public async Task HEADERS_HeaderFrameReceivedWithinRequestHeadersTimeout_Success(bool pendingStreamsEnabled) 209public async Task ControlStream_HeaderNotReceivedWithinRequestHeadersTimeout_StreamError_PendingStreamsEnabled() 236public async Task ControlStream_HeaderNotReceivedWithinRequestHeadersTimeout_StreamError() 277public async Task ControlStream_HeaderReceivedWithinRequestHeadersTimeout_StreamError() 299public async Task ControlStream_RequestHeadersTimeoutMaxValue_ExpirationIsMaxValue(bool pendingStreamEnabled) 332public async Task DATA_Received_TooSlowlyOnSmallRead_AbortsConnectionAfterGracePeriod() 373public async Task ResponseDrain_SlowerThanMinimumDataRate_AbortsConnection() 419public Task WriteStartedTask => _writeStartedTcs.Task; 421public async Task RunApp(HttpContext context) 430var writeTask = context.Response.Body.WriteAsync(buffer, 0, received); 439public async Task DATA_Sent_TooSlowlyDueToSocketBackPressureOnSmallWrite_AbortsConnectionAfterGracePeriod() 481public async Task DATA_Sent_TooSlowlyDueToSocketBackPressureOnLargeWrite_AbortsConnectionAfterRateTimeout() 524public async Task DATA_Received_TooSlowlyOnLargeRead_AbortsConnectionAfterRateTimeout() 569public async Task DATA_Received_TooSlowlyOnMultipleStreams_AbortsConnectionAfterAdditiveRateTimeout() 623public async Task DATA_Received_TooSlowlyOnSecondStream_AbortsConnectionAfterNonAdditiveRateTimeout() 678public async Task DATA_Received_SlowlyWhenRateLimitDisabledPerRequest_DoesNotAbortConnection()
Http3\WebTransport\WebTransportHandshakeTests.cs (2)
20public async Task WebTransportHandshake_ClientToServerPasses() 111public async Task WebTransportHandshake_IncorrectHeadersRejects(long error, string targetErrorMessage, params string[] headers)
Http3\WebTransport\WebTransportSessionTests.cs (3)
13public async Task WebTransportSession_CanOpenNewStream() 34public async Task WebTransportSession_AcceptNewStreamsInOrderOfArrival() 69public async Task WebTransportSession_ClosesProperly(int method)
Http3\WebTransport\WebTransportStreamTests.cs (2)
18internal async Task WebTransportStream_StreamTypesAreDefinedCorrectly(WebTransportStreamType type, bool canRead, bool canWrite) 35internal async Task WebTransportStream_WritingFlushingReadingWorks()
Http3\WebTransport\WebTransportTestUtilities.cs (2)
146public Task CompleteAsync(Exception exception) 149return Task.CompletedTask;
HttpProtocolSelectionTests.cs (8)
20public Task Server_NoProtocols_Error() 26public Task Server_Http1AndHttp2_Cleartext_Http1Default() 32public Task Server_Http1Only_Cleartext_Success() 38public Task Server_Http2Only_Cleartext_Success() 59private async Task TestSuccess(HttpProtocols serverProtocols, string request, string expectedResponse) 67await using (var server = new TestServer(context => Task.CompletedTask, testContext, listenOptions)) 77private async Task TestError<TException>(HttpProtocols serverProtocols, string expectedErrorMessage) 86await using (var server = new TestServer(context => Task.CompletedTask, testContext, listenOptions))
HttpsConnectionMiddlewareTests.cs (58)
51public async Task CanReadAndWriteWithHttpsConnectionMiddleware() 71public async Task CanReadAndWriteWithHttpsConnectionMiddlewareWithPemCertificate() 105public async Task SslStreamIsAvailable() 127public async Task HandshakeDetailsAreAvailable() 166public async Task HandshakeDetailsAreAvailableAfterAsyncCallback() 172await Task.Yield(); 202public async Task RequireCertificateFailsWhenNoCertificate() 219public async Task AllowCertificateContinuesWhenNoCertificate() 244public async Task AsyncCallbackSettingClientCertificateRequiredContinuesWhenNoCertificate() 278public async Task UsesProvidedServerCertificate() 285await using (var server = new TestServer(context => Task.CompletedTask, new TestServiceContext(LoggerFactory), ConfigureListenOptions)) 297public async Task UsesProvidedServerCertificateSelector() 315await using (var server = new TestServer(context => Task.CompletedTask, new TestServiceContext(LoggerFactory), ConfigureListenOptions)) 328public async Task UsesProvidedAsyncCallback() 335await Task.Yield(); 348await using (var server = new TestServer(context => Task.CompletedTask, new TestServiceContext(LoggerFactory), ConfigureListenOptions)) 361public async Task UsesProvidedServerCertificateSelectorEachTime() 383await using (var server = new TestServer(context => Task.CompletedTask, new TestServiceContext(LoggerFactory), ConfigureListenOptions)) 403public async Task UsesProvidedServerCertificateSelectorValidatesEkus() 418await using (var server = new TestServer(context => Task.CompletedTask, new TestServiceContext(LoggerFactory), ConfigureListenOptions)) 433public async Task UsesProvidedServerCertificateSelectorOverridesServerCertificate() 452await using (var server = new TestServer(context => Task.CompletedTask, new TestServiceContext(LoggerFactory), ConfigureListenOptions)) 465public async Task UsesProvidedServerCertificateSelectorFailsIfYouReturnNull() 480await using (var server = new TestServer(context => Task.CompletedTask, new TestServiceContext(LoggerFactory), ConfigureListenOptions)) 497public async Task CertificatePassedToHttpContext(HttpProtocols httpProtocols) 533public async Task RenegotiateForClientCertificateOnHttp1DisabledByDefault() 577public async Task CanRenegotiateForClientCertificate(HttpProtocols httpProtocols) 618public async Task CanRenegotiateForClientCertificate_MacOS_PlatformNotSupportedException() 659public async Task Renegotiate_ServerOptionsSelectionCallback_NotSupported() 703public async Task CanRenegotiateForTlsCallbackOptions() 751public async Task CanRenegotiateForClientCertificateOnHttp1CanReturnNoCert() 800public async Task ServerCertificateChainInExtraStore() 875public async Task RenegotiateForClientCertificateOnPostWithoutBufferingThrows() 917public async Task ServerOptionsSelectionCallback_SetsALPN() 928await using var server = new TestServer(context => Task.CompletedTask, 945public async Task TlsHandshakeCallbackOptionsOverload_SetsALPN() 961await using var server = new TestServer(context => Task.CompletedTask, 977public async Task TlsHandshakeCallbackOptionsOverload_EmptyAlpnList_DisablesAlpn() 994await using var server = new TestServer(context => Task.CompletedTask, 1012public async Task CanRenegotiateForClientCertificateOnPostIfDrained() 1059public async Task RenegotationFailureCausesConnectionClose() 1111public async Task HttpsSchemePassedToRequestFeature() 1126public async Task Tls10CanBeDisabled() 1160public async Task ClientCertificateValidationGetsCalledWithNotNullParameters(ClientCertificateMode mode) 1179await using (var server = new TestServer(context => Task.CompletedTask, new TestServiceContext(LoggerFactory), ConfigureListenOptions)) 1194public async Task ValidationFailureRejectsConnection(ClientCertificateMode mode) 1206await using (var server = new TestServer(context => Task.CompletedTask, new TestServiceContext(LoggerFactory), ConfigureListenOptions)) 1220public async Task RejectsConnectionOnSslPolicyErrorsWhenNoValidation(ClientCertificateMode mode) 1231await using (var server = new TestServer(context => Task.CompletedTask, new TestServiceContext(LoggerFactory), ConfigureListenOptions)) 1243public async Task AllowAnyCertOverridesCertificateValidation() 1256await using (var server = new TestServer(context => Task.CompletedTask, new TestServiceContext(LoggerFactory), ConfigureListenOptions)) 1268public async Task CertificatePassedToHttpContextIsNotDisposed() 1381public async Task ListenOptionsProtolsCanBeSetAfterUseHttps(HttpProtocols httpProtocols) 1389await using var server = new TestServer(context => Task.CompletedTask, new TestServiceContext(LoggerFactory), ConfigureListenOptions); 1476return new HttpsConnectionMiddleware(context => Task.CompletedTask, options, httpProtocols, loggerFactory, new KestrelMetrics(new TestMeterFactory())); 1481return new HttpsConnectionMiddleware(context => Task.CompletedTask, options, httpProtocols, new KestrelMetrics(new TestMeterFactory())); 1484private static async Task App(HttpContext httpContext) 1516private static async Task AssertConnectionResult(SslStream stream, bool success, string body = null)
HttpsTests.cs (36)
76public async Task UseHttpsWithAsyncCallbackDoesNotFallBackToDefaultCert() 83await using (var server = new TestServer(context => Task.CompletedTask, 170public async Task EmptyRequestLoggedAsDebug() 175await using (var server = new TestServer(context => Task.CompletedTask, 198public async Task ClientHandshakeFailureLoggedAsDebug() 203await using (var server = new TestServer(context => Task.CompletedTask, 227public async Task DoesNotThrowObjectDisposedExceptionOnConnectionAbort() 240await Task.Delay(1000, ct); 272public async Task DoesNotThrowObjectDisposedExceptionFromWriteAsyncAfterConnectionIsAborted() 317public async Task DoesNotThrowObjectDisposedExceptionOnEmptyConnection() 322await using (var server = new TestServer(context => Task.CompletedTask, 343public async Task ConnectionFilterDoesNotLeakBlock() 348await using (var server = new TestServer(context => Task.CompletedTask, 363public async Task HandshakeTimesOutAndIsLoggedAsDebug() 370await using (var server = new TestServer(context => Task.CompletedTask, 393public async Task HandshakeTimesOutAndIsLoggedAsDebugWithAsyncCallback() 400await using (var server = new TestServer(context => Task.CompletedTask, 406await Task.Yield(); 427public async Task Http3_UseHttpsNoArgsWithDefaultCertificate_UseDefaultCertificate() 441await using (var server = new TestServer(context => Task.CompletedTask, 468public async Task Http3_ConfigureHttpsDefaults_Works() 481await using (var server = new TestServer(context => Task.CompletedTask, 512public async Task Http1And2And3_NoUseHttps_MultiplexBindNotCalled() 526await using (var server = new TestServer(context => Task.CompletedTask, 546public async Task Http3_NoUseHttps_Throws() 562await using var server = new TestServer(context => Task.CompletedTask, 582public async Task Http3_ServerOptionsSelectionCallback_Works() 597await using (var server = new TestServer(context => Task.CompletedTask, 628public async Task Http3_TlsHandshakeCallbackOptions_Works() 643await using (var server = new TestServer(context => Task.CompletedTask, 677public async Task ClientAttemptingToUseUnsupportedProtocolIsLoggedAsDebug() 683await using (var server = new TestServer(context => Task.CompletedTask, 711public async Task OnAuthenticate_SeesOtherSettings() 719await using (var server = new TestServer(context => Task.CompletedTask, 747public async Task OnAuthenticate_CanSetSettings() 755await using (var server = new TestServer(context => Task.CompletedTask,
KeepAliveTimeoutTests.cs (10)
23public async Task ConnectionClosedWhenKeepAliveTimeoutExpires() 50public async Task ConnectionKeptAliveBetweenRequests() 78public async Task ConnectionNotTimedOutWhileRequestBeingSent() 118private async Task ConnectionNotTimedOutWhileAppIsRunning() 158private async Task ConnectionTimesOutWhenOpenedButNoRequestSent() 178private async Task KeepAliveTimeoutDoesNotApplyToUpgradedConnections() 226private async Task App(HttpContext httpContext, CancellationToken longRunningCt, CancellationToken upgradeCt) 259private async Task ReceiveResponse(InMemoryConnection connection, TestServiceContext testContext) 273private static Task CancellationTokenAsTask(CancellationToken token) 277return Task.CompletedTask;
KestrelMetricsTests.cs (9)
28public async Task Http1Connection() 90public async Task Http1Connection_BeginListeningAfterConnectionStarted() 148public async Task Http1Connection_IHttpConnectionTagsFeatureIgnoreFeatureSetOnTransport() 228public async Task Http1Connection_Error() 283public async Task Http1Connection_Upgrade() 310static async Task UpgradeApp(HttpContext context) 324public async Task Http2Connection() 343return Task.CompletedTask; 419private static async Task EchoApp(HttpContext httpContext)
LoggingConnectionMiddlewareTests.cs (1)
18public async Task LoggingConnectionMiddlewareCanBeAddedBeforeAndAfterHttps()
MaxRequestBodySizeTests.cs (13)
21public async Task RejectsRequestWithContentLengthHeaderExceedingGlobalLimit() 64public async Task RejectsRequestWithBodySizeExceedingPerRequestLimitAndExceptionWasCaughtByApplication() 108public async Task RejectsRequestWithChunckedBodySizeExceedingPerRequestLimitAndExceptionWasCaughtByApplication() 152public async Task RejectsRequestWithContentLengthHeaderExceedingPerRequestLimit() 202public async Task DoesNotRejectRequestWithContentLengthHeaderExceedingGlobalLimitIfLimitDisabledPerRequest() 242public async Task DoesNotRejectBodylessGetRequestWithZeroMaxRequestBodySize() 274public async Task SettingMaxRequestBodySizeAfterReadingFromRequestBodyThrows() 317public async Task SettingMaxRequestBodySizeAfterUpgradingRequestThrows() 356public async Task EveryReadFailsWhenContentLengthHeaderExceedsGlobalLimit() 401public async Task ChunkFramingAndExtensionsCountTowardsRequestBodySize() 450public async Task TrailingHeadersDoNotCountTowardsRequestBodySize() 492public async Task PerRequestMaxRequestBodySizeGetsReset() 567public async Task EveryReadFailsWhenChunkedPayloadExceedsGlobalLimit()
MaxRequestLineSizeTests.cs (2)
29public async Task ServerAcceptsRequestLineWithinLimit(string request, int limit) 55public async Task ServerRejectsRequestLineExceedingLimit(string requestLine)
RequestBodyTimeoutTests.cs (4)
18public async Task RequestTimesOutWhenRequestBodyNotReceivedAtSpecifiedMinimumRate() 90public async Task RequestTimesOutWhenNotDrainedWithinDrainTimeoutPeriod() 109return Task.CompletedTask; 138public async Task ConnectionClosedEvenIfAppSwallowsException()
RequestHeaderLimitsTests.cs (4)
25public async Task ServerAcceptsRequestWithHeaderTotalSizeWithinLimit(int headerCount, int extraLimit) 57public async Task ServerAcceptsRequestWithHeaderCountWithinLimit(int headerCount, int maxHeaderCount) 83public async Task ServerRejectsRequestWithHeaderTotalSizeOverLimit(int headerCount) 107public async Task ServerRejectsRequestWithHeaderCountOverLimit(int headerCount, int maxHeaderCount)
RequestHeadersTimeoutTests.cs (6)
22public async Task ConnectionAbortedWhenRequestHeadersNotReceivedInTime(string headers) 46public async Task RequestHeadersTimeoutCanceledAfterHeadersReceived() 78public async Task ConnectionAbortedWhenRequestLineNotReceivedInTime(string requestLine) 100public async Task TimeoutNotResetOnEachRequestLineCharacterReceived() 142private async Task ReceiveResponse(InMemoryConnection connection, TestServiceContext testContext) 156private async Task ReceiveTimeoutResponse(InMemoryConnection connection, TestServiceContext testContext)
RequestTargetProcessingTests.cs (3)
18public async Task RequestPathIsNotNormalized() 63public async Task RequestFeatureContainsRawTarget(string requestTarget) 95public async Task NonPathRequestTargetSetInRawTarget(HttpMethod method, string requestTarget)
RequestTests.cs (83)
24public async Task StreamsAreNotPersistedAcrossRequests() 56public async Task PipesAreNotPersistedAcrossRequests() 79public async Task RequestBodyPipeReaderDoesZeroByteReads() 109public async Task RequestBodyReadAsyncCanBeCancelled() 177public async Task CanUpgradeRequestWithConnectionKeepAliveUpgradeHeader() 228public async Task CanHandleRequestsWithUrlInAbsoluteForm(string requestUrl, string expectedPath, string queryValue) 265await Task.WhenAll(pathTcs.Task, rawTargetTcs.Task, queryTcs.Task).DefaultTimeout(); 281public async Task CanHandleTwoAbsoluteFormRequestsInARow() 313public async Task ExecutionContextMutationsOfValueTypeDoNotLeakAcrossRequestsOnSameConnection() 318Task ExecuteApplication(HttpContext context) 326return Task.CompletedTask; 332return Task.CompletedTask; 347public async Task ExecutionContextMutationsOfReferenceTypeDoNotLeakAcrossRequestsOnSameConnection() 352Task ExecuteApplication(HttpContext context) 363return Task.CompletedTask; 369return Task.CompletedTask; 385public async Task ExecutionContextMutationsDoNotLeakAcrossAwaits() 390Task ExecuteApplication(HttpContext context) 418public async Task ExecutionContextMutationsOfValueTypeFlowIntoButNotOutOfAsyncEvents() 422async Task ExecuteApplication(HttpContext context) 456public async Task ExecutionContextMutationsOfReferenceTypeFlowThroughAsyncEvents() 460async Task ExecuteApplication(HttpContext context) 498public async Task ExecutionContextMutationsOfValueTypeFlowIntoButNotOutOfNonAsyncEvents() 502async Task ExecuteApplication(HttpContext context) 512return Task.CompletedTask; 520return Task.CompletedTask; 539private static async Task TestAsyncLocalValues(TestServiceContext testContext, TestServer server) 571public async Task AppCanSetTraceIdentifier() 586public async Task TraceIdentifierIsUnique() 601var tasks = new List<Task>(iterations); 604tasks.Add(Task.Run(async () => 611await Task.WhenAll(tasks); 647public async Task Http11KeptAliveByDefault() 681public async Task Http10NotKeptAliveByDefault() 720public async Task Http10KeepAlive() 754public async Task Http10KeepAliveNotHonoredIfResponseContentLengthNotSet() 793public async Task Http10KeepAliveHonoredIfResponseContentLengthSet() 849public async Task Expect100ContinueHonored() 881public async Task Expect100ContinueHonoredWhenMinRequestBodyDataRateIsDisabled() 917public async Task ZeroContentLengthAssumedOnNonKeepAliveRequestsWithoutContentLengthOrTransferEncodingHeader() 963public async Task ZeroContentLengthAssumedOnNonKeepAliveRequestsWithoutContentLengthOrTransferEncodingHeaderPipeReader() 1010public async Task ContentLengthReadAsyncPipeReader() 1042public async Task ContentLengthReadAsyncPipeReaderBufferRequestBody() 1077public async Task ContentLengthReadAsyncPipeReaderBufferRequestBodyMultipleTimes() 1116public async Task ContentLengthReadAsyncPipeReaderReadsCompletedBody() 1153public async Task ContentLengthReadAsyncSingleBytesAtATime() 1227public async Task ContentLengthDoesNotConsumeEntireBufferDoesNotThrow() 1261public async Task ConnectionClosesWhenFinReceivedBeforeRequestCompletes() 1293public async Task RequestHeadersAreResetOnEachRequest() 1315return Task.CompletedTask; 1343public async Task UpgradeRequestIsNotKeptAliveOrChunked() 1379public async Task HeadersAndStreamsAreReusedAcrossRequests() 1456public async Task MatchesValidRequestTargetAndHostHeader(string request, string hostHeader) 1458await using (var server = new TestServer(context => Task.CompletedTask, new TestServiceContext(LoggerFactory))) 1473public async Task ServerConsumesKeepAliveContentLengthRequest() 1476await using (var server = new TestServer(context => Task.CompletedTask, new TestServiceContext(LoggerFactory))) 1514public async Task ServerConsumesKeepAliveChunkedRequest() 1517await using (var server = new TestServer(context => Task.CompletedTask, new TestServiceContext(LoggerFactory))) 1562public async Task NonKeepAliveRequestNotConsumedByAppCompletes() 1565await using (var server = new TestServer(context => Task.CompletedTask, new TestServiceContext(LoggerFactory))) 1588public async Task UpgradedRequestNotConsumedByAppCompletes() 1620public async Task DoesNotEnforceRequestBodyMinimumDataRateOnUpgradedRequest() 1678public async Task SynchronousReadsDisallowedByDefault() 1729public async Task SynchronousReadsAllowedByOptIn() 1772public async Task SynchronousReadsCanBeDisallowedGlobally() 1817public async Task SynchronousReadsCanBeAllowedGlobally() 1859public async Task ContentLengthSwallowedUnexpectedEndOfRequestContentDoesNotResultInWarnings() 1892public async Task ContentLengthRequestCallCancelPendingReadWorks() 1943public async Task ContentLengthRequestCallCompleteThrowsExceptionOnRead() 1987public async Task ContentLengthRequestCallCompleteDoesNotCauseException() 2028public async Task ContentLengthCallCompleteWithExceptionCauses500() 2070public async Task ReuseRequestHeaderStrings() 2080return Task.CompletedTask; 2125public async Task PersistentStateBetweenRequests() 2140return Task.CompletedTask; 2187public async Task Latin1HeaderValueAcceptedWhenLatin1OptionIsConfigured() 2196return Task.CompletedTask; 2221public async Task Latin1HeaderValueRejectedWhenLatin1OptionIsNotConfigured() 2225await using (var server = new TestServer(_ => Task.CompletedTask, testContext)) 2250public async Task CustomRequestHeaderEncodingSelectorCanBeConfigured() 2259return Task.CompletedTask; 2286public async Task SingleLineFeedIsSupportedAnywhere() 2299await using (var server = new TestServer(context => Task.CompletedTask, new TestServiceContext(LoggerFactory, disableHttp1LineFeedTerminators: false)))
ResponseDrainingTests.cs (2)
23public async Task ConnectionClosedWhenResponseNotDrainedAtMinimumDataRate(ListenOptions listenOptions) 31return Task.CompletedTask;
ResponseHeaderTests.cs (4)
19public async Task ResponseHeaders_WithNonAscii_Throws() 47public async Task ResponseHeaders_WithNonAsciiWithCustomEncoding_Works() 82public async Task ResponseHeaders_WithInvalidValuesAndCustomEncoder_AbortsConnection() 106public async Task ResponseHeaders_NullEntriesAreIgnored()
ResponseTests.cs (192)
35public async Task OnCompleteCalledEvenWhenOnStartingNotCalled() 42context.Response.OnStarting(() => Task.Run(() => onStartingCalled = true)); 43context.Response.OnCompleted(() => Task.Run(() => 74public async Task OnStartingThrowsWhenSetAfterResponseHasAlreadyStarted() 82ex = Assert.Throws<InvalidOperationException>(() => context.Response.OnStarting(_ => Task.CompletedTask, null)); 109public async Task OnStartingThrowsWhenSetAfterStartAsyncIsCalled() 116ex = Assert.Throws<InvalidOperationException>(() => context.Response.OnStarting(_ => Task.CompletedTask, null)); 141public async Task ResponseBodyWriteAsyncCanBeCancelled() 156var timerTask = Task.Delay(TimeSpan.FromSeconds(1)); 158var completedTask = await Task.WhenAny(writeTask, timerTask); 163timerTask = Task.Delay(TimeSpan.FromSeconds(1)); 165completedTask = await Task.WhenAny(writeTask, timerTask); 208public async Task BodyWriterWriteAsync_OnAbortedRequest_ReturnsResultWithIsCompletedTrue() 238public async Task BodyWriterWriteAsync_OnCanceledPendingFlush_ReturnsResultWithIsCanceled() 272public Task ResponseStatusCodeSetBeforeHttpContextDisposeAppException() 286public Task ResponseStatusCodeSetBeforeHttpContextDisposeRequestAborted() 294return Task.CompletedTask; 301public Task ResponseStatusCodeSetBeforeHttpContextDisposeRequestAbortedAppException() 316public Task ResponseStatusCodeSetBeforeHttpContextDisposedRequestMalformed() 323return Task.CompletedTask; 331public Task ResponseStatusCodeSetBeforeHttpContextDisposedRequestMalformedRead() 346public Task ResponseStatusCodeSetBeforeHttpContextDisposedRequestMalformedReadIgnored() 367public async Task OnCompletedExceptionShouldNotPreventAResponse() 397public async Task OnCompletedShouldNotBlockAResponse() 434public async Task InvalidChunkedEncodingInRequestShouldNotBlockOnCompleted() 440httpContext.Response.OnCompleted(() => Task.Run(() => 444return Task.CompletedTask; 470public async Task NoErrorResponseSentWhenAppSwallowsBadRequestException() 510public async Task TransferEncodingChunkedSetOnUnknownLengthHttp11Response() 544public async Task TransferEncodingChunkedNotSetOnNonBodyResponse(int statusCode) 549return Task.CompletedTask; 569public async Task ContentLengthZeroSetOn205Response() 574return Task.CompletedTask; 628public async Task AttemptingToWriteNonzeroContentLengthFailsFor1xxAnd204Responses(int statusCode, HttpMethod method) 633public async Task AttemptingToWriteZeroContentLengthFor1xxAnd204Responses_ContentLengthRemoved(int statusCode, HttpMethod method) 647public async Task AttemptingToWriteNonzeroContentLengthFailsFor2xxResponsesOnConnect(int statusCode) 661public async Task AttemptingToWriteZeroContentLengthFor2xxResponsesOnConnect_ContentLengthRemoved(int statusCode) 664private async Task AttemptingToWriteNonzeroContentLengthFails(int statusCode, HttpMethod method) 700private async Task AttemptingToWriteZeroContentLength_ContentLengthRemoved(int statusCode, HttpMethod method) 740public async Task AttemptingToWriteNonzeroContentLengthFailsFor205Response() 779public async Task AttemptingToWriteFailsForNonBodyResponse(int statusCode) 821public async Task AttemptingToWriteFailsFor205Response() 864public async Task TransferEncodingNotSetOnHeadResponse() 868return Task.CompletedTask; 888public async Task ResponseBodyNotWrittenOnHeadResponseAndLoggedOnlyOnce() 936public async Task ThrowsAndClosesConnectionWhenAppWritesMoreThanContentLengthWrite() 976public async Task ThrowsAndClosesConnectionWhenAppWritesMoreThanContentLengthWriteAsync() 1010public async Task InternalServerErrorAndConnectionClosedOnWriteWithMoreThanContentLengthAndResponseNotStarted() 1048public async Task InternalServerErrorAndConnectionClosedOnWriteAsyncWithMoreThanContentLengthAndResponseNotStarted() 1083public async Task WhenAppWritesLessThanContentLengthErrorLogged() 1135public async Task WhenAppWritesLessThanContentLengthCompleteThrowsAndErrorLogged() 1194public async Task WhenAppWritesLessThanContentLengthButRequestIsAbortedErrorNotLogged() 1241public async Task WhenAppSetsContentLengthButDoesNotWriteBody500ResponseSentAndConnectionDoesNotClose() 1248return Task.CompletedTask; 1282public async Task WhenAppSetsContentLengthToZeroAndDoesNotWriteNoErrorIsThrown(bool flushResponse) 1320public async Task WhenAppSetsTransferEncodingAndContentLengthWritingLessIsNotAnError() 1356public async Task WhenAppSetsTransferEncodingAndContentLengthWritingMoreIsNotAnError() 1388public async Task HeadResponseCanContainContentLengthHeader() 1393return Task.CompletedTask; 1414public async Task HeadResponseBodyNotWrittenWithAsyncWrite() 1445public async Task HeadResponseBodyNotWrittenWithSyncWrite() 1478public async Task ZeroLengthWritesFlushHeaders() 1512public async Task AppCanWriteOwnBadRequestResponse() 1555public async Task ConnectionClosedWhenChunkedIsNotFinalTransferCoding(string responseTransferEncoding) 1600public async Task ConnectionClosedWhenChunkedIsNotFinalTransferCodingEvenIfConnectionKeepAliveSetInResponse(string responseTransferEncoding) 1646public async Task ConnectionKeptAliveWhenChunkedIsFinalTransferCoding(string responseTransferEncoding) 1687public async Task FirstWriteVerifiedAfterOnStarting() 1697return Task.CompletedTask; 1729public async Task FirstWriteVerifiedAfterOnStartingWithResponseBody() 1739return Task.CompletedTask; 1771public async Task SubsequentWriteVerifiedAfterOnStarting() 1781return Task.CompletedTask; 1816public async Task SubsequentWriteVerifiedAfterOnStartingWithResponseBody() 1826return Task.CompletedTask; 1861public async Task FirstWriteAsyncVerifiedAfterOnStarting() 1869return Task.CompletedTask; 1901public async Task SubsequentWriteAsyncVerifiedAfterOnStarting() 1909return Task.CompletedTask; 1944public async Task WhenResponseAlreadyStartedResponseEndedBeforeConsumingRequestBody() 1981public async Task WhenResponseNotStartedResponseEndedBeforeConsumingRequestBody() 1983await using (var server = new TestServer(httpContext => Task.CompletedTask, 2014public async Task RequestDrainingFor100ContinueDoesNotBlockResponse() 2073await Task.Delay(TimeSpan.FromSeconds(1)); 2085public async Task Sending100ContinueDoesNotPreventAutomatic400Responses() 2131public async Task Sending100ContinueAndResponseSendsChunkTerminatorBeforeConsumingRequestBody() 2178public async Task Http11ResponseSentToHttp10Request() 2202public async Task ZeroContentLengthSetAutomaticallyAfterNoWrites() 2234public async Task ZeroContentLengthSetAutomaticallyForNonKeepAliveRequests() 2278public async Task ZeroContentLengthNotSetAutomaticallyForHeadRequests() 2301public async Task ZeroContentLengthNotSetAutomaticallyForCertainStatusCodes() 2350public async Task ConnectionClosedAfter101Response() 2396public async Task ThrowingResultsIn500Response() 2408return Task.CompletedTask; 2446public async Task ThrowingInOnStartingResultsInFailedWritesAnd500Response() 2504public async Task OnStartingThrowsInsideOnStartingCallbacksRuns() 2517return Task.CompletedTask; 2521return Task.CompletedTask; 2549public async Task OnCompletedThrowsInsideOnCompletedCallbackRuns() 2563return Task.CompletedTask; 2567return Task.CompletedTask; 2595public async Task ThrowingInOnCompletedIsLogged() 2644public async Task ThrowingAfterWritingKillsConnection() 2656return Task.FromResult<object>(null); 2685public async Task ThrowingAfterPartialWriteKillsConnection() 2697return Task.FromResult<object>(null); 2726public async Task NoErrorsLoggedWhenServerEndsConnectionBeforeClient() 2757public async Task NoResponseSentWhenConnectionIsClosedByServerBeforeClientFinishesSendingRequest() 2764return Task.CompletedTask; 2780public async Task AppAbortIsLogged() 2787return Task.CompletedTask; 2805public async Task AppAbortViaIConnectionLifetimeFeatureIsLogged() 2809var closeTaskTcs = new TaskCompletionSource<Task>(TaskCreationOptions.RunContinuationsAsynchronously); 2813var closeTask = await closeTaskTcs.Task.DefaultTimeout(); 2838public async Task ResponseHeadersAreResetOnEachRequest() 2860return Task.CompletedTask; 2888public async Task StartAsyncDefaultToChunkedResponse() 2917public async Task StartAsyncWithContentLengthAndEmptyWriteStillCallsFinalFlush() 2945public async Task StartAsyncAndEmptyWriteStillCallsFinalFlush() 2975public async Task StartAsyncWithSingleChunkedWriteStillWritesSuffix() 3007public async Task StartAsyncWithoutFlushStartsResponse() 3037public async Task StartAsyncThrowExceptionThrowsConnectionAbortedException() 3065public async Task StartAsyncWithContentLengthThrowExceptionThrowsConnectionAbortedException() 3094public async Task StartAsyncWithoutFlushingDoesNotFlush() 3106var res = await Task.WhenAny(tcs.Task, Task.Delay(1000)) == tcs.Task; 3132public async Task StartAsyncWithContentLengthWritingWorks() 3162public async Task LargeWriteWithContentLengthWritingWorks() 3192public async Task UnflushedContentLengthResponseIsFlushedAutomatically() 3220return Task.CompletedTask; 3241public async Task StartAsyncAndFlushWorks() 3272public async Task OnStartingCallbacksAreCalledInLastInFirstOutOrder() 3287return Task.CompletedTask; 3292return Task.CompletedTask; 3323public async Task OnCompletedCallbacksAreCalledInLastInFirstOutOrder() 3338return Task.CompletedTask; 3343return Task.CompletedTask; 3374public async Task SynchronousWritesDisallowedByDefault() 3404public async Task SynchronousWritesAllowedByOptIn() 3413return Task.CompletedTask; 3430public async Task SynchronousWritesCanBeAllowedGlobally() 3444return Task.CompletedTask; 3465public async Task SynchronousWritesCanBeDisallowedGlobally() 3504public async Task NonZeroContentLengthFor304StatusCodeIsAllowed() 3512return Task.CompletedTask; 3533public async Task AdvanceNegativeValueThrowsArgumentOutOfRangeException() 3566public async Task AdvanceNegativeValueThrowsArgumentOutOfRangeExceptionWithStart() 3575return Task.CompletedTask; 3596public async Task AdvanceWithTooLargeOfAValueThrowInvalidOperationException() 3605return Task.CompletedTask; 3628public async Task ContentLengthWithoutStartAsyncWithGetSpanWorks() 3645return Task.CompletedTask; 3666public async Task ContentLengthWithGetMemoryWorks() 3705public async Task ResponseBodyCanWrite() 3731public async Task ResponseBodyAndResponsePipeWorks() 3773public async Task ResponseBodyWriterCompleteWithoutExceptionDoesNotThrow() 3778await Task.CompletedTask; 3799public async Task ResponseBodyWriterCompleteWithoutExceptionNextWriteDoesThrow() 3830public async Task ResponseBodyWriterCompleteFlushesChunkTerminator() 3864public async Task ResponseAdvanceStateIsResetWithMultipleReqeusts() 3916public async Task ResponseStartCalledAndAutoChunkStateIsResetWithMultipleReqeusts() 3965public async Task ResponseStartCalledStateIsResetWithMultipleReqeusts() 4026public async Task ResponseIsLeasedMemoryInvalidStateIsResetWithMultipleReqeusts() 4034return Task.CompletedTask; 4038return Task.CompletedTask; 4071public async Task ResponsePipeWriterCompleteWithException() 4077await Task.CompletedTask; 4100public async Task ResponseCompleteGetMemoryReturnsRentedMemory() 4109await Task.CompletedTask; 4132public async Task ResponseCompleteGetMemoryReturnsRentedMemoryWithoutStartAsync() 4140await Task.CompletedTask; 4161public async Task ResponseGetMemoryAndStartAsyncMemoryReturnsNewMemory() 4196public async Task ResponseGetMemoryAndStartAsyncAdvanceThrows() 4228public async Task ResponseCompleteGetMemoryDoesThrow() 4238return Task.CompletedTask; 4261public async Task ResponseSetBodyToSameValueTwiceGetPipeMultipleTimesDifferentObject() 4272await Task.CompletedTask; 4293public async Task ResponseStreamWrappingWorks() 4326public async Task AltSvc_HeaderSetInAppCode_AltSvcNotOverwritten() 4332return Task.CompletedTask; 4363public async Task AltSvc_Http1And2And3EndpointConfigured_AltSvcInResponseHeaders() 4366httpContext => Task.CompletedTask, 4400public async Task AltSvc_Http1And2And3EndpointConfigured_NoMultiplexedFactory_NoAltSvcInResponseHeaders() 4403httpContext => Task.CompletedTask, 4433public async Task AltSvc_Http1_NoAltSvcInResponseHeaders() 4436httpContext => Task.CompletedTask, 4458public async Task AltSvc_Http3ConfiguredDifferentEndpoint_NoAltSvcInResponseHeaders() 4461httpContext => Task.CompletedTask, 4498public async Task AltSvc_DisableAltSvcHeaderIsTrue_Http1And2And3EndpointConfigured_NoAltSvcInResponseHeaders() 4501httpContext => Task.CompletedTask, 4530private static async Task ResponseStatusCodeSetBeforeHttpContextDispose(
src\Servers\Kestrel\shared\ConnectionCompletion.cs (10)
12public static Task FireOnCompletedAsync(ILogger logger, Stack<KeyValuePair<Func<object, Task>, object>>? onCompleted) 16return Task.CompletedTask; 22private static Task CompleteAsyncMayAwait(ILogger logger, Stack<KeyValuePair<Func<object, Task>, object>> onCompleted) 28var task = entry.Key.Invoke(entry.Value); 40return Task.CompletedTask; 43private static async Task CompleteAsyncAwaited(Task currentTask, ILogger logger, Stack<KeyValuePair<Func<object, Task>, object>> onCompleted)
src\Servers\Kestrel\shared\test\DummyApplication.cs (2)
18: this(_ => Task.CompletedTask) 43public async Task ProcessRequestAsync(HttpContext context)
src\Servers\Kestrel\shared\test\Http3\Http3InMemory.cs (28)
79protected Task _connectionTask; 137internal Task WaitForConnectionStopAsync(long expectedLastStreamId, bool ignoreNonGoAwayFrames, Http3ErrorCode? expectedErrorCode = null) 142internal async Task WaitForConnectionErrorAsync<TException>(bool ignoreNonGoAwayFrames, long? expectedLastStreamId, Http3ErrorCode expectedErrorCode, Action<Type, string[]> matchExpectedErrorMessage = null, params string[] expectedErrorMessage) 157internal async Task WaitForGoAwayAsync(bool ignoreNonGoAwayFrames, long? expectedLastStreamId) 224public async Task InitializeConnectionAsync(RequestDelegate application) 488public Task OnUnidentifiedStreamCreatedTask => OnUnidentifiedStreamCreatedTcs.Task; 489public Task OnStreamCreatedTask => OnStreamCreatedTcs.Task; 490public Task OnStreamCompletedTask => OnStreamCompletedTcs.Task; 491public Task OnHeaderReceivedTask => OnHeaderReceivedTcs.Task; 502protected Task SendAsync(ReadOnlySpan<byte> span) 509protected static Task FlushAsync(PipeWriter writableBuffer) 519internal async Task ReceiveEndAsync() 597internal async Task SendFrameAsync(Http3FrameType frameType, Memory<byte> data, bool endStream = false) 614internal Task EndStreamAsync(ReadOnlySpan<byte> span = default) 624internal async Task WaitForStreamErrorAsync(Http3ErrorCode protocolError, Action<string> matchExpectedErrorMessage = null, string expectedErrorMessage = null) 669public Task OnDisposedTask => _testStreamContext.OnDisposedTask; 670public Task OnDisposingTask => _testStreamContext.OnDisposingTask; 688public Task SendHeadersAsync(IEnumerable<KeyValuePair<string, string>> headers, bool endStream = false) 693public async Task SendHeadersAsync(Http3HeadersEnumerator headers, bool endStream = false) 717internal async Task SendHeadersPartialAsync() 725internal async Task SendDataAsync(Memory<byte> data, bool endStream = false) 758internal async Task ExpectReceiveEndOfStream() 863public async Task WriteStreamIdAsync(int id) 879internal async Task SendGoAwayAsync(long streamId, bool endStream = false) 887internal async Task SendSettingsAsync(List<Http3PeerSetting> settings, bool endStream = false) 951internal async Task WaitForGoAwayAsync(bool ignoreNonGoAwayFrames, long? expectedLastStreamId) 1170public Task OnDisposingTask => _disposingTcs.Task; 1171public Task OnDisposedTask => _disposedTcs.Task;
src\Servers\Kestrel\shared\test\PassThroughConnectionMiddleware.cs (1)
21public Task OnConnectionAsync(ConnectionContext context)
src\Servers\Kestrel\shared\test\RevocationResponder.cs (1)
105internal async Task HandleRequestAsync()
src\Servers\Kestrel\shared\test\ServerRetryHelper.cs (2)
17public static async Task BindPortsWithRetry(Func<int, Task> retryFunc, ILogger logger)
src\Servers\Kestrel\shared\test\StreamBackedTestConnection.cs (10)
42public Task SendEmptyGet() 50public Task SendEmptyGetWithUpgradeAndKeepAlive() 53public Task SendEmptyGetWithUpgrade() 56public Task SendEmptyGetAsKeepAlive() 59private Task SendEmptyGetWithConnection(string connection) 68public async Task SendAll(params string[] lines) 77public async Task Send(params string[] lines) 93public async Task Receive(params string[] lines) 129public async Task ReceiveEnd(params string[] lines) 138public async Task WaitForConnectionClose()
src\Servers\Kestrel\shared\test\TestApp.cs (6)
14public static async Task EchoApp(HttpContext httpContext) 27public static async Task EchoAppChunked(HttpContext httpContext) 39public static Task EmptyApp(HttpContext httpContext) 41return Task.CompletedTask; 44public static async Task EchoAppPipeWriter(HttpContext httpContext) 61public static async Task EchoAppPipeWriterChunked(HttpContext httpContext)
src\Servers\Kestrel\shared\test\TestContextFactory.cs (2)
105Func<ListenOptions, Task> createBinding) 120Func<ListenOptions, CancellationToken, Task> createBinding)
src\Servers\Kestrel\shared\test\TestHttp1Connection.cs (1)
31public Task ProduceEndAsync()
src\Shared\Buffers.MemoryPool\DiagnosticMemoryPool.cs (4)
153public async Task WhenAllBlocksReturnedAsync(TimeSpan timeout) 155var task = await Task.WhenAny(_allBlocksReturned.Task, Task.Delay(timeout));
src\Shared\SyncPoint\SyncPoint.cs (5)
18public Task WaitForSyncPoint() => _atSyncPoint.Task; 32public Task WaitToContinue() 38public static Func<Task> Create(out SyncPoint syncPoint) 51public static Func<Task> Create(int count, out SyncPoint[] syncPoints) 67return Task.CompletedTask;
TestTransport\InMemoryTransportConnection.cs (4)
45public Task WaitForReadTask { get; } 51public Task WaitForCloseTask => _waitForCloseTcs.Task; 109public Task WaitForReadTask => _reader.WaitForReadTask; 120public Task WaitForReadTask => _tcs.Task;
TestTransport\TestServer.cs (1)
125public Task StopAsync(CancellationToken cancellationToken = default)
UpgradeTests.cs (13)
23public async Task ResponseThrowsAfterUpgrade() 63public async Task RequestBodyAlwaysEmptyAfterUpgrade() 118public async Task UpgradeCannotBeCalledMultipleTimes() 138await Task.Delay(100); 159public async Task AcceptsRequestWithContentLengthAndUpgrade() 193public async Task AcceptsRequestWithNoContentLengthAndUpgrade() 228public async Task AcceptsRequestWithChunkedEncodingAndUpgrade() 268public async Task ThrowsWhenUpgradingNonUpgradableRequest() 301public async Task RejectsUpgradeWhenLimitReached() 318await Task.Delay(100); 352public async Task DoesNotThrowOnFin() 389public async Task DoesNotThrowGivenCanceledReadResult() 434public async Task DoesNotCloseConnectionWithout101Response()
InProcessWebSite (112)
src\Servers\IIS\IIS\test\testassets\InProcessWebSite\DummyServer.cs (4)
18public Task StartAsync<TContext>(IHttpApplication<TContext> application, CancellationToken cancellationToken) 20return Task.Delay(TimeSpan.MaxValue); 23public Task StopAsync(CancellationToken cancellationToken) 25return Task.Delay(TimeSpan.MaxValue);
src\Servers\IIS\IIS\test\testassets\InProcessWebSite\Startup.cs (102)
57private async Task ContentRootPath(HttpContext ctx) => await ctx.Response.WriteAsync(ctx.RequestServices.GetService<Microsoft.AspNetCore.Hosting.IHostingEnvironment>().ContentRootPath); 59private async Task WebRootPath(HttpContext ctx) => await ctx.Response.WriteAsync(ctx.RequestServices.GetService<Microsoft.AspNetCore.Hosting.IHostingEnvironment>().WebRootPath); 66private async Task CurrentDirectory(HttpContext ctx) => await ctx.Response.WriteAsync(Environment.CurrentDirectory); 68private async Task BaseDirectory(HttpContext ctx) => await ctx.Response.WriteAsync(AppContext.BaseDirectory); 70private async Task IIISEnvironmentFeatureConfig(HttpContext ctx) 102private async Task ASPNETCORE_IIS_PHYSICAL_PATH(HttpContext ctx) => await ctx.Response.WriteAsync(Environment.GetEnvironmentVariable("ASPNETCORE_IIS_PHYSICAL_PATH")); 104private async Task ServerAddresses(HttpContext ctx) 110private async Task CheckProtocol(HttpContext ctx) 115private async Task ConsoleWrite(HttpContext ctx) 122private async Task ConsoleErrorWrite(HttpContext ctx) 129public async Task Auth(HttpContext ctx) 141public async Task GetClientCert(HttpContext context) 149public Task WaitForAbort(HttpContext context) 155return Task.CompletedTask; 163public Task Abort(HttpContext context) 166return Task.CompletedTask; 169public async Task WaitingRequestCount(HttpContext context) 174public Task CreateFile(HttpContext context) 188return Task.CompletedTask; 191public Task ConnectionClose(HttpContext context) 194return Task.CompletedTask; 197public Task OverrideServer(HttpContext context) 200return Task.CompletedTask; 215private async Task GetEnvironmentVariable(HttpContext ctx) 220private async Task ServerVariable(HttpContext ctx) 232private async Task AuthenticationAnonymous(HttpContext ctx) 237private async Task AuthenticationRestricted(HttpContext ctx) 249private async Task AuthenticationForbidden(HttpContext ctx) 254private async Task AuthenticationRestrictedNTLM(HttpContext ctx) 266private Task PathAndPathBase(HttpContext ctx) 271private async Task FeatureCollectionSetRequestFeatures(HttpContext ctx) 326private async Task FeatureCollectionSetResponseFeatures(HttpContext ctx) 362private async Task FeatureCollectionSetConnectionFeatures(HttpContext ctx) 389private async Task SetCustomErorCode(HttpContext ctx) 400private async Task HelloWorld(HttpContext ctx) 416private async Task LargeResponseBody(HttpContext ctx) 446private async Task ResponseHeaders(HttpContext ctx) 454private async Task ResponseEmptyHeaders(HttpContext ctx) 460private Task TestRequestHeaders(HttpContext ctx) 517private async Task ResponseInvalidOrdering(HttpContext ctx) 549private async Task ReadAndWriteSynchronously(HttpContext ctx) 551var t2 = Task.Run(() => WriteManyTimesToResponseBody(ctx)); 552var t1 = Task.Run(() => ReadRequestBody(ctx)); 553await Task.WhenAll(t1, t2); 556private async Task ReadRequestBody(HttpContext ctx) 569private async Task ReadRequestBodyLarger(HttpContext ctx) 583private async Task ReadAndCountRequestBody(HttpContext ctx) 595private async Task WaitForAppToStartShuttingDown(HttpContext ctx) 607private async Task ReadFullBody(HttpContext ctx) 617private async Task WriteManyTimesToResponseBody(HttpContext ctx) 625private async Task ReadAndWriteEcho(HttpContext ctx) 638private async Task ReadAndFlushEcho(HttpContext ctx) 653private async Task ReadAndWriteEchoLines(HttpContext ctx) 679private async Task ReadAndWriteEchoLinesNoBuffering(HttpContext ctx) 710private async Task ReadPartialBody(HttpContext ctx) 724private async Task SetHeaderFromBody(HttpContext ctx) 734private async Task ReadAndWriteEchoTwice(HttpContext ctx) 748private async Task ReadAndWriteSlowConnection(HttpContext ctx) 750var t2 = Task.Run(() => WriteResponseBodyAFewTimes(ctx)); 751var t1 = Task.Run(() => ReadRequestBody(ctx)); 752await Task.WhenAll(t1, t2); 755private async Task WriteResponseBodyAFewTimes(HttpContext ctx) 763private async Task ReadAndWriteCopyToAsync(HttpContext ctx) 771private async Task TestReadOffsetWorks(HttpContext ctx) 780private async Task TestInvalidReadOperations(HttpContext ctx) 853private async Task TestValidReadOperations(HttpContext ctx) 877private async Task TestInvalidWriteOperations(HttpContext ctx) 940private async Task TestValidWriteOperations(HttpContext ctx) 954private async Task LargeResponseFile(HttpContext ctx) 980private async Task BasePath(HttpContext ctx) 985private Task RequestPath(HttpContext ctx) 991private async Task Shutdown(HttpContext ctx) 1001private async Task ShutdownStopAsync(HttpContext ctx) 1008private async Task ShutdownStopAsyncWithCancelledToken(HttpContext ctx) 1017private async Task StackSize(HttpContext ctx) 1024private async Task StackSizeLarge(HttpContext ctx) 1040private async Task StartupHook(HttpContext ctx) 1045private async Task GetServerVariableStress(HttpContext ctx) 1061private async Task CommandLineArgs(HttpContext ctx) 1066public Task HttpsHelloWorld(HttpContext ctx) => 1069public Task Path(HttpContext ctx) => ctx.Response.WriteAsync(ctx.Request.Path.Value); 1071public Task Query(HttpContext ctx) => ctx.Response.WriteAsync(ctx.Request.QueryString.Value); 1073public Task BodyLimit(HttpContext ctx) => ctx.Response.WriteAsync(ctx.Features.Get<IHttpMaxRequestBodySizeFeature>()?.MaxRequestBodySize?.ToString(CultureInfo.InvariantCulture) ?? "null"); 1075public Task Anonymous(HttpContext context) => context.Response.WriteAsync("Anonymous?" + !context.User.Identity.IsAuthenticated); 1077public Task Restricted(HttpContext context) 1090public Task Forbidden(HttpContext context) => context.ForbidAsync(IISDefaults.AuthenticationScheme); 1092public Task RestrictedNTLM(HttpContext context) 1104public Task UpgradeFeatureDetection(HttpContext context) => 1107public Task CheckRequestHandlerVersion(HttpContext context) 1125private async Task ProcessId(HttpContext context) 1130public async Task ANCM_HTTPS_PORT(HttpContext context) 1137public async Task HTTPS_PORT(HttpContext context) 1144public Task Latin1(HttpContext context) 1148return Task.CompletedTask; 1151public Task InvalidCharacter(HttpContext context) 1155return Task.CompletedTask; 1158private async Task TransferEncodingHeadersWithMultipleValues(HttpContext ctx) 1176private async Task TransferEncodingAndContentLengthShouldBeRemove(HttpContext ctx)
src\Servers\IIS\IIS\test\testassets\InProcessWebSite\Startup.WebSockets.cs (5)
30return Task.CompletedTask; 40return Task.CompletedTask; 81return Task.CompletedTask; 101private static async Task SendMessages(WebSocket webSocket, params string[] messages) 130private async Task Echo(WebSocket webSocket, CancellationToken token)
src\Servers\IIS\IIS\test\testassets\shared\WebSockets\TestStartup.cs (1)
36appfunc = context => (Task)method.Invoke(startup, new[] { context });
installer.tasks (2)
StaticFileRegeneration\RegenerateThirdPartyNotices.cs (2)
49public async Task ExecuteAsync(HttpClient client) 51var results = await Task.WhenAll(TpnRepos
IntegrationTestsWebsite (1)
Services\GreeterService.cs (1)
18return Task.FromResult(new HelloReply
Interop.FunctionalTests (155)
H2SpecCommands.cs (3)
215public static async Task RunTest(string testId, int port, bool https, ILogger logger) 254if (await Task.WhenAny(exitedTcs.Task, Task.Delay(TimeSpan.FromSeconds(TimeoutSeconds * 2))) != exitedTcs.Task)
H2SpecTests.cs (1)
28public async Task RunIndividualTestCase(H2SpecTestCase testCase)
Http2\Http2RequestTests.cs (6)
27public async Task GET_Metrics_HttpProtocolAndTlsSet() 35return Task.CompletedTask; 93public async Task GET_NoTLS_Http11RequestToHttp2Endpoint_400Result() 96var builder = CreateHostBuilder(c => Task.CompletedTask, protocol: HttpProtocols.Http2, plaintext: true); 120public async Task GET_RequestReturnsLargeData_GracefulShutdownDuringRequest_RequestGracefullyCompletes(bool hasTrailers) 170var stopTask = host.StopAsync();
Http2WebSocketInteropTests.cs (1)
49public async Task HttpVersionNegotationWorks(string scheme, string clientVersion, HttpVersionPolicy clientPolicy, HttpProtocols serverProtocols, string expectedVersion)
Http3\Http3RequestTests.cs (71)
37protected override Task SerializeToStreamAsync(Stream stream, TransportContext context) 42protected override async Task SerializeToStreamAsync(Stream stream, TransportContext context, CancellationToken cancellationToken) 49await Task.WhenAny(_completeTcs.Task, cancellationTcs.Task); 73public async Task GET_Metrics_HttpProtocolAndTlsSet() 76var builder = CreateHostBuilder(context => Task.CompletedTask); 123public async Task GET_MiddlewareIsRunWithConnectionLoggingScopeForHttpRequests(HttpProtocols protocol) 231public async Task GET_ServerStreaming_ClientReadsPartialResponse(HttpProtocols protocol, int clientBufferSize) 275public async Task POST_ClientSendsOnlyHeaders_RequestReceivedOnServer(HttpProtocols protocol) 282return Task.CompletedTask; 320public async Task POST_MultipleRequests_PooledStreamAndHeaders(HttpProtocols protocol) 397public async Task POST_ServerCompletesWithoutReadingRequestBody_ClientGetsResponse() 450public async Task POST_ClientCancellationUpload_RequestAbortRaised(HttpProtocols protocol) 455var readAsyncTask = new TaskCompletionSource<Task>(TaskCreationOptions.RunContinuationsAsynchronously); 518var serverReadTask = await readAsyncTask.Task.DefaultTimeout(); 532public async Task POST_ServerAbort_ClientReceivesAbort(HttpProtocols protocol) 537var readAsyncTask = new TaskCompletionSource<Task>(TaskCreationOptions.RunContinuationsAsynchronously); 585var serverReadTask = await readAsyncTask.Task.DefaultTimeout(); 595public async Task POST_ServerAbortAfterWrite_ClientReceivesAbort() 650public async Task GET_ServerAbort_ClientReceivesAbort(HttpProtocols protocol) 655var writeAsyncTask = new TaskCompletionSource<Task>(TaskCreationOptions.RunContinuationsAsynchronously); 694var serverWriteTask = await writeAsyncTask.Task.DefaultTimeout(); 703public async Task POST_Expect100Continue_Get100Continue() 760public async Task GET_ConnectionsMakingMultipleRequests_AllSuccess() 768return Task.CompletedTask; 785var calls = (await Task.WhenAll(connectionRequestTasks)).Sum(); 798var requestTasks = new List<Task>(); 805await Task.WhenAll(requestTasks); 811static async Task MakeRequest(HttpMessageInvoker client, string address, int count) 824public async Task GET_MultipleRequestsInSequence_ReusedState() 840return Task.CompletedTask; 858await Task.Delay(100); 881public async Task GET_MultipleRequests_RequestVersionOrHigher_UpgradeToHttp3() 892return Task.CompletedTask; 935await Task.Delay(100); 962public async Task POST_ClientCancellationBidirectional_RequestAbortRaised(HttpProtocols protocol) 966var readAsyncTask = new TaskCompletionSource<Task>(TaskCreationOptions.RunContinuationsAsynchronously); 1041var serverReadTask = await readAsyncTask.Task.DefaultTimeout(); 1063public async Task POST_Bidirectional_LargeData_Cancellation_Error(HttpProtocols protocol) 1133await Task.Delay(50); 1154public async Task GET_ClientCancellationAfterResponseHeaders_RequestAbortRaised(HttpProtocols protocol) 1206public async Task StreamResponseContent_DelayAndTrailers_ClientSuccess() 1226await Task.Delay(TimeSpan.FromMilliseconds(10)); 1269public async Task GET_MultipleRequests_ConnectionAndTraceIdsUpdated() 1280return Task.CompletedTask; 1322public async Task GET_MultipleRequestsInSequence_ReusedRequestHeaderStrings() 1346return Task.CompletedTask; 1364await Task.Delay(100); 1384public async Task Get_CompleteAsyncAndReset_StreamNotPooled() 1424await Task.Delay(100); 1444public async Task GET_ConnectionLoggingConfigured_OutputToLogs() 1450return Task.CompletedTask; 1494public async Task GET_UseHttpsCallback_ConnectionContextAvailable() 1501return Task.CompletedTask; 1546public async Task GET_ClientDisconnected_ConnectionAbortRaised() 1554return Task.CompletedTask; 1610public async Task ConnectionLifetimeNotificationFeature_RequestClose_ConnectionEnds() 1630return Task.CompletedTask; 1633return Task.CompletedTask; 1715public async Task GET_ServerAbortTransport_ConnectionAbortRaised() 1781private async Task WaitForLogAsync(Func<IEnumerable<WriteContext>, bool> testLogs, string message) 1794await Task.Delay(100 * (i + 1)); 1802public async Task GET_ConnectionInfo_PropertiesSet() 1818return Task.CompletedTask; 1855public async Task GET_GracefulServerShutdown_AbortRequestsAfterHostTimeout(HttpProtocols protocol) 1859var readAsyncTask = new TaskCompletionSource<Task>(TaskCreationOptions.RunContinuationsAsynchronously); 1920var stopTask = host.StopAsync(); 1931var readTask = await readAsyncTask.Task.DefaultTimeout(); 1967public async Task GET_GracefulServerShutdown_RequestCompleteSuccessfullyInsideHostTimeout(HttpProtocols protocol) 2016var stopTask = host.StopAsync(); 2035public async Task ServerReset_InvalidErrorCode() 2044return Task.CompletedTask;
Http3\Http3TlsTests.cs (9)
27public async Task ServerCertificateSelector_Invoked() 78public async Task ClientCertificate_AllowOrRequire_Available_Accepted(ClientCertificateMode mode) 120public async Task ClientCertificate_NoOrDelayed_Available_Ignored(ClientCertificateMode mode) 165public async Task ClientCertificate_AllowOrRequire_Available_Invalid_Refused(ClientCertificateMode mode, bool serverAllowInvalid) 219public async Task ClientCertificate_Allow_NotAvailable_Optional() 259public async Task OnAuthenticate_Available_Throws(HttpProtocols protocols) 289public async Task TlsHandshakeCallbackOptions_Invoked() 346public async Task UseKestrelCore_CodeBased(bool useQuic, bool useHttps, bool useHttpsEnablesHttpsConfiguration) 431public async Task LoadDevelopmentCertificateViaConfiguration()
HttpClientHttp2InteropTests.cs (57)
51public async Task HelloWorld(string scheme) 72public async Task Echo(string scheme) 102public async Task MultiplexGet(string scheme) 129var requestTasks = new List<Task>(requestCount); 135async Task RunRequest(string url) 143await Task.WhenAll(requestTasks); 150public async Task MultiplexEcho(string scheme) 177var requestTasks = new List<Task>(requestCount); 183async Task RunRequest(string url) 192await Task.WhenAll(requestTasks); 210protected override async Task SerializeToStreamAsync(Stream stream, TransportContext context) 218await Task.Yield(); // Intermix writes 228public static async Task VerifyContent(Stream stream) 260public async Task BidirectionalStreaming(string scheme) 318public async Task BidirectionalStreamingMoreClientData(string scheme) 400public async Task ReverseEcho(string scheme) 454private Func<string, Task> _sendContent; 461public Task SendStarted => _sendStarted.Task; 463public async Task SendAsync(string text) 478protected override Task SerializeToStreamAsync(Stream stream, TransportContext context) 517public async Task ResponseTrailersWithoutData(string scheme) 528return Task.CompletedTask; 546public async Task ResponseTrailersWithData(string scheme) 582public async Task ServerReset_BeforeResponse_ClientThrows(string scheme) 592return Task.CompletedTask; 606public async Task ServerReset_AfterHeaders_ClientBodyThrows(string scheme) 635public async Task ServerReset_AfterEndStream_NoError(string scheme) 662public async Task ServerReset_AfterTrailers_NoError(string scheme) 695public async Task ServerReset_BeforeRequestBody_ClientBodyThrows(string scheme) 751public async Task ServerReset_BeforeRequestBodyEnd_ClientBodyThrows(string scheme) 810public async Task ClientReset_BeforeRequestData_ReadThrows(string scheme) 856public async Task ClientReset_BeforeRequestDataEnd_ReadThrows(string scheme) 901public async Task ClientReset_BeforeResponse_ResponseSuppressed(string scheme) 943public async Task ClientReset_BeforeEndStream_WritesSuppressed(string scheme) 983public async Task ClientReset_BeforeTrailers_TrailersSuppressed(string scheme) 1024public async Task RequestHeaders_MultipleFrames_Accepted(string scheme) 1047return Task.CompletedTask; 1076public async Task ResponseHeaders_MultipleFrames_Accepted(string scheme) 1100return Task.CompletedTask; 1128public async Task Settings_HeaderTableSize_CanBeReduced_Server(string scheme) 1156return Task.CompletedTask; 1188public async Task Settings_MaxConcurrentStreamsGet_Server(string scheme) 1233var responses = await Task.WhenAll(tasks.ToList()).DefaultTimeout(); 1249public async Task Settings_MaxConcurrentStreamsPost_Server(string scheme) 1294var responses = await Task.WhenAll(tasks.ToList()).DefaultTimeout(); 1312public async Task Settings_MaxFrameSize_Larger_Server(string scheme) 1345public async Task Settings_MaxHeaderListSize_Server(string scheme) 1378public async Task Settings_MaxHeaderListSize_Client(string scheme) 1393return Task.CompletedTask; 1412public async Task Settings_InitialWindowSize_Server(string scheme) 1454public async Task Settings_InitialWindowSize_Client(string scheme) 1490public async Task ConnectionWindowSize_Server(string scheme) 1549public async Task UnicodeRequestHost(string scheme) 1576public async Task UrlEncoding(string scheme) 1599public async Task ClientCertificate_Required() 1644public async Task ClientCertificate_DelayedNotSupported() 1721private static async Task ReadStreamHelloWorld(Stream stream)
src\Servers\Kestrel\shared\test\ServerRetryHelper.cs (2)
17public static async Task BindPortsWithRetry(Func<int, Task> retryFunc, ILogger logger)
src\Shared\SyncPoint\SyncPoint.cs (5)
18public Task WaitForSyncPoint() => _atSyncPoint.Task; 32public Task WaitToContinue() 38public static Func<Task> Create(out SyncPoint syncPoint) 51public static Func<Task> Create(int count, out SyncPoint[] syncPoints) 67return Task.CompletedTask;
InteropClient (26)
Assert.cs (1)
62public static async Task<TException> ThrowsAsync<TException>(Func<Task> action) where TException : Exception
AsyncStreamExtensions.cs (4)
31public static async Task ForEachAsync<T>(this IAsyncStreamReader<T> streamReader, Func<T, Task> asyncAction) 58public static async Task WriteAllAsync<T>(this IClientStreamWriter<T> streamWriter, IEnumerable<T> elements, bool complete = true) 74public static async Task WriteAllAsync<T>(this IServerStreamWriter<T> streamWriter, IEnumerable<T> elements)
IChannelWrapper.cs (3)
27Task ShutdownAsync(); 39public Task ShutdownAsync() 41return Task.CompletedTask;
InteropClient.cs (18)
136private async Task Run() 209private async Task RunTestCaseAsync(IChannelWrapper channel, ClientOptions options) 307public static async Task RunClientStreamingAsync(TestService.TestServiceClient client) 323public static async Task RunServerStreamingAsync(TestService.TestServiceClient client) 342public static async Task RunPingPongAsync(TestService.TestServiceClient client) 391public static async Task RunEmptyStreamAsync(TestService.TestServiceClient client) 445public static async Task RunOAuth2AuthTokenAsync(TestService.TestServiceClient client, string oauthScope) 466public static async Task RunPerRpcCredsAsync(TestService.TestServiceClient client, string oauthScope) 483public static async Task RunCancelAfterBeginAsync(TestService.TestServiceClient client) 491await Task.Delay(1000); 500public static async Task RunCancelAfterFirstResponseAsync(TestService.TestServiceClient client) 532public static async Task RunTimeoutOnSleepingServerAsync(TestService.TestServiceClient client) 565public static async Task RunCustomMetadataAsync(TestService.TestServiceClient client) 610public static async Task RunStatusCodeAndMessageAsync(TestService.TestServiceClient client) 652private static async Task RunSpecialStatusMessageAsync(TestService.TestServiceClient client) 739public static async Task RunClientCompressedStreamingAsync(TestService.TestServiceClient client) 790public static async Task RunServerCompressedUnary(TestService.TestServiceClient client) 819public static async Task RunServerCompressedStreamingAsync(TestService.TestServiceClient client)
InteropTests (24)
Helpers\ClientProcess.cs (2)
41public Task WaitForReadyAsync() => _startTcs.Task; 42public Task WaitForExitAsync() => _processEx.Exited;
Helpers\WebsiteProcess.cs (2)
54public Task WaitForReady() 58return Task.FromException(new InvalidOperationException("Server is not running."));
InteropTests.cs (19)
25public Task EmptyUnary() => InteropTestCase("empty_unary"); 28public Task LargeUnary() => InteropTestCase("large_unary"); 31public Task ClientStreaming() => InteropTestCase("client_streaming"); 34public Task ServerStreaming() => InteropTestCase("server_streaming"); 37public Task PingPong() => InteropTestCase("ping_pong"); 40public Task EmptyStream() => InteropTestCase("empty_stream"); 43public Task CancelAfterBegin() => InteropTestCase("cancel_after_begin"); 46public Task CancelAfterFirstResponse() => InteropTestCase("cancel_after_first_response"); 49public Task TimeoutOnSleepingServer() => InteropTestCase("timeout_on_sleeping_server"); 52public Task CustomMetadata() => InteropTestCase("custom_metadata"); 55public Task StatusCodeAndMessage() => InteropTestCase("status_code_and_message"); 58public Task SpecialStatusMessage() => InteropTestCase("special_status_message"); 61public Task UnimplementedService() => InteropTestCase("unimplemented_service"); 64public Task UnimplementedMethod() => InteropTestCase("unimplemented_method"); 67public Task ClientCompressedUnary() => InteropTestCase("client_compressed_unary"); 70public Task ClientCompressedStreaming() => InteropTestCase("client_compressed_streaming"); 73public Task ServerCompressedUnary() => InteropTestCase("server_compressed_unary"); 76public Task ServerCompressedStreaming() => InteropTestCase("server_compressed_streaming"); 78private async Task InteropTestCase(string name)
src\Shared\Process\ProcessEx.cs (1)
71public Task Exited => _exited.Task;
InteropWebsite (11)
artifacts\obj\InteropWebsite\Release\net9.0\TestGrpc.cs (3)
206public virtual global::System.Threading.Tasks.Task StreamingOutputCall(global::Grpc.Testing.StreamingOutputCallRequest request, grpc::IServerStreamWriter<global::Grpc.Testing.StreamingOutputCallResponse> responseStream, grpc::ServerCallContext context) 234public virtual global::System.Threading.Tasks.Task FullDuplexCall(grpc::IAsyncStreamReader<global::Grpc.Testing.StreamingOutputCallRequest> requestStream, grpc::IServerStreamWriter<global::Grpc.Testing.StreamingOutputCallResponse> responseStream, grpc::ServerCallContext context) 250public virtual global::System.Threading.Tasks.Task HalfDuplexCall(grpc::IAsyncStreamReader<global::Grpc.Testing.StreamingOutputCallRequest> requestStream, grpc::IServerStreamWriter<global::Grpc.Testing.StreamingOutputCallResponse> responseStream, grpc::ServerCallContext context)
AsyncStreamExtensions.cs (2)
29public static async Task ForEachAsync<T>(this IAsyncStreamReader<T> streamReader, Func<T, Task> asyncAction)
TestServiceImpl.cs (6)
30return Task.FromResult(new Empty()); 43public override async Task StreamingOutputCall(StreamingOutputCallRequest request, IServerStreamWriter<StreamingOutputCallResponse> responseStream, ServerCallContext context) 69return Task.CompletedTask; 74public override async Task FullDuplexCall(IAsyncStreamReader<StreamingOutputCallRequest> requestStream, IServerStreamWriter<StreamingOutputCallResponse> responseStream, ServerCallContext context) 89public override Task HalfDuplexCall(IAsyncStreamReader<StreamingOutputCallRequest> requestStream, IServerStreamWriter<StreamingOutputCallResponse> responseStream, ServerCallContext context) 99private static async Task EnsureEchoMetadataAsync(ServerCallContext context, bool enableCompression = false)
JwtBearerSample (1)
Program.cs (1)
8public static Task Main(string[] args)
JwtClientSample (5)
Program.cs (5)
13static async Task Main(string[] args) 16await Task.WhenAll( 26private async Task RunConnection(HttpTransportType transportType) 43return Task.CompletedTask; 57await Task.Delay(1000);
JwtSample (3)
Broadcaster.cs (1)
13public Task Broadcast(string sender, string message) =>
Program.cs (1)
8public static Task Main(string[] args)
Startup.cs (1)
54return Task.CompletedTask;
Kestrel.SampleApp (1)
Startup.cs (1)
67public static Task Main(string[] args)
LargeResponseApp (1)
Startup.cs (1)
41public static Task Main(string[] args)
LocalizationSample (2)
Startup.cs (2)
115private static async System.Threading.Tasks.Task WriteCultureSelectOptions(HttpContext context) 130public static Task Main(string[] args)
LocalizationWebsite (1)
Program.cs (1)
8public static Task Main(string[] args)
Microsoft.Arcade.Common (13)
ArcadeHttpMessageHandler.cs (2)
24return Task.FromResult(new HttpResponseMessage() 31return Task.FromResult(new HttpResponseMessage()
ExponentialRetry.cs (1)
63await Task.Delay(delay, cancellationToken);
Helpers.cs (2)
60public void MutexExec(Func<Task> function, string mutexName) => 70public void DirectoryMutexExec(Func<Task> function, string path) =>
IHelpers.cs (2)
12void MutexExec(Func<Task> function, string mutexName); 16void DirectoryMutexExec(Func<Task> function, string path);
IZipArchiveManager.cs (3)
26Task AddResourceFileToArchive<TAssembly>(string archivePath, string resourceName, string targetFileName = null); 34Task AddContentToArchive(string archivePath, string targetFilename, Stream content); 42Task AddContentToArchive(string archivePath, string targetFilename, string content);
ZipArchiveManager.cs (3)
18public async Task AddResourceFileToArchive<TAssembly>(string archivePath, string resourceName, string targetFileName = null) 44public Task AddContentToArchive(string archivePath, string targetFilename, string content) 47public async Task AddContentToArchive(string archivePath, string targetFilename, Stream content)
Microsoft.Arcade.Test.Common (1)
FakeHttpClient.cs (1)
39return Task.FromResult(_responseEnumerator.Current);
Microsoft.AspNetCore (6)
WebApplication.cs (6)
157/// A <see cref="Task"/> that represents the startup of the <see cref="WebApplication"/>. 160public Task StartAsync(CancellationToken cancellationToken = default) => 168/// A <see cref="Task"/> that represents the shutdown of the <see cref="WebApplication"/>. 171public Task StopAsync(CancellationToken cancellationToken = default) => 179/// A <see cref="Task"/> that represents the entire runtime of the <see cref="WebApplication"/> from startup to shutdown. 181public Task RunAsync([StringSyntax(StringSyntaxAttribute.Uri)] string? url = null)
Microsoft.AspNetCore.Analyzer.Testing (1)
CodeFixRunner.cs (1)
44private async Task EnsureCompilable(Project project)
Microsoft.AspNetCore.Analyzers.Test (44)
CompilationFeatureDetectorTest.cs (3)
11public async Task DetectFeaturesAsync_FindsNoFeatures() 46public async Task DetectFeatureAsync_StartupWithMapHub_FindsSignalR() 87public async Task DetectFeatureAsync_StartupWithMapBlazorHub_FindsSignalR()
MinimalStartupTest.cs (22)
37public async Task StartupAnalyzer_FindsStartupMethods_StartupSignatures_Standard() 52public async Task StartupAnalyzer_FindsStartupMethods_StartupSignatures_MoreVariety() 66public async Task StartupAnalyzer_MvcOptionsAnalysis_UseMvc_FindsEndpointRoutingDisabled() 91public async Task StartupAnalyzer_MvcOptionsAnalysis_AddMvcOptions_FindsEndpointRoutingDisabled() 116public Task StartupAnalyzer_MvcOptionsAnalysis_UseMvc_FindsEndpointRoutingEnabled() 134public Task StartupAnalyzer_MvcOptionsAnalysis_UseMvcAndConfiguredRoutes_FindsEndpointRoutingEnabled() 155public Task StartupAnalyzer_MvcOptionsAnalysis_MvcOptions_UseMvcWithDefaultRoute_FindsEndpointRoutingEnabled() 173private async Task VerifyMvcOptionsAnalysis(string source, string mvcMiddlewareName, params DiagnosticResult[] diagnosticResults) 188public async Task StartupAnalyzer_MvcOptionsAnalysis_MultipleMiddleware() 229public async Task StartupAnalyzer_MvcOptionsAnalysis_MultipleUseMvc() 273public async Task StartupAnalyzer_ServicesAnalysis_CallBuildServiceProvider() 296public async Task StartupAnalyzer_UseAuthorizationConfiguredCorrectly_ReportsNoDiagnostics() 320public async Task StartupAnalyzer_UseAuthorizationConfiguredAsAChain_ReportsNoDiagnostics() 345public async Task StartupAnalyzer_UseAuthorizationInvokedMultipleTimesInEndpointRoutingBlock_ReportsNoDiagnostics() 370public async Task StartupAnalyzer_UseAuthorizationConfiguredBeforeUseRouting_ReportsDiagnostics() 394public async Task StartupAnalyzer_UseAuthorizationConfiguredBeforeUseRoutingChained_ReportsDiagnostics() 421public async Task StartupAnalyzer_UseAuthorizationConfiguredAfterUseEndpoints_ReportsDiagnostics() 448public async Task StartupAnalyzer_MultipleUseAuthorization_ReportsNoDiagnostics() 472protected Task VerifyAnalyzerAsync(string source, params DiagnosticResult[] expected) 485public async Task StartupAnalyzer_AuthNoRouting() 507public async Task StartupAnalyzer_WorksWithNonImplicitMain() 558public async Task StartupAnalyzer_WorksWithOtherMethodsInProgram()
StartupAnalyzerTest.cs (19)
35public async Task StartupAnalyzer_FindsStartupMethods_StartupSignatures_Standard() 66public async Task StartupAnalyzer_FindsStartupMethods_StartupSignatures_MoreVariety() 121public async Task StartupAnalyzer_MvcOptionsAnalysis_UseMvc_FindsEndpointRoutingDisabled() 157public async Task StartupAnalyzer_MvcOptionsAnalysis_AddMvcOptions_FindsEndpointRoutingDisabled() 194public Task StartupAnalyzer_MvcOptionsAnalysis_UseMvc_FindsEndpointRoutingEnabled() 223public Task StartupAnalyzer_MvcOptionsAnalysis_UseMvcAndConfiguredRoutes_FindsEndpointRoutingEnabled() 256public Task StartupAnalyzer_MvcOptionsAnalysis_MvcOptions_UseMvcWithDefaultRoute_FindsEndpointRoutingEnabled() 285private async Task VerifyMvcOptionsAnalysis(string source, string mvcMiddlewareName, params DiagnosticResult[] diagnosticResults) 300public async Task StartupAnalyzer_MvcOptionsAnalysis_MultipleMiddleware() 354public async Task StartupAnalyzer_MvcOptionsAnalysis_MultipleUseMvc() 413public async Task StartupAnalyzer_ServicesAnalysis_CallBuildServiceProvider() 447public async Task StartupAnalyzer_UseAuthorizationConfiguredCorrectly_ReportsNoDiagnostics() 475public async Task StartupAnalyzer_UseAuthorizationConfiguredAsAChain_ReportsNoDiagnostics() 503public async Task StartupAnalyzer_UseAuthorizationInvokedMultipleTimesInEndpointRoutingBlock_ReportsNoDiagnostics() 532public async Task StartupAnalyzer_UseAuthorizationConfiguredBeforeUseRouting_ReportsDiagnostics() 560public async Task StartupAnalyzer_UseAuthorizationConfiguredBeforeUseRoutingChained_ReportsDiagnostics() 591public async Task StartupAnalyzer_UseAuthorizationConfiguredAfterUseEndpoints_ReportsDiagnostics() 622public async Task StartupAnalyzer_MultipleUseAuthorization_ReportsNoDiagnostics() 654private Task VerifyAnalyzerAsync(string source, params DiagnosticResult[] expected)
Microsoft.AspNetCore.Antiforgery (5)
AntiforgeryMiddleware.cs (2)
16public Task Invoke(HttpContext context) 39public async Task InvokeAwaited(HttpContext context)
IAntiforgery.cs (2)
54/// <returns>A <see cref="Task"/> that completes when validation has completed.</returns> 58Task ValidateRequestAsync(HttpContext httpContext);
Internal\DefaultAntiforgery.cs (1)
143public async Task ValidateRequestAsync(HttpContext httpContext)
Microsoft.AspNetCore.Antiforgery.Test (40)
AntiforgeryApplicationBuilderExtensionsTest.cs (1)
14public async Task UseAntiforgery_HasRequiredServices_RegistersMiddleware()
AntiforgeryMiddlewareTest.cs (10)
16public async Task ValidatesAntiforgeryTokenForValidMethods(string method) 19antiforgeryService.Setup(af => af.ValidateRequestAsync(It.IsAny<HttpContext>())).Returns(Task.FromResult(true)); 20var antiforgeryMiddleware = new AntiforgeryMiddleware(antiforgeryService.Object, hc => Task.CompletedTask); 31public async Task RespectsIgnoreAntiforgeryMetadata() 34var antiforgeryMiddleware = new AntiforgeryMiddleware(antiforgeryService.Object, hc => Task.CompletedTask); 49public async Task IgnoresUnsupportedHttpMethods(string method) 52var antiforgeryMiddleware = new AntiforgeryMiddleware(antiforgeryService.Object, hc => Task.CompletedTask); 64public async Task SetMiddlewareInvokedProperty(bool hasIgnoreMetadata) 67antiforgeryService.Setup(af => af.ValidateRequestAsync(It.IsAny<HttpContext>())).Returns(Task.FromResult(true)); 68var antiforgeryMiddleware = new AntiforgeryMiddleware(antiforgeryService.Object, hc => Task.CompletedTask);
DefaultAntiforgeryTest.cs (19)
23public async Task ChecksSSL_ValidateRequestAsync_Throws() 46public async Task ChecksSSL_IsRequestValidAsync_Throws() 599public async Task IsRequestValidAsync_FromStore_Failure() 632public async Task IsRequestValidAsync_FromStore_Success() 666public async Task IsRequestValidAsync_DoesNotDeserializeTwice() 712public async Task IsRequestValidAsync_SkipsAntiforgery_ForSafeHttpMethods(string httpMethod) 749public async Task IsRequestValidAsync_ValidatesAntiforgery_ForNonSafeHttpMethods(string httpMethod) 776public async Task ValidateRequestAsync_FromStore_Failure() 808public async Task ValidateRequestAsync_FromStore_Success() 840public async Task ValidateRequestAsync_NoCookieToken_Throws() 853.Returns(Task.FromResult(tokenSet)); 864public async Task ValidateRequestAsync_NonFormRequest_HeaderDisabled_Throws() 877.Returns(Task.FromResult(tokenSet)); 888public async Task ValidateRequestAsync_NonFormRequest_NoHeaderValue_Throws() 903.Returns(Task.FromResult(tokenSet)); 914public async Task ValidateRequestAsync_FormRequest_NoRequestTokenValue_Throws() 929.Returns(Task.FromResult(tokenSet)); 943public async Task ValidateRequestAsync_DoesNotDeserializeTwice() 1444.Returns(() => Task.FromResult(new AntiforgeryTokenSet(
DefaultAntiforgeryTokenStoreTest.cs (10)
74public async Task GetRequestTokens_CookieIsEmpty_ReturnsNullTokens() 97public async Task GetRequestTokens_HeaderTokenTakensPriority_OverFormToken() 126public async Task GetRequestTokens_FormTokenDisabled_ReturnsNullToken() 155public async Task GetRequestTokens_FormTokenDisabled_ReturnsHeaderToken() 185public async Task GetRequestTokens_NoHeaderToken_FallsBackToFormToken() 213public async Task GetRequestTokens_NonFormContentType_UsesHeaderToken() 241public async Task GetRequestTokens_NoHeaderToken_NonFormContentType_ReturnsNullToken() 268public async Task GetRequestTokens_BothHeaderValueAndFormFieldsEmpty_ReturnsNullTokens() 293public async Task GetRequestTokens_ReadFormAsyncThrowsIOException_ThrowsAntiforgeryValidationException() 318public async Task GetRequestTokens_ReadFormAsyncThrowsInvalidDataException_ThrowsAntiforgeryValidationException()
Microsoft.AspNetCore.App.Analyzers (8)
RouteEmbeddedLanguage\FrameworkParametersCompletionProvider.cs (4)
70return Task.FromResult<CompletionDescription?>(null); 73return Task.FromResult<CompletionDescription?>(CompletionDescription.Create( 87return Task.FromResult(CompletionChange.Create( 92public override async Task ProvideCompletionsAsync(CompletionContext context)
RouteEmbeddedLanguage\RoutePatternCompletionProvider.cs (4)
64return Task.FromResult<CompletionDescription?>(null); 67return Task.FromResult<CompletionDescription?>(CompletionDescription.Create( 81return Task.FromResult(CompletionChange.Create( 86public override async Task ProvideCompletionsAsync(CompletionContext context)
Microsoft.AspNetCore.App.Analyzers.Test (397)
Authorization\AddAuthorizationBuilderTests.cs (26)
14public async Task ConfigureAction_UsingExpressionBody_FixedWithAddAuthorizationBuilder() 48public async Task SingleAddPolicyCall_UsingExpressionBody_FixedWithAddAuthorizationBuilder() 84public async Task MultipleAddPolicyCalls_UsingExpressionBody_FixedWithAddAuthorizationBuilder() 125public async Task SingleAddPolicyCall_UsingBlockBody_FixedWithAddAuthorizationBuilder() 165public async Task MultipleAddPolicyCalls_UsingBlockBody_FixedWithAddAuthorizationBuilder() 214public async Task AuthorizationOptions_DefaultPolicyAssignment_ReplacedWithSetDefaultPolicyInvocation() 257public async Task AuthorizationOptions_FallbackPolicyAssignment_ReplacedWithSetFallbackPolicyInvocation() 300public async Task AuthorizationOptions_InvokeHandlersAfterFailureAssignment_ReplacedWithSetInvokeHandlersAfterFailureInvocation() 339public async Task AddAuthorization_IsTheLastCallInChain_FixedWithAddAuthorizationBuilder() 377public async Task AddAuthorization_IsNotTheLastCallInChain_NoDiagnostic() 398public async Task AuthorizationOptions_DefaultPolicyAccess_NoDiagnostic() 417public async Task AuthorizationOptions_DefaultPolicyAccess_SelfAssignment_NoDiagnostic() 436public async Task AuthorizationOptions_FallbackPolicyAccess_NoDiagnostic() 455public async Task AuthorizationOptions_FallbackPolicyAccess_SelfAssignment_NoDiagnostic() 474public async Task AuthorizationOptions_InvokeHandlesAfterFailureAccess_NoDiagnostic() 493public async Task AuthorizationOptions_InvokeHandlesAfterFailureAccess_SelfAssignment_NoDiagnostic() 512public async Task AuthorizationOptions_GetPolicyReference_NoDiagnostic() 532public async Task AuthorizationOptions_GetPolicyInvocation_NoDiagnostic() 551public async Task ConfigureAction_IsNotAnonymousFunction_NoDiagnostic() 578public async Task ConfigureAction_AuthorizationOptionsPassedToMethodCall_NoDiagnostic() 605public async Task ConfigureAction_ContainsOperationsNotRelatedToAuthorizationOptions_NoDiagnostic() 629public async Task NestedAddAuthorization_UsingBlockBody_FixedWithAddAuthorizationBuilder() 673public async Task NestedAddAuthorization_UsingExpressionBody_FixedWithAddAuthorizationBuilder() 711public async Task AddAuthorization_CallAssignedToVariable_NoDiagnostic() 728private static async Task VerifyCodeFix(string source, DiagnosticResult[] diagnostics, string fixedSource) 736private static async Task VerifyNoCodeFix(string source)
Components\DisallowNonLiteralSequenceNumbersTest.cs (4)
14public async Task RenderTreeBuilderInvocationWithNumericLiteralArgument_Works() 31public async Task RenderTreeBuilderInvocationWithNonConstantArgument_ProducesDiagnostics() 52public async Task RenderTreeBuilderInvocationWithConstantArgument_ProducesDiagnostics() 73public async Task RenderTreeBuilderInvocationWithInvocationArgument_ProducesDiagnostics()
Http\HeaderDictionaryAddTest.cs (5)
87public async Task IHeaderDictionary_WithAdd_FixedWithAppend(string source, DiagnosticResult[] expectedDiagnostics, string fixedSource) 152public async Task IHeaderDictionary_WithAdd_FixedWithAppend_AddsUsingDirective(string source, string fixedSource) 242public async Task IHeaderDictionary_WithAdd_FixedWithIndexer(string source, DiagnosticResult[] expectedDiagnostics, string fixedSource) 249public async Task IHeaderDictionary_WithAppend_DoesNotProduceDiagnostics() 263public async Task IHeaderDictionary_WithIndexer_DoesNotProduceDiagnostics()
Http\HeaderDictionaryIndexerAnalyzerTests.cs (8)
17public async Task IHeaderDictionary_Get_MismatchCase_ReturnDiagnostic() 38public async Task IHeaderDictionary_Set_MismatchCase_ReturnDiagnostic() 59public async Task IHeaderDictionary_Get_UnknownProperty_NoDiagnostic() 77public async Task IHeaderDictionary_Get_NullProperty_NoDiagnostic() 95public async Task IHeaderDictionary_Get_StronglyTypeProperty_NoDiagnostic() 113public async Task IHeaderDictionary_Get_VariableProperty_NoDiagnostic() 132public async Task HeaderDictionary_Get_KnownProperty_NoDiagnostic() 143public async Task HeaderDictionary_CastToIHeaderDictionary_Get_KnownProperty_ReturnDiagnostic()
Http\HeaderDictionaryIndexerFixerTests.cs (5)
15public async Task IHeaderDictionary_Get_MismatchCase_Fixed() 51public async Task IHeaderDictionary_Set_MismatchCase_Fixed() 87public async Task HeaderDictionary_CastToIHeaderDictionary_SetFromMethod_KnownProperty_Fix() 110public async Task HeaderDictionary_CastToIHeaderDictionary_GetToMethod_KnownProperty_Fix() 137public async Task HttpContext_GetToMethod_KnownProperty_Fix()
Http\RequestDelegateReturnTypeAnalyzerTests.cs (17)
14public async Task AnonymousDelegate_RequestDelegate_ThrowError_NoDiagnostics() 32public async Task AnonymousDelegate_RequestDelegate_ReturnNull_NoDiagnostics() 50public async Task AnonymousDelegate_RequestDelegate_ReturnType_EndpointCtor_ReportDiagnostics() 71public async Task AnonymousDelegate_RequestDelegate_ReturnType_AsTask_ReportDiagnostics() 90public async Task AnonymousDelegate_RequestDelegate_ReturnType_DelegateCtor_ReportDiagnostics() 113public async Task AnonymousDelegate_RequestDelegate_ReturnTypeMethodCall_ReportDiagnostics() 129public async Task AnonymousDelegate_RequestDelegate_ReturnTypeVariable_ReportDiagnostics() 149public async Task AnonymousDelegate_RequestDelegate_ReturnTypeTernary_ReportDiagnostics() 170public async Task AnonymousDelegate_RequestDelegate_ReturnTypeCoalesce_ReportDiagnostics() 191public async Task AnonymousDelegate_RequestDelegate_MultipleReturns_ReportDiagnostics() 219public async Task AnonymousDelegate_RequestDelegate_MixReturnValues_ReportDiagnostics() 247public async Task AnonymousDelegate_NotRequestDelegate_Async_HasReturnType_NoDiagnostics() 260public async Task AnonymousDelegate_RequestDelegate_Async_HasReturns_NoReturnType_NoDiagnostics() 285public async Task AnonymousDelegate_RequestDelegate_NoReturnType_NoDiagnostics() 298public async Task AnonymousDelegate_RequestDelegate_MultipleReturns_NoReturnType_NoDiagnostics() 321public async Task MethodReference_RequestDelegate_HasReturnType_ReportDiagnostics() 339public async Task MethodReference_RequestDelegate_NoReturnType_NoDiagnostics()
Infrastructure\WellKnownTypesTests.cs (2)
21public async Task ResolveAllWellKnownTypes() 43public async Task ResolveAllWellKnownTypes_ToleratesDuplicateTypeNames(string assemblyName)
Mvc\DetectAmbiguousActionRoutesTest.cs (31)
12public async Task SameRoutes_DifferentAction_HasDiagnostics() 44public async Task ActionReplacementToken_DifferentActionNames_NoDiagnostics() 71public async Task ActionReplacementToken_SameActionName_HasDiagnostics() 103public async Task ActionReplacementToken_ActionNameAttribute_HasDiagnostics() 136public async Task ActionReplacementToken_ActionNameAttributeNullValue_NoDiagnostics() 164public async Task ActionReplacementToken_OnController_NoDiagnostics() 192public async Task ActionReplacementToken_OnBaseController_NoDiagnostics() 223public async Task ActionReplacementToken_OnBaseControllerButOverridden_HasDiagnostics() 260public async Task ActionReplacementToken_OnController_ActionName_NoDiagnostics() 289public async Task ActionReplacementToken_OnController_ActionNameOnBase_NoDiagnostics() 322public async Task ActionRouteToken_DifferentActionNames_NoDiagnostics() 349public async Task ActionRouteToken_SameActionName_HasDiagnostics() 381public async Task ActionRouteToken_ActionNameAttribute_HasDiagnostics() 414public async Task ActionRouteToken_ActionNameAttributeNullValue_NoDiagnostics() 442public async Task ActionRouteToken_OnController_NoDiagnostics() 470public async Task ActionRouteToken_OnBaseController_NoDiagnostics() 501public async Task ActionRouteToken_OnBaseControllerButOverridden_HasDiagnostics() 538public async Task ActionRouteToken_OnController_ActionName_NoDiagnostics() 567public async Task ActionRouteToken_OnController_ActionNameOnBase_NoDiagnostics() 600public async Task MixedRoutes_DifferentAction_HasDiagnostics() 644public async Task SameRoutes_DifferentAction_HostAttribute_NoDiagnostics() 673public async Task SameRoutes_SameAction_HostAttribute_HasDiagnostics() 705public async Task SameRoutes_DifferentAction_AuthorizeAttribute_HasDiagnostics() 739public async Task SameRoutes_SameAction_AuthorizeAttribute_HasDiagnostics() 771public async Task DifferentRoutes_DifferentAction_NoDiagnostics() 798public async Task SameRoute_DifferentMethods_NoDiagnostics() 825public async Task SameRoute_DifferentMethods_Route_NoDiagnostics() 852public async Task DuplicateRoutes_SameAction_HasDiagnostics() 882public async Task DuplicateRoutes_HasHttpAttributes_NoDiagnostics() 913public async Task DuplicateRoutes_HasDuplicateHttpAttributes_HasDiagnostics() 947public async Task DuplicateRoutes_RouteAndGetVsGet_HasDiagnostics()
RouteEmbeddedLanguage\FrameworkParametersCompletionProviderTests.cs (39)
16public async Task Insertion_Space_Int_EndpointMapGet_HasDelegate_ReturnRouteParameterItem() 44public async Task Insertion_Space_DateTime_EndpointMapGet_HasDelegate_ReturnRouteParameterItem() 72public async Task Insertion_Space_NullableInt_CloseParen_EndpointMapGet_HasDelegate_ReturnRouteParameterItem() 100public async Task Insertion_Space_NullableInt_EndpointMapGet_HasDelegate_ReturnRouteParameterItem() 128public async Task Insertion_Space_OutInt_EndpointMapGet_HasDelegate_ReturnRouteParameterItem() 158public async Task Insertion_Space_Generic_EndpointMapGet_HasDelegate_ReturnRouteParameterItem() 186public async Task Invoke_Space_Generic_EndpointMapGet_HasDelegate_HasText_ReturnRouteParameterItem() 214public async Task Invoke_Space_Generic_EndpointMapGet_HasDelegate_InText_ReturnRouteParameterItem() 242public async Task Invoke_Space_Generic_EndpointMapGet_HasCompleteDelegate_InText_ReturnRouteParameterItem() 270public async Task Insertion_FirstArgument_SpaceAfterIdentifer_EndpointMapGet_HasDelegate_NoItems() 292public async Task Insertion_SecondArgument_SpaceAfterIdentifer_EndpointMapGet_HasDelegate_NoItems() 314public async Task Insertion_Space_MultipleArgs_EndpointMapGet_HasDelegate_ReturnRouteParameterItem() 339public async Task Insertion_Space_SystemString_EndpointMapGet_HasDelegate_ReturnRouteParameterItem() 364public async Task Insertion_Space_MultipleArgs_ParameterAlreadyUsed_EndpointMapGet_HasDelegate_NoItems() 386public async Task Insertion_Space_MultipleArgs_OneParameterAlreadyUsed_EndpointMapGet_HasDelegate_HasItems() 410public async Task Insertion_Space_MultipleParameters_EndpointMapGet_HasDelegate_HasItems() 435public async Task Insertion_Space_DuplicateParameters_EndpointMapGet_HasDelegate_HasItems() 459public async Task Insertion_Space_MultipleArgs_ParameterAlreadyUsed_EndpointMapGet_HasCompleteDelegate_NoItems() 481public async Task Insertion_Space_MultipleArgs_ParameterAlreadyUsed_DifferentCase_EndpointMapGet_HasCompleteDelegate_NoItems() 503public async Task Insertion_Space_CustomParsableType_EndpointMapGet_HasDelegate_HasItem() 536public async Task Insertion_Space_CustomParsableWithFormatType_EndpointMapGet_HasDelegate_HasItem() 569public async Task Insertion_Space_CustomParsableWithFormatType_NonPublic_EndpointMapGet_HasDelegate_NoItems() 600public async Task Insertion_Space_NonParsableType_EndpointMapGet_HasDelegate_NoItems() 641public async Task Insertion_Space_SupportedBuiltinTypes_EndpointMapGet_HasDelegate_HasItem(string parameterType) 674public async Task Insertion_Space_SpecialType_EndpointMapGet_HasDelegate_NoItems(string parameterType) 701public async Task Insertion_Space_EndpointMapGet_HasMethod_NoItems() 728public async Task Insertion_Space_EndpointMapGet_HasMethod_NamedParameters_ReturnDelegateParameterItem() 757public async Task Insertion_Space_EndpointMapGet_AsParameters_NoItem(string attributeName) 781public async Task Insertion_Space_EndpointMapGet_UnknownAttribute_ReturnItems() 806public async Task Insertion_Space_EndpointMapGet_NullDelegate_NoResults() 828public async Task Insertion_Space_EndpointMapGet_Incomplete_NoResults() 851public async Task Insertion_Space_CustomMapGet_ReturnDelegateParameterItem() 880public async Task Insertion_Space_CustomMapGet_NoRouteSyntax_NoItems() 907public async Task Insertion_Space_ControllerAction_HasParameter_ReturnActionParameterItem() 940public async Task Insertion_Space_ControllerAction_HasParameter_Incomplete_ReturnActionParameterItem() 970public async Task Invoke_ControllerAction_HasParameter_Incomplete_ReturnActionParameterItem() 1004public async Task Insertion_ControllerAction_HasParameter_Incomplete_NoItems() 1032public async Task Insertion_Space_ControllerAction_HasParameter_BeforeComma_ReturnActionParameterItem() 1065public async Task Insertion_Space_NonControllerAction_HasParameter_NoItems()
RouteEmbeddedLanguage\RouteParameterUnusedParameterFixerTest.cs (17)
14public async Task Controller_UnusedParameter_AddToAction() 68public async Task Controller_UnusedParameter_HasCancellationToken_AddToActionBeforeToken() 124public async Task Controller_UnusedParameter_BeforeExistingParameter_AddToActionBeforeExisting() 178public async Task Controller_MultipleUnusedParameters_AddToAction() 236public async Task Controller_MultipleUnusedParameters_WithConstraints_AddToAction() 294public async Task Controller_DuplicateUnusedParameters_AddToAction() 352public async Task MapGet_UnusedParameter_AddToLambda() 393public async Task MapGet_UnusedParameter_AddToRequestDelegateLambda() 438public async Task MapGet_UnusedParameter_IntPolicy_AddIntToLambda() 479public async Task MapGet_UnusedParameter_IntPolicy_IsOptional_AddNullableIntToLambda() 520public async Task MapGet_UnusedParameter_IsOptional_AddNullableStringToLambda() 561public async Task MapGet_UnusedParameter_IntAndDecimalPolicy_AddStringToLambda() 602public async Task MapGet_UnusedParameter_IntAndMinPolicy_AddStringToLambda() 643public async Task MapGet_UnusedParameter_BeforeExistingParameter_AddToLambdaBefore() 684public async Task MapGet_UnusedParameter_HasCancellationToken_AddToLambdaBeforeToken() 727public async Task MapGet_UnusedParameter_Multiple_HasCancellationToken_AddToLambdaBeforeToken() 773public async Task MapGet_UnusedParameter_AsParameters_HasCancellationToken_AddToLambdaBeforeToken()
RouteEmbeddedLanguage\RoutePatternAnalyzerTests.cs (19)
27public async Task CommentOnString_ReportResults() 51public async Task StringSyntax_AttributeProperty_ReportResults() 83public async Task StringSyntax_AttributeCtorArgument_ReportResults() 116public async Task StringSyntax_FieldSet_ReportResults() 144public async Task StringSyntax_PropertySet_ReportResults() 172public async Task StringSyntax_MethodArgument_ReportResults() 201public async Task StringSyntax_MethodArgument_MultipleResults() 238public async Task BadTokenReplacement_MethodArgument_MultipleResults() 264public async Task BadTokenReplacement_MvcAction_TokenReplacementDiagnostics() 300public async Task ControllerAction_UnusedRouteParameter_ReportedDiagnostics() 340public async Task ControllerAction_MatchRouteParameterWithFromRoute_NoDiagnostics() 374public async Task ControllerAction_MatchRouteParameterWithMultipleFromRoute_NoDiagnostics() 414public async Task MapGet_AsParameter_NoResults() 451public async Task MapGet_AsParameter_Extra_ReportedDiagnostics() 494public async Task ControllerAction_MatchedRouteParameter_NoDiagnostics() 528public async Task ConcatString_PerformanceTest() 567public async Task ConcatString_DetectLanguage_NoWarningsBecauseConcatString() 596public async Task NestedLangComment_NoWarningsBecauseConcatString() 622public async Task TopLangComment_NoWarningsBecauseConcatString()
RouteEmbeddedLanguage\RoutePatternBraceMatcherTests.cs (9)
14public async Task AfterLiteral_NoHighlight() 35public async Task BeforeParameterStart_CompleteParameter_HighlightBraces() 56public async Task BeforeParameterStart_IncompleteParameter_NoHighlight() 77public async Task BeforeArgumentStart_CompleteParenAndParameter_HighlightParens() 98public async Task BeforeArgumentStart_CompleteParenIncompleteParameter_HighlightParens() 119public async Task AfterParameterStart_CompleteParameter_NoHighlight() 140public async Task BeforeReplacementTokenStart_NotUsedWithMvc_NoHighlight() 161public async Task BeforeReplacementTokenStart_MvcAction_HighlightReplacementTokenBrackets() 185private async Task TestBraceMatchesAsync(string source)
RouteEmbeddedLanguage\RoutePatternClassifierTests.cs (6)
24protected async Task TestAsync( 44public async Task CommentOnString_Classified() 64public async Task AttributeOnField_Classified() 89public async Task AttributeOnField_TokenReplacementText_TokenReplacementNotClassified() 113public async Task AttributeOnAction_TokenReplacementText_TokenReplacementClassified() 135public async Task AttributeOnController_TokenReplacementText_TokenReplacementClassified()
RouteEmbeddedLanguage\RoutePatternCompletionProviderTests.cs (25)
18public async Task Insertion_Literal_NoItems() 43public async Task Insertion_PolicyColon_ReturnPolicies() 74public async Task Invoke_PolicyColon_ReturnPolicies() 99public async Task Invoke_Policy_HasText_ReturnPolicies() 128public async Task Invoke_Policy_InText_ReturnPolicies() 157public async Task Invoke_MultiplePolicy_HasText_ReturnPolicies() 186public async Task Insertion_PolicyColon_MultipleOverloads_ReturnPolicies() 214public async Task Insertion_ParameterOpenBrace_UnsupportedMethod_NoItems() 238public async Task Insertion_ParameterOpenBrace_EndpointMapGet_HasDelegate_ReturnDelegateParameterItem() 262public async Task Insertion_ParameterOpenBrace_EndpointMapGet_HasDelegate_FromRouteAttribute_ReturnDelegateParameterItem() 287public async Task Insertion_ParameterOpenBrace_EndpointMapGet_HasMethod_ReturnDelegateParameterItem() 316public async Task Insertion_ParameterOpenBrace_EndpointMapGet_HasMethod_HasStarted_ReturnDelegateParameterItem() 345public async Task Insertion_ParameterOpenBrace_EndpointMapGet_HasMethod_NamedParameters_ReturnDelegateParameterItem() 374public async Task Insertion_ParameterOpenBrace_EndpointMapGet_HasSpecialTypes_ExcludeSpecialTypes() 410public async Task Insertion_ParameterOpenBrace_EndpointMapGet_AsParameters_ReturnObjectParameterItem() 451public async Task Insertion_ParameterOpenBrace_EndpointMapGet_NullDelegate_NoResults() 473public async Task Insertion_ParameterOpenBrace_EndpointMapGet_Incomplete_NoResults() 495public async Task Insertion_ParameterOpenBrace_CustomMapGet_ReturnDelegateParameterItem() 524public async Task Insertion_ParameterOpenBrace_ParameterInUse_NoResults() 551public async Task Insertion_ParameterOpenBrace_ParameterInUse_DifferentCase_NoResults() 578public async Task Insertion_ParameterOpenBrace_OtherParameters_ReturnDelegateParameterItem() 607public async Task Insertion_ParameterOpenBrace_ControllerAction_HasParameter_ReturnActionParameterItem() 640public async Task Invoke_Comment_PolicyColon_ReturnHttpPolicies() 662public async Task Invoke_Comment_Http_PolicyColon_ReturnHttpPolicies() 684public async Task Invoke_Comment_Component_PolicyColon_ReturnComponentPolicies()
RouteEmbeddedLanguage\RoutePatternHighlighterTests.cs (19)
16public async Task AfterLiteral_NoHighlight() 37public async Task AfterParameterStart_NoHighlight() 58public async Task BeforeParameterName_CompleteParameter_HighlightName() 79public async Task BeforeParameterName_ParameterWithConstraint_HighlightName() 100public async Task MiddleParameterName_CompleteParameter_HighlightName() 121public async Task MiddleConstraint_ParameterWithConstraint_NoHighlight() 142public async Task InParameterName_ExtensionMethod_MatchingDelegate_HighlightParameter() 163public async Task InParameterName_ExtensionMethod_MatchingDelegate_RouteMetadataWithoutName_HighlightParameter() 185public async Task InParameterName_ExtensionMethod_MatchingDelegate_RouteMetadataWithName_HighlightParameter() 207public async Task InParameterName_ExtensionMethod_MatchingDelegate_RouteMetadataWithName_MultipleMatches_HighlightParameter() 229public async Task InParameterName_MatchingDelegate_HighlightParameter() 248public async Task InParameterName_MatchingDelegate_AsParameters_HighlightProperty() 279public async Task InParameterName_MatchingDelegate_AsParameters_DontHighlightArgument() 310public async Task InParameterName_MatchingMethod_HighlightParameter() 334public async Task InParameterName_MatchingAction_HighlightParameter() 362public async Task InParameterName_MatchingActionWithNamespace_HighlightParameter() 393public async Task InParameterName_NestedControllerMatchingAction_NoHighlight() 424public async Task InParameterName_MatchingDelegateWithConflictingIdentifer_DontHighlightConflict() 453private async Task TestHighlightingAsync(string source)
RouteHandlers\AtMostOneFromBodyAttributeTest.cs (6)
15public async Task Handler_With_No_FromBody_Attributes_Works() 33public async Task Handler_With_One_FromBody_Attributes_Works() 52public async Task Handler_With_Two_FromBody_Attributes_Fails() 78public async Task MethodGroup_Handler_With_Two_FromBody_Attributes_Fails() 111public async Task Handler_Handler_With_AsParameters_Argument_With_TwoFromBody_Attributes_Fails() 147public async Task Handler_Handler_With_AsParameters_Argument_With_OneFromBody_Attributes_Works()
RouteHandlers\DetectAmbiguousMappedRoutesTest.cs (20)
12public async Task DuplicateRoutes_SameHttpMethod_HasDiagnostics() 33public async Task DuplicateRoutes_SameHttpMethod_HasRequestDelegate_HasDiagnostics() 56public async Task DuplicateRoutes_SameHttpMethod_InMethod_HasDiagnostics() 84public async Task DuplicateRoutes_TernaryStatement_NoDiagnostics() 101public async Task DuplicateRoutes_SwitchStatement_NoDiagnostics() 125public async Task DuplicateRoutes_InsideSwitchStatement_HasDiagnostics() 153public async Task DuplicateRoutes_SwitchExpression_NoDiagnostics() 174public async Task DuplicateRoutes_NullCoalescing_NoDiagnostics() 189public async Task DuplicateRoutes_NullCoalescingAssignment_NoDiagnostics() 205public async Task DuplicateRoutes_DifferentMethods_HasDiagnostics() 221public async Task DuplicateMapGetRoutes_InsideConditional_NoDiagnostics() 243public async Task DuplicateMapGetRoutes_DuplicatesInsideConditional_NoDiagnostics() 267public async Task DuplicateRoutes_UnknownUsageOfEndConventionBuilderExtension_NoDiagnostics() 291public async Task DuplicateRoutes_UnknownUsageOfEndConventionBuilder_NoDiagnostics() 315public async Task DuplicateRoutes_AddMethod_NoDiagnostics() 331public async Task DuplicateRoutes_AssignedToVariable_NoDiagnostics() 347public async Task DuplicateRoutes_MultipleGroups_NoDiagnostics() 365public async Task DuplicateRoutes_EndpointsOnGroup_HasDiagnostics() 398public async Task DuplicateRoutes_AllowedBuilderExtensionMethods_HasDiagnostics(string method) 425public async Task DuplicateRoutes_UnknownBuilderExtensionMethods_NoDiagnostics(string method)
RouteHandlers\DetectMismatchedParameterOptionalityTest.cs (14)
14public async Task MatchingRequiredOptionality_CanBeFixed() 36public async Task MatchingMultipleRequiredOptionality_CanBeFixed() 62public async Task MatchingSingleRequiredOptionality_CanBeFixed() 84public async Task MismatchedOptionalityInMethodGroup_CanBeFixed() 112public async Task MismatchedOptionalityInMethodGroupFromPartialMethod_CanBeFixed() 167public async Task MismatchedOptionalityInSeparateSource_CanBeFixed() 208public async Task MatchingRequiredOptionality_DoesNotProduceDiagnostics() 223public async Task ParameterFromRouteOrQuery_DoesNotProduceDiagnostics() 238public async Task MatchingOptionality_DoesNotProduceDiagnostics() 253public async Task RequiredRouteParamOptionalArgument_DoesNotProduceDiagnostics() 268public async Task OptionalRouteParamRequiredArgument_WithFromRoute_ProducesDiagnostics() 295public async Task OptionalRouteParamRequiredArgument_WithRegexConstraint_ProducesDiagnostics() 319public async Task OptionalRouteParamRequiredArgument_WithTypeConstraint_ProducesDiagnostics() 344public async Task MatchingRequiredOptionality_WithDisabledNullability()
RouteHandlers\DetectMisplacedLambdaAttributeTest.cs (10)
14public async Task MinimalAction_WithCorrectlyPlacedAttribute_Works() 32public async Task MinimalAction_WithMisplacedAttribute_ProducesDiagnostics() 54public async Task MinimalAction_WithMisplacedAttributeAndBlockSyntax_ProducesDiagnostics() 76public async Task MinimalAction_WithMultipleMisplacedAttributes_ProducesDiagnostics() 110public async Task MinimalAction_WithSingleMisplacedAttribute_ProducesDiagnostics() 137public async Task MinimalAction_DoesNotWarnOnNonReturningMethods() 157public async Task MinimalAction_DoesNotWarnOrErrorOnNonExistantLambdas() 174public async Task MinimalAction_WithMisplacedAttributeOnMethodGroup_DoesNotProduceDiagnostics() 193public async Task MinimalAction_WithMisplacedAttributeOnExternalReference_DoesNotProduceDiagnostics() 224public async Task MinimalAction_OutOfScope_ProducesDiagnostics()
RouteHandlers\DisallowMvcBindArgumentsOnParametersTest.cs (4)
14public async Task MinimalAction_WithoutBindAttributes_Works() 30public async Task MinimalAction_WithAllowedMvcAttributes_Works() 47public async Task MinimalAction_Lambda_WithBindAttributes_ProducesDiagnostics() 67public async Task MinimalAction_MethodReference_WithBindAttributes_ProducesDiagnostics()
RouteHandlers\DisallowNonParsableComplexTypesOnParametersTest.cs (29)
15public async Task Route_Parameter_withoutComplexTypes_Works() 29public async Task QueryString_Parameter_withString_Works() 46public async Task QueryString_Parameter_withNullableString_Works() 63public async Task QueryString_Parameter_withStringArray_Works() 80public async Task QueryString_Parameter_withUri_Works() 98public async Task QueryString_Parameter_withNullableUri_Works() 116public async Task QueryString_Parameter_withUriArray_Works() 134public async Task QueryString_Parameter_withInt_Works() 151public async Task QueryString_Parameter_withNullableInt_Works() 168public async Task QueryString_Parameter_withIntArray_Works() 185public async Task Route_Parameter_withNonParsableComplexType_Fails() 207public async Task Route_Parameter_withNameChanged_viaFromRoute_whenNotParsable_Fails() 230public async Task Route_Parameter_withTwoReceivingHandlerParameters_Works() 255public async Task Route_Parameter_withNameChanged_viaFromRoute_whenParsable_Works() 292public async Task Route_Parameter_withBindAsyncMethod_Fails() 320public async Task Route_Parameter_withParsableComplexType_viaImplicitIParsable_Works() 357public async Task Route_Parameter_withParsableComplexType_viaExplicitIParsable_Works() 400public async Task Route_Parameter_withParsableComplexType_viaMethodConvention_Works() 425public async Task Route_Parameter_withHttpContextBindableComplexType_viaImplicitIBindableFromHttp_Fails() 456public async Task Route_Parameter_withHttpContextBindableComplexType_viaExplicitIBindableFromHttp_Fails() 487public async Task Route_Parameter_withNullableType_Works() 503public async Task Handler_Parameter_withFromBodyAttribute_Works() 526public async Task Handler_Parameter_withBindableComplexType_viaMethodConvention_Works() 555public async Task Handler_Parameter_withBindableComplexType_viaMethodConventionWithParameterInfo_Works() 585public async Task Handler_Parameter_withWellKnownTypes_Works() 617public async Task Handler_Parameter_with_FromService_Attribute_Works() 642public async Task Handler_Parameter_withServiceInterface_Works() 664public async Task Route_Parameter_withAbstractBaseType_Works() 704public async Task Route_Parameter_withInterfaceType_Works()
RouteHandlers\DisallowReturningActionResultsFromMapMethodsTest.cs (10)
14public async Task MinimalAction_ReturningIResult_Works() 33public async Task MinimalAction_ReturningCustomIResult_Works() 58public async Task MinimalAction_ReturningIResultConditionallyWorks() 86public async Task MinimalAction_ReturningTypeThatImplementsIResultAndActionResultDoesNotProduceDiagnostics() 113public async Task MinimalAction_ReturningActionResult_ProducesDiagnostics() 136public async Task MinimalAction_ReturningActionResultConditionally_ProducesDiagnostics() 159public async Task MinimalAction_ReturningActionResultFromMethodReference_ProducesDiagnostics() 187public async Task MinimalAction_ReturningActionResultOfTFromMethodReference_ProducesDiagnostics() 219public async Task MinimalAction_ReturningActionResultOfTFromANonLocalFunction_ProducesDiagnostics() 257public async Task MinimalAction_ReturningActionResultOfTDeclarationInDifferentFile_ProducesDiagnostics()
TestDiagnosticAnalyzer.cs (1)
127var parts = Task.Run(() => discovery.CreatePartsAsync(assemblies)).GetAwaiter().GetResult();
Verifiers\CSharpAnalyzerVerifier.cs (1)
33public static async Task VerifyAnalyzerAsync(string source, params DiagnosticResult[] expected)
Verifiers\CSharpCodeFixVerifier.cs (4)
30public static async Task VerifyAnalyzerAsync(string source, params DiagnosticResult[] expected) 47public static async Task VerifyCodeFixAsync(string source, string fixedSource) 51public static async Task VerifyCodeFixAsync(string source, DiagnosticResult expected, string fixedSource) 55public static async Task VerifyCodeFixAsync(string source, DiagnosticResult[] expected, string fixedSource, int? expectedIterations = null, string usageSource = null, string codeActionEquivalenceKey = null)
WebApplicationBuilder\DisallowConfigureAppConfigureHostBuilderTest.cs (9)
14public async Task ConfigurationBuilderRunsWithoutDiagnostic() 29public async Task ConfigureAppHostBuilderProducesDiagnostic() 54public async Task ConfigureHostHostBuilderProducesDiagnostic() 77public async Task ConfigureAppWebHostBuilderProducesDiagnostic() 102public async Task ConfigureAppWebHostBuilderProducesDiagnosticInMain() 137public async Task TwoInvocationsProduceTwoDiagnostic() 167public async Task TwoMethodsInArgumentsProducesTwoProperties() 192public async Task WarnsWhenConfigureAppConfigurationIsCalledWhenChainedWithCreateBuilder() 212public async Task WarnsWhenConfigureAppConfigurationIsCalledAsAnArgument()
WebApplicationBuilder\DisallowConfigureHostBuilderConfigureWebHostTest.cs (10)
14public async Task WebApplicationBuilder_HostWithoutConfigureWebHost_Works() 31public async Task WebApplicationBuilder_HostWithConfigureWebHost_ProducesDiagnostics() 51public async Task WebApplicationBuilder_HostWithConfigureWebHost_ProducesDiagnostics_OnDifferentLine() 72public async Task WebApplicationBuilder_HostWithConfigureWebHost_ProducesDiagnostics_WhenChained() 94public async Task WebApplicationBuilder_HostWithConfigureWebHost_DoesNotProduceDiagnostics_WhenChained() 113public async Task WebApplicationBuilder_HostWithConfigureWebHostWithOptions_ProducesDiagnostics() 134public async Task WebApplicationBuilder_WebHostWithConfigureWebHostOnProperty_ProducesDiagnostics_In_Program_Main() 162public async Task WebApplicationBuilder_WebHostWithConfigureWebHostOnBuilder_ProducesDiagnostics_In_Program_Main() 191public async Task WebApplicationBuilder_WebHostWithConfigureWebHostInsideOtherMethod_ProducesDiagnostics_In_Program_Main() 225public async Task HostBuilder_ConfigureWebHost_DoesNotProduceDiagnostic()
WebApplicationBuilder\DisallowConfigureHostLoggingTest.cs (12)
18public async Task DoesNotWarnWhenBuilderLoggingIsUsed() 34public async Task DoesNotWarnWhenBuilderLoggingIsUsed_InMain() 58public async Task WarnsWhenBuilderLoggingIsNotUsed_Host() 85public async Task WarnsWhenBuilderLoggingIsNotUsed_WebHost() 114public async Task WarnsWhenBuilderLoggingIsNotUsed_OnDifferentLine_Host() 141public async Task WarnsWhenBuilderLoggingIsNotUsed_OnDifferentLine_WebHost() 171public async Task WarnsWhenBuilderLoggingIsNotUsed_InMain_Host() 212public async Task WarnsWhenBuilderLoggingIsNotUsed_InMain_WebHost() 255public async Task WarnsWhenBuilderLoggingIsNotUsed_WhenChained_WebHost() 279public async Task WarnsTwiceWhenBuilderLoggingIsNotUsed_Host() 311public async Task WarnsWhenConfigureLoggingIsCalledWhenChainedWithCreateBuilder() 333public async Task WarnsWhenConfigureLoggingIsCalledAsAnArgument()
WebApplicationBuilder\DisallowConfigureServicesTest.cs (10)
18public async Task DoesNotWarnWhenBuilderConfigureServicesIsNotUsed() 34public async Task WarnsWhenBuilderHostConfigureServicesIsUsed() 61public async Task WarnsWhenBuilderWebHostConfigureServicesIsUsed() 88public async Task WarnsWhenBuilderHostConfigureServicesIsUsed_OnDifferentLine() 116public async Task WarnsWhenBuilderWebHostConfigureServicesIsUsed_OnDifferentLine() 144public async Task DoesNotWarnWhenBuilderConfigureServicesIsNotUsed_InProgramMain() 170public async Task WarnsWhenBuilderHostConfigureServicesIsUsedOnProperty_In_Program_Main() 211public async Task WarnsWhenBuilderWebHostConfigureServicesIsUsedOnProperty_In_Program_Main() 252public async Task WarnsWhenBuilderHostConfigureServicesIsUsed_Inside_Another_Method() 290public async Task WarnsTwiceWhenBuilderLoggingIsNotUsed_Host()
WebApplicationBuilder\DisallowConfigureWebHostBuilderConfigureTest.cs (7)
14public async Task WebApplicationBuilder_WebHostWithoutConfigure_Works() 32public async Task WebApplicationBuilder_WebHostWithConfigure_ProducesDiagnostics() 53public async Task WebApplicationBuilder_WebHostWithConfigureWithContext_ProducesDiagnostics() 74public async Task WebApplicationBuilder_WebHostWithConfigureOnProperty_ProducesDiagnostics_In_Program_Main() 101public async Task WebApplicationBuilder_WebHostWithConfigureOnBuilder_ProducesDiagnostics_In_Program_Main() 129public async Task HostBuilder_WebHostBuilder_Configure_DoesNotProduceDiagnostic() 146public async Task WebHostBuilder_Configure_DoesNotProduceDiagnostic()
WebApplicationBuilder\DisallowConfigureWebHostBuilderUseStartupTest.cs (9)
14public async Task WebApplicationBuilder_WebHostWithoutUseStartup_Works() 31public async Task WebApplicationBuilder_WebHostWithoutUseStartupGenericType_ProducesDiagnostics() 52public async Task WebApplicationBuilder_WebHostWithoutUseStartupType_ProducesDiagnostics() 73public async Task WebApplicationBuilder_WebHostWithoutUseStartupString_ProducesDiagnostics() 93public async Task WebApplicationBuilder_WebHostWithoutUseStartupGenericTypeWithContext_ProducesDiagnostics() 114public async Task WebApplicationBuilder_WebHostWithUseStartupOnProperty_ProducesDiagnostics_In_Program_Main() 141public async Task WebApplicationBuilder_WebHostWithUseStartupOnBuilder_ProducesDiagnostics_In_Program_Main() 169public async Task HostBuilder_WebHostBuilder_UseStartup_DoesNotProduceDiagnostic() 190public async Task WebHostBuilder_UseStartup_DoesNotProduceDiagnostic()
WebApplicationBuilder\UseTopLevelRouteRegistrationInsteadOfUseEndpointsTest.cs (9)
20public async Task DoesNotWarnWhenEndpointRegistrationIsTopLevel() 38public async Task DoesNotWarnWhenEndpointRegistrationIsTopLevel_InMain() 62public async Task DoesNotWarnWhenEndpointRegistrationIsNotTopLevel_NoInvocation() 80public async Task DoesNotWarnWhenEndpointRegistrationIsNotTopLevel_NoInvocation_InMain() 104public async Task WarnsWhenEndpointRegistrationIsNotTopLevel() 128public async Task WarnsWhenEndpointRegistrationIsNotTopLevel_OtherMapMethods() 181public async Task WarnsWhenEndpointRegistrationIsNotTopLevel_InMain_MapControllers() 213public async Task WarnsWhenEndpointRegistrationIsNotTopLevel_OnDifferentLine_WithRouteParameters() 239public async Task WarnsTwiceWhenEndpointRegistrationIsNotTopLevel_OnDifferentLine()
Microsoft.AspNetCore.App.CodeFixes (14)
Authorization\AddAuthorizationBuilderFixer.cs (2)
27public override async Task RegisterCodeFixesAsync(CodeFixContext context) 138return Task.FromResult(document.WithSyntaxRoot(
DetectMismatchedParameterOptionalityFixer.cs (2)
23public sealed override Task RegisterCodeFixesAsync(CodeFixContext context) 34return Task.CompletedTask;
Http\HeaderDictionaryAddFixer.cs (3)
28public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 74return Task.FromResult(document.WithSyntaxRoot( 103return Task.FromResult(document.WithSyntaxRoot(root.ReplaceNode(diagnosticTarget, assignment)));
Http\HeaderDictionaryIndexerFixer.cs (2)
23public sealed override Task RegisterCodeFixesAsync(CodeFixContext context) 39return Task.CompletedTask;
RouteParameterUnusedParameterFixer.cs (3)
29public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 68return Task.FromResult(document); 71return Task.FromResult(UpdateDocument(diagnostic, root, document, routeUsage.UsageContext.MethodSyntax));
WebApplicationBuilderFixer.cs (2)
29public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 81return Task.FromResult(document.WithSyntaxRoot(root.ReplaceNode(diagnosticTarget, invocation)));
Microsoft.AspNetCore.Authentication (32)
AuthenticationHandler.cs (11)
147public async Task InitializeAsync(AuthenticationScheme scheme, HttpContext context) 169protected virtual async Task InitializeEventsAsync() 183protected virtual Task<object> CreateEventsAsync() => Task.FromResult(new object()); 189protected virtual Task InitializeHandlerAsync() => Task.CompletedTask; 286protected virtual Task HandleForbiddenAsync(AuthenticationProperties properties) 289return Task.CompletedTask; 299protected virtual Task HandleChallengeAsync(AuthenticationProperties properties) 302return Task.CompletedTask; 306public async Task ChallengeAsync(AuthenticationProperties? properties) 321public async Task ForbidAsync(AuthenticationProperties? properties)
AuthenticationMiddleware.cs (1)
40public async Task Invoke(HttpContext context)
Events\RemoteAuthenticationEvents.cs (9)
14public Func<AccessDeniedContext, Task> OnAccessDenied { get; set; } = context => Task.CompletedTask; 19public Func<RemoteFailureContext, Task> OnRemoteFailure { get; set; } = context => Task.CompletedTask; 24public Func<TicketReceivedContext, Task> OnTicketReceived { get; set; } = context => Task.CompletedTask; 29public virtual Task AccessDenied(AccessDeniedContext context) => OnAccessDenied(context); 34public virtual Task RemoteFailure(RemoteFailureContext context) => OnRemoteFailure(context); 39public virtual Task TicketReceived(TicketReceivedContext context) => OnTicketReceived(context);
PolicySchemeHandler.cs (4)
37protected override Task HandleChallengeAsync(AuthenticationProperties? properties) 41protected override Task HandleForbiddenAsync(AuthenticationProperties? properties) 45protected override Task HandleSignInAsync(ClaimsPrincipal user, AuthenticationProperties? properties) 49protected override Task HandleSignOutAsync(AuthenticationProperties? properties)
RemoteAuthenticationHandler.cs (3)
62=> Task.FromResult<object>(new RemoteAuthenticationEvents()); 69=> Task.FromResult(Options.CallbackPath == Request.Path); 219protected override Task HandleForbiddenAsync(AuthenticationProperties properties)
SignInAuthenticationHandler.cs (2)
38public virtual Task SignInAsync(ClaimsPrincipal user, AuthenticationProperties? properties) 52protected abstract Task HandleSignInAsync(ClaimsPrincipal user, AuthenticationProperties? properties);
SignOutAuthenticationHandler.cs (2)
37public virtual Task SignOutAsync(AuthenticationProperties? properties) 49protected abstract Task HandleSignOutAsync(AuthenticationProperties? properties);
Microsoft.AspNetCore.Authentication.Abstractions (25)
AuthenticationHttpContextExtensions.cs (16)
41public static Task ChallengeAsync(this HttpContext context, string? scheme) => 51public static Task ChallengeAsync(this HttpContext context) => 62public static Task ChallengeAsync(this HttpContext context, AuthenticationProperties? properties) => 73public static Task ChallengeAsync(this HttpContext context, string? scheme, AuthenticationProperties? properties) => 83public static Task ForbidAsync(this HttpContext context, string? scheme) => 93public static Task ForbidAsync(this HttpContext context) => 104public static Task ForbidAsync(this HttpContext context, AuthenticationProperties? properties) => 115public static Task ForbidAsync(this HttpContext context, string? scheme, AuthenticationProperties? properties) => 125public static Task SignInAsync(this HttpContext context, string? scheme, ClaimsPrincipal principal) => 135public static Task SignInAsync(this HttpContext context, ClaimsPrincipal principal) => 146public static Task SignInAsync(this HttpContext context, ClaimsPrincipal principal, AuthenticationProperties? properties) => 157public static Task SignInAsync(this HttpContext context, string? scheme, ClaimsPrincipal principal, AuthenticationProperties? properties) => 166public static Task SignOutAsync(this HttpContext context) => context.SignOutAsync(scheme: null, properties: null); 175public static Task SignOutAsync(this HttpContext context, AuthenticationProperties? properties) => context.SignOutAsync(scheme: null, properties: properties); 183public static Task SignOutAsync(this HttpContext context, string? scheme) => context.SignOutAsync(scheme, properties: null); 192public static Task SignOutAsync(this HttpContext context, string? scheme, AuthenticationProperties? properties) =>
IAuthenticationHandler.cs (3)
18Task InitializeAsync(AuthenticationScheme scheme, HttpContext context); 30Task ChallengeAsync(AuthenticationProperties? properties); 36Task ForbidAsync(AuthenticationProperties? properties);
IAuthenticationService.cs (4)
30Task ChallengeAsync(HttpContext context, string? scheme, AuthenticationProperties? properties); 40Task ForbidAsync(HttpContext context, string? scheme, AuthenticationProperties? properties); 50Task SignInAsync(HttpContext context, string? scheme, ClaimsPrincipal principal, AuthenticationProperties? properties); 59Task SignOutAsync(HttpContext context, string? scheme, AuthenticationProperties? properties);
IAuthenticationSignInHandler.cs (1)
19Task SignInAsync(ClaimsPrincipal user, AuthenticationProperties? properties);
IAuthenticationSignOutHandler.cs (1)
16Task SignOutAsync(AuthenticationProperties? properties);
Microsoft.AspNetCore.Authentication.BearerToken (7)
BearerTokenEvents.cs (3)
14public Func<MessageReceivedContext, Task> OnMessageReceived { get; set; } = context => Task.CompletedTask; 20public virtual Task MessageReceivedAsync(MessageReceivedContext context) => OnMessageReceived(context);
BearerTokenHandler.cs (4)
58protected override Task HandleChallengeAsync(AuthenticationProperties properties) 64protected override async Task HandleSignInAsync(ClaimsPrincipal user, AuthenticationProperties? properties) 92protected override Task HandleSignOutAsync(AuthenticationProperties? properties) => Task.CompletedTask;
Microsoft.AspNetCore.Authentication.Certificate (12)
CertificateAuthenticationHandler.cs (3)
40protected override Task<object> CreateEventsAsync() => Task.FromResult<object>(new CertificateAuthenticationEvents()); 42protected override Task InitializeHandlerAsync() 172protected override async Task HandleChallengeAsync(AuthenticationProperties properties)
Events\CertificateAuthenticationEvents.cs (9)
16public Func<CertificateAuthenticationFailedContext, Task> OnAuthenticationFailed { get; set; } = context => Task.CompletedTask; 26public Func<CertificateValidatedContext, Task> OnCertificateValidated { get; set; } = context => Task.CompletedTask; 31public Func<CertificateChallengeContext, Task> OnChallenge { get; set; } = context => Task.CompletedTask; 38public virtual Task AuthenticationFailed(CertificateAuthenticationFailedContext context) => OnAuthenticationFailed(context); 45public virtual Task CertificateValidated(CertificateValidatedContext context) => OnCertificateValidated(context); 50public virtual Task Challenge(CertificateChallengeContext context) => OnChallenge(context);
Microsoft.AspNetCore.Authentication.Cookies (43)
CookieAuthenticationEvents.cs (27)
17public Func<CookieValidatePrincipalContext, Task> OnValidatePrincipal { get; set; } = context => Task.CompletedTask; 22public Func<CookieSlidingExpirationContext, Task> OnCheckSlidingExpiration { get; set; } = context => Task.CompletedTask; 27public Func<CookieSigningInContext, Task> OnSigningIn { get; set; } = context => Task.CompletedTask; 32public Func<CookieSignedInContext, Task> OnSignedIn { get; set; } = context => Task.CompletedTask; 37public Func<CookieSigningOutContext, Task> OnSigningOut { get; set; } = context => Task.CompletedTask; 42public Func<RedirectContext<CookieAuthenticationOptions>, Task> OnRedirectToLogin { get; set; } = context => 53return Task.CompletedTask; 59public Func<RedirectContext<CookieAuthenticationOptions>, Task> OnRedirectToAccessDenied { get; set; } = context => 70return Task.CompletedTask; 76public Func<RedirectContext<CookieAuthenticationOptions>, Task> OnRedirectToLogout { get; set; } = context => 86return Task.CompletedTask; 92public Func<RedirectContext<CookieAuthenticationOptions>, Task> OnRedirectToReturnUrl { get; set; } = context => 102return Task.CompletedTask; 115public virtual Task ValidatePrincipal(CookieValidatePrincipalContext context) => OnValidatePrincipal(context); 121public virtual Task CheckSlidingExpiration(CookieSlidingExpirationContext context) => OnCheckSlidingExpiration(context); 127public virtual Task SigningIn(CookieSigningInContext context) => OnSigningIn(context); 133public virtual Task SignedIn(CookieSignedInContext context) => OnSignedIn(context); 139public virtual Task SigningOut(CookieSigningOutContext context) => OnSigningOut(context); 145public virtual Task RedirectToLogout(RedirectContext<CookieAuthenticationOptions> context) => OnRedirectToLogout(context); 151public virtual Task RedirectToLogin(RedirectContext<CookieAuthenticationOptions> context) => OnRedirectToLogin(context); 157public virtual Task RedirectToReturnUrl(RedirectContext<CookieAuthenticationOptions> context) => OnRedirectToReturnUrl(context); 163public virtual Task RedirectToAccessDenied(RedirectContext<CookieAuthenticationOptions> context) => OnRedirectToAccessDenied(context);
CookieAuthenticationHandler.cs (10)
69protected override Task InitializeHandlerAsync() 73return Task.CompletedTask; 80protected override Task<object> CreateEventsAsync() => Task.FromResult<object>(new CookieAuthenticationEvents()); 92private async Task CheckForRefreshAsync(AuthenticationTicket ticket) 239protected virtual async Task FinishResponseAsync() 291protected override async Task HandleSignInAsync(ClaimsPrincipal user, AuthenticationProperties? properties) 381protected override async Task HandleSignOutAsync(AuthenticationProperties? properties) 416private async Task ApplyHeaders(bool shouldRedirect, bool shouldHonorReturnUrlParameter, AuthenticationProperties properties) 462protected override async Task HandleForbiddenAsync(AuthenticationProperties properties) 475protected override async Task HandleChallengeAsync(AuthenticationProperties properties)
ITicketStore.cs (6)
45Task RenewAsync(string key, AuthenticationTicket ticket); 54Task RenewAsync(string key, AuthenticationTicket ticket, CancellationToken cancellationToken) => RenewAsync(key, ticket); 64Task RenewAsync(string key, AuthenticationTicket ticket, HttpContext httpContext, CancellationToken cancellationToken) => RenewAsync(key, ticket, cancellationToken); 95Task RemoveAsync(string key); 103Task RemoveAsync(string key, CancellationToken cancellationToken) => RemoveAsync(key); 112Task RemoveAsync(string key, HttpContext httpContext, CancellationToken cancellationToken) => RemoveAsync(key, cancellationToken);
Microsoft.AspNetCore.Authentication.Core (10)
AuthenticationSchemeProvider.cs (5)
50private static readonly Task<AuthenticationScheme?> _nullScheme = Task.FromResult<AuthenticationScheme?>(null); 123=> Task.FromResult(_schemes.TryGetValue(name, out var scheme) ? scheme : null); 130=> Task.FromResult(_requestHandlersCopy); 208=> Task.FromResult(_schemesCopy); 216_autoDefaultScheme = Task.FromResult<AuthenticationScheme?>(_schemesCopy.First());
AuthenticationService.cs (4)
107public virtual async Task ChallengeAsync(HttpContext context, string? scheme, AuthenticationProperties? properties) 135public virtual async Task ForbidAsync(HttpContext context, string? scheme, AuthenticationProperties? properties) 164public virtual async Task SignInAsync(HttpContext context, string? scheme, ClaimsPrincipal principal, AuthenticationProperties? properties) 212public virtual async Task SignOutAsync(HttpContext context, string? scheme, AuthenticationProperties? properties)
NoopClaimsTransformation.cs (1)
20return Task.FromResult(principal);
Microsoft.AspNetCore.Authentication.Core.Test (86)
AuthenticationSchemeProviderTests.cs (17)
15public async Task NoDefaultsWithoutAutoDefaultScheme() 28public async Task NoDefaultsWithMoreSchemes() 41public async Task DefaultSchemesUsesSingleScheme() 57public async Task DefaultSchemesFallbackToDefaultScheme() 75public async Task DefaultSignOutFallsbackToSignIn() 91public async Task DefaultForbidFallsbackToChallenge() 107public async Task DefaultSchemesAreSet() 132public async Task SignOutWillDefaultsToSignInThatDoesNotSignOut() 176public async Task LookupUsesProvidedStringComparer() 195public async Task AutoDefaultSchemeAddRemoveWorks() 247private async Task VerifyAllDefaults(IAuthenticationSchemeProvider provider, AuthenticationScheme? expected) 263public Task ChallengeAsync(AuthenticationProperties? properties) 268public Task ForbidAsync(AuthenticationProperties? properties) 273public Task InitializeAsync(AuthenticationScheme scheme, HttpContext context) 281public Task SignInAsync(ClaimsPrincipal user, AuthenticationProperties? properties) 286public Task SignOutAsync(AuthenticationProperties? properties) 294public Task SignOutAsync(AuthenticationProperties? properties)
AuthenticationServiceTests.cs (60)
13public async Task AuthenticateThrowsForSchemeMismatch() 28public async Task CustomHandlersAuthenticateRunsClaimsTransformationEveryTime() 52public async Task ChallengeThrowsForSchemeMismatch() 67public async Task ForbidThrowsForSchemeMismatch() 82public async Task CanOnlySignInWithIsAuthenticated() 96public async Task CanSignInWithoutIsAuthenticated() 111public async Task CanOnlySignInIfSupported() 134public async Task CanOnlySignOutIfSupported() 155public async Task ServicesWithDefaultIAuthenticationHandlerMethodsTest() 175public async Task ServicesWithDefaultUberMethodsTest() 193public async Task ServicesWithDefaultSignInMethodsTest() 211public async Task ServicesWithDefaultSignOutMethodsTest() 230public async Task ServicesWithDefaultForbidMethod_CallsForbidMethod() 249return Task.FromResult(new ClaimsPrincipal()); 257return Task.FromResult(AuthenticateResult.Success( 264public Task ChallengeAsync(AuthenticationProperties? properties) 266return Task.FromResult(0); 269public Task ForbidAsync(AuthenticationProperties? properties) 271return Task.FromResult(0); 274public Task InitializeAsync(AuthenticationScheme scheme, HttpContext context) 276return Task.FromResult(0); 284return Task.FromResult(AuthenticateResult.NoResult()); 287public Task ChallengeAsync(AuthenticationProperties? properties) 289return Task.FromResult(0); 292public Task ForbidAsync(AuthenticationProperties? properties) 294return Task.FromResult(0); 297public Task InitializeAsync(AuthenticationScheme scheme, HttpContext context) 299return Task.FromResult(0); 302public Task SignInAsync(ClaimsPrincipal user, AuthenticationProperties? properties) 304return Task.FromResult(0); 307public Task SignOutAsync(AuthenticationProperties? properties) 309return Task.FromResult(0); 317return Task.FromResult(AuthenticateResult.NoResult()); 320public Task ChallengeAsync(AuthenticationProperties? properties) 322return Task.FromResult(0); 325public Task ForbidAsync(AuthenticationProperties? properties) 327return Task.FromResult(0); 330public Task InitializeAsync(AuthenticationScheme scheme, HttpContext context) 332return Task.FromResult(0); 335public Task SignOutAsync(AuthenticationProperties? properties) 337return Task.FromResult(0); 345return Task.FromResult(AuthenticateResult.NoResult()); 348public Task ChallengeAsync(AuthenticationProperties? properties) 350return Task.FromResult(0); 353public Task ForbidAsync(AuthenticationProperties? properties) 355return Task.FromResult(0); 360return Task.FromResult(false); 363public Task InitializeAsync(AuthenticationScheme scheme, HttpContext context) 365return Task.FromResult(0); 368public Task SignInAsync(ClaimsPrincipal user, AuthenticationProperties? properties) 370return Task.FromResult(0); 373public Task SignOutAsync(AuthenticationProperties? properties) 375return Task.FromResult(0); 386public Task ChallengeAsync(AuthenticationProperties? properties) 391public Task ForbidAsync(AuthenticationProperties? properties) 393return Task.FromResult(0); 401public Task InitializeAsync(AuthenticationScheme scheme, HttpContext context) 403return Task.FromResult(0); 406public Task SignInAsync(ClaimsPrincipal user, AuthenticationProperties? properties) 411public Task SignOutAsync(AuthenticationProperties? properties)
TokenExtensionTests.cs (9)
123public async Task GetTokenWorksWithDefaultAuthenticateScheme() 140public async Task GetTokenWorksWithExplicitScheme() 165return Task.FromResult(AuthenticateResult.Success(new AuthenticationTicket(new ClaimsPrincipal(), props, "simple"))); 168public Task ChallengeAsync(AuthenticationProperties? properties) 173public Task ForbidAsync(AuthenticationProperties? properties) 178public Task InitializeAsync(AuthenticationScheme scheme, HttpContext context) 180return Task.FromResult(0); 183public Task SignInAsync(ClaimsPrincipal user, AuthenticationProperties properties) 188public Task SignOutAsync(AuthenticationProperties properties)
Microsoft.AspNetCore.Authentication.JwtBearer (18)
JwtBearerEvents.cs (15)
14public Func<AuthenticationFailedContext, Task> OnAuthenticationFailed { get; set; } = context => Task.CompletedTask; 19public Func<ForbiddenContext, Task> OnForbidden { get; set; } = context => Task.CompletedTask; 24public Func<MessageReceivedContext, Task> OnMessageReceived { get; set; } = context => Task.CompletedTask; 29public Func<TokenValidatedContext, Task> OnTokenValidated { get; set; } = context => Task.CompletedTask; 34public Func<JwtBearerChallengeContext, Task> OnChallenge { get; set; } = context => Task.CompletedTask; 39public virtual Task AuthenticationFailed(AuthenticationFailedContext context) => OnAuthenticationFailed(context); 44public virtual Task Forbidden(ForbiddenContext context) => OnForbidden(context); 49public virtual Task MessageReceived(MessageReceivedContext context) => OnMessageReceived(context); 54public virtual Task TokenValidated(TokenValidatedContext context) => OnTokenValidated(context); 59public virtual Task Challenge(JwtBearerChallengeContext context) => OnChallenge(context);
JwtBearerHandler.cs (3)
50protected override Task<object> CreateEventsAsync() => Task.FromResult<object>(new JwtBearerEvents()); 275protected override async Task HandleChallengeAsync(AuthenticationProperties properties) 349protected override Task HandleForbiddenAsync(AuthenticationProperties properties)
Microsoft.AspNetCore.Authentication.JwtBearer.Tools.Tests (7)
src\Tools\Shared\TestHelpers\TestConsole.cs (1)
37public Task CancelKeyPressSubscribed => _cancelKeySubscribed.Task;
UserJwtsTests.cs (6)
190public async Task Key_CanResetSigningKey_WhenSecretsHasPrepulatedData() 412public async Task Create_GracefullyHandles_PrepopulatedSecrets() 439public async Task Create_GracefullyHandles_PrepopulatedSecrets_WithCommasAndComments() 484public async Task Create_SupportsSettingACustomIssuerAndScheme() 505public async Task Create_SupportsSettingMutlipleIssuersAndSingleScheme() 527public async Task Create_SupportsSettingSingleIssuerAndMultipleSchemes()
Microsoft.AspNetCore.Authentication.Negotiate (18)
Events\NegotiateEvents.cs (12)
14public Func<AuthenticationFailedContext, Task> OnAuthenticationFailed { get; set; } = context => Task.CompletedTask; 20public Func<LdapContext, Task> OnRetrieveLdapClaims { get; set; } = context => Task.CompletedTask; 25public Func<AuthenticatedContext, Task> OnAuthenticated { get; set; } = context => Task.CompletedTask; 30public Func<ChallengeContext, Task> OnChallenge { get; set; } = context => Task.CompletedTask; 35public virtual Task AuthenticationFailed(AuthenticationFailedContext context) => OnAuthenticationFailed(context); 40public virtual Task RetrieveLdapClaims(LdapContext context) => OnRetrieveLdapClaims(context); 45public virtual Task Authenticated(AuthenticatedContext context) => OnAuthenticated(context); 50public virtual Task Challenge(ChallengeContext context) => OnChallenge(context);
Internal\LdapAdapter.cs (1)
20public static async Task RetrieveClaimsAsync(LdapSettings settings, ClaimsIdentity identity, ILogger logger)
NegotiateHandler.cs (5)
61protected override Task<object> CreateEventsAsync() => Task.FromResult<object>(new NegotiateEvents()); 199return Task.CompletedTask; 383protected override async Task HandleChallengeAsync(AuthenticationProperties properties) 421private static Task DisposeState(object state) 424return Task.CompletedTask;
Microsoft.AspNetCore.Authentication.Negotiate.Test (70)
EventTests.cs (35)
21public async Task OnChallenge_Fires() 34return Task.CompletedTask; 47public async Task OnChallenge_Handled() 58return Task.CompletedTask; 70public async Task OnAuthenticationFailed_FromException_Fires() 82return Task.CompletedTask; 95public async Task OnAuthenticationFailed_FromException_Handled() 106return Task.CompletedTask; 118public async Task OnAuthenticationFailed_FromOtherBlobError_Fires() 130return Task.CompletedTask; 143public async Task OnAuthenticationFailed_FromOtherBlobError_Handled() 156return Task.CompletedTask; 169public async Task OnAuthenticationFailed_FromCredentialError_Fires() 181return Task.CompletedTask; 193public async Task OnAuthenticationFailed_FromCredentialError_Handled() 206return Task.CompletedTask; 219public async Task OnAuthenticationFailed_FromClientError_Fires() 231return Task.CompletedTask; 243public async Task OnAuthenticationFailed_FromClientError_Handled() 256return Task.CompletedTask; 269public async Task OnAuthenticated_FiresOncePerRequest() 284return Task.CompletedTask; 299public async Task OnAuthenticated_Success_Continues() 310return Task.CompletedTask; 321public async Task OnAuthenticated_NoResult_SuppresesCredentials() 332return Task.CompletedTask; 345public async Task OnAuthenticated_Fail_SuppresesCredentials() 356return Task.CompletedTask; 369public async Task OnRetrieveLdapClaims_DoesNotFireWhenLdapDisabled() 379return Task.CompletedTask; 389private static async Task KerberosStage1And2Auth(TestServer server, TestConnection testConnection) 395private static async Task KerberosStage1Auth(TestServer server, TestConnection testConnection) 402private static async Task KerberosStage2Auth(TestServer server, TestConnection testConnection) 453return Task.CompletedTask; 478public void OnCompleted(Func<object, Task> callback, object state)
NegotiateHandlerTests.cs (32)
24public async Task Anonymous_MissingConnectionFeatures_ThrowsNotSupported() 34public async Task Anonymous_NoChallenge_NoOps() 44public async Task Anonymous_Http2_NoOps() 54public async Task Anonymous_Challenge_401Negotiate() 65public async Task Anonymous_ChallengeHttp2_401Negotiate() 77public async Task NtlmStage1Auth_401NegotiateServerBlob1() 87public async Task AnonymousAfterNtlmStage1_Throws() 99public async Task NtlmStage2Auth_WithoutStage1_Throws() 111public async Task NtlmStage1And2Auth_Success(bool persistNtlm) 122public async Task KerberosAuth_Success(bool persistKerberos) 133public async Task KerberosTwoStageAuth_Success(bool persistKerberos) 145public async Task AnonymousAfterCompletedPersist_Cached(string protocol) 172public async Task AnonymousAfterCompletedNoPersist_Denied(string protocol) 198public async Task AuthHeaderAfterNtlmCompleted_ReAuthenticates(bool persist) 208public async Task RBACClaimsRetrievedFromCacheAfterKerberosCompleted() 232public async Task AuthHeaderAfterKerberosCompleted_ReAuthenticates(bool persist) 244public async Task AuthHeaderAfterKerberos2StageCompleted_ReAuthenticates(bool persist) 254public async Task ApplicationExceptionReExecute_AfterComplete_DoesntReRun() 294public async Task CredentialError_401() 305public async Task ClientError_400() 316public async Task OtherError_Throws() 325private static async Task AuthenticateAndRetrieveRBACClaims(TestServer server, TestConnection testConnection) 333private static async Task KerberosAuth(TestServer server, TestConnection testConnection) 340private static async Task KerberosStage1And2Auth(TestServer server, TestConnection testConnection) 346private static async Task KerberosStage1Auth(TestServer server, TestConnection testConnection) 353private static async Task KerberosStage2Auth(TestServer server, TestConnection testConnection) 360private static async Task NtlmStage1And2Auth(TestServer server, TestConnection testConnection) 366private static async Task NtlmStage1Auth(TestServer server, TestConnection testConnection) 373private static async Task NtlmStage2Auth(TestServer server, TestConnection testConnection) 411return Task.CompletedTask; 418return Task.CompletedTask; 502public void OnCompleted(Func<object, Task> callback, object state)
ServerDeferralTests.cs (3)
17public async Task ServerDoesNotSupportAuth_NoError() 26public async Task ServerSupportsAuthButDisabled_Error() 34public async Task ServerSupportsAuthAndEnabled_Deferred()
Microsoft.AspNetCore.Authentication.OAuth (9)
Events\OAuthEvents.cs (7)
14public Func<OAuthCreatingTicketContext, Task> OnCreatingTicket { get; set; } = context => Task.CompletedTask; 19public Func<RedirectContext<OAuthOptions>, Task> OnRedirectToAuthorizationEndpoint { get; set; } = context => 22return Task.CompletedTask; 29/// <returns>A <see cref="Task"/> representing the completed operation.</returns> 30public virtual Task CreatingTicket(OAuthCreatingTicketContext context) => OnCreatingTicket(context); 36public virtual Task RedirectToAuthorizationEndpoint(RedirectContext<OAuthOptions> context) => OnRedirectToAuthorizationEndpoint(context);
OAuthHandler.cs (2)
61protected override Task<object> CreateEventsAsync() => Task.FromResult<object>(new OAuthEvents()); 263protected override async Task HandleChallengeAsync(AuthenticationProperties properties)
Microsoft.AspNetCore.Authentication.OpenIdConnect (34)
Events\OpenIdConnectEvents.cs (30)
14public Func<AuthenticationFailedContext, Task> OnAuthenticationFailed { get; set; } = context => Task.CompletedTask; 19public Func<AuthorizationCodeReceivedContext, Task> OnAuthorizationCodeReceived { get; set; } = context => Task.CompletedTask; 24public Func<MessageReceivedContext, Task> OnMessageReceived { get; set; } = context => Task.CompletedTask; 31public Func<RedirectContext, Task> OnRedirectToIdentityProvider { get; set; } = context => Task.CompletedTask; 36public Func<RedirectContext, Task> OnRedirectToIdentityProviderForSignOut { get; set; } = context => Task.CompletedTask; 41public Func<RemoteSignOutContext, Task> OnSignedOutCallbackRedirect { get; set; } = context => Task.CompletedTask; 46public Func<RemoteSignOutContext, Task> OnRemoteSignOut { get; set; } = context => Task.CompletedTask; 51public Func<TokenResponseReceivedContext, Task> OnTokenResponseReceived { get; set; } = context => Task.CompletedTask; 57public Func<TokenValidatedContext, Task> OnTokenValidated { get; set; } = context => Task.CompletedTask; 62public Func<UserInformationReceivedContext, Task> OnUserInformationReceived { get; set; } = context => Task.CompletedTask; 67public virtual Task AuthenticationFailed(AuthenticationFailedContext context) => OnAuthenticationFailed(context); 72public virtual Task AuthorizationCodeReceived(AuthorizationCodeReceivedContext context) => OnAuthorizationCodeReceived(context); 77public virtual Task MessageReceived(MessageReceivedContext context) => OnMessageReceived(context); 84public virtual Task RedirectToIdentityProvider(RedirectContext context) => OnRedirectToIdentityProvider(context); 89public virtual Task RedirectToIdentityProviderForSignOut(RedirectContext context) => OnRedirectToIdentityProviderForSignOut(context); 94public virtual Task SignedOutCallbackRedirect(RemoteSignOutContext context) => OnSignedOutCallbackRedirect(context); 99public virtual Task RemoteSignOut(RemoteSignOutContext context) => OnRemoteSignOut(context); 104public virtual Task TokenResponseReceived(TokenResponseReceivedContext context) => OnTokenResponseReceived(context); 110public virtual Task TokenValidated(TokenValidatedContext context) => OnTokenValidated(context); 115public virtual Task UserInformationReceived(UserInformationReceivedContext context) => OnUserInformationReceived(context);
OpenIdConnectHandler.cs (4)
86protected override Task<object> CreateEventsAsync() => Task.FromResult<object>(new OpenIdConnectEvents()); 208public virtual async Task SignOutAsync(AuthenticationProperties? properties) 362protected override async Task HandleChallengeAsync(AuthenticationProperties properties) 380private async Task HandleChallengeAsyncInternal(AuthenticationProperties properties)
Microsoft.AspNetCore.Authentication.Test (753)
AuthenticationMiddlewareTests.cs (39)
22public async Task OnlyInvokesCanHandleRequestHandlers() 61public async Task IAuthenticateResultFeature_SetOnSuccessfulAuthenticate() 65.Returns(Task.FromResult(AuthenticateResult.Success(new AuthenticationTicket(new ClaimsPrincipal(), "custom")))); 68.Returns(Task.FromResult(new AuthenticationScheme("custom", "custom", typeof(JwtBearerHandler)))); 69var middleware = new AuthenticationMiddleware(c => Task.CompletedTask, schemeProvider.Object); 84public async Task IAuthenticateResultFeature_NotSetOnUnsuccessfulAuthenticate() 88.Returns(Task.FromResult(AuthenticateResult.Fail("not authenticated"))); 91.Returns(Task.FromResult(new AuthenticationScheme("custom", "custom", typeof(JwtBearerHandler)))); 92var middleware = new AuthenticationMiddleware(c => Task.CompletedTask, schemeProvider.Object); 104public async Task IAuthenticateResultFeature_NullResultWhenUserSetAfter() 108.Returns(Task.FromResult(AuthenticateResult.Success(new AuthenticationTicket(new ClaimsPrincipal(), "custom")))); 111.Returns(Task.FromResult(new AuthenticationScheme("custom", "custom", typeof(JwtBearerHandler)))); 112var middleware = new AuthenticationMiddleware(c => Task.CompletedTask, schemeProvider.Object); 130public async Task IAuthenticateResultFeature_SettingResultSetsUser() 134.Returns(Task.FromResult(AuthenticateResult.Success(new AuthenticationTicket(new ClaimsPrincipal(), "custom")))); 137.Returns(Task.FromResult(new AuthenticationScheme("custom", "custom", typeof(JwtBearerHandler)))); 138var middleware = new AuthenticationMiddleware(c => Task.CompletedTask, schemeProvider.Object); 157public async Task WebApplicationBuilder_RegistersAuthenticationAndAuthorizationMiddlewares() 185public async Task WebApplicationBuilder_OnlyRegistersMiddlewareWithSupportedServices() 255public Task ChallengeAsync(AuthenticationProperties properties) 260public Task ForbidAsync(AuthenticationProperties properties) 268return Task.FromResult(true); 271public Task InitializeAsync(AuthenticationScheme scheme, HttpContext context) 274return Task.FromResult(0); 277public Task SignInAsync(ClaimsPrincipal user, AuthenticationProperties properties) 282public Task SignOutAsync(AuthenticationProperties properties) 297public Task ChallengeAsync(AuthenticationProperties properties) 302public Task ForbidAsync(AuthenticationProperties properties) 312public Task InitializeAsync(AuthenticationScheme scheme, HttpContext context) 315return Task.FromResult(0); 318public Task SignInAsync(ClaimsPrincipal user, AuthenticationProperties properties) 323public Task SignOutAsync(AuthenticationProperties properties) 338public Task ChallengeAsync(AuthenticationProperties properties) 343public Task ForbidAsync(AuthenticationProperties properties) 350return Task.FromResult(false); 353public Task InitializeAsync(AuthenticationScheme scheme, HttpContext context) 356return Task.FromResult(0); 359public Task SignInAsync(ClaimsPrincipal user, AuthenticationProperties properties) 364public Task SignOutAsync(AuthenticationProperties properties)
CertificateTests.cs (36)
27public async Task VerifySchemeDefaults() 46public async Task VerifyValidSelfSignedWithClientEkuAuthenticates() 62public async Task VerifyValidSelfSignedWithNoEkuAuthenticates() 78public async Task VerifyValidSelfSignedWithClientEkuFailsWhenSelfSignedCertsNotAllowed() 93public async Task VerifyValidSelfSignedWithNoEkuFailsWhenSelfSignedCertsNotAllowed() 109public async Task VerifyValidSelfSignedWithServerFailsEvenIfSelfSignedCertsAreAllowed() 125public async Task VerifyValidSelfSignedWithServerPassesWhenSelfSignedCertsAreAllowedAndPurposeValidationIsOff() 142public async Task VerifyValidSelfSignedWithServerFailsPurposeValidationIsOffButSelfSignedCertsAreNotAllowed() 160public async Task VerifyExpiredSelfSignedFails() 177public async Task VerifyExpiredSelfSignedPassesIfDateRangeValidationIsDisabled() 195public async Task VerifyNotYetValidSelfSignedFails() 212public async Task VerifyNotYetValidSelfSignedPassesIfDateRangeValidationIsDisabled() 229public async Task VerifyFailingInTheValidationEventReturnsForbidden() 245public async Task DoingNothingInTheValidationEventReturnsOK() 262public async Task VerifyNotSendingACertificateEndsUpInForbidden() 276public async Task VerifyUntrustedClientCertEndsUpInForbidden() 290public async Task VerifyValidationFailureCanBeHandled() 302return Task.CompletedTask; 314public async Task VerifyClientCertWithUntrustedRootAndTrustedChainEndsUpInForbidden() 331public async Task VerifyValidClientCertWithTrustedChainAuthenticates() 348public async Task VerifyValidClientCertWithAdditionalCertificatesAuthenticates() 366public async Task VerifyValidClientCertFailsWithoutAdditionalCertificatesAuthenticates() 383public async Task VerifyHeaderIsUsedIfCertIsNotPresent() 401public async Task VerifyHeaderEncodedCertFailsOnBadEncoding() 418public async Task VerifySettingTheAzureHeaderOnTheForwarderOptionsWorks() 437public async Task VerifyACustomHeaderFailsIfTheHeaderIsNotPresent() 455public async Task VerifyNoEventWireupWithAValidCertificateCreatesADefaultUser() 563public async Task VerifyValidationResultCanBeCached(bool cache) 589return Task.CompletedTask; 638public async Task VerifyValidationEventPrincipalIsPropogated() 659return Task.CompletedTask; 688public async Task VerifyValidationResultNeverCachedAfter30Min(bool cache) 716return Task.CompletedTask; 918return Task.CompletedTask; 927return Task.CompletedTask; 935return Task.CompletedTask;
CookieTests.cs (83)
36public async Task NormalRequestPassesThrough() 45public async Task AjaxLoginRedirectToReturnUrlTurnsInto200WithLocationHeader() 57public async Task AjaxForbidTurnsInto403WithLocationHeader() 69public async Task AjaxLogoutRedirectToReturnUrlTurnsInto200WithLocationHeader() 81public async Task AjaxChallengeRedirectTurnsInto200WithLocationHeader() 93public async Task ProtectedCustomRequestShouldRedirectToCustomRedirectUri() 105private static Task SignInAsAlice(HttpContext context) 114private static Task SignInAsWrong(HttpContext context) 121private Task SignOutAsWrong(HttpContext context) 127public async Task SignInCausesDefaultCookieToBeCreated() 164public Task RenewAsync(string key, AuthenticationTicket ticket) 168return Task.FromResult(0); 175return Task.FromResult(ticket); 178public Task RemoveAsync(string key) 181return Task.FromResult(0); 186public async Task SignInWithTicketStoreWorks() 221public async Task SessionStoreRemovesExpired() 253public async Task CustomAuthSchemeEncodesCookieName() 297public async Task SignInWrongAuthTypeThrows() 310public async Task SignOutWrongAuthTypeThrows() 329public async Task SecureSignInCausesSecureOnlyCookieByDefault( 356public async Task CookieOptionsAlterSetCookieHeader() 407public async Task CookieContainsIdentity() 420public async Task CookieAppliesClaimsTransform() 438public async Task CookieStopsWorkingAfterExpiration() 468public async Task CookieExpirationCanBeOverridenInSignin() 502public async Task ExpiredCookieWithValidatorStillExpired() 512return Task.FromResult(0); 531public async Task CookieCanBeRejectedAndSignedOutByValidator() 543return Task.FromResult(0); 560public async Task CookieNotRenewedAfterSignOut() 571return Task.FromResult(0); 597public async Task CookieCanBeRenewedByValidator() 608return Task.FromResult(0); 643public async Task CookieCanBeReplacedByValidator() 653return Task.FromResult(0); 670public async Task CookieCanBeUpdatedByValidatorDuringRefresh() 686return Task.FromResult(0); 719public async Task CookieCanBeRenewedByValidatorWithSlidingExpiry() 729return Task.FromResult(0); 764public async Task CookieCanBeRenewedByValidatorWithModifiedProperties() 785return Task.FromResult(0); 820public async Task CookieCanBeRenewedByValidatorWithModifiedLifetime() 844return Task.FromResult(0); 879public async Task CookieValidatorOnlyCalledOnce() 890return Task.FromResult(0); 927public async Task ShouldRenewUpdatesIssuedExpiredUtc(bool sliding) 942return Task.FromResult(0); 980public async Task CookieExpirationCanBeOverridenInEvent() 991return Task.FromResult(0); 1018public async Task CookieIsRenewedWithSlidingExpiration() 1055public async Task CookieIsRenewedWithSlidingExpirationWithoutTransformations() 1067return Task.CompletedTask; 1101public async Task CookieIsRenewedWithSlidingExpirationEvent() 1115return Task.CompletedTask; 1153public async Task CookieUsesPathBaseByDefault() 1170public async Task CookieChallengeRedirectsToLoginWithoutCookie() 1184public async Task CookieForbidRedirectsWithoutCookie() 1198public async Task CookieChallengeRedirectsWithLoginPath() 1214public async Task CookieChallengeWithUnauthorizedRedirectsToLoginIfNotAuthenticated() 1232public async Task MapWillAffectChallengeOnlyWithUseAuth(bool useAuth) 1267public async Task ChallengeDoesNotSet401OnUnauthorized() 1291public async Task CanConfigureDefaultCookieInstance() 1319public async Task CanConfigureNamedCookieInstance() 1347public async Task MapWithSignInOnlyRedirectToReturnUrlOnLoginPath() 1370public async Task MapWillNotAffectSignInRedirectToReturnUrl() 1396public async Task MapWithSignOutOnlyRedirectToReturnUrlOnLogoutPath() 1418public async Task MapWillNotAffectSignOutRedirectToReturnUrl() 1444public async Task MapWillNotAffectAccessDenied() 1468public async Task NestedMapWillNotAffectLogin() 1498public async Task RedirectUriIsHonoredAfterSignin(string redirectUrl, string loginPath) 1520public async Task RedirectUriInQueryIsIgnoredAfterSigninForUnrecognizedEndpoints() 1542public async Task RedirectUriInQueryIsHonoredAfterSignin() 1565public async Task AbsoluteRedirectUriInQueryStringIsRejected() 1587public async Task EnsurePrecedenceOfRedirectUriAfterSignin() 1611public async Task NestedMapWillNotAffectAccessDenied() 1635public async Task CanSpecifyAndShareDataProtector() 1687public async Task NullExpiresUtcPropertyIsGuarded() 1700return Task.FromResult(0); 1789return Task.FromResult(p); 1793private Task<IHost> CreateHost(Action<CookieAuthenticationOptions> configureOptions, Func<HttpContext, Task> testpath = null, Uri baseAddress = null, bool claimsTransform = false) 1807private static async Task<IHost> CreateHostWithServices(Action<IServiceCollection> configureServices, Func<HttpContext, Task> testpath = null, Uri baseAddress = null) 1886private static Task DescribeAsync(HttpResponse res, AuthenticateResult result)
DynamicSchemeTests.cs (3)
22public async Task OptionsAreConfiguredOnce() 59public async Task CanAddAndRemoveSchemes() 125return Task.FromResult(AuthenticateResult.Success(new AuthenticationTicket(principal, new AuthenticationProperties(), Scheme.Name)));
FacebookTests.cs (12)
46public async Task ThrowsIfAppIdMissing() 62public async Task ThrowsIfAppSecretMissing() 78public async Task ChallengeWillTriggerApplyRedirectEvent() 98return Task.FromResult(0); 116public async Task ChallengeWillIncludeScopeAsConfigured() 146public async Task ChallengeWillIncludeScopeAsOverwritten() 178public async Task ChallengeWillIncludeScopeAsOverwrittenWithBaseAuthenticationProperties() 210public async Task NestedMapWillNotAffectRedirect() 242public async Task MapWillNotAffectRedirect() 275public async Task ChallengeWillTriggerRedirection() 312public async Task CustomUserInfoEndpointHasValidGraphQuery() 375public async Task PkceSentToTokenEndpoint()
GoogleTests.cs (47)
46public async Task ChallengeWillTriggerRedirection() 77public async Task SignInThrows() 90public async Task SignOutThrows() 103public async Task ForbidThrows() 116public async Task Challenge401WillNotTriggerRedirection() 129public async Task ChallengeWillSetCorrelationCookie() 142public async Task ChallengeWillSetDefaultScope() 157public async Task ChallengeWillUseAuthenticationPropertiesParametersAsQueryArguments() 183return Task.FromResult<object>(null); 209public async Task ChallengeWillUseAuthenticationPropertiesItemsAsParameters() 235return Task.FromResult<object>(null); 261public async Task ChallengeWillUseAuthenticationPropertiesItemsAsQueryArgumentsButParametersWillOverwrite() 291return Task.FromResult<object>(null); 317public async Task ChallengeWillTriggerApplyRedirectEvent() 328return Task.FromResult(0); 340public async Task AuthenticateWithoutCookieWillReturnNoResult() 363public async Task ReplyPathWithoutStateQueryStringWillBeRejected() 378public async Task ReplyPathWithAccessDeniedErrorFails(bool redirect) 391return Task.FromResult(0); 412public async Task ReplyPathWithAccessDeniedError_AllowsCustomizingPath() 430return Task.FromResult(0); 442public async Task ReplyPathWithAccessDeniedErrorAndNoAccessDeniedPath_FallsBackToRemoteError() 459return Task.FromResult(0); 473return Task.FromResult(0); 489public async Task ReplyPathWithErrorFails(bool redirect) 509return Task.FromResult(0); 532public async Task ReplyPathWillAuthenticateValidAuthorizeCodeAndState(string claimsIssuer) 588public async Task ReplyPathWillThrowIfCodeIsInvalid(bool redirect) 610return Task.FromResult(0); 642public async Task ReplyPathWillRejectIfAccessTokenIsMissing(bool redirect) 663return Task.FromResult(0); 692public async Task AuthenticatedEventCanGetRefreshToken() 707return Task.FromResult(0); 734public async Task NullRedirectUriWillRedirectToSlash() 748return Task.FromResult(0); 769public async Task ValidateAuthenticatedContext() 790return Task.FromResult(0); 814public async Task NoStateCausesException() 829public async Task CanRedirectOnError() 842return Task.FromResult(0); 858public async Task AuthenticateAutomaticWhenAlreadySignedInSucceeds() 902public async Task AuthenticateGoogleWhenAlreadySignedInSucceeds() 946public async Task AuthenticateGoogleWhenAlreadySignedWithGoogleReturnsNull() 983public async Task ChallengeGoogleWhenAlreadySignedWithGoogleSucceeds() 1020public async Task PkceSentToTokenEndpoint() 1140return Task.FromResult(p); 1144private static async Task<IHost> CreateHost(Action<GoogleOptions> configureOptions, Func<HttpContext, Task> testpath = null)
JwtBearerTests.cs (48)
48public async Task BearerTokenValidation() 85public async Task SaveBearerToken() 158public async Task SignInThrows() 167public async Task SignOutThrows() 176public async Task ThrowAtAuthenticationFailedEvent() 190return Task.FromResult(0); 220public async Task CustomHeaderReceived() 238return Task.FromResult<object>(null); 251public async Task NoHeaderReceived() 260public async Task HeaderWithoutBearerReceived() 269public async Task UnrecognizedTokenReceived() 279public async Task InvalidTokenReceived() 306public async Task ExceptionReportedInHeaderForAuthenticationFailures(Type errorType, string message) 330public async Task ExceptionReportedInHeaderWithDetailsForAuthenticationFailures(Type errorType, string message) 350public async Task ExceptionNotReportedInHeaderForOtherFailures(Type errorType) 369public async Task ExceptionsReportedInHeaderForMultipleAuthenticationFailures() 396public async Task ExceptionsReportedInHeaderExposesUserDefinedError(string error, string description, string uri) 408return Task.FromResult(0); 455public async Task ExceptionNotReportedInHeaderWhenIncludeErrorDetailsIsFalse() 471public async Task ExceptionNotReportedInHeaderWhenTokenWasMissing() 483public async Task CustomTokenValidated() 505return Task.FromResult<object>(null); 522public async Task RetrievingTokenFromAlternateLocation() 531return Task.FromResult<object>(null); 551public async Task EventOnMessageReceivedSkip_NoMoreEventsExecuted() 561return Task.FromResult(0); 585public async Task EventOnMessageReceivedReject_NoMoreEventsExecuted() 596return Task.FromResult(0); 623public async Task EventOnTokenValidatedSkip_NoMoreEventsExecuted() 632return Task.FromResult(0); 657public async Task EventOnTokenValidatedReject_NoMoreEventsExecuted() 667return Task.FromResult(0); 695public async Task EventOnAuthenticationFailedSkip_NoMoreEventsExecuted() 708return Task.FromResult(0); 729public async Task EventOnAuthenticationFailedReject_NoMoreEventsExecuted() 743return Task.FromResult(0); 767public async Task EventOnChallengeSkip_ResponseNotModified() 776return Task.FromResult(0); 790public async Task EventOnForbidden_ResponseNotModified() 811public async Task EventOnForbiddenSkip_ResponseNotModified() 826return Task.FromResult(0); 838public async Task EventOnForbidden_ResponseModified() 867public async Task EventOnForbidden_ResponseForMultipleAuthenticationSchemas() 881return Task.CompletedTask; 917public async Task ExpirationAndIssuedSetOnAuthenticateResult() 962public async Task ExpirationAndIssuedWhenMinOrMaxValue() 1159private static async Task<IHost> CreateHost(Action<JwtBearerOptions> options = null, Func<HttpContext, Func<Task>, Task> handlerBeforeAuth = null)
JwtBearerTests_Handler.cs (49)
48public async Task BearerTokenValidation() 84public async Task SaveBearerToken() 156public async Task SignInThrows() 165public async Task SignOutThrows() 174public async Task ThrowAtAuthenticationFailedEvent() 188return Task.FromResult(0); 215public async Task CustomHeaderReceived() 233return Task.FromResult<object>(null); 245public async Task NoHeaderReceived() 254public async Task HeaderWithoutBearerReceived() 263public async Task UnrecognizedTokenReceived() 273public async Task InvalidTokenReceived() 297public async Task ExceptionReportedInHeaderForAuthenticationFailures(Type errorType, string message) 318public async Task ExceptionReportedInHeaderWithDetailsForAuthenticationFailures(Type errorType, string message) 335public async Task ExceptionNotReportedInHeaderForOtherFailures(Type errorType) 351public async Task ExceptionsReportedInHeaderForMultipleAuthenticationFailures() 375public async Task ExceptionsReportedInHeaderExposesUserDefinedError(string error, string description, string uri) 387return Task.FromResult(0); 433public async Task ExceptionNotReportedInHeaderWhenIncludeErrorDetailsIsFalse() 448public async Task ExceptionNotReportedInHeaderWhenTokenWasMissing() 460public async Task CustomTokenValidated() 482return Task.FromResult<object>(null); 496public async Task RetrievingTokenFromAlternateLocation() 505return Task.FromResult<object>(null); 522public async Task EventOnMessageReceivedSkip_NoMoreEventsExecuted() 531return Task.FromResult(0); 555public async Task EventOnMessageReceivedReject_NoMoreEventsExecuted() 565return Task.FromResult(0); 592public async Task EventOnTokenValidatedSkip_NoMoreEventsExecuted() 601return Task.FromResult(0); 623public async Task EventOnTokenValidatedReject_NoMoreEventsExecuted() 633return Task.FromResult(0); 658public async Task EventOnAuthenticationFailedSkip_NoMoreEventsExecuted() 671return Task.FromResult(0); 689public async Task EventOnAuthenticationFailedReject_NoMoreEventsExecuted() 703return Task.FromResult(0); 724public async Task EventOnChallengeSkip_ResponseNotModified() 733return Task.FromResult(0); 746public async Task EventOnForbidden_ResponseNotModified() 766public async Task EventOnForbiddenSkip_ResponseNotModified() 781return Task.FromResult(0); 792public async Task EventOnForbidden_ResponseModified() 820public async Task EventOnForbidden_ResponseForMultipleAuthenticationSchemas() 834return Task.CompletedTask; 870public async Task ExpirationAndIssuedSetOnAuthenticateResult() 914public async Task ExpirationAndIssuedWhenMinOrMaxValue() 1182return Task.FromResult(new TokenValidationResult 1191private static async Task<IHost> CreateHost(Action<JwtBearerOptions> options = null, Func<HttpContext, Func<Task>, Task> handlerBeforeAuth = null)
MicrosoftAccountTests.cs (13)
47public async Task ChallengeWillTriggerApplyRedirectEvent() 58return Task.FromResult(0); 71public async Task SignInThrows() 84public async Task SignOutThrows() 97public async Task ForbidThrows() 110public async Task ChallengeWillTriggerRedirection() 132public async Task ChallengeWillIncludeScopeAsConfigured() 150public async Task ChallengeWillIncludeScopeAsOverwritten() 168public async Task ChallengeWillIncludeScopeAsOverwrittenWithBaseAuthenticationProperties() 186public async Task AuthenticatedEventCanGetRefreshToken() 229return Task.FromResult<object>(null); 256public async Task ChallengeWillUseAuthenticationPropertiesParametersAsQueryArguments() 287public async Task PkceSentToTokenEndpoint()
OAuthTests.cs (22)
35public async Task ThrowsIfClientIdMissing() 51public async Task ThrowsIfClientSecretMissing() 67public async Task ThrowsIfCallbackPathMissing() 83public async Task ThrowsIfTokenEndpointMissing() 99public async Task ThrowsIfAuthorizationEndpointMissing() 115public async Task RedirectToIdentityProvider_SetsCorrelationIdCookiePath_ToCallBackPath() 142public async Task RedirectToAuthorizeEndpoint_CorrelationIdCookieOptions_CanBeOverriden() 170public async Task RedirectToAuthorizeEndpoint_HasScopeAsConfigured() 197public async Task RedirectToAuthorizeEndpoint_HasAdditionalAuthorizationParametersAsConfigured() 223public async Task RedirectToAuthorizeEndpoint_HasScopeAsOverwritten() 252public async Task RedirectToAuthorizeEndpoint_HasScopeAsOverwrittenWithBaseAuthenticationProperties() 291public async Task HandleRequestAsync_RedirectsToAccessDeniedPathWhenExplicitlySet() 318public async Task HandleRequestAsync_InvokesAccessDeniedEvent() 339return Task.CompletedTask; 353public async Task HandleRequestAsync_InvokesRemoteFailureEventWhenAccessDeniedPathIsNotExplicitlySet() 375return Task.CompletedTask; 389public async Task RemoteAuthenticationFailed_OAuthError_IncludesProperties() 411return Task.CompletedTask; 427public async Task ExchangeCodeAsync_ChecksForErrorInformation(HttpStatusCode httpStatusCode) 460return Task.CompletedTask; 471public async Task ExchangeCodeAsync_FallbackToBasicErrorReporting_WhenErrorInformationIsNotPresent() 501return Task.CompletedTask;
OpenIdConnect\OpenIdConnectAuthenticateTests.cs (4)
15public async Task RegularGetRequestToCallbackPathSkips() 40public async Task RegularPostRequestToCallbackPathSkips() 68public async Task ErrorResponseWithDetails() 89return Task.FromResult(0);
OpenIdConnect\OpenIdConnectChallengeTests.cs (30)
19public async Task ChallengeRedirectIsIssuedCorrectly() 50public async Task ChallengeIncludesPkceIfRequested(bool include) 85public async Task ChallengeDoesNotIncludePkceForOtherResponseTypes(string responseType) 109public async Task AuthorizationRequestDoesNotIncludeTelemetryParametersWhenDisabled() 147public async Task ChallengeFormPostIssuedCorrectly() 177public async Task ChallengeCanSetUserStateThroughProperties(string userState) 207public async Task OnRedirectToIdentityProviderEventCanSetState(string userState) 220return Task.FromResult(0); 247public async Task OnRedirectToIdentityProviderEventIsHit() 260return Task.FromResult(0); 285public async Task OnRedirectToIdentityProviderEventCanReplaceValues() 299return Task.FromResult(0); 324public async Task OnRedirectToIdentityProviderEventCanReplaceMessage() 343return Task.FromResult(0); 362public async Task OnRedirectToIdentityProviderEventHandlesResponse() 377return Task.FromResult(0); 395public async Task OnRedirectToIdentityProviderEventHandleResponse() 407return Task.FromResult(0); 424public async Task ChallengeSetsNonceAndStateCookies(OpenIdConnectRedirectBehavior method) 457public async Task Challenge_WithEmptyConfig_Fails() 472public async Task Challenge_WithDefaultMaxAge_HasExpectedMaxAgeParam() 493public async Task Challenge_WithSpecificMaxAge_HasExpectedMaxAgeParam() 515public async Task Challenge_HasExpectedPromptParam() 535public async Task Challenge_HasOverwrittenPromptParam() 559public async Task Challenge_HasOverwrittenPromptParamFromBaseAuthenticationProperties() 581public async Task Challenge_HasOverwrittenScopeParam() 605public async Task Challenge_HasOverwrittenScopeParamFromBaseAuthenticationProperties() 629public async Task Challenge_HasOverwrittenMaxAgeParam() 653public async Task Challenge_HasOverwrittenMaxAgeParaFromBaseAuthenticationPropertiesm() 675public async Task Challenge_WithAdditionalAuthorizationParameters()
OpenIdConnect\OpenIdConnectConfigurationTests.cs (17)
29public async Task CanForwardDefault() 72public async Task ForwardSignInThrows() 101public async Task ForwardSignOutWinsOverDefault() 141public async Task ForwardForbidWinsOverDefault() 181public async Task ForwardAuthenticateWinsOverDefault() 221public async Task ForwardChallengeWinsOverDefault() 261public async Task ForwardSelectorWinsOverDefault() 316public async Task NullForwardSelectorUsesDefault() 371public async Task SpecificForwardWinsOverSelectorAndDefault() 431public async Task MetadataAddressIsGeneratedFromAuthorityWhenMissing() 470public Task ThrowsWhenSignInSchemeIsSetToSelf() 484public Task ThrowsWhenClientIdIsMissing() 496public Task ThrowsWhenAuthorityIsMissing() 510public Task ThrowsWhenAuthorityIsNotHttps() 525public Task ThrowsWhenMetadataAddressIsNotHttps() 540public Task ThrowsWhenMaxAgeIsNegative() 571private async Task TestConfigurationException<T>(
OpenIdConnect\OpenIdConnectEventTests.cs (103)
32public async Task OnMessageReceived_Skip_NoMoreEventsRun() 41return Task.FromResult(0); 53public async Task OnMessageReceived_Fail_NoMoreEventsRun() 63return Task.FromResult(0); 77public async Task OnMessageReceived_Handled_NoMoreEventsRun() 87return Task.FromResult(0); 99public async Task OnTokenValidated_Skip_NoMoreEventsRun() 109return Task.FromResult(0); 121public async Task OnTokenValidated_Fail_NoMoreEventsRun() 132return Task.FromResult(0); 146public async Task OnTokenValidated_HandledWithoutTicket_NoMoreEventsRun() 158return Task.FromResult(0); 170public async Task OnTokenValidated_HandledWithTicket_SkipToTicketReceived() 183return Task.FromResult(0); 188return Task.FromResult(0); 194return Task.FromResult(0); 206public async Task OnAuthorizationCodeReceived_Skip_NoMoreEventsRun() 217return Task.FromResult(0); 229public async Task OnAuthorizationCodeReceived_Fail_NoMoreEventsRun() 241return Task.FromResult(0); 255public async Task OnAuthorizationCodeReceived_HandledWithoutTicket_NoMoreEventsRun() 268return Task.FromResult(0); 280public async Task OnAuthorizationCodeReceived_HandledWithTicket_SkipToTicketReceived() 292return Task.FromResult(0); 298return Task.FromResult(0); 310public async Task OnTokenResponseReceived_Skip_NoMoreEventsRun() 322return Task.FromResult(0); 334public async Task OnTokenResponseReceived_Fail_NoMoreEventsRun() 347return Task.FromResult(0); 361public async Task OnTokenResponseReceived_HandledWithoutTicket_NoMoreEventsRun() 375return Task.FromResult(0); 387public async Task OnTokenResponseReceived_HandledWithTicket_SkipToTicketReceived() 400return Task.FromResult(0); 406return Task.FromResult(0); 418public async Task OnTokenValidatedBackchannel_Skip_NoMoreEventsRun() 430return Task.FromResult(0); 442public async Task OnTokenValidatedBackchannel_Fail_NoMoreEventsRun() 455return Task.FromResult(0); 469public async Task OnTokenValidatedBackchannel_HandledWithoutTicket_NoMoreEventsRun() 483return Task.FromResult(0); 495public async Task OnTokenValidatedBackchannel_HandledWithTicket_SkipToTicketReceived() 508return Task.FromResult(0); 514return Task.FromResult(0); 526public async Task OnUserInformationReceived_Skip_NoMoreEventsRun() 539return Task.FromResult(0); 551public async Task OnUserInformationReceived_Fail_NoMoreEventsRun() 565return Task.FromResult(0); 579public async Task OnUserInformationReceived_HandledWithoutTicket_NoMoreEventsRun() 594return Task.FromResult(0); 606public async Task OnUserInformationReceived_HandledWithTicket_SkipToTicketReceived() 620return Task.FromResult(0); 626return Task.FromResult(0); 638public async Task OnAuthenticationFailed_Skip_NoMoreEventsRun() 657return Task.FromResult(0); 669public async Task OnAuthenticationFailed_Fail_NoMoreEventsRun() 689return Task.FromResult(0); 703public async Task OnAuthenticationFailed_HandledWithoutTicket_NoMoreEventsRun() 724return Task.FromResult(0); 736public async Task OnAuthenticationFailed_HandledWithTicket_SkipToTicketReceived() 766return Task.FromResult(0); 772return Task.FromResult(0); 784public async Task OnAccessDenied_Skip_NoMoreEventsRun() 794return Task.FromResult(0); 806public async Task OnAccessDenied_Handled_NoMoreEventsRun() 818return Task.FromResult(0); 830public async Task OnRemoteFailure_Skip_NoMoreEventsRun() 849return Task.FromResult(0); 855return Task.FromResult(0); 867public async Task OnRemoteFailure_Handled_NoMoreEventsRun() 889return Task.FromResult(0); 901public async Task OnTicketReceived_Skip_NoMoreEventsRun() 915return Task.FromResult(0); 927public async Task OnTicketReceived_Handled_NoMoreEventsRun() 942return Task.FromResult(0); 954public async Task OnRedirectToIdentityProviderForSignOut_Invoked() 975public async Task OnRedirectToIdentityProviderForSignOut_Handled_RedirectNotInvoked() 985return Task.CompletedTask; 1002public async Task OnRemoteSignOut_Invoked() 1022public async Task OnRemoteSignOut_Handled_NoSignout() 1032return Task.CompletedTask; 1045public async Task OnRemoteSignOut_Skip_NoSignout() 1054return Task.CompletedTask; 1059return Task.CompletedTask; 1071public async Task OnRedirectToSignedOutRedirectUri_Invoked() 1088public async Task OnRedirectToSignedOutRedirectUri_Handled_NoRedirect() 1098return Task.CompletedTask; 1111public async Task OnRedirectToSignedOutRedirectUri_Skipped_NoRedirect() 1120return Task.CompletedTask; 1126return Task.CompletedTask; 1175public override Task MessageReceived(MessageReceivedContext context) 1181public override Task TokenValidated(TokenValidatedContext context) 1187public override Task AuthorizationCodeReceived(AuthorizationCodeReceivedContext context) 1193public override Task TokenResponseReceived(TokenResponseReceivedContext context) 1199public override Task UserInformationReceived(UserInformationReceivedContext context) 1205public override Task AuthenticationFailed(AuthenticationFailedContext context) 1211public override Task TicketReceived(TicketReceivedContext context) 1217public override Task AccessDenied(AccessDeniedContext context) 1223public override Task RemoteFailure(RemoteFailureContext context) 1229public override Task RedirectToIdentityProviderForSignOut(RedirectContext context) 1235public override Task RemoteSignOut(RemoteSignOutContext context) 1241public override Task SignedOutCallbackRedirect(RemoteSignOutContext context) 1395return Task.FromResult(new HttpResponseMessage() 1403return Task.FromResult(new HttpResponseMessage() { Content = new StringContent("{ }", Encoding.ASCII, "application/json") });
OpenIdConnect\OpenIdConnectEventTests_Handler.cs (104)
32public async Task OnMessageReceived_Skip_NoMoreEventsRun() 41return Task.FromResult(0); 53public async Task OnMessageReceived_Fail_NoMoreEventsRun() 63return Task.FromResult(0); 77public async Task OnMessageReceived_Handled_NoMoreEventsRun() 87return Task.FromResult(0); 99public async Task OnTokenValidated_Skip_NoMoreEventsRun() 109return Task.FromResult(0); 121public async Task OnTokenValidated_Fail_NoMoreEventsRun() 132return Task.FromResult(0); 146public async Task OnTokenValidated_HandledWithoutTicket_NoMoreEventsRun() 158return Task.FromResult(0); 170public async Task OnTokenValidated_HandledWithTicket_SkipToTicketReceived() 183return Task.FromResult(0); 188return Task.FromResult(0); 194return Task.FromResult(0); 206public async Task OnAuthorizationCodeReceived_Skip_NoMoreEventsRun() 217return Task.FromResult(0); 229public async Task OnAuthorizationCodeReceived_Fail_NoMoreEventsRun() 241return Task.FromResult(0); 255public async Task OnAuthorizationCodeReceived_HandledWithoutTicket_NoMoreEventsRun() 268return Task.FromResult(0); 280public async Task OnAuthorizationCodeReceived_HandledWithTicket_SkipToTicketReceived() 292return Task.FromResult(0); 298return Task.FromResult(0); 310public async Task OnTokenResponseReceived_Skip_NoMoreEventsRun() 322return Task.FromResult(0); 334public async Task OnTokenResponseReceived_Fail_NoMoreEventsRun() 347return Task.FromResult(0); 361public async Task OnTokenResponseReceived_HandledWithoutTicket_NoMoreEventsRun() 375return Task.FromResult(0); 387public async Task OnTokenResponseReceived_HandledWithTicket_SkipToTicketReceived() 400return Task.FromResult(0); 406return Task.FromResult(0); 418public async Task OnTokenValidatedBackchannel_Skip_NoMoreEventsRun() 430return Task.FromResult(0); 442public async Task OnTokenValidatedBackchannel_Fail_NoMoreEventsRun() 455return Task.FromResult(0); 469public async Task OnTokenValidatedBackchannel_HandledWithoutTicket_NoMoreEventsRun() 483return Task.FromResult(0); 495public async Task OnTokenValidatedBackchannel_HandledWithTicket_SkipToTicketReceived() 508return Task.FromResult(0); 514return Task.FromResult(0); 526public async Task OnUserInformationReceived_Skip_NoMoreEventsRun() 539return Task.FromResult(0); 551public async Task OnUserInformationReceived_Fail_NoMoreEventsRun() 565return Task.FromResult(0); 579public async Task OnUserInformationReceived_HandledWithoutTicket_NoMoreEventsRun() 594return Task.FromResult(0); 606public async Task OnUserInformationReceived_HandledWithTicket_SkipToTicketReceived() 620return Task.FromResult(0); 626return Task.FromResult(0); 638public async Task OnAuthenticationFailed_Skip_NoMoreEventsRun() 657return Task.FromResult(0); 669public async Task OnAuthenticationFailed_Fail_NoMoreEventsRun() 689return Task.FromResult(0); 703public async Task OnAuthenticationFailed_HandledWithoutTicket_NoMoreEventsRun() 724return Task.FromResult(0); 736public async Task OnAuthenticationFailed_HandledWithTicket_SkipToTicketReceived() 766return Task.FromResult(0); 772return Task.FromResult(0); 784public async Task OnAccessDenied_Skip_NoMoreEventsRun() 794return Task.FromResult(0); 806public async Task OnAccessDenied_Handled_NoMoreEventsRun() 818return Task.FromResult(0); 830public async Task OnRemoteFailure_Skip_NoMoreEventsRun() 849return Task.FromResult(0); 855return Task.FromResult(0); 867public async Task OnRemoteFailure_Handled_NoMoreEventsRun() 889return Task.FromResult(0); 901public async Task OnTicketReceived_Skip_NoMoreEventsRun() 915return Task.FromResult(0); 927public async Task OnTicketReceived_Handled_NoMoreEventsRun() 942return Task.FromResult(0); 954public async Task OnRedirectToIdentityProviderForSignOut_Invoked() 975public async Task OnRedirectToIdentityProviderForSignOut_Handled_RedirectNotInvoked() 985return Task.CompletedTask; 1002public async Task OnRemoteSignOut_Invoked() 1022public async Task OnRemoteSignOut_Handled_NoSignout() 1032return Task.CompletedTask; 1045public async Task OnRemoteSignOut_Skip_NoSignout() 1054return Task.CompletedTask; 1059return Task.CompletedTask; 1071public async Task OnRedirectToSignedOutRedirectUri_Invoked() 1088public async Task OnRedirectToSignedOutRedirectUri_Handled_NoRedirect() 1098return Task.CompletedTask; 1111public async Task OnRedirectToSignedOutRedirectUri_Skipped_NoRedirect() 1120return Task.CompletedTask; 1126return Task.CompletedTask; 1175public override Task MessageReceived(MessageReceivedContext context) 1181public override Task TokenValidated(TokenValidatedContext context) 1187public override Task AuthorizationCodeReceived(AuthorizationCodeReceivedContext context) 1193public override Task TokenResponseReceived(TokenResponseReceivedContext context) 1199public override Task UserInformationReceived(UserInformationReceivedContext context) 1205public override Task AuthenticationFailed(AuthenticationFailedContext context) 1211public override Task TicketReceived(TicketReceivedContext context) 1217public override Task AccessDenied(AccessDeniedContext context) 1223public override Task RemoteFailure(RemoteFailureContext context) 1229public override Task RedirectToIdentityProviderForSignOut(RedirectContext context) 1235public override Task RemoteSignOut(RemoteSignOutContext context) 1241public override Task SignedOutCallbackRedirect(RemoteSignOutContext context) 1354return Task.FromResult(new TokenValidationResult() 1390return Task.FromResult(new HttpResponseMessage() 1398return Task.FromResult(new HttpResponseMessage() { Content = new StringContent("{ }", Encoding.ASCII, "application/json") });
OpenIdConnect\OpenIdConnectTests.cs (14)
33public async Task SignOutSettingMessage() 60public async Task RedirectToIdentityProvider_SetsNonceCookiePath_ToCallBackPath() 85public async Task RedirectToIdentityProvider_NonceCookieOptions_CanBeOverriden() 113public async Task RedirectToIdentityProvider_SetsCorrelationIdCookiePath_ToCallBackPath() 138public async Task RedirectToIdentityProvider_CorrelationIdCookieOptions_CanBeOverriden() 166public async Task EndSessionRequestDoesNotIncludeTelemetryParametersWhenDisabled() 189public async Task SignOutFormPostWithDefaultRedirectUri() 207public async Task SignOutRedirectWithDefaultRedirectUri() 225public async Task SignOutWithCustomRedirectUri() 257public async Task SignOutWith_Specific_RedirectUri_From_Authentication_Properites() 288public async Task SignOut_WithMissingConfig_Throws() 302public async Task RemoteSignOut_WithMissingIssuer() 326public async Task RemoteSignOut_WithInvalidIssuer() 349public async Task RemoteSignOut_Get_Successful()
OpenIdConnect\TestServerBuilder.cs (1)
61Func<HttpContext, Task> handler,
OpenIdConnect\TestSettings.cs (1)
43public TestServer CreateTestServer(AuthenticationProperties properties = null, Func<HttpContext, Task> handler = null) => TestServerBuilder.CreateServer(_configureOptions, handler: handler, properties: properties);
PolicyTests.cs (29)
18public async Task CanDispatch() 55public async Task DefaultTargetSelectorWinsOverDefaultTarget() 111public async Task NullDefaultTargetSelectorFallsBacktoDefaultTarget() 167public async Task SpecificTargetAlwaysWinsOverDefaultTarget() 228public async Task VirtualSchemeTargetsForwardWithDefaultTarget() 280public async Task VirtualSchemeTargetsOverrideDefaultTarget() 337public async Task CanDynamicTargetBasedOnQueryString() 377return Task.FromResult(AuthenticateResult.Success(new AuthenticationTicket(principal, new AuthenticationProperties(), Scheme.Name))); 380public Task ChallengeAsync(AuthenticationProperties properties) 383return Task.CompletedTask; 386public Task ForbidAsync(AuthenticationProperties properties) 389return Task.CompletedTask; 392public Task InitializeAsync(AuthenticationScheme scheme, HttpContext context) 395return Task.CompletedTask; 398public Task SignInAsync(ClaimsPrincipal user, AuthenticationProperties properties) 401return Task.CompletedTask; 404public Task SignOutAsync(AuthenticationProperties properties) 407return Task.CompletedTask; 427return Task.FromResult(AuthenticateResult.Success(new AuthenticationTicket(principal, new AuthenticationProperties(), Scheme.Name))); 430public Task ChallengeAsync(AuthenticationProperties properties) 433return Task.CompletedTask; 436public Task ForbidAsync(AuthenticationProperties properties) 439return Task.CompletedTask; 442public Task InitializeAsync(AuthenticationScheme scheme, HttpContext context) 445return Task.CompletedTask; 448public Task SignInAsync(ClaimsPrincipal user, AuthenticationProperties properties) 451return Task.CompletedTask; 454public Task SignOutAsync(AuthenticationProperties properties) 457return Task.CompletedTask;
RemoteAuthenticationTests.cs (5)
18private Task<IHost> CreateHost(Action<TOptions> configureOptions, Func<HttpContext, Task> testpath = null, bool isDefault = true) 34protected virtual async Task<IHost> CreateHostWithServices(Action<IServiceCollection> configureServices, Func<HttpContext, Task> testpath = null) 59public async Task VerifySignInSchemeCannotBeSetToSelf() 74public async Task VerifySignInSchemeCannotBeSetToSelfUsingDefaultScheme() 87public async Task VerifySignInSchemeCannotBeSetToSelfUsingDefaultSignInScheme()
SharedAuthenticationTests.cs (12)
27public async Task CanForwardDefault() 82public async Task ForwardSignInWinsOverDefault() 125public async Task ForwardSignOutWinsOverDefault() 167public async Task ForwardForbidWinsOverDefault() 211return Task.FromResult(new ClaimsPrincipal()); 216public async Task ForwardAuthenticateOnlyRunsTransformOnceByDefault() 246public async Task ForwardAuthenticateWinsOverDefault() 285public async Task ForwardChallengeWinsOverDefault() 324public async Task ForwardSelectorWinsOverDefault() 393public async Task NullForwardSelectorUsesDefault() 462public async Task SpecificForwardWinsOverSelectorAndDefault() 536public async Task VerifySchemeDefaults()
TestExtensions.cs (2)
45public static Task DescribeAsync(this HttpResponse res, ClaimsPrincipal principal) 64public static Task DescribeAsync(this HttpResponse res, IEnumerable<AuthenticationToken> tokens)
TestHandlers.cs (20)
23protected override Task HandleChallengeAsync(AuthenticationProperties properties) 26return Task.CompletedTask; 29protected override Task HandleForbiddenAsync(AuthenticationProperties properties) 32return Task.CompletedTask; 42return Task.FromResult(AuthenticateResult.Success(new AuthenticationTicket(principal, new AuthenticationProperties(), Scheme.Name))); 45public Task SignInAsync(ClaimsPrincipal user, AuthenticationProperties properties) 48return Task.CompletedTask; 51public Task SignOutAsync(AuthenticationProperties properties) 54return Task.CompletedTask; 74return Task.FromResult(AuthenticateResult.Success(new AuthenticationTicket(principal, new AuthenticationProperties(), Scheme.Name))); 77public Task ChallengeAsync(AuthenticationProperties properties) 80return Task.CompletedTask; 83public Task ForbidAsync(AuthenticationProperties properties) 86return Task.CompletedTask; 89public Task InitializeAsync(AuthenticationScheme scheme, HttpContext context) 92return Task.CompletedTask; 95public Task SignInAsync(ClaimsPrincipal user, AuthenticationProperties properties) 98return Task.CompletedTask; 101public Task SignOutAsync(AuthenticationProperties properties) 104return Task.CompletedTask;
TestHttpMessageHandler.cs (2)
16return Task.FromResult(Sender(request)); 19return Task.FromResult<HttpResponseMessage>(null);
TwitterTests.cs (18)
45public async Task ChallengeWillTriggerApplyRedirectEvent() 56return Task.FromResult(0); 81public async Task ThrowsIfClientIdMissing() 97public async Task ThrowsIfClientSecretMissing() 109public async Task BadSignInWillThrow() 124public async Task SignInThrows() 137public async Task SignOutThrows() 150public async Task ForbidThrows() 163public async Task ChallengeWillTriggerRedirection() 187public async Task HandleRequestAsync_RedirectsToAccessDeniedPathWhenExplicitlySet() 228public async Task BadCallbackCallsAccessDeniedWithState() 246return Task.CompletedTask; 277public async Task TwitterError_Json_ThrowsParsedException() 307public async Task TwitterError_UnknownContentType_ThrowsHttpException() 332public async Task BadCallbackCallsRemoteAuthFailedWithState() 352return Task.CompletedTask; 384public async Task CanSignIn() 450public async Task CanFetchUserDetails()
WsFederation\TestTokenHandler.cs (1)
20return Task.FromResult(new TokenValidationResult
WsFederation\WsFederationTest.cs (19)
27public async Task VerifySchemeDefaults() 41public async Task MissingConfigurationThrows() 70public async Task ChallengeRedirects() 86public async Task MapWillNotAffectRedirect() 102public async Task PreMappedWillAffectRedirect() 118public async Task ValidTokenIsAccepted() 142public async Task ValidUnsolicitedTokenIsRefused() 151public async Task ValidUnsolicitedTokenIsAcceptedWhenAllowed() 169public async Task InvalidTokenIsRejected() 187public async Task RemoteSignoutRequestTriggersSignout() 201public async Task EventsResolvedFromDI() 239public override Task RedirectToIdentityProvider(RedirectContext context) 310return Task.FromResult(0); 320return Task.FromResult(0); 325return Task.FromResult(0); 340return Task.FromResult(0); 348return Task.FromResult(0); 353return Task.FromResult(0); 454return Task.FromResult<HttpResponseMessage>(newResponse);
WsFederation\WsFederationTest_Handler.cs (19)
25public async Task VerifySchemeDefaults() 39public async Task MissingConfigurationThrows() 68public async Task ChallengeRedirects() 84public async Task MapWillNotAffectRedirect() 100public async Task PreMappedWillAffectRedirect() 116public async Task ValidTokenIsAccepted() 140public async Task ValidUnsolicitedTokenIsRefused() 149public async Task ValidUnsolicitedTokenIsAcceptedWhenAllowed() 167public async Task InvalidTokenIsRejected() 185public async Task RemoteSignoutRequestTriggersSignout() 199public async Task EventsResolvedFromDI() 237public override Task RedirectToIdentityProvider(RedirectContext context) 306return Task.FromResult(0); 316return Task.FromResult(0); 321return Task.FromResult(0); 336return Task.FromResult(0); 344return Task.FromResult(0); 349return Task.FromResult(0); 450return Task.FromResult<HttpResponseMessage>(newResponse);
Microsoft.AspNetCore.Authentication.Twitter (10)
TwitterEvents.cs (7)
14public Func<TwitterCreatingTicketContext, Task> OnCreatingTicket { get; set; } = context => Task.CompletedTask; 19public Func<RedirectContext<TwitterOptions>, Task> OnRedirectToAuthorizationEndpoint { get; set; } = context => 22return Task.CompletedTask; 29/// <returns>A <see cref="Task"/> representing the completed operation.</returns> 30public virtual Task CreatingTicket(TwitterCreatingTicketContext context) => OnCreatingTicket(context); 36public virtual Task RedirectToAuthorizationEndpoint(RedirectContext<TwitterOptions> context) => OnRedirectToAuthorizationEndpoint(context);
TwitterHandler.cs (3)
55protected override Task<object> CreateEventsAsync() => Task.FromResult<object>(new TwitterEvents()); 164protected override async Task HandleChallengeAsync(AuthenticationProperties properties) 356private async Task EnsureTwitterRequestSuccess(HttpResponseMessage response)
Microsoft.AspNetCore.Authentication.WsFederation (21)
WsFederationEvents.cs (18)
14public Func<AuthenticationFailedContext, Task> OnAuthenticationFailed { get; set; } = context => Task.CompletedTask; 19public Func<MessageReceivedContext, Task> OnMessageReceived { get; set; } = context => Task.CompletedTask; 24public Func<RedirectContext, Task> OnRedirectToIdentityProvider { get; set; } = context => Task.CompletedTask; 29public Func<RemoteSignOutContext, Task> OnRemoteSignOut { get; set; } = context => Task.CompletedTask; 34public Func<SecurityTokenReceivedContext, Task> OnSecurityTokenReceived { get; set; } = context => Task.CompletedTask; 39public Func<SecurityTokenValidatedContext, Task> OnSecurityTokenValidated { get; set; } = context => Task.CompletedTask; 44public virtual Task AuthenticationFailed(AuthenticationFailedContext context) => OnAuthenticationFailed(context); 49public virtual Task MessageReceived(MessageReceivedContext context) => OnMessageReceived(context); 54public virtual Task RedirectToIdentityProvider(RedirectContext context) => OnRedirectToIdentityProvider(context); 59public virtual Task RemoteSignOut(RemoteSignOutContext context) => OnRemoteSignOut(context); 64public virtual Task SecurityTokenReceived(SecurityTokenReceivedContext context) => OnSecurityTokenReceived(context); 69public virtual Task SecurityTokenValidated(SecurityTokenValidatedContext context) => OnSecurityTokenValidated(context);
WsFederationHandler.cs (3)
61protected override Task<object> CreateEventsAsync() => Task.FromResult<object>(new WsFederationEvents()); 85protected override async Task HandleChallengeAsync(AuthenticationProperties properties) 411public virtual async Task SignOutAsync(AuthenticationProperties? properties)
Microsoft.AspNetCore.Authorization (22)
AssertionRequirement.cs (2)
29Handler = context => Task.FromResult(handler(context)); 47public async Task HandleAsync(AuthorizationHandlerContext context)
AuthorizationHandler.cs (4)
20public virtual async Task HandleAsync(AuthorizationHandlerContext context) 33protected abstract Task HandleRequirementAsync(AuthorizationHandlerContext context, TRequirement requirement); 49public virtual async Task HandleAsync(AuthorizationHandlerContext context) 66protected abstract Task HandleRequirementAsync(AuthorizationHandlerContext context, TRequirement requirement, TResource resource);
AuthorizationOptions.cs (3)
16private static readonly Task<AuthorizationPolicy?> _nullPolicyTask = Task.FromResult<AuthorizationPolicy?>(null); 54PolicyMap[name] = Task.FromResult<AuthorizationPolicy?>(policy); 69PolicyMap[name] = Task.FromResult<AuthorizationPolicy?>(policyBuilder.Build());
ClaimsAuthorizationRequirement.cs (2)
51protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, ClaimsAuthorizationRequirement requirement) 84return Task.CompletedTask;
DefaultAuthorizationHandlerProvider.cs (1)
27_handlersTask = Task.FromResult(handlers);
DefaultAuthorizationPolicyProvider.cs (2)
40_cachedDefaultPolicy = Task.FromResult(_options.DefaultPolicy); 54_cachedFallbackPolicy = Task.FromResult(_options.FallbackPolicy);
DenyAnonymousAuthorizationRequirement.cs (2)
22protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, DenyAnonymousAuthorizationRequirement requirement) 32return Task.CompletedTask;
IAuthorizationHandler.cs (1)
17Task HandleAsync(AuthorizationHandlerContext context);
NameAuthorizationRequirement.cs (2)
38protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, NameAuthorizationRequirement requirement) 58return Task.CompletedTask;
PassThroughAuthorizationHandler.cs (1)
35public async Task HandleAsync(AuthorizationHandlerContext context)
RolesAuthorizationRequirement.cs (2)
43protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, RolesAuthorizationRequirement requirement) 63return Task.CompletedTask;
Microsoft.AspNetCore.Authorization.Policy (4)
AuthorizationMiddleware.cs (1)
93public async Task Invoke(HttpContext context)
AuthorizationMiddlewareResultHandler.cs (2)
15public Task HandleAsync(RequestDelegate next, HttpContext context, AuthorizationPolicy policy, PolicyAuthorizationResult authorizeResult) 24async Task Handle()
IAuthorizationMiddlewareResultHandler.cs (1)
23Task HandleAsync(RequestDelegate next, HttpContext context, AuthorizationPolicy policy, PolicyAuthorizationResult authorizeResult);
Microsoft.AspNetCore.Authorization.Test (172)
AuthorizationAppBuilderExtensionsTests.cs (1)
15public async Task UseAuthorization_HasRequiredSevices_RegistersMiddleware()
AuthorizationEndpointConventionBuilderExtensionsTests.cs (10)
25var endpointModel = new RouteEndpointBuilder((context) => Task.CompletedTask, RoutePatternFactory.Parse("/"), 0); 43var endpointModel = new RouteEndpointBuilder((context) => Task.CompletedTask, RoutePatternFactory.Parse("/"), 0); 62var endpointModel = new RouteEndpointBuilder((context) => Task.CompletedTask, RoutePatternFactory.Parse("/"), 0); 81var endpointModel = new RouteEndpointBuilder((context) => Task.CompletedTask, RoutePatternFactory.Parse("/"), 0); 100var endpointModel = new RouteEndpointBuilder((context) => Task.CompletedTask, RoutePatternFactory.Parse("/"), 0); 133var endpointModel = new RouteEndpointBuilder((context) => Task.CompletedTask, RoutePatternFactory.Parse("/"), 0); 156var endpointModel = new RouteEndpointBuilder((context) => Task.CompletedTask, RoutePatternFactory.Parse("/"), 0); 182var endpointModel = new RouteEndpointBuilder((context) => Task.CompletedTask, RoutePatternFactory.Parse("/"), 0); 208var endpointModel = new RouteEndpointBuilder((context) => Task.CompletedTask, RoutePatternFactory.Parse("/"), 0); 232var endpointModel = new RouteEndpointBuilder((context) => Task.CompletedTask, RoutePatternFactory.Parse("/"), 0);
AuthorizationMiddlewareResultHandlerTests.cs (7)
15public async Task CallRequestDelegate_If_PolicyAuthorizationResultSucceeded() 29public async Task NotCallRequestDelegate_If_PolicyAuthorizationResultWasChallenged() 43public async Task NotCallRequestDelegate_If_PolicyAuthorizationResultWasForbidden() 57public async Task ChallangeEachAuthenticationScheme_If_PolicyAuthorizationResultWasChallenged() 81public async Task ChallangeWithoutAuthenticationScheme_If_PolicyAuthorizationResultWasChallenged() 96public async Task ForbidEachAuthenticationScheme_If_PolicyAuthorizationResultWasForbidden() 120public async Task ForbidWithoutAuthenticationScheme_If_PolicyAuthorizationResultWasForbidden()
AuthorizationMiddlewareTests.cs (43)
24public async Task NoEndpoint_AnonymousUser_Allows() 43public async Task NoEndpointWithFallback_AnonymousUser_Challenges() 63public async Task HasEndpointWithoutAuth_AnonymousUser_Allows() 82public async Task HasEndpointWithFallbackWithoutAuth_AnonymousUser_Challenges() 103public async Task HasEndpointWithOnlyFallbackAuth_AnonymousUser_Allows() 125public async Task HasEndpointWithAuth_AnonymousUser_Challenges() 147public async Task HasEndpointWithAuth_ChallengesAuthenticationSchemes() 169public async Task HasEndpointWithAuth_AnonymousUser_ChallengePerScheme() 191public async Task OnAuthorizationAsync_WillCallPolicyProvider() 233public async Task OnAuthorizationAsync_WillNotCallPolicyProviderWithCache() 275public async Task UseAuthorizationUsesCache() 344return Task.FromResult(new AuthorizationPolicyBuilder().RequireAssertion(_ => true).Build()); 353public async Task OnAuthorizationAsync_WillCallDerviedDefaultPolicyProviderCanCache(bool canCache) 385public async Task OnAuthorizationAsync_WillCallCustomPolicyProviderWithCache() 419public async Task CanApplyPolicyDirectlyToEndpoint() 463public async Task CanApplyRequirementAttributeDirectlyToEndpoint(bool assertSuccess) 484public async Task CanApplyMultipleRequirements(bool assertSuccess, bool assert2Success) 504public async Task CanApplyRequirementAttributeWithAuthorizeDirectlyToEndpoint(bool assertSuccess) 526public async Task CanApplyAuthorizeRequirementAttributeDirectlyToEndpoint(bool anonymous, bool assertSuccess) 544public async Task Invoke_ValidClaimShouldNotFail() 563public async Task HasEndpointWithAuthAndAllowAnonymous_AnonymousUser_Allows() 584public async Task HasEndpointWithAuth_AuthenticatedUser_Allows() 605public async Task Invoke_AuthSchemesFailShouldSetEmptyPrincipalOnContext() 629public async Task Invoke_SingleValidClaimShouldSucceed() 648public async Task AuthZResourceCanBeHttpContextAndHaveEndpoint() 675public async Task AuthZResourceShouldBeEndpointByDefaultWithCompatSwitch() 702public async Task Invoke_RequireUnknownRoleShouldForbid() 724public async Task Invoke_RequireUnknownRole_ForbidPerScheme() 745public async Task Invoke_InvalidClaimShouldForbid() 769public async Task IAuthenticateResultFeature_SetOnSuccessfulAuthorize() 792public async Task IAuthenticateResultFeature_NotSetOnUnsuccessfulAuthorize() 815public async Task IAuthenticateResultFeature_ContainsLowestExpiration() 856public async Task IAuthenticateResultFeature_NullResultWhenUserSetAfter() 882public async Task IAuthenticateResultFeature_SettingResultSetsUser() 914public async Task IAuthenticateResultFeature_UsesExistingFeature_WithScheme() 948public async Task IAuthenticateResultFeature_UsesExistingFeatureAndResult_WithoutScheme() 975public async Task WebApplicationBuilder_CanRegisterAuthzMiddlewareWithScopedService() 996requestDelegate = requestDelegate ?? ((context) => Task.CompletedTask); 1003return new Endpoint(context => Task.CompletedTask, new EndpointMetadataCollection(metadata), "Test endpoint"); 1063public Task HandleAsync(AuthorizationHandlerContext context) => Task.CompletedTask; 1078public Task Invoke(HttpContext context) 1082return Task.CompletedTask;
AuthorizationPolicyFacts.cs (7)
18public async Task CanCombineAuthorizeAttributes() 47public async Task CanReplaceDefaultPolicyDirectly() 70public async Task CanReplaceDefaultPolicy() 96public async Task CombineMustTrimRoles() 117public async Task CombineMustTrimAuthenticationScheme() 137public async Task CombineMustIgnoreEmptyAuthenticationScheme() 157public async Task CombineMustIgnoreEmptyRoles()
DefaultAuthorizationServiceTests.cs (71)
25public async Task AuthorizeCombineThrowsOnUnknownPolicy() 36public async Task Authorize_ShouldAllowIfClaimIsPresent() 51public async Task Authorize_ShouldAllowIfClaimIsPresentWithSpecifiedAuthType() 72public async Task Authorize_ShouldAllowIfClaimIsAmongValues() 94public async Task Authorize_ShouldInvokeAllHandlersByDefault() 119public async Task Authorize_ShouldInvokeAllHandlersDependingOnSetting(bool invokeAllHandlers) 146public Task HandleAsync(AuthorizationHandlerContext context) 150return Task.FromResult(0); 162public Task HandleAsync(AuthorizationHandlerContext context) 166return Task.FromResult(0); 171public async Task CanFailWithReasons() 200public async Task Authorize_ShouldFailWhenAllRequirementsNotHandled() 222public async Task Authorize_ShouldNotAllowIfClaimTypeIsNotPresent() 243public async Task Authorize_ShouldNotAllowIfClaimValueIsNotPresent() 264public async Task Authorize_ShouldNotAllowIfNoClaims() 283public async Task Authorize_ShouldNotAllowIfUserIsNull() 297public async Task Authorize_ShouldNotAllowIfNotCorrectAuthType() 312public async Task Authorize_ShouldAllowWithNoAuthType() 333public async Task Authorize_ThrowsWithUnknownPolicy() 345public async Task Authorize_CustomRolePolicy() 368public async Task Authorize_HasAnyClaimOfTypePolicy() 389public async Task Authorize_PolicyCanAuthenticationSchemeWithNameClaim() 406public async Task RolePolicyCanRequireSingleRole() 423public async Task RolePolicyCanRequireOneOfManyRoles() 439public async Task RolePolicyCanBlockWrongRole() 460public async Task RolePolicyCanBlockNoRole() 487public async Task RequireUserNameFailsForWrongUserName() 508public async Task CanRequireUserName() 534public async Task CanRequireUserNameWithDiffClaimType() 556public async Task CanRequireRoleWithDiffClaimType() 578public async Task CanApproveAnyAuthenticatedUser() 603public async Task CanBlockNonAuthenticatedUser() 627protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, CustomRequirement requirement) 631return Task.FromResult(0); 636public async Task CustomReqWithNoHandlerFails() 656public async Task CustomReqWithHandlerSucceeds() 685protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, PassThroughRequirement requirement) 691return Task.FromResult(0); 698public async Task PassThroughRequirementWillSucceedWithoutCustomHandler(bool shouldSucceed) 718public async Task CanCombinePolicies() 746public async Task CombinePoliciesWillFailIfBasePolicyFails() 773public async Task CombinedPoliciesWillFailIfExtraRequirementFails() 817protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, OperationAuthorizationRequirement requirement, ExpenseReport resource) 823return Task.FromResult(0); 829protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, OperationAuthorizationRequirement requirement) 835return Task.FromResult(0); 840public async Task CanAuthorizeAllSuperuserOperations() 865protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, OperationAuthorizationRequirement requirement, string resource) 873protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, OperationAuthorizationRequirement requirement, int id) 879return Task.FromResult(0); 884public async Task CanUseValueTypeResource() 905public async Task DoesNotCallHandlerWithWrongResourceType() 926public async Task CanAuthorizeOnlyAllowedOperations() 943public async Task AuthorizeHandlerNotCalledWithNullResource() 958public async Task CanAuthorizeWithAssertionRequirement() 977public async Task CanAuthorizeWithAsyncAssertionRequirement() 983options.AddPolicy("Basic", policy => policy.RequireAssertion(context => Task.FromResult(true))); 999return Task.FromResult(new AuthorizationPolicyBuilder().RequireAuthenticatedUser().Build()); 1004return Task.FromResult<AuthorizationPolicy>(null); 1009return Task.FromResult(new AuthorizationPolicyBuilder().RequireAuthenticatedUser().Build()); 1014public async Task CanReplaceDefaultPolicyProvider() 1038return Task.FromResult(new AuthorizationPolicyBuilder().RequireAuthenticatedUser().Build()); 1043return Task.FromResult<AuthorizationPolicy>(null); 1048return Task.FromResult(new AuthorizationPolicyBuilder().RequireClaim(policyName).Build()); 1053public async Task CanUseDynamicPolicyProvider() 1080public async Task CanUseCustomEvaluatorThatOverridesRequirement() 1121public async Task CanUseCustomContextThatAlwaysFails() 1135return Task.FromResult<IEnumerable<IAuthorizationHandler>>(new IAuthorizationHandler[1] { new FailHandler() }); 1140public async Task CanUseCustomHandlerProvider() 1184public async Task Authorize_ShouldLogRequirementDetailWhenUnHandled() 1217public async Task Authorize_ShouldLogExplicitFailedWhenFailedCall()
PassThroughAuthorizationHandlerTests.cs (3)
25public async Task PassThroughShouldInvokeAllHandlersBasedOnSetting(bool invokeAllHandlers) 57protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, SelfRequirement requirement) 68return Task.FromResult(0);
PolicyEvaluatorTests.cs (22)
14public async Task AuthenticateFailsIfNoPrincipalReturned() 31public async Task AuthenticateMergeSchemes() 49public async Task AuthenticateMergeSchemesPreservesSingleScheme() 69public async Task AuthorizeSucceedsEvenIfAuthenticationFails() 86public async Task AuthorizeSucceedsOnlyIfResourceSpecified() 104public async Task AuthorizeChallengesIfAuthenticationFails() 121public async Task AuthorizeForbidsIfAuthenticationSuceeds() 138public async Task AuthorizeForbidsAndFailureIsIncludedIfAuthenticationSuceeds() 172=> Task.FromResult(AuthorizationResult.Success()); 175=> Task.FromResult(AuthorizationResult.Success()); 181=> Task.FromResult(AuthorizationResult.Failed()); 184=> Task.FromResult(AuthorizationResult.Failed()); 190=> Task.FromResult(AuthenticateResult.Fail("Sad.")); 192public Task ChallengeAsync(HttpContext context, string scheme, AuthenticationProperties properties) 195public Task ForbidAsync(HttpContext context, string scheme, AuthenticationProperties properties) 198public Task SignInAsync(HttpContext context, string scheme, ClaimsPrincipal principal, AuthenticationProperties properties) 201public Task SignOutAsync(HttpContext context, string scheme, AuthenticationProperties properties) 212return Task.FromResult(AuthenticateResult.Success(new AuthenticationTicket(Principal, scheme))); 215public Task ChallengeAsync(HttpContext context, string scheme, AuthenticationProperties properties) 218public Task ForbidAsync(HttpContext context, string scheme, AuthenticationProperties properties) 221public Task SignInAsync(HttpContext context, string scheme, ClaimsPrincipal principal, AuthenticationProperties properties) 224public Task SignOutAsync(HttpContext context, string scheme, AuthenticationProperties properties)
TestObjects\TestAuthenticationService.cs (8)
27return Task.FromResult(AuthenticateResult.Success(new AuthenticationTicket(new ClaimsPrincipal(identity), scheme))); 30return Task.FromResult(AuthenticateResult.Fail("Denied")); 33public Task ChallengeAsync(HttpContext context, string scheme, AuthenticationProperties properties) 36return Task.CompletedTask; 39public Task ForbidAsync(HttpContext context, string scheme, AuthenticationProperties properties) 42return Task.CompletedTask; 45public Task SignInAsync(HttpContext context, string scheme, ClaimsPrincipal principal, AuthenticationProperties properties) 50public Task SignOutAsync(HttpContext context, string scheme, AuthenticationProperties properties)
Microsoft.AspNetCore.BrowserTesting (9)
BrowserManager.cs (4)
29private Task _initializeTask; 51private async Task InitializeAsync() 55async Task InitializeCore() 147public async Task DisposeAsync()
BrowserTestBase.cs (4)
28protected override async Task InitializeCoreAsync(TestContext context) 35public Task InitializeAsync() => Task.CompletedTask; 66public virtual Task DisposeAsync() => BrowserManager?.DisposeAsync();
PageInformation.cs (1)
39private async Task LogPageVideoPath()
Microsoft.AspNetCore.Components (252)
CascadingValue.cs (2)
51public Task SetParametersAsync(ParameterView parameters) 126return Task.CompletedTask;
CascadingValueSource.cs (7)
83/// <returns>A <see cref="Task"/> that completes when the notifications have been issued.</returns> 84public Task NotifyChangedAsync() 93var tasks = new List<Task>(); 106return Task.WhenAll(tasks); 110return Task.CompletedTask; 118/// <returns>A <see cref="Task"/> that completes when the notifications have been issued.</returns> 119public Task NotifyChangedAsync(TValue newValue)
CompilerServices\RuntimeHelpers.cs (9)
51public static EventCallback<T> CreateInferredEventCallback<T>(object receiver, Func<T, Task> callback, T value) 81public static Func<T, Task> CreateInferredBindSetter<T>(Func<T, Task> callback, T value) 94public static Func<T, Task> CreateInferredBindSetter<T>(Action<T?> callback, T value) 99return Task.CompletedTask; 133public static Task InvokeAsynchronousDelegate(Action callback) 136return Task.CompletedTask; 153public static Task InvokeAsynchronousDelegate(Func<Task> callback)
ComponentBase.cs (28)
94/// <returns>A <see cref="Task"/> representing any asynchronous operation.</returns> 95protected virtual Task OnInitializedAsync() 96=> Task.CompletedTask; 110/// <returns>A <see cref="Task"/> representing any asynchronous operation.</returns> 111protected virtual Task OnParametersSetAsync() 112=> Task.CompletedTask; 178/// Note that the component does not automatically re-render after the completion of any returned <see cref="Task"/>, 185/// <returns>A <see cref="Task"/> representing any asynchronous operation.</returns> 192protected virtual Task OnAfterRenderAsync(bool firstRender) 193=> Task.CompletedTask; 200protected Task InvokeAsync(Action workItem) 208protected Task InvokeAsync(Func<Task> workItem) 220/// <returns>A <see cref="Task"/> that will be completed when the exception has finished dispatching.</returns> 221protected Task DispatchExceptionAsync(Exception exception) 241/// <returns>A <see cref="Task"/> that completes when the component has finished updating and rendering itself.</returns> 254public virtual Task SetParametersAsync(ParameterView parameters) 269private async Task RunInitAndSetParametersAsync() 272var task = OnInitializedAsync(); 305private Task CallOnParametersSetAsync() 308var task = OnParametersSetAsync(); 321Task.CompletedTask; 324private async Task CallStateHasChangedOnAsyncCompletion(Task task) 344Task IHandleEvent.HandleEventAsync(EventCallbackWorkItem callback, object? arg) 346var task = callback.InvokeAsync(arg); 357Task.CompletedTask; 360Task IHandleAfterRender.OnAfterRenderAsync()
Dispatcher.cs (5)
58/// <returns>A <see cref="Task"/> that will be completed when the action has finished executing.</returns> 59public abstract Task InvokeAsync(Action workItem); 65/// <returns>A <see cref="Task"/> that will be completed when the action has finished executing.</returns> 66public abstract Task InvokeAsync(Func<Task> workItem);
DynamicComponent.cs (2)
63public Task SetParametersAsync(ParameterView parameters) 90return Task.CompletedTask;
ErrorBoundaryBase.cs (4)
55protected abstract Task OnErrorAsync(Exception exception); 83var onErrorTask = OnErrorAsync(exception); 93private async Task HandleOnErrorExceptions(Task onExceptionTask)
EventCallback.cs (4)
52/// <returns>A <see cref="Task"/> which completes asynchronously once event processing has completed.</returns> 53public Task InvokeAsync(object? arg) 67/// <returns>A <see cref="Task"/> which completes asynchronously once event processing has completed.</returns> 68public Task InvokeAsync() => InvokeAsync(null!);
EventCallbackFactory.cs (5)
63public EventCallback Create(object receiver, Func<Task> callback) 77public EventCallback Create(object receiver, Func<object, Task> callback) 147public EventCallback<TValue> Create<TValue>(object receiver, Func<Task> callback) 161public EventCallback<TValue> Create<TValue>(object receiver, Func<TValue, Task> callback) 191public EventCallback<TValue> CreateInferred<TValue>(object receiver, Func<TValue, Task> callback, TValue value)
EventCallbackFactoryBinderExtensions.cs (36)
58Func<string?, Task> setter, 98Func<bool, Task> setter, 138Func<bool?, Task> setter, 178Func<int, Task> setter, 218Func<int?, Task> setter, 258Func<long, Task> setter, 298Func<short, Task> setter, 338Func<long?, Task> setter, 378Func<short?, Task> setter, 418Func<float, Task> setter, 458Func<float?, Task> setter, 498Func<double, Task> setter, 538Func<double?, Task> setter, 578Func<decimal, Task> setter, 618Func<decimal?, Task> setter, 658Func<DateTime, Task> setter, 701Func<DateTime, Task> setter, 742Func<DateTime?, Task> setter, 785Func<DateTime?, Task> setter, 826Func<DateTimeOffset, Task> setter, 869Func<DateTimeOffset, Task> setter, 910Func<DateTimeOffset?, Task> setter, 953Func<DateTimeOffset?, Task> setter, 994Func<DateOnly, Task> setter, 1037Func<DateOnly, Task> setter, 1078Func<DateOnly?, Task> setter, 1121Func<DateOnly?, Task> setter, 1162Func<TimeOnly, Task> setter, 1205Func<TimeOnly, Task> setter, 1246Func<TimeOnly?, Task> setter, 1289Func<TimeOnly?, Task> setter, 1332Func<T, Task> setter, 1385Func<T, Task> setter, 1389Func<ChangeEventArgs, Task> callback = async e => 1472Func<T, Task> setter, 1477Func<ChangeEventArgs, Task> callback = async e =>
EventCallbackFactoryEventArgsExtensions.cs (2)
34public static EventCallback<EventArgs> Create(this EventCallbackFactory factory, object receiver, Func<EventArgs, Task> callback) 64public static EventCallback<ChangeEventArgs> Create(this EventCallbackFactory factory, object receiver, Func<ChangeEventArgs, Task> callback)
EventCallbackOfT.cs (4)
47/// <returns>A <see cref="Task"/> which completes asynchronously once event processing has completed.</returns> 48public Task InvokeAsync(TValue? arg) 62/// <returns>A <see cref="Task"/> which completes asynchronously once event processing has completed.</returns> 63public Task InvokeAsync() => InvokeAsync(default!);
EventCallbackWorkItem.cs (11)
33/// <returns>A <see cref="Task"/> then will complete asynchronously once the delegate has completed.</returns> 34public Task InvokeAsync(object? arg) 39internal static Task InvokeAsync<T>(MulticastDelegate? @delegate, T arg) 44return Task.CompletedTask; 48return Task.CompletedTask; 52return Task.CompletedTask; 54case Func<Task> func: 57case Func<T, Task> funcEventArgs: 64return @delegate.DynamicInvoke(arg) as Task ?? Task.CompletedTask; 71return Task.FromException(e.InnerException!);
IComponent.cs (2)
21/// <returns>A <see cref="Task"/> that completes when the component has finished updating and rendering itself.</returns> 27Task SetParametersAsync(ParameterView parameters);
IHandleAfterRender.cs (2)
14/// <returns>A <see cref="Task"/> that represents the asynchronous event handling operation.</returns> 15Task OnAfterRenderAsync();
IHandleEvent.cs (2)
17/// A <see cref="Task"/> that completes once the component has processed the state change. 19Task HandleEventAsync(EventCallbackWorkItem item, object? arg);
Infrastructure\ComponentStatePersistenceManager.cs (17)
38/// <returns>A <see cref="Task"/> that will complete when the state has been restored.</returns> 39public async Task RestoreStateAsync(IPersistentComponentStateStore store) 50/// <returns>A <see cref="Task"/> that will complete when the state has been restored.</returns> 51public Task PersistStateAsync(IPersistentComponentStateStore store, Renderer renderer) 60async Task PauseAndPersistState() 88async Task PersistState(IPersistentComponentStateStore store) 128internal Task PauseAsync(IPersistentComponentStateStore store) 130List<Task>? pendingCallbackTasks = null; 145var result = ExecuteCallback(registration.Callback, _logger); 155return Task.WhenAll(pendingCallbackTasks); 159return Task.CompletedTask; 162static Task ExecuteCallback(Func<Task> callback, ILogger<ComponentStatePersistenceManager> logger) 166var current = callback(); 179return Task.CompletedTask; 182static async Task Awaited(Task task, ILogger<ComponentStatePersistenceManager> logger)
IPersistentComponentStateStore.cs (2)
21/// <returns>A <see cref="Task" /> that completes when the state is persisted to disk.</returns> 22Task PersistStateAsync(IReadOnlyDictionary<string, byte[]> state);
LayoutComponentBase.cs (1)
29public override Task SetParametersAsync(ParameterView parameters) => base.SetParametersAsync(parameters);
LayoutView.cs (2)
42public Task SetParametersAsync(ParameterView parameters) 46return Task.CompletedTask;
NavigationManager.cs (3)
373var locationChangingTasks = new HashSet<Task>(); 395var completedHandlerTask = await Task.WhenAny(locationChangingTasks).WaitAsync(cancellationToken);
PersistComponentStateRegistration.cs (2)
7Func<Task> callback, 10public Func<Task> Callback { get; } = callback;
PersistentComponentState.cs (2)
45public PersistingComponentStateSubscription RegisterOnPersisting(Func<Task> callback) 55public PersistingComponentStateSubscription RegisterOnPersisting(Func<Task> callback, IComponentRenderMode? renderMode)
RenderHandle.cs (2)
94/// <returns>A <see cref="Task"/> that will be completed when the exception has finished dispatching.</returns> 95public Task DispatchExceptionAsync(Exception exception)
Rendering\ComponentState.cs (6)
133internal Task NotifyRenderCompletedAsync() 143return Task.FromCanceled(cex.CancellationToken); 147return Task.FromException(ex); 151return Task.CompletedTask; 233Task setParametersAsyncTask; 240setParametersAsyncTask = Task.FromException(ex);
Rendering\RendererSynchronizationContext.cs (11)
13private Task _taskQueue; 17public RendererSynchronizationContext() : this(new object(), Task.CompletedTask) { } 19private RendererSynchronizationContext(object @lock, Task taskQueue) 41public Task InvokeAsync(Action action) 44var t = completion.Task; // lazy initialize before passing around the struct 118public Task InvokeAsync(Func<Task> asyncAction) 121var t = completion.Task; // lazy initialize before passing around the struct 171Task antecedent; 191private async Task PostAsync<TState>(Task antecedent, Action<TState> callback, TState state)
Rendering\RendererSynchronizationContextDispatcher.cs (5)
21public override Task InvokeAsync(Action workItem) 27return Task.CompletedTask; 33public override Task InvokeAsync(Func<Task> workItem) 49return Task.FromResult(workItem());
RenderTree\Renderer.cs (56)
37private Task? _ongoingQuiescenceTask; 42private List<Task>? _pendingTasks; 43private Task? _disposeTask; 239protected Task RenderRootComponentAsync(int componentId) 250/// The returned <see cref="Task"/> waits for this component and all descendant components to 259protected internal async Task RenderRootComponentAsync(int componentId, ParameterView initialParameters) 323private async Task WaitForQuiescence() 344async Task ProcessAsynchronousWork() 351var pendingWork = Task.WhenAll(_pendingTasks); 391/// <returns>A <see cref="Task"/> to represent the UI update process.</returns> 392protected abstract Task UpdateDisplayAsync(in RenderBatch renderBatch); 401/// A <see cref="Task"/> which will complete once all asynchronous processing related to the event 404public virtual Task DispatchEventAsync(ulong eventHandlerId, EventFieldInfo? fieldInfo, EventArgs eventArgs) 417/// A <see cref="Task"/> which will complete once all asynchronous processing related to the event 420public virtual Task DispatchEventAsync(ulong eventHandlerId, EventFieldInfo? fieldInfo, EventArgs eventArgs, bool waitForQuiescence) 442return Task.CompletedTask; 463Task? task = null; 475return Task.CompletedTask; 488var errorHandledTask = GetErrorHandledTask(task, receiverComponentState); 568internal void AddToPendingTasksWithErrorHandling(Task task, ComponentState? owningComponentState) 590var handledErrorTask = GetErrorHandledTask(task, owningComponentState); 601/// <param name="task">The <see cref="Task"/>.</param> 602protected virtual void AddPendingTask(ComponentState? componentState, Task task) 742var updateDisplayTask = Task.CompletedTask; 798private Task InvokeRenderCompletedCalls(ArrayRange<RenderTreeDiff> updatedComponents, Task updateDisplayTask) 808return Task.CompletedTask; 815return Task.CompletedTask; 830List<Task> batch = null; 842Task.WhenAll(batch) : 843Task.CompletedTask; 846private async Task InvokeRenderCompletedCallsAfterUpdateDisplayTask( 847Task updateDisplayTask, 865List<Task> batch = null; 876var result = batch != null ? 877Task.WhenAll(batch) : 878Task.CompletedTask; 883private void NotifyRenderCompleted(ComponentState state, ref List<Task> batch) 892var task = state.NotifyRenderCompletedAsync(); 912batch = batch ?? new List<Task>(); 952var result = disposalTask.AsTask(); 955async Task GetHandledAsynchronousDisposalErrorsTask(Task result) 989private void RemoveEventHandlerIds(ArrayRange<ulong> eventHandlerIds, Task afterTaskIgnoreErrors) 1014async Task ContinueAfterTask(ArrayRange<ulong> eventHandlerIds, Task afterTaskIgnoreErrors) 1033RemoveEventHandlerIds(eventHandlerIdsClone, Task.CompletedTask); 1037private async Task GetErrorHandledTask(Task taskToHandle, ComponentState? owningComponentState) 1145var done = Dispatcher.InvokeAsync(() => Dispose(disposing)); 1169List<Task> asyncDisposables = null; 1207async Task HandleAsyncExceptions(List<Task> tasks) 1210foreach (var task in tasks)
RouteView.cs (2)
57public Task SetParametersAsync(ParameterView parameters) 67return Task.CompletedTask;
Routing\INavigationInterception.cs (2)
14/// <returns>A <see cref="Task" /> that represents the asynchronous operation.</returns> 15Task EnableNavigationInterceptionAsync();
Routing\IScrollToLocationHash.cs (2)
15/// <returns>A <see cref="Task" /> that represents the asynchronous operation.</returns> 16Task RefreshScrollPositionForHash(string locationAbsolute);
Routing\Router.cs (6)
36private Task _previousOnNavigateTask = Task.CompletedTask; 117public async Task SetParametersAsync(ParameterView parameters) 303var task = await Task.WhenAny(OnNavigateAsync.InvokeAsync(navigateContext), cancellationTcs.Task); 323async Task IHandleAfterRender.OnAfterRenderAsync()
Sections\SectionContent.cs (2)
43Task IComponent.SetParametersAsync(ParameterView parameters) 82return Task.CompletedTask;
Sections\SectionOutlet.cs (4)
39Task IComponent.SetParametersAsync(ParameterView parameters) 75return Task.CompletedTask; 137public Task SetParametersAsync(ParameterView parameters) 141return Task.CompletedTask;
Microsoft.AspNetCore.Components.Analyzers (2)
ComponentParametersShouldBePublicCodeFixProvider.cs (2)
31public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 57return Task.FromResult(document.WithSyntaxRoot(newSyntaxRoot));
Microsoft.AspNetCore.Components.Analyzers.Tests (4)
ComponentInternalUsageDiagnosticsAnalyzerTest.cs (2)
21public async Task InternalUsage_FindsUseOfInternalTypesInDeclarations() 65public async Task InternalUsage_FindsUseOfInternalTypesInMethodBody()
TestFiles\ComponentInternalUsageDiagnosticsAnalyzerTest\UsesRendererAsBaseClass.cs (1)
23protected override Task UpdateDisplayAsync(/*M1*/in RenderBatch renderBatch)
TestFiles\ComponentInternalUsageDiagnosticsAnalyzerTest\UsesRendererTypesInDeclarations.cs (1)
28/*MMParameter*/protected override Task UpdateDisplayAsync(in RenderBatch renderBatch)
Microsoft.AspNetCore.Components.Authorization (3)
AuthenticationStateProvider.cs (2)
26/// <param name="task">A <see cref="Task"/> that supplies the updated <see cref="AuthenticationState"/>.</param> 38/// <param name="task">A <see cref="Task"/> that supplies the updated <see cref="AuthenticationState"/>.</param>
AuthorizeViewCore.cs (1)
71protected override async Task OnParametersSetAsync()
Microsoft.AspNetCore.Components.Authorization.Tests (30)
AuthorizeRouteViewTest.cs (6)
25_authenticationStateProvider.CurrentAuthStateTask = Task.FromResult( 179_authenticationStateProvider.CurrentAuthStateTask = Task.FromResult(new AuthenticationState( 202public async Task WhenAuthorizing_RendersDefaultAuthorizingContentInsideLayout() 212var firstRenderTask = _renderer.RenderRootComponentAsync(_authorizeRouteViewComponentId, ParameterView.FromDictionary(new Dictionary<string, object> 256var firstRenderTask = _renderer.RenderRootComponentAsync(_authorizeRouteViewComponentId, ParameterView.FromDictionary(new Dictionary<string, object> 344var render2Task = _renderer.Dispatcher.InvokeAsync(() => _authorizeRouteViewComponent.SetParametersAsync(ParameterView.FromDictionary(new Dictionary<string, object>
AuthorizeViewTest.cs (3)
291public async Task RendersAuthorizingUntilAuthorizationCompletedAsync() 524= Task.FromResult(new AuthenticationState(new ClaimsPrincipal())); 561=> Task.FromResult(new AuthenticationState(
CascadingAuthenticationStateTest.cs (3)
39CurrentAuthStateTask = Task.FromResult(CreateAuthenticationState("Bert")) 124CurrentAuthStateTask = Task.FromResult(CreateAuthenticationState(null)) 138Task.FromResult(CreateAuthenticationState("Bert")));
src\Components\Shared\test\AutoRenderComponent.cs (3)
18public virtual Task SetParametersAsync(ParameterView parameters) 22return Task.CompletedTask; 28var t = _renderHandle.Dispatcher.InvokeAsync(() => _renderHandle.Render(BuildRenderTree));
src\Components\Shared\test\TestRenderer.cs (10)
48public Task NextRenderResultTask { get; set; } = Task.CompletedTask; 63var task = Dispatcher.InvokeAsync(() => base.RenderRootComponentAsync(componentId, parameters ?? ParameterView.Empty)); 67public new Task RenderRootComponentAsync(int componentId) 70public new Task RenderRootComponentAsync(int componentId, ParameterView parameters) 73public Task DispatchEventAsync(ulong eventHandlerId, EventArgs args) 76public new Task DispatchEventAsync(ulong eventHandlerId, EventFieldInfo eventFieldInfo, EventArgs args) 79private static Task UnwrapTask(Task task) 111protected override Task UpdateDisplayAsync(in RenderBatch renderBatch)
TestAsyncAuthorizationService.cs (1)
22await Task.Yield();
TestAuthorizationPolicyProvider.cs (3)
13=> Task.FromResult(options.DefaultPolicy); 16=> Task.FromResult(options.FallbackPolicy); 18public Task<AuthorizationPolicy> GetPolicyAsync(string policyName) => Task.FromResult(
TestAuthorizationService.cs (1)
25return Task.FromResult(NextResult);
Microsoft.AspNetCore.Components.Endpoints (61)
Builder\OpaqueRedirection.cs (3)
57return Task.CompletedTask; 75return Task.CompletedTask; 79return Task.CompletedTask;
DependencyInjection\UnsupportedNavigationInterception.cs (1)
10public Task EnableNavigationInterceptionAsync()
DependencyInjection\UnsupportedScrollToLocationHash.cs (1)
10public Task RefreshScrollPositionForHash(string locationAbsolute)
IRazorComponentEndpointInvoker.cs (2)
25/// <returns>A <see cref="Task"/> that completes when the endpoint has been invoked and the component 27Task Render(HttpContext context);
RazorComponentEndpointHost.cs (2)
34public Task SetParametersAsync(ParameterView parameters) 38return Task.CompletedTask;
RazorComponentEndpointInvoker.cs (5)
31public Task Render(HttpContext context) 36private async Task RenderComponentCore(HttpContext context) 72return Task.CompletedTask; 95Task quiesceTask; 116quiesceTask = Task.CompletedTask;
Rendering\Buffering\BufferedTextWriter.cs (5)
15private Task _currentFlushAsyncTask = Task.CompletedTask; 45public override Task FlushAsync() 51private async Task FlushAsyncCore(Task priorTask)
Rendering\Buffering\TextChunk.cs (1)
54public Task WriteToAsync(TextWriter writer, string charArraySegments, ref StringBuilder? tempBuffer)
Rendering\Buffering\TextChunkListBuilder.cs (1)
35public async Task WriteToAsync(TextWriter writer, string charArraySegments)
Rendering\EndpointHtmlRenderer.cs (9)
42private Task? _servicesInitializedTask; 49private readonly List<Task> _nonStreamingPendingTasks = new(); 72internal static async Task InitializeStandardComponentServicesAsync( 84authenticationStateProvider.SetAuthenticationState(Task.FromResult(authenticationState)); 118protected override void AddPendingTask(ComponentState? componentState, Task task) 134internal Task? NonStreamingPendingTasksCompletion; 136protected override Task UpdateDisplayAsync(in RenderBatch renderBatch) 158static async Task FlushThenComplete(TextWriter writerToFlush, Task completion)
Rendering\EndpointHtmlRenderer.EventDispatch.cs (4)
20internal Task DispatchSubmitEventAsync(string? handlerName, out bool isBadRequest) 53: Task.CompletedTask; 68private Task ReturnErrorResponse(string detailedMessage) 74: Task.CompletedTask;
Rendering\EndpointHtmlRenderer.Prerendering.cs (7)
155private async Task WaitForResultReady(bool waitForQuiescence, PrerenderedComponentHtmlContent result) 168public Task WaitForNonStreamingPendingTasks() 172async Task Execute() 177var pendingWork = Task.WhenAll(_nonStreamingPendingTasks); 281public Task QuiescenceTask => 282_htmlToEmitOrNull.HasValue ? _htmlToEmitOrNull.Value.QuiescenceTask : Task.CompletedTask;
Rendering\EndpointHtmlRenderer.PrerenderingState.cs (9)
92var saveServerTask = server.Saved.Count > 0 94: Task.CompletedTask; 96var saveWebAssemblyTask = webAssembly.Saved.Count > 0 98: Task.CompletedTask; 100await Task.WhenAll( 258public Task PersistStateAsync(IReadOnlyDictionary<string, byte[]> state) => Task.CompletedTask; 269public Task PersistStateAsync(IReadOnlyDictionary<string, byte[]> state) 272return Task.CompletedTask;
Rendering\EndpointHtmlRenderer.Streaming.cs (2)
40public async Task SendStreamingUpdatesAsync(HttpContext httpContext, Task untilTaskCompleted, TextWriter writer)
Rendering\SSRRenderModeBoundary.cs (2)
101public Task SetParametersAsync(ParameterView parameters) 114return Task.CompletedTask;
Results\RazorComponentResult.cs (1)
99public Task ExecuteAsync(HttpContext httpContext)
Results\RazorComponentResultExecutor.cs (2)
22public static Task ExecuteAsync(HttpContext httpContext, RazorComponentResult result) 41private static Task RenderComponentToResponse(
src\Components\Shared\src\DefaultAntiforgeryStateProvider.cs (1)
28return Task.CompletedTask;
src\Shared\Components\PrerenderComponentApplicationStore.cs (3)
48return Task.FromResult((IDictionary<string, byte[]>)ExistingState); 55public Task PersistStateAsync(IReadOnlyDictionary<string, byte[]> state) 69return Task.CompletedTask;
Microsoft.AspNetCore.Components.Endpoints.Tests (115)
Buffering\BufferedTextWriterTest.cs (7)
16public async Task WritesThroughToUnderlyingWriter() 32public async Task CanWriteAndFlushWhileFlushIsInProgress() 41var flushAsyncTask1 = writer.FlushAsync(); 48var flushAsyncTask2 = writer.FlushAsync(); 55var flushAsyncTask3 = writer.FlushAsync(); 74public Task CompleteNextFlushAfter { get; set; } 78public override async Task FlushAsync()
Buffering\TextChunkListBuilderTest.cs (1)
11public async Task CanAddContentThatSpansMultiplePages()
Buffering\TextChunkPageTest.cs (1)
11public async Task CanAddValuesUntilFull()
Buffering\TextChunkTest.cs (4)
14public async Task CanHoldString() 22public async Task CanHoldChar() 30public async Task CanHoldCharArraySegment() 44public async Task CanHoldInt()
EndpointHtmlRendererTest.cs (61)
50public async Task CanRender_ParameterlessComponent_ClientMode() 73public async Task CanPrerender_ParameterlessComponent_ClientMode() 111public async Task CanRender_ComponentWithParameters_ClientMode() 148public async Task CanRender_ComponentWithNullParameters_ClientMode() 183public async Task CanPrerender_ComponentWithParameters_ClientMode() 232public async Task CanPrerender_ComponentWithNullParameters_ClientMode() 280public async Task CanRender_ParameterlessComponent() 296public async Task CanRender_ParameterlessComponent_ServerMode() 328public async Task CanPrerender_ParameterlessComponent_ServerMode() 373public async Task Prerender_ServerAndClientComponentUpdatesInvokedPrerenderModes() 389public async Task CanRenderMultipleServerComponents() 431public async Task CanRender_ComponentWithParametersObject() 446public async Task CanRender_ComponentWithParameters_ServerMode() 485public async Task CanRender_ComponentWithNullParameters_ServerMode() 524public async Task CanPrerender_ComponentWithParameters_ServerPrerenderedMode() 575public async Task CanPrerender_ComponentWithNullParameters_ServerPrerenderedMode() 626public async Task ComponentWithInvalidRenderMode_Throws() 642public async Task RenderComponent_DoesNotInvokeOnAfterRenderInComponent() 659public async Task DisposableComponents_GetDisposedAfterScopeCompletes() 691public async Task CanCatch_ComponentWithSynchronousException() 711public async Task CanCatch_ComponentWithAsynchronousException() 731public async Task Rendering_ComponentWithJsInteropThrows() 754public async Task UriHelperRedirect_ThrowsInvalidOperationException_WhenResponseHasAlreadyStarted() 785public async Task HtmlHelper_Redirects_WhenComponentNavigates() 812public async Task CanRender_AsyncComponent() 851public async Task CanDispatchNamedEvent_ToComponent() 879public async Task Dispatching_WhenNoHandlerIsSpecified_Throws() 908public async Task Dispatching_WhenNamedEventDoesNotExist_Throws() 937public async Task Dispatching_WhenComponentHasRerendered_UsesCurrentDelegate() 949await Task.Delay(500); 962public async Task Dispatching_WhenComponentReRendersNamedEventAtSameLocation() 998public async Task Dispatching_WhenNamedEventChangesName() 1049public async Task RenderMode_CanRenderInteractiveComponents() 1153public async Task DoesNotEmitNestedRenderModeBoundaries() 1182public async Task PrerenderedState_EmptyWhenNoDeclaredRenderModes() 1185var endpoint = new Endpoint((context) => Task.CompletedTask, new EndpointMetadataCollection(declaredRenderModesMetadata), 1203public async Task PrerenderedState_SelectsSingleStoreCorrectly(IComponentRenderMode renderMode) 1206var endpoint = new Endpoint((context) => Task.CompletedTask, new EndpointMetadataCollection(declaredRenderModesMetadata), 1233public async Task PrerenderedState_MultipleStoresCorrectly() 1236var endpoint = new Endpoint((context) => Task.CompletedTask, new EndpointMetadataCollection(declaredRenderModesMetadata), 1253public async Task PrerenderedState_PersistToStores_OnlyWhenContentIsAvailable(string renderMode) 1264var endpoint = new Endpoint((context) => Task.CompletedTask, new EndpointMetadataCollection(declaredRenderModesMetadata), 1274return Task.CompletedTask; 1307public async Task PrerenderedState_PersistToStores_DoesNotNeedToInferRenderMode_ForSingleRenderMode(string declaredRenderMode) 1318var endpoint = new Endpoint((context) => Task.CompletedTask, new EndpointMetadataCollection(declaredRenderModesMetadata), 1328return Task.CompletedTask; 1353public async Task PrerenderedState_Throws_WhenItCanInfer_CallbackRenderMode_ForMultipleRenderModes() 1356var endpoint = new Endpoint((context) => Task.CompletedTask, new EndpointMetadataCollection(declaredRenderModesMetadata), 1366return Task.CompletedTask; 1376public async Task PrerenderedState_InfersCallbackRenderMode_ForMultipleRenderModes(string renderMode) 1386var endpoint = new Endpoint((context) => Task.CompletedTask, new EndpointMetadataCollection(declaredRenderModesMetadata), 1432public async Task PrerenderedState_ExplicitRenderModes_AreRespected(string renderMode, string declared, bool persisted) 1451var endpoint = new Endpoint((context) => Task.CompletedTask, new EndpointMetadataCollection(declaredRenderModesMetadata), 1547[Parameter] public Task Continue { get; set; } 1559protected override async Task OnInitializedAsync() 1596private Task PersistState() 1599return Task.CompletedTask; 1606public Task SetParametersAsync(ParameterView parameters) 1624return Task.CompletedTask; 1709protected override async Task OnParametersSetAsync() 1722await Task.Yield();
HotReloadServiceTests.cs (1)
252(context) => Task.CompletedTask,
RazorComponentEndpointDataSourceTest.cs (5)
260(context) => Task.CompletedTask, 273(context) => Task.CompletedTask, 303public Task SetParametersAsync(ParameterView parameters) 317public Task SetParametersAsync(ParameterView parameters) 331public Task SetParametersAsync(ParameterView parameters)
RazorComponentEndpointInvokerTest.cs (2)
18public async Task Invoker_RejectsPostRequestsWithNonFormDataContentTypesAsync() 35ctx => Task.CompletedTask,
RazorComponentResultTest.cs (29)
52public async Task CanRenderComponentStatically() 70public async Task ResponseIncludesStatusCodeAndContentTypeAndHtml() 92public async Task PerformsStreamingRendering() 103var completionTask = result.ExecuteAsync(httpContext); 111await Task.Yield(); 123public async Task EmitsEachComponentOnlyOncePerStreamingUpdate_WhenAComponentRendersTwice() 134var completionTask = result.ExecuteAsync(httpContext); 150public async Task EmitsEachComponentOnlyOncePerStreamingUpdate_WhenAnAncestorAlsoUpdated() 165var completionTask = result.ExecuteAsync(httpContext); 182public async Task WaitsForQuiescenceIfPreventStreamingRenderingIsTrue() 196var completionTask = result.ExecuteAsync(httpContext); 197await Task.Yield(); 209public async Task SupportsLayouts() 224public async Task OnNavigationBeforeResponseStarted_Redirects() 237public async Task OnNavigationAfterResponseStarted_WithStreamingOff_Throws() 259public async Task OnNavigationAfterResponseStarted_WithStreamingOn_EmitsCommand() 280public async Task OnUnhandledExceptionBeforeResponseStarted_Throws() 294public async Task OnUnhandledExceptionAfterResponseStarted_WithStreamingOff_Throws() 311public async Task OnUnhandledExceptionAfterResponseStarted_WithStreamingOn_EmitsCommand(bool isDevelopmentEnvironment) 335public async Task StreamingRendering_IsOffByDefault_AndCanBeEnabledForSubtree() 339var initialOutputTask = testContext.Renderer.NonStreamingPendingTasksCompletion; 345await Task.Yield(); // Just to show it's still not completed after 368public async Task StreamingRendering_CanBeDisabledForSubtree() 372var initialOutputTask = testContext.Renderer.NonStreamingPendingTasksCompletion; 378await Task.Yield(); // Just to show it's still not completed after 432var quiescence = result.ExecuteAsync(httpContext); 439Task Quiescence, 481private static async Task WaitForContentWrittenAsync(Stream stream, TimeSpan? timeout = default) 491await Task.Delay(pollInterval);
src\Components\Shared\test\AutoRenderComponent.cs (3)
18public virtual Task SetParametersAsync(ParameterView parameters) 22return Task.CompletedTask; 28var t = _renderHandle.Dispatcher.InvokeAsync(() => _renderHandle.Render(BuildRenderTree));
SSRRenderModeBoundaryTest.cs (1)
95public Task SetParametersAsync(ParameterView parameters)
Microsoft.AspNetCore.Components.Forms.Tests (13)
src\Components\Shared\test\AutoRenderComponent.cs (3)
18public virtual Task SetParametersAsync(ParameterView parameters) 22return Task.CompletedTask; 28var t = _renderHandle.Dispatcher.InvokeAsync(() => _renderHandle.Render(BuildRenderTree));
src\Components\Shared\test\TestRenderer.cs (10)
48public Task NextRenderResultTask { get; set; } = Task.CompletedTask; 63var task = Dispatcher.InvokeAsync(() => base.RenderRootComponentAsync(componentId, parameters ?? ParameterView.Empty)); 67public new Task RenderRootComponentAsync(int componentId) 70public new Task RenderRootComponentAsync(int componentId, ParameterView parameters) 73public Task DispatchEventAsync(ulong eventHandlerId, EventArgs args) 76public new Task DispatchEventAsync(ulong eventHandlerId, EventFieldInfo eventFieldInfo, EventArgs args) 79private static Task UnwrapTask(Task task) 111protected override Task UpdateDisplayAsync(in RenderBatch renderBatch)
Microsoft.AspNetCore.Components.Performance (2)
RenderTreeDiffBuilderBenchmark.cs (2)
100protected override Task UpdateDisplayAsync(in RenderBatch renderBatch) 101=> Task.CompletedTask;
Microsoft.AspNetCore.Components.QuickGrid (23)
Infrastructure\ColumnsCollectedNotifier.cs (2)
49public Task SetParametersAsync(ParameterView parameters) 59return Task.CompletedTask;
Infrastructure\EventCallbackSubscribable.cs (1)
19public async Task InvokeCallbacksAsync(T eventArg)
Pagination\PaginationState.cs (4)
51/// <returns>A <see cref="Task"/> representing the completion of the operation.</returns> 52public Task SetCurrentPageIndexAsync(int pageIndex) 59internal Task SetTotalItemCountAsync(int totalItemCount) 63return Task.CompletedTask;
Pagination\Paginator.razor.cs (5)
34private Task GoFirstAsync() => GoToPageAsync(0); 35private Task GoPreviousAsync() => GoToPageAsync(State.CurrentPageIndex - 1); 36private Task GoNextAsync() => GoToPageAsync(State.CurrentPageIndex + 1); 37private Task GoLastAsync() => GoToPageAsync(State.LastPageIndex.GetValueOrDefault(0)); 42private Task GoToPageAsync(int pageIndex)
QuickGrid.razor.cs (11)
170protected override Task OnParametersSetAsync() 195return (_columns.Count > 0 && mustRefreshData) ? RefreshDataCoreAsync() : Task.CompletedTask; 199protected override async Task OnAfterRenderAsync(bool firstRender) 245/// <returns>A <see cref="Task"/> representing the completion of the operation.</returns> 246public Task SortByColumnAsync(ColumnBase<TGridItem> column, SortDirection direction = SortDirection.Auto) 267public Task ShowColumnOptionsAsync(ColumnBase<TGridItem> column) 272return Task.CompletedTask; 279/// <returns>A <see cref="Task"/> that represents the completion of the operation.</returns> 280public async Task RefreshDataAsync() 288private async Task RefreshDataCoreAsync() 328await Task.Delay(100);
Microsoft.AspNetCore.Components.SdkAnalyzers (2)
ComponentParametersShouldBePublicCodeFixProvider.cs (2)
31public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 57return Task.FromResult(document.WithSyntaxRoot(newSyntaxRoot));
Microsoft.AspNetCore.Components.SdkAnalyzers.Tests (4)
ComponentInternalUsageDiagnosticsAnalyzerTest.cs (2)
21public async Task InternalUsage_FindsUseOfInternalTypesInDeclarations() 65public async Task InternalUsage_FindsUseOfInternalTypesInMethodBody()
TestFiles\ComponentInternalUsageDiagnosticsAnalyzerTest\UsesRendererAsBaseClass.cs (1)
23protected override Task UpdateDisplayAsync(/*M1*/in RenderBatch renderBatch)
TestFiles\ComponentInternalUsageDiagnosticsAnalyzerTest\UsesRendererTypesInDeclarations.cs (1)
28/*MMParameter*/protected override Task UpdateDisplayAsync(in RenderBatch renderBatch)
Microsoft.AspNetCore.Components.Server (103)
Builder\ServerComponentsEndpointOptions.cs (1)
55public Func<HttpContext, WebSocketAcceptContext, Task>? ConfigureWebSocketAcceptContext { get; set; }
CircuitDisconnectMiddleware.cs (2)
32public async Task Invoke(HttpContext context) 81private async Task TerminateCircuitGracefully(CircuitId circuitId)
CircuitJavaScriptInitializationMiddleware.cs (1)
21public async Task InvokeAsync(HttpContext context)
Circuits\CircuitClientProxy.cs (1)
38public Task SendCoreAsync(string method, object[] args, CancellationToken cancellationToken = default)
Circuits\CircuitHandler.cs (15)
45/// <returns><see cref="Task"/> that represents the asynchronous execution operation.</returns> 46public virtual Task OnCircuitOpenedAsync(Circuit circuit, CancellationToken cancellationToken) => Task.CompletedTask; 57/// <returns><see cref="Task"/> that represents the asynchronous execution operation.</returns> 58public virtual Task OnConnectionUpAsync(Circuit circuit, CancellationToken cancellationToken) => Task.CompletedTask; 65/// <returns><see cref="Task"/> that represents the asynchronous execution operation.</returns> 66public virtual Task OnConnectionDownAsync(Circuit circuit, CancellationToken cancellationToken) => Task.CompletedTask; 73/// <returns><see cref="Task"/> that represents the asynchronous execution operation.</returns> 74public virtual Task OnCircuitClosedAsync(Circuit circuit, CancellationToken cancellationToken) => Task.CompletedTask; 80/// <returns>A handler function that returns a <see cref="Task"/> that completes when the activity has finished.</returns> 81public virtual Func<CircuitInboundActivityContext, Task> CreateInboundActivityHandler(Func<CircuitInboundActivityContext, Task> next) => next;
Circuits\CircuitHost.cs (26)
25private Func<Func<Task>, Task> _dispatchInboundActivity; 102public Task InitializeAsync(ProtectedPrerenderComponentApplicationStore store, CancellationToken cancellationToken) 130var pendingRenders = new Task[count]; 138await Task.WhenAll(pendingRenders); 229private async Task OnCircuitOpenedAsync(CancellationToken cancellationToken) 258public async Task OnConnectionUpAsync(CancellationToken cancellationToken) 287public async Task OnConnectionDownAsync(CancellationToken cancellationToken) 316private async Task OnCircuitDownAsync(CancellationToken cancellationToken) 346public async Task OnRenderCompletedAsync(long renderId, string errorMessageOrNull) 367public async Task BeginInvokeDotNetFromJS(string callId, string assemblyName, string methodIdentifier, long dotNetObjectId, string argsJson) 393public async Task EndInvokeJSFromDotNet(long asyncCall, bool succeeded, string arguments) 427internal async Task ReceiveByteArray(int id, byte[] data) 527public async Task OnLocationChangedAsync(string uri, string state, bool intercepted) 569public async Task OnLocationChangingAsync(int callId, string uri, string? state, bool intercepted) 603authenticationStateProvider.SetAuthenticationState(Task.FromResult(authenticationState)); 619internal Task HandleInboundActivityAsync(Func<Task> handler) 630private static Func<Func<Task>, Task> BuildInboundActivityDispatcher(IReadOnlyList<CircuitHandler> circuitHandlers, Circuit circuit) 682private async Task ReportUnhandledException(Exception exception) 705private async Task TryNotifyClientErrorAsync(IClientProxy client, string error, Exception exception = null) 728internal Task UpdateRootComponents( 811? new Task[operations.Length] 848return Task.CompletedTask; 853await Task.WhenAll(pendingTasks);
Circuits\CircuitInboundActivityContext.cs (2)
11internal Func<Task> Handler { get; } 18internal CircuitInboundActivityContext(Func<Task> handler, Circuit circuit)
Circuits\CircuitRegistry.cs (5)
87public virtual Task DisconnectAsync(CircuitHost circuitHost, string connectionId) 91Task circuitHandlerTask; 104return Task.CompletedTask; 176Task circuitHandlerTask; 281private async Task DisposeCircuitEntry(DisconnectedCircuitEntry entry)
Circuits\RemoteJSDataStream.cs (3)
204private async Task ThrowOnTimeout() 206await Task.Delay(_jsInteropDefaultCallTimeout); 227private async Task CompletePipeAndDisposeStream(Exception? ex = null)
Circuits\RemoteJSRuntime.cs (1)
153protected override async Task TransmitStreamAsync(long streamId, DotNetStreamReference dotNetStreamReference)
Circuits\RemoteNavigationInterception.cs (1)
26public async Task EnableNavigationInterceptionAsync()
Circuits\RemoteNavigationManager.cs (3)
96async Task PerformNavigationAsync() 137async Task RefreshAsync() 168private async Task SetHasLocationChangingListenersAsync(bool value)
Circuits\RemoteRenderer.cs (14)
20private static readonly Task CanceledTask = Task.FromCanceled(new CancellationToken(canceled: true)); 64public Task AddComponentAsync(Type componentType, ParameterView parameters, string domElementSelector) 74var attachComponentTask = _client.SendAsync("JS.AttachComponent", componentId, domElementSelector); 140protected override Task UpdateDisplayAsync(in Microsoft.AspNetCore.Components.RenderTree.RenderBatch batch) 184var _ = WriteBatchBytesAsync(pendingRender); 189public Task ProcessBufferedRenderBatches() 194return Task.WhenAll(_unacknowledgedRenderBatches.Select(WriteBatchBytesAsync)); 197private async Task WriteBatchBytesAsync(UnacknowledgedRenderBatch pending) 230public Task OnRenderCompletedAsync(long incomingBatchId, string? errorMessageOrNull) 235return Task.CompletedTask; 264return Task.CompletedTask; 355private async Task CaptureAsyncExceptions(Task task)
Circuits\RemoteScrollToLocationHash.cs (1)
26public async Task RefreshScrollPositionForHash(string locationAbsolute)
Circuits\RevalidatingServerAuthenticationStateProvider.cs (4)
56/// <returns>A <see cref="Task"/> that resolves as true if the <paramref name="authenticationState"/> is still valid, or false if it is not.</returns> 59private async Task RevalidationLoop(Task<AuthenticationState> authenticationStateTask, CancellationToken cancellationToken) 72await Task.Delay(RevalidationInterval, cancellationToken); 106SetAuthenticationState(Task.FromResult(anonymousState));
ComponentHub.cs (4)
70public override Task OnDisconnectedAsync(Exception exception) 77return Task.CompletedTask; 163public async Task UpdateRootComponents(string serializedComponentOperations, string applicationState) 369private static Task NotifyClientError(IClientProxy client, string error) => client.SendAsync("JS.Error", error);
DependencyInjection\ServerRazorComponentsBuilderExtensions.cs (2)
165Func<HttpContext, WebSocketAcceptContext, Task>? configureConnection, 192private async Task<WebSocket> ReturnAwaited(Task result, WebSocketAcceptContext context)
src\Components\Shared\src\ArrayBuilderMemoryStream.cs (4)
77public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 82return Task.CompletedTask; 92public override Task FlushAsync(CancellationToken cancellationToken) => Task.CompletedTask;
src\Components\Shared\src\DefaultAntiforgeryStateProvider.cs (1)
28return Task.CompletedTask;
src\Components\Shared\src\WebRootComponentManager.cs (5)
35public async Task AddRootComponentAsync( 59public Task UpdateRootComponentAsync( 128public Task UpdateAsync( 163return Task.CompletedTask; 179public Task RenderAsync(Renderer renderer)
src\Shared\Components\PrerenderComponentApplicationStore.cs (3)
48return Task.FromResult((IDictionary<string, byte[]>)ExistingState); 55public Task PersistStateAsync(IReadOnlyDictionary<string, byte[]> state) 69return Task.CompletedTask;
src\SignalR\common\Shared\MemoryBufferWriter.cs (4)
138public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) 191private async Task CopyToSlowAsync(Stream destination, CancellationToken cancellationToken) 277public override Task FlushAsync(CancellationToken cancellationToken) => Task.CompletedTask;
Microsoft.AspNetCore.Components.Server.Tests (180)
CircuitDisconnectMiddlewareTest.cs (14)
19public async Task DisconnectMiddleware_OnlyAccepts_PostRequests(string httpMethod) 32(ctx) => Task.CompletedTask); 47public async Task Returns400BadRequest_ForInvalidContentTypes(string contentType) 60(ctx) => Task.CompletedTask); 74public async Task Returns400BadRequest_IfNoCircuitIdOnForm() 87(ctx) => Task.CompletedTask); 101public async Task Returns400BadRequest_InvalidCircuitId() 114(ctx) => Task.CompletedTask); 133public async Task Returns200OK_NonExistingCircuit() 147(ctx) => Task.CompletedTask); 166public async Task GracefullyTerminates_ConnectedCircuit() 184(ctx) => Task.CompletedTask); 203public async Task GracefullyTerminates_DisconnectedCircuit() 222(ctx) => Task.CompletedTask);
Circuits\CircuitClientProxyTest.cs (4)
12public async Task SendCoreAsync_WithoutTransfer() 22.Returns(Task.CompletedTask); 26var sendTask = circuitClient.SendCoreAsync("test", Array.Empty<object>()); 38c => c.SendCoreAsync(It.IsAny<string>(), It.IsAny<object[]>(), It.IsAny<CancellationToken>()) == Task.CompletedTask);
Circuits\CircuitHostTest.cs (58)
25public async Task DisposeAsync_DisposesResources() 44public async Task DisposeAsync_DisposesScopeAsynchronouslyIfPossible() 51.Returns(new ValueTask(Task.CompletedTask)) 70public async Task DisposeAsync_DisposesResourcesAndSilencesException() 97public async Task DisposeAsync_DisposesRendererWithinSynchronizationContext() 127public async Task DisposeAsync_MarksJSRuntimeAsDisconnectedBeforeDisposingRenderer() 159public async Task InitializeAsync_InvokesHandlers() 172.Returns(Task.CompletedTask) 178.Returns(Task.CompletedTask) 184.Returns(Task.CompletedTask) 190.Returns(Task.CompletedTask) 204public async Task InitializeAsync_RendersRootComponentsInParallel() 239var initializeTask = circuitHost.InitializeAsync(new ProtectedPrerenderComponentApplicationStore(Mock.Of<IDataProtectionProvider>()), cancellationToken); 247public async Task InitializeAsync_ReportsOwnAsyncExceptions() 269var initializeAsyncTask = circuitHost.InitializeAsync(new ProtectedPrerenderComponentApplicationStore(Mock.Of<IDataProtectionProvider>()), new CancellationToken()); 290public async Task DisposeAsync_InvokesCircuitHandler() 303.Returns(Task.CompletedTask) 309.Returns(Task.CompletedTask) 315.Returns(Task.CompletedTask) 321.Returns(Task.CompletedTask) 335public async Task HandleInboundActivityAsync_InvokesCircuitActivityHandlers() 348.Setup(h => h.CreateInboundActivityHandler(It.IsAny<Func<CircuitInboundActivityContext, Task>>())) 349.Returns((Func<CircuitInboundActivityContext, Task> next) => async (CircuitInboundActivityContext context) => 358.Setup(h => h.CreateInboundActivityHandler(It.IsAny<Func<CircuitInboundActivityContext, Task>>())) 359.Returns((Func<CircuitInboundActivityContext, Task> next) => next) 364.Setup(h => h.CreateInboundActivityHandler(It.IsAny<Func<CircuitInboundActivityContext, Task>>())) 365.Returns((Func<CircuitInboundActivityContext, Task> next) => async (CircuitInboundActivityContext context) => 381return Task.CompletedTask; 397public async Task HandleInboundActivityAsync_InvokesHandlerFunc_WhenNoCircuitActivityHandlersAreRegistered() 407return Task.CompletedTask; 415public async Task UpdateRootComponents_CanAddNewRootComponent() 437public async Task UpdateRootComponents_CanUpdateExistingRootComponent() 463public async Task UpdateRootComponents_CanReplaceExistingRootComponent_WhenNoComponentKeyWasSpecified() 490public async Task UpdateRootComponents_DoesNotUpdateExistingRootComponent_WhenDescriptorComponentTypeDoesNotMatchRootComponentType() 528public async Task UpdateRootComponents_DoesNotUpdateExistingRootComponent_WhenDescriptorKeyDoesNotMatchOriginalKey() 565public async Task UpdateRootComponents_CanRemoveExistingRootComponent() 587private async Task AddComponentAsync<TComponent>(CircuitHost circuitHost, int ssrComponentId, Dictionary<string, object> parameters = null, string componentKey = "") 604private async Task UpdateComponentAsync<TComponent>(CircuitHost circuitHost, int ssrComponentId, Dictionary<string, object> parameters = null, string componentKey = "") 620private async Task RemoveComponentAsync(CircuitHost circuitHost, int ssrComponentId) 657.Setup(h => h.CreateInboundActivityHandler(It.IsAny<Func<CircuitInboundActivityContext, Task>>())) 658.Returns((Func<CircuitInboundActivityContext, Task> next) => next) 666.Setup(h => h.CreateInboundActivityHandler(It.IsAny<Func<CircuitInboundActivityContext, Task>>())) 667.Returns((Func<CircuitInboundActivityContext, Task> next) => next) 754public Task SetParametersAsync(ParameterView parameters) 755=> Task.CompletedTask; 802public async Task SetParametersAsync(ParameterView parameters) 805await Task.WhenAll(_renderTcsArray.Select(tcs => tcs.Task)); 829public Task SetParametersAsync(ParameterView parameters) 830=> Task.CompletedTask; 879public Task SetParametersAsync(ParameterView parameters) 887return Task.CompletedTask; 892var task = _renderHandle.Dispatcher.InvokeAsync(() => _renderHandle.Render(Render)); 896public Task WaitForDisposeAsync() 921public Task OnAfterRenderAsync() 924return Task.CompletedTask; 927public Task SetParametersAsync(ParameterView parameters) 930return Task.CompletedTask; 935var task = _renderHandle.Dispatcher.InvokeAsync(() => _renderHandle.Render(_renderFragment));
Circuits\CircuitRegistryTest.cs (21)
31public async Task ConnectAsync_TransfersClientOnActiveCircuit() 56public async Task ConnectAsync_MakesInactiveCircuitActive() 82public async Task ConnectAsync_InvokesCircuitHandlers_WhenCircuitWasPreviouslyDisconnected() 106public async Task ConnectAsync_InvokesCircuitHandlers_WhenCircuitWasConsideredConnected() 130public async Task ConnectAsync_InvokesCircuitHandlers_DisposesCircuitOnFailure() 154public async Task DisconnectAsync_DoesNothing_IfCircuitIsInactive() 170public async Task DisconnectAsync_InvokesCircuitHandlers_WhenCircuitWasDisconnected() 189public async Task DisconnectAsync_DoesNotInvokeCircuitHandlers_WhenCircuitReconnected() 208public async Task DisconnectAsync_DoesNotInvokeCircuitHandlers_WhenCircuitWasNotFound() 226public async Task Connect_WhileDisconnectIsInProgress() 241var disconnect = Task.Run(() => 247var connect = Task.Run(async () => 254await Task.WhenAll(disconnect, connect); 267public async Task DisconnectWhenAConnectIsInProgress() 281var connect = Task.Run(() => registry.ConnectAsync(circuitHost.CircuitId, client, newId, default)); 282var disconnect = Task.Run(() => registry.DisconnectAsync(circuitHost, oldId)); 284await Task.WhenAll(connect, disconnect); 297public async Task DisconnectedCircuitIsRemovedAfterConfiguredTimeout() 319await Task.Run(() => tcs.Task.TimeoutAfter(TimeSpan.FromSeconds(10))); 324public async Task ReconnectBeforeTimeoutDoesNotGetEntryToBeEvicted() 345await Task.Run(() => tcs.Task.TimeoutAfter(TimeSpan.FromSeconds(10)));
Circuits\ComponentHubTest.cs (7)
21public async Task CannotStartMultipleCircuits() 35public async Task StartCircuitFailsWithNullData() 46public async Task CannotInvokeJSInteropBeforeInitialization() 57public async Task CannotInvokeJSInteropCallbackCompletionsBeforeInitialization() 68public async Task CannotInvokeOnRenderCompletedBeforeInitialization() 79public async Task CannotInvokeOnLocationChangedBeforeInitialization() 90public async Task CannotInvokeOnLocationChangingBeforeInitialization()
Circuits\RemoteJSDataStreamTest.cs (13)
18public async Task CreateRemoteJSDataStreamAsync_CreatesStream() 31public async Task ReceiveData_DoesNotFindStream() 45public async Task ReceiveData_SuccessReadsBackStream() 55var sendDataTask = Task.Run(async () => 73public async Task ReceiveData_SuccessReadsBackPipeReader() 83var sendDataTask = Task.Run(async () => 101public async Task ReceiveData_WithError() 119public async Task ReceiveData_WithZeroLengthChunk() 138public async Task ReceiveData_WithLargerChunksThanPermitted() 157public async Task ReceiveData_ProvidedWithMoreBytesThanRemaining() 177public async Task ReceiveData_ProvidedWithOutOfOrderChunk_SimulatesSignalRDisconnect() 201public async Task ReceiveData_NoDataProvidedBeforeTimeout_StreamDisposed() 242public async Task ReceiveData_ReceivesDataThenTimesout_StreamDisposed()
Circuits\RemoteRendererTest.cs (27)
79public async Task NoNewBatchesAreCreated_WhenThereAreNoPendingRenderRequestsFromComponents() 104public async Task ProducesNewBatch_WhenABatchGetsAcknowledged() 129public async Task ProcessBufferedRenderBatches_WritesRenders() 192public async Task OnRenderCompletedAsync_DoesNotThrowWhenReceivedDuplicateAcks() 255public async Task OnRenderCompletedAsync_DoesNotThrowWhenThereAreNoPendingBatchesToAck() 318public async Task ConsumesAllPendingBatchesWhenReceivingAHigherSequenceBatchId() 375public async Task ThrowsIfWeReceivedAnAcknowledgeForANeverProducedBatch() 432public async Task WebRootComponentManager_AddRootComponentAsync_Throws_IfMaxInteractiveServerComponentCountIsExceeded() 451public async Task WebRootComponentManager_AddRootComponentAsync_Throws_IfDuplicateSsrComponentIdIsProvided() 467public async Task WebRootComponentManager_AddRootComponentAsync_Throws_IfKeyIsInvalid() 488public async Task WebRootComponentManager_AddRootComponentAsync_CanAddAndRenderRootComponent() 502public async Task WebRootComponentManager_UpdateRootComponentAsync_Throws_IfSsrComponentIdIsInvalid() 522public async Task WebRootComponentManager_UpdateRootComponentAsync_Throws_IfKeyDoesNotMatch() 542public async Task WebRootComponentManager_UpdateRootComponentAsync_Works_IfComponentKeyWasSupplied() 562public async Task WebRootComponentManager_UpdateRootComponentAsync_DoesNothing_IfNoComponentKeyWasSuppliedAndParametersDidNotChange() 581public async Task WebRootComponentManager_UpdateRootComponentAsync_ReinitializesComponent_IfNoComponentKeyWasSuppliedAndParameterChanged() 601public async Task WebRootComponentManager_RemoveRootComponent_Throws_IfSsrComponentIdIsInvalid() 617public async Task WebRootComponentManager_RemoveRootComponent_Works() 707public async Task RenderComponentAsync<TComponent>(ParameterView initialParameters) 753public Task OnAfterRenderAsync() 756return Task.CompletedTask; 759public Task SetParametersAsync(ParameterView parameters) 762return Task.CompletedTask; 767var task = _renderHandle.Dispatcher.InvokeAsync(() => _renderHandle.Render(_renderFragment)); 785public Task SetParametersAsync(ParameterView parameters) 791return Task.CompletedTask; 796var task = _renderHandle.Dispatcher.InvokeAsync(() => _renderHandle.Render(Content));
Circuits\RenderBatchWriterTest.cs (2)
381public Task SetParametersAsync(ParameterView parameters) 399protected override Task UpdateDisplayAsync(in RenderBatch renderBatch)
Circuits\RevalidatingServerAuthenticationStateProviderTest.cs (19)
32public async Task IfValidateAuthenticationStateAsyncReturnsTrue_ContinuesRevalidating() 38provider.NextValidationResult = Task.FromResult(true); 55public async Task IfValidateAuthenticationStateAsyncReturnsFalse_ForcesSignOut() 61provider.NextValidationResult = Task.FromResult(false); 74await Task.Delay(200); 79public async Task IfValidateAuthenticationStateAsyncThrows_ForcesSignOut() 85provider.NextValidationResult = Task.FromException<bool>(new InvalidTimeZoneException()); 98await Task.Delay(200); 103public async Task IfHostSuppliesNewAuthenticationState_RestartsRevalidationLoop() 109provider.NextValidationResult = Task.FromResult(true); 117await Task.Delay(200); 128public async Task StopsRevalidatingAfterDisposal() 134provider.NextValidationResult = Task.FromResult(true); 138await Task.Delay(200); 145public async Task SuppliesCancellationTokenThatSignalsWhenRevalidationLoopIsBeingDiscarded() 166provider.NextValidationResult = Task.FromResult(true); 182public async Task IfValidateAuthenticationStateAsyncReturnsUnrelatedCancelledTask_TreatAsFailure() 222return Task.FromResult(authenticationState); 239public Task NextValidateAuthenticationStateAsyncCall
Circuits\ServerAuthenticationStateProviderTest.cs (4)
12public async Task CannotProvideAuthenticationStateBeforeInitialization() 20public async Task SuppliesAuthenticationStateWithFixedUser() 28provider.SetAuthenticationState(Task.FromResult(expectedAuthenticationState1)); 37provider.SetAuthenticationState(Task.FromResult(expectedAuthenticationState2));
Circuits\ServerComponentDeserializerTest.cs (2)
512public Task SetParametersAsync(ParameterView parameters) => throw new NotImplementedException(); 518public Task SetParametersAsync(ParameterView parameters) => throw new NotImplementedException();
ComponentEndpointRouteBuilderExtensionsTest.cs (1)
156public Task SetParametersAsync(ParameterView parameters)
ProtectedBrowserStorageTest.cs (8)
94public async Task GetAsync_InvokesJSAndUnprotects_ValidData_DefaultPurpose() 121public async Task GetAsync_InvokesJSAndUnprotects_ValidData_CustomPurpose() 148public async Task GetAsync_InvokesJSAndUnprotects_NoValue() 165public async Task GetAsync_InvokesJSAndUnprotects_InvalidJson() 182public async Task GetAsync_InvokesJSAndUnprotects_InvalidProtection_Plaintext() 198public async Task GetAsync_InvokesJSAndUnprotects_InvalidProtection_Base64Encoded() 218public async Task GetValueOrDefaultAsync_InvokesJSAndUnprotects_WrongPurpose() 257public async Task ReusesCachedProtectorsByPurpose()
Microsoft.AspNetCore.Components.Tests (517)
CascadingParameterStateTest.cs (1)
504public Task SetParametersAsync(ParameterView parameters)
CascadingParameterTest.cs (4)
571public async Task CanTriggerUpdatesOnCascadingValuesFromServiceProvider() 638public async Task AfterSupplyingValueThroughNotifyChanged_InitialValueFactoryIsNotUsed() 843public override async Task SetParametersAsync(ParameterView parameters) 876public override async Task SetParametersAsync(ParameterView parameters)
ComponentBaseTest.cs (30)
46return Task.CompletedTask; 70return Task.CompletedTask; 113return Task.CompletedTask; 137return Task.CompletedTask; 150public async Task RendersAfterParametersSetAsyncTaskIsCompleted() 163var renderTask = renderer.RenderRootComponentAsync(componentId); 179public async Task RendersAfterParametersSetAndInitAsyncTasksAreCompleted() 200var renderTask = renderer.RenderRootComponentAsync(componentId); 232public async Task DoesNotRenderAfterOnInitAsyncTaskIsCancelled() 242var renderTask = renderer.RenderRootComponentAsync(componentId); 260public async Task RunsOnAfterRender_AfterRenderingCompletes() 276var renderTask = renderer.RenderRootComponentAsync(componentId); 303public async Task RunsOnAfterRenderAsync_AfterRenderingCompletes() 321var renderTask = renderer.RenderRootComponentAsync(componentId); 352public async Task DoesNotRenderAfterOnInitAsyncTaskIsCancelledUsingCancellationToken() 362await Task.Yield(); 376public async Task DoesNotRenderAfterOnParametersSetAsyncTaskIsCanceled() 386var renderTask = renderer.RenderRootComponentAsync(componentId); 403public async Task RenderRootComponentAsync_ReportsErrorDuringOnInit() 419public async Task RenderRootComponentAsync_ReportsErrorDuringOnInitAsync() 424var component = new TestComponent { OnInitAsyncLogic = _ => Task.FromException(expected) }; 435public async Task RenderRootComponentAsync_ReportsErrorDuringOnParameterSet() 451public async Task RenderRootComponentAsync_ReportsErrorDuringOnParameterSetAsync() 456var component = new TestComponent { OnParametersSetAsyncLogic = _ => Task.FromException(expected) }; 482public Func<TestComponent, Task> OnInitAsyncLogic { get; set; } 486public Func<TestComponent, Task> OnParametersSetAsyncLogic { get; set; } 490public Func<TestComponent, bool, Task> OnAfterRenderAsyncLogic { get; set; } 511protected override async Task OnInitializedAsync() 534protected override async Task OnParametersSetAsync() 560protected override async Task OnAfterRenderAsync(bool firstRender)
ComponentFactoryTest.cs (6)
271public Task SetParametersAsync(ParameterView parameters) 301public Task SetParametersAsync(ParameterView parameters) 319public Task SetParametersAsync(ParameterView parameters) 344public Task SetParametersAsync(ParameterView parameters) 398public Task SetParametersAsync(ParameterView parameters) 431protected override Task UpdateDisplayAsync(in RenderBatch renderBatch)
DependencyInjectionTest.cs (1)
238public Task SetParametersAsync(ParameterView parameters)
EventCallbackFactoryBinderExtensionsTest.cs (35)
13public async Task CreateBinder_SwallowsConversionException() 30public async Task CreateBinder_IfConverterThrows_ConvertsEmptyStringToDefault() 47public async Task CreateBinder_ThrowsSetterException() 65public async Task CreateBinder_BindsEmpty_DoesNotCallSetter() 82public async Task CreateBinder_BindsEmpty_CallsSetterForNullable() 99public async Task CreateBinder_String() 118public async Task CreateBinder_Bool() 137public async Task CreateBinder_NullableBool() 156public async Task CreateBinder_Int() 175public async Task CreateBinder_NullableInt() 194public async Task CreateBinder_Long() 213public async Task CreateBinder_NullableLong() 232public async Task CreateBinder_Float() 251public async Task CreateBinder_NullableFloat() 270public async Task CreateBinder_Double() 289public async Task CreateBinder_NullableDouble() 308public async Task CreateBinder_Decimal() 327public async Task CreateBinder_NullableDecimal() 346public async Task CreateBinder_Enum() 365public async Task CreateBinder_NullableEnum() 384public async Task CreateBinder_DateTime() 403public async Task CreateBinder_NullableDateTime() 422public async Task CreateBinder_DateTime_Format() 442public async Task CreateBinder_NullableDateTime_Format() 462public async Task CreateBinder_DateTimeOffset() 481public async Task CreateBinder_NullableDateTimeOffset() 500public async Task CreateBinder_DateTimeOffset_Format() 520public async Task CreateBinder_NullableDateTimeOffset_Format() 541public async Task CreateBinder_Guid() 561public async Task CreateBinder_NullableGuid() 580public async Task CreateBinder_CustomTypeConverter() 615public async Task CreateBinder_NumericType_WithCurrentCulture() 634public async Task CreateBinder_NumericType_WithInvariantCulture() 656public Task HandleEventAsync(EventCallbackWorkItem item, object arg) 667public Task SetParametersAsync(ParameterView parameters)
EventCallbackFactoryTest.cs (28)
166var @delegate = (Func<Task>)component.SomeFuncTask; 182var @delegate = (Func<Task>)component.SomeFuncTask; 200var @delegate = (Func<Task>)(() => Task.CompletedTask); 218var @delegate = (Func<string, Task>)component.SomeFuncTTask; 236var callback = EventCallback.Factory.Create(component, (Func<Task>)null); 249var @delegate = (Func<string, Task>)component.SomeFuncTTask; 267var @delegate = (Func<string, Task>)((s) => Task.CompletedTask); 287var callback = EventCallback.Factory.Create(component, (Func<string, Task>)null); 453var @delegate = (Func<Task>)component.SomeFuncTask; 469var @delegate = (Func<Task>)component.SomeFuncTask; 487var @delegate = (Func<Task>)(() => Task.CompletedTask); 507var callback = EventCallback.Factory.Create<string>(component, (Func<Task>)null); 520var @delegate = (Func<string, Task>)component.SomeFuncTTask; 536var @delegate = (Func<string, Task>)component.SomeFuncTTask; 554var @delegate = (Func<string, Task>)((s) => Task.CompletedTask); 574var callback = EventCallback.Factory.Create<string>(component, (Func<string, Task>)null); 603var @delegate = (Func<string, Task>)((s) => Task.CompletedTask); 624public Task SomeFuncTask() 626return Task.CompletedTask; 629public Task SomeFuncTTask(string s) 631return Task.CompletedTask; 639public Task HandleEventAsync(EventCallbackWorkItem item, object arg) 644public Task SetParametersAsync(ParameterView parameters)
EventCallbackTest.cs (46)
11public async Task EventCallback_Default() 21public async Task EventCallbackOfT_Default() 31public async Task EventCallback_NullReceiver() 45public async Task EventCallbackOfT_NullReceiver() 59public async Task EventCallback_Action_Null() 76public async Task EventCallback_Action_IgnoresArg() 93public async Task EventCallback_ActionT_Null() 112public async Task EventCallback_ActionT_Arg() 131public async Task EventCallback_ActionT_Arg_ValueType() 150public async Task EventCallback_ActionT_ArgMismatch() 167public async Task EventCallback_FuncTask_Null() 173var callback = new EventCallback(component, (Func<Task>)(() => { runCount++; return Task.CompletedTask; })); 184public async Task EventCallback_FuncTask_IgnoresArg() 190var callback = new EventCallback(component, (Func<Task>)(() => { runCount++; return Task.CompletedTask; })); 201public async Task EventCallback_FuncTTask_Null() 208var callback = new EventCallback(component, (Func<EventArgs, Task>)((e) => { arg = e; runCount++; return Task.CompletedTask; })); 220public async Task EventCallback_FuncTTask_Arg() 227var callback = new EventCallback(component, (Func<EventArgs, Task>)((e) => { arg = e; runCount++; return Task.CompletedTask; })); 239public async Task EventCallback_FuncTTask_Arg_ValueType() 246var callback = new EventCallback(component, (Func<int, Task>)((e) => { arg = e; runCount++; return Task.CompletedTask; })); 258public async Task EventCallback_FuncTTask_ArgMismatch() 265var callback = new EventCallback(component, (Func<EventArgs, Task>)((e) => { arg = e; runCount++; return Task.CompletedTask; })); 275public async Task EventCallbackOfT_Action_Null() 292public async Task EventCallbackOfT_Action_IgnoresArg() 309public async Task EventCallbackOfT_ActionT_Null() 328public async Task EventCallbackOfT_ActionT_Arg() 347public async Task EventCallbackOfT_FuncTask_Null() 353var callback = new EventCallback<EventArgs>(component, (Func<Task>)(() => { runCount++; return Task.CompletedTask; })); 364public async Task EventCallbackOfT_FuncTask_IgnoresArg() 370var callback = new EventCallback<EventArgs>(component, (Func<Task>)(() => { runCount++; return Task.CompletedTask; })); 381public async Task EventCallbackOfT_FuncTTask_Null() 388var callback = new EventCallback<EventArgs>(component, (Func<EventArgs, Task>)((e) => { arg = e; runCount++; return Task.CompletedTask; })); 400public async Task EventCallbackOfT_FuncTTask_Arg() 407var callback = new EventCallback<EventArgs>(component, (Func<EventArgs, Task>)((e) => { arg = e; runCount++; return Task.CompletedTask; })); 422public Task HandleEventAsync(EventCallbackWorkItem item, object arg) 430public Task SetParametersAsync(ParameterView parameters) => throw new NotImplementedException();
LayoutViewTest.cs (8)
27var setParametersTask = _renderer.Dispatcher.InvokeAsync(() => _layoutViewComponent.SetParametersAsync(ParameterView.Empty)); 40var setParametersTask = _renderer.Dispatcher.InvokeAsync(() => _layoutViewComponent.SetParametersAsync(ParameterView.FromDictionary(new Dictionary<string, object> 61var setParametersTask = _renderer.Dispatcher.InvokeAsync(() => _layoutViewComponent.SetParametersAsync(ParameterView.FromDictionary(new Dictionary<string, object> 87var setParametersTask = _renderer.Dispatcher.InvokeAsync(() => _layoutViewComponent.SetParametersAsync(ParameterView.FromDictionary(new Dictionary<string, object> 119var setParametersTask = _renderer.Dispatcher.InvokeAsync(() => _layoutViewComponent.SetParametersAsync(ParameterView.FromDictionary(new Dictionary<string, object> 160var setParametersTask = _renderer.Dispatcher.InvokeAsync(() => _layoutViewComponent.SetParametersAsync(ParameterView.FromDictionary(new Dictionary<string, object> 204var setParametersTask1 = _renderer.Dispatcher.InvokeAsync(() => _layoutViewComponent.SetParametersAsync(ParameterView.FromDictionary(new Dictionary<string, object> 214var setParametersTask2 = _renderer.Dispatcher.InvokeAsync(() => _layoutViewComponent.SetParametersAsync(ParameterView.FromDictionary(new Dictionary<string, object>
Lifetime\ComponentStatePersistenceManagerTest.cs (23)
19public async Task RestoreStateAsync_InitializesStateWithDataFromTheProvidedStore() 40public async Task RestoreStateAsync_ThrowsOnDoubleInitialization() 57public async Task PersistStateAsync_ThrowsWhenCallbackRenerModeCannotBeInferred() 70return Task.CompletedTask; 79public async Task PersistStateAsync_SavesPersistedStateToTheStore() 92return Task.CompletedTask; 104public async Task PersistStateAsync_InvokesPauseCallbacksDuringPersist() 124public async Task PersistStateAsync_FiresCallbacksInParallel() 141var persistTask = lifetime.PersistStateAsync(store, renderer); 152public async Task PersistStateAsync_CallbacksAreRemovedWhenSubscriptionsAreDisposed() 172var persistTask = lifetime.PersistStateAsync(store, renderer); 183public async Task PersistStateAsync_ContinuesInvokingPauseCallbacksDuringPersistIfACallbackThrows() 197lifetime.State.RegisterOnPersisting(() => { invoked = true; return Task.CompletedTask; }, new TestRenderMode()); 209public async Task PersistStateAsync_ContinuesInvokingPauseCallbacksDuringPersistIfACallbackThrowsAsynchonously() 223lifetime.State.RegisterOnPersisting(() => { invoked = true; return Task.CompletedTask; }, new TestRenderMode()); 226var persistTask = lifetime.PersistStateAsync(store, renderer); 252protected override Task UpdateDisplayAsync(in RenderBatch renderBatch) 269return Task.FromResult(State); 272public Task PersistStateAsync(IReadOnlyDictionary<string, byte[]> state) 276return Task.CompletedTask; 297return Task.FromResult(State); 300public Task PersistStateAsync(IReadOnlyDictionary<string, byte[]> state) 304return Task.CompletedTask;
NavigationManagerTest.cs (21)
288public async Task LocationChangingHandlers_CanContinueTheNavigationAsynchronously_WhenMultipleHandlersAreRegistered() 312await Task.Yield(); 476await Task.Yield(); 513await Task.Delay(System.Threading.Timeout.Infinite, context.CancellationToken); 536await Task.Yield(); 542public async Task LocationChangingHandlers_AreCanceledBySuccessiveNavigations_WhenOneHandlerIsRegistered() 569await Task.Delay(System.Threading.Timeout.Infinite, context.CancellationToken); 584public async Task LocationChangingHandlers_AreCanceledBySuccessiveNavigations_WhenMultipleHandlersAreRegistered() 634await Task.Delay(System.Threading.Timeout.Infinite, context.CancellationToken); 658public async Task LocationChangingHandlers_CanThrowCatchableExceptionsAsynchronously_AfterNavigationEnds() 698public async Task LocationChangingHandlers_DoNotBubbleExceptionsThroughNotifyLocationChangingAsync_WhenOneHandlerIsRegistered() 717await Task.Yield(); 723public async Task LocationChangingHandlers_DoNotBubbleExceptionsThroughNotifyLocationChangingAsync_WhenMultipleHandlersAreRegistered() 743await Task.Yield(); 748await Task.Yield(); 754public async Task LocationChangingAsync_Throws_WithoutHandleLocationChangingHandlerOverride_WhenALocationChangingHandlerThrows_WhenOneHandlerIsRegistered() 769await Task.Yield(); 775public async Task LocationChangingAsync_Throws_WithoutHandleLocationChangingHandlerOverride_WhenALocationChangingHandlerThrows_WhenMultipleHandlersAreRegistered() 791await Task.Yield(); 796await Task.Yield(); 802public async Task LocationChangingHandlers_CannotCancelTheNavigationAsynchronously_UntilReturning()
ParameterViewTest.cs (1)
594public Task SetParametersAsync(ParameterView parameters)
RendererTest.cs (218)
176public async Task CanRenderAsyncTopLevelComponents() 185var renderTask = renderer.Dispatcher.InvokeAsync(() => renderer.RenderRootComponentAsync(componentId)); 229public async Task CanRenderAsyncNestedComponents() 315public async Task CanAddAndRenderNewRootComponentsWhileNotQuiescent() 324var renderTask1 = renderer.Dispatcher.InvokeAsync(() => renderer.RenderRootComponentAsync(component1Id)); 331var renderTask2 = renderer.Dispatcher.InvokeAsync(() => renderer.RenderRootComponentAsync(component2Id)); 348await Task.WhenAll(renderTask1, renderTask2); 352public async Task AsyncComponentTriggeringRootReRenderDoesNotDeadlock() 379var renderTask = renderer.Dispatcher.InvokeAsync(() => renderer.RenderRootComponentAsync(componentId.Value)); 388public async Task CanRenderAsyncComponentsWithSyncChildComponents() 432public async Task CanRenderAsyncComponentsWithAsyncChildInit() 476public async Task CanRenderAsyncComponentsWithMultipleAsyncChildren() 563var task = renderer.DispatchEventAsync(eventHandlerId, eventArgs); 593var renderTask = renderer.DispatchEventAsync(eventHandlerId, eventArgs); 606OnArbitraryDelegateEvent = (Func<DerivedEventArgs, Task>)(args => Task.CompletedTask), 629OnArbitraryDelegateEvent = (Func<Task>)(() => Task.CompletedTask), 716var renderTask = renderer.DispatchEventAsync(eventHandlerId, eventArgs); 747var renderTask = renderer.DispatchEventAsync(eventHandlerId, eventArgs); 776var renderTask = renderer.DispatchEventAsync(eventHandlerId, eventArgs); 816var renderTask = renderer.DispatchEventAsync(eventHandlerId, eventArgs); 822public async Task CanAsyncDispatchEventsToTopLevelComponents() 854var task = renderer.DispatchEventAsync(eventHandlerId, eventArgs); 865public async Task CanAsyncDispatchTypedEventsToTopLevelComponents() 897var task = renderer.DispatchEventAsync(eventHandlerId, eventArgs); 908public async Task CanAsyncDispatchActionEventsToTopLevelComponents() 940var task = renderer.DispatchEventAsync(eventHandlerId, eventArgs); 951public async Task CanAsyncDispatchEventsToNestedComponents() 994var task = renderer.DispatchEventAsync(eventHandlerId, eventArgs); 1011public async Task EventDispatching_DelegateParameter_MethodToDelegateConversion() 1052public async Task EventDispatching_DelegateParameter_NoTargetLambda() 1094public async Task EventDispatching_EventCallback_MethodToDelegateConversion() 1132public async Task EventDispatching_EventCallback_NoTargetLambda() 1173public async Task EventDispatching_EventCallback_AsyncNoTargetLambda() 1183builder.AddComponentParameter(1, nameof(EventComponent.OnClickEventCallback), EventCallback.Factory.Create(parentComponent, (Func<Task>)(() => 1186return Task.CompletedTask; 1213public async Task EventDispatching_EventCallbackOfT_MethodToDelegateConversion() 1251public async Task EventDispatching_EventCallbackOfT_NoTargetLambda() 1292public async Task EventDispatching_EventCallbackOfT_AsyncNoTargetLambda() 1302builder.AddComponentParameter(1, nameof(EventComponent.OnClickEventCallbackOfT), EventCallback.Factory.Create<DerivedEventArgs>(parentComponent, (Func<Task>)(() => 1305return Task.CompletedTask; 1332public async Task DispatchEventAsync_Delegate_SynchronousCompletion() 1358var task = renderer.DispatchEventAsync(eventHandlerId, new DerivedEventArgs()); 1366public async Task DispatchEventAsync_EventCallback_SynchronousCompletion() 1390var task = renderer.DispatchEventAsync(eventHandlerId, new DerivedEventArgs()); 1398public async Task DispatchEventAsync_EventCallbackOfT_SynchronousCompletion() 1424var task = renderer.DispatchEventAsync(eventHandlerId, new DerivedEventArgs()); 1433public async Task DispatchEventAsync_Delegate_SynchronousCancellation() 1459var task = renderer.DispatchEventAsync(eventHandlerId, new DerivedEventArgs()); 1467public async Task DispatchEventAsync_EventCallback_SynchronousCancellation() 1491var task = renderer.DispatchEventAsync(eventHandlerId, new DerivedEventArgs()); 1499public async Task DispatchEventAsync_EventCallbackOfT_SynchronousCancellation() 1526var task = renderer.DispatchEventAsync(eventHandlerId, new DerivedEventArgs()); 1535public async Task DispatchEventAsync_Delegate_SynchronousException() 1561var task = renderer.DispatchEventAsync(eventHandlerId, new DerivedEventArgs()); 1569public async Task DispatchEventAsync_EventCallback_SynchronousException() 1593var task = renderer.DispatchEventAsync(eventHandlerId, new DerivedEventArgs()); 1601public async Task DispatchEventAsync_EventCallbackOfT_SynchronousException() 1628var task = renderer.DispatchEventAsync(eventHandlerId, new DerivedEventArgs()); 1637public async Task DispatchEventAsync_Delegate_AsynchronousCompletion() 1648builder.AddComponentParameter(1, nameof(EventComponent.OnClickAsyncAction), (Func<Task>)(async () => 1665var task = renderer.DispatchEventAsync(eventHandlerId, new DerivedEventArgs()); 1674public async Task DispatchEventAsync_EventCallback_AsynchronousCompletion() 1700var task = renderer.DispatchEventAsync(eventHandlerId, new DerivedEventArgs()); 1709public async Task DispatchEventAsync_EventCallbackOfT_AsynchronousCompletion() 1738var task = renderer.DispatchEventAsync(eventHandlerId, new DerivedEventArgs()); 1748public async Task DispatchEventAsync_Delegate_AsynchronousCancellation() 1759builder.AddComponentParameter(1, nameof(EventComponent.OnClickAsyncAction), (Func<Task>)(async () => 1777var task = renderer.DispatchEventAsync(eventHandlerId, new DerivedEventArgs()); 1788public async Task DispatchEventAsync_EventCallback_AsynchronousCancellation() 1815var task = renderer.DispatchEventAsync(eventHandlerId, new DerivedEventArgs()); 1826public async Task DispatchEventAsync_EventCallbackOfT_AsynchronousCancellation() 1856var task = renderer.DispatchEventAsync(eventHandlerId, new DerivedEventArgs()); 1868public async Task DispatchEventAsync_Delegate_AsynchronousException() 1879builder.AddComponentParameter(1, nameof(EventComponent.OnClickAsyncAction), (Func<Task>)(async () => 1897var task = renderer.DispatchEventAsync(eventHandlerId, new DerivedEventArgs()); 1907public async Task DispatchEventAsync_EventCallback_AsynchronousException() 1934var task = renderer.DispatchEventAsync(eventHandlerId, new DerivedEventArgs()); 1944public async Task DispatchEventAsync_EventCallbackOfT_AsynchronousException() 1974var task = renderer.DispatchEventAsync(eventHandlerId, new DerivedEventArgs()); 1985public async Task CannotDispatchEventsWithUnknownEventHandlers() 2623public async Task DoesNotDispatchEventsAfterOwnerComponentIsDisposed() 2656var renderTask = renderer.DispatchEventAsync(eventHandlerId, args: null); 2673public async Task DisposesEventHandlersWhenAttributeValueChanged() 2690var renderTask = renderer.DispatchEventAsync(origEventHandlerId, args: null); 2715public async Task DisposesEventHandlersWhenAttributeRemoved() 2732var renderTask = renderer.DispatchEventAsync(origEventHandlerId, args: null); 2750public async Task DisposesEventHandlersWhenOwnerComponentRemoved() 2783var renderTask = renderer.DispatchEventAsync(eventHandlerId, args: null); 2801public async Task DisposesEventHandlersWhenAncestorElementRemoved() 2818var renderTask = renderer.DispatchEventAsync(origEventHandlerId, args: null); 2836public async Task AllRendersTriggeredSynchronouslyDuringEventHandlerAreHandledAsSingleBatch() 2870var renderTask = renderer.DispatchEventAsync(origEventHandlerId, args: null); 3063var renderTask = renderer.DispatchEventAsync(origEventHandlerId, args: null); 3079public async Task CanCombineBindAndConditionalAttribute() 3095var renderTask = renderer.DispatchEventAsync(checkboxChangeEventHandlerId, eventArgs); 3113public async Task BindWithSynchronousSetter_Lambda() 3137var renderTask = renderer.DispatchEventAsync(checkboxChangeEventHandlerId, eventArgs); 3145public async Task BindWithAsynchronousSetter_MethodGroupToDelegate() 3153async Task SetValue(string __value) 3156await Task.CompletedTask; 3176var renderTask = renderer.DispatchEventAsync(checkboxChangeEventHandlerId, eventArgs); 3184public async Task BindWithAfter() 3201return RuntimeHelpers.InvokeAsynchronousDelegate(() => Task.CompletedTask); 3216var renderTask = renderer.DispatchEventAsync(checkboxChangeEventHandlerId, eventArgs); 3224public async Task BindWithAfter_Action() 3256var renderTask = renderer.DispatchEventAsync(checkboxChangeEventHandlerId, eventArgs); 3374OnUpdateDisplayAsync = _ => Task.CompletedTask 3468public async Task CanTriggerEventHandlerDisposedInEarlierPendingBatchAsync() 3485NextUpdateDisplayReturnTask = Task.CompletedTask 3531var awaitableTask = render1TCS.Task.ContinueWith(_ => Task.Delay(1000)).Unwrap(); 3552var task = renderer.RenderRootComponentAsync(componentId, ParameterView.FromDictionary(new Dictionary<string, object> 3585var renderTask = renderer.RenderRootComponentAsync(componentId, ParameterView.FromDictionary(new Dictionary<string, object> 3618var renderTask = renderer.RenderRootComponentAsync(componentId, ParameterView.FromDictionary(new Dictionary<string, object> 3627EventAction = () => Task.FromException<(int, NestedAsyncComponent.EventType)>(exception), 3642public async Task ExceptionsThrownAsynchronouslyDuringFirstRenderCanBeHandled() 3652var renderTask = renderer.RenderRootComponentAsync(componentId, ParameterView.FromDictionary(new Dictionary<string, object> 3682public async Task ExceptionsDispatchedOffSyncContextCanBeHandledAsync() 3698public async Task ExceptionsThrownAsynchronouslyAfterFirstRenderCanBeHandled() 3710var taskToAwait = Task.CompletedTask; 3738public async Task ExceptionsThrownAsynchronouslyFromMultipleComponentsCanBeHandled() 3749var renderTask = renderer.RenderRootComponentAsync(componentId, ParameterView.FromDictionary(new Dictionary<string, object> 3807var renderTask = renderer.RenderRootComponentAsync(componentId, ParameterView.FromDictionary(new Dictionary<string, object> 3851public async Task ExceptionsThrownFromHandleAfterRender_Sync_AreHandled() 3862var renderTask = renderer.RenderRootComponentAsync(componentId, ParameterView.FromDictionary(new Dictionary<string, object> 3885return Task.FromResult((1, NestedAsyncComponent.EventType.OnAfterRenderAsyncSync)); 3905public async Task ExceptionsThrownFromHandleAfterRender_Async_AreHandled() 3916var renderTask = renderer.RenderRootComponentAsync(componentId, ParameterView.FromDictionary(new Dictionary<string, object> 3927await Task.Yield(); 3939await Task.Yield(); 3961public async Task ExceptionThrownFromConstructor() 3973var renderTask = renderer.RenderRootComponentAsync(componentId); 3994public Task SetParametersAsync(ParameterView parameters) 4001public async Task ExceptionThrownFromAttach() 4013var renderTask = renderer.RenderRootComponentAsync(componentId); 4029public Task SetParametersAsync(ParameterView parameters) 4046var renderTask = renderer.RenderRootComponentAsync(componentId, ParameterView.FromDictionary(new Dictionary<string, object> 4080var renderTask = renderer.RenderRootComponentAsync(componentId, ParameterView.FromDictionary(new Dictionary<string, object> 4106public async Task CanceledTasksInHandleAfterRender_AreIgnored() 4263public async Task DisposingRenderer_CapturesSyncExceptionsFromAllRegisteredAsyncDisposableComponents() 4290public async Task DisposingRenderer_CapturesAsyncExceptionsFromAllRegisteredAsyncDisposableComponents() 4344var dispatchEventTask = renderer.DispatchEventAsync(eventHandlerId, eventFieldInfo, new ChangeEventArgs 4396var dispatchEventTask = renderer.DispatchEventAsync(eventHandlerId, fieldInfo, new ChangeEventArgs 4469public async Task CanSetComponentParameter_WhenParameterTypeHasImplicitConversionToString() 4526public async Task ThrowsIfComponentProducesInvalidRenderTree() 4609public async Task SetParametersAsyncExceptionsCanBeHandledByClosestErrorBoundary_Async() 4673var task = renderer.DispatchEventAsync(eventHandlerId, new EventArgs()); 4687public async Task EventDispatchExceptionsCanBeHandledByClosestErrorBoundary_Async() 4712var dispatchEventTask = renderer.DispatchEventAsync(eventHandlerId, new EventArgs()); 4731public async Task EventDispatchExceptionsCanBeHandledByClosestErrorBoundary_AfterDisposal() 4761var dispatchEventTask = renderer.DispatchEventAsync(eventHandlerId, new EventArgs()); 4783public async Task CanRemoveRootComponents() 4835public async Task CannotRemoveSameRootComponentMultipleTimesSynchronously() 4864public async Task CannotRemoveNonRootComponentsDirectly() 4961public async Task DisposeAsyncCallsComponentDisposeAsyncOnSyncContext() 4984public async Task NoHotReloadListenersAreRegistered_WhenMetadataUpdatesAreNotSupported() 5006public async Task DisposingRenderer_UnsubsribesFromHotReloadManager() 5118public Task SetParametersAsync(ParameterView parameters) => throw new NotImplementedException(); 5130public Task SetParametersAsync(ParameterView parameters) => throw new NotImplementedException(); 5179protected override Task UpdateDisplayAsync(in RenderBatch renderBatch) 5180=> Task.CompletedTask; 5198public Task SetParametersAsync(ParameterView parameters) 5201return Task.CompletedTask; 5206var t = _renderHandle.Dispatcher.InvokeAsync(() => _renderHandle.Render(_renderFragment)); 5267public Task SetParametersAsync(ParameterView parameters) 5270return Task.CompletedTask; 5280public Func<EventArgs, Task> OnTestAsync { get; set; } 5286public Func<DerivedEventArgs, Task> OnClickAsync { get; set; } 5292public Func<Task> OnClickAsyncAction { get; set; } 5361public Task HandleEventAsync(EventCallbackWorkItem callback, object arg) 5424public Task SetParametersAsync(ParameterView parameters) 5428return Task.CompletedTask; 5431public Task HandleEventAsync(EventCallbackWorkItem callback, object arg) 5433var task = callback.InvokeAsync(arg); 5455public Task SetParametersAsync(ParameterView parameters) 5457return Task.CompletedTask; 5477public Task HandleEventAsync(EventCallbackWorkItem callback, object arg) 5479var task = callback.InvokeAsync(arg); 5505public Task OnAfterRenderAsync() 5509return Task.CompletedTask; 5512Task IComponent.SetParametersAsync(ParameterView parameters) 5515return Task.CompletedTask; 5561public Task NextUpdateDisplayReturnTask { get; set; } 5563protected override Task UpdateDisplayAsync(in RenderBatch renderBatch) 5574public AsyncComponent(Task taskToAwait, int number) 5580private readonly Task _taskToAwait; 5589public async Task SetParametersAsync(ParameterView parameters) 5630public Task HandleEventAsync(EventCallbackWorkItem callback, object arg) 5632var task = callback.InvokeAsync(arg); 5637public Task SetParametersAsync(ParameterView parameters) 5642public Task TriggerRenderAsync() => _renderHandle.Dispatcher.InvokeAsync(() => _renderHandle.Render(RenderFragment)); 5719protected override async Task OnInitializedAsync() 5745protected override async Task OnParametersSetAsync() 5766protected override async Task OnAfterRenderAsync(bool firstRender) 5809EventAction = () => Task.FromResult((id, @event)) 5819await Task.Yield(); 5839public Task ExternalExceptionDispatch(Exception exception) 5842Task.Run(async () => 5856[Parameter] public Task TaskToAwait { get; set; } 5858protected override async Task OnParametersSetAsync() 5866public Func<RenderBatch, Task> OnUpdateDisplayAsync { get; set; } 5868protected override Task UpdateDisplayAsync(in RenderBatch renderBatch) 5876private readonly Task _task; 5878public AsyncAfterRenderComponent(Task task) 5887public async Task OnAfterRenderAsync() 5956public Task SetParametersAsync(ParameterView parameters) 5971public Task ReceivedErrorTask => receivedErrorTaskCompletionSource.Task; 6003[Parameter] public Task ThrowDuringEventAsync { get; set; } 6005[Parameter] public Task ThrowDuringParameterSettingAsync { get; set; } 6007public override async Task SetParametersAsync(ParameterView parameters) 6035public async Task HandleEventAsync(EventCallbackWorkItem item, object arg) 6052public Func<Task> Callback { get; set; } 6054public override async Task SetParametersAsync(ParameterView parameters) 6075public Task SetParametersAsync(ParameterView parameters) 6087return Task.CompletedTask;
Rendering\RendererSynchronizationContextTest.cs (52)
64public async Task Post_CanRunAsynchronously_WhenBusy() 75var task = Task.Run(() => 104public async Task Post_CanRunAsynchronously_CaptureExecutionContext() 119var task = Task.Run(() => 159public async Task Post_CanRunAsynchronously_WhenBusy_Exception() 173var task = Task.Run(() => 201public async Task Post_BackgroundWorkItem_CanProcessMoreItemsInline() 215var task1 = Task.Run(() => context.Send((_) => 223var task2 = Task.Run(() => 278await Task.Yield(); 323public async Task Send_BlocksWhenOtherWorkRunning() 334var task1 = Task.Run(() => 348var task2 = Task.Run(() => 386await Task.Yield(); 401public async Task InvokeAsync_Action_CanRunSynchronously_WhenNotBusy() 420public async Task InvokeAsync_Action_CanRunAsynchronously_WhenBusy() 431var task1 = Task.Run(() => 460public async Task InvokeAsync_Action_CanRethrowExceptions() 476public async Task InvokeAsync_Action_CanReportCancellation() 493public async Task InvokeAsync_FuncT_CanRunSynchronously_WhenNotBusy() 510public async Task InvokeAsync_FuncT_CanRunAsynchronously_WhenBusy() 520var task1 = Task.Run(() => 548public async Task InvokeAsync_FuncT_CanRethrowExceptions() 564public async Task InvokeAsync_FuncT_CanReportCancellation() 581public async Task InvokeAsync_FuncTask_CanRunSynchronously_WhenNotBusy() 592return Task.CompletedTask; 601public async Task InvokeAsync_FuncTask_CanRunAsynchronously_WhenBusy() 612var task1 = Task.Run(() => 628return Task.CompletedTask; 642public async Task InvokeAsync_FuncTask_CanRethrowExceptions() 658public async Task InvokeAsync_FuncTask_CanReportCancellation() 675public async Task InvokeAsync_FuncTaskT_CanRunSynchronously_WhenNotBusy() 684return Task.FromResult(Thread.CurrentThread); 692public async Task InvokeAsync_FuncTaskT_CanRunAsynchronously_WhenBusy() 702var task1 = Task.Run(() => 717return Task.FromResult(Thread.CurrentThread); 730public async Task InvokeAsync_FuncTaskT_CanRethrowExceptions() 746public async Task InvokeAsync_FuncTaskT_CanReportCancellation() 763public async Task InvokeAsync_SyncWorkInAsyncTaskIsCompletedFirst() 771await Task.Yield(); 781await Task.Delay(250);
Rendering\RenderTreeBuilderTest.cs (2)
2283public Task SetParametersAsync(ParameterView parameters) 2302protected override Task UpdateDisplayAsync(in RenderBatch renderBatch)
RenderTreeDiffBuilderTest.cs (12)
2461protected override Task UpdateDisplayAsync(in RenderBatch renderBatch) 2462=> Task.CompletedTask; 2485public Task SetParametersAsync(ParameterView parameters) 2488return Task.CompletedTask; 2498public Task SetParametersAsync(ParameterView parameters) => Task.CompletedTask; 2509public Task SetParametersAsync(ParameterView parameters) 2512return Task.CompletedTask; 2523public Task SetParametersAsync(ParameterView parameters) => Task.CompletedTask; 2530public Task SetParametersAsync(ParameterView parameters) => Task.CompletedTask;
Routing\RouterTest.cs (16)
38public async Task CanRunOnNavigateAsync() 44await Task.CompletedTask; 57public async Task CanceledFailedOnNavigateAsyncDoesNothing() 66await Task.Delay(Timeout.Infinite, args.CancellationToken); 92public async Task AlreadyCanceledOnNavigateAsyncDoesNothing() 134await Task.CompletedTask; 149public async Task RefreshesOnceOnCancelledOnNavigateAsync() 156await Task.Delay(Timeout.Infinite, args.CancellationToken); 180public async Task UsesCurrentRouteMatchingIfSpecified() 203public async Task SetParametersAsyncRefreshesOnce() 228public async Task UsesNotFoundContentIfSpecified() 249public async Task UsesDefaultNotFoundContentIfNotSpecified() 284public Task EnableNavigationInterceptionAsync() 286return Task.CompletedTask; 292public Task RefreshScrollPositionForHash(string locationAbsolute) 294return Task.CompletedTask;
src\Components\Shared\test\AutoRenderComponent.cs (3)
18public virtual Task SetParametersAsync(ParameterView parameters) 22return Task.CompletedTask; 28var t = _renderHandle.Dispatcher.InvokeAsync(() => _renderHandle.Render(BuildRenderTree));
src\Components\Shared\test\TestRenderer.cs (10)
48public Task NextRenderResultTask { get; set; } = Task.CompletedTask; 63var task = Dispatcher.InvokeAsync(() => base.RenderRootComponentAsync(componentId, parameters ?? ParameterView.Empty)); 67public new Task RenderRootComponentAsync(int componentId) 70public new Task RenderRootComponentAsync(int componentId, ParameterView parameters) 73public Task DispatchEventAsync(ulong eventHandlerId, EventArgs args) 76public new Task DispatchEventAsync(ulong eventHandlerId, EventFieldInfo eventFieldInfo, EventArgs args) 79private static Task UnwrapTask(Task task) 111protected override Task UpdateDisplayAsync(in RenderBatch renderBatch)
Microsoft.AspNetCore.Components.Web (41)
Forms\AntiforgeryToken.cs (2)
26Task IComponent.SetParametersAsync(ParameterView parameters) 37return Task.CompletedTask;
Forms\EditForm.cs (2)
15private readonly Func<Task> _handleSubmitDelegate; // Cache to avoid per-render allocations 192private async Task HandleSubmitAsync()
Forms\InputBase.cs (1)
224public override Task SetParametersAsync(ParameterView parameters)
Forms\InputFile.cs (2)
48protected override async Task OnAfterRenderAsync(bool firstRender) 89Task IInputFileJsCallbacks.NotifyChange(BrowserFile[] files)
Forms\InputFile\IInputFileJsCallbacks.cs (1)
8Task NotifyChange(BrowserFile[] files);
Forms\InputFile\InputFileJsCallbacksRelay.cs (1)
24public Task NotifyChange(BrowserFile[] files)
Forms\Mapping\FormMappingScope.cs (2)
36Task IComponent.SetParametersAsync(ParameterView parameters) 67return Task.CompletedTask;
Head\HeadOutlet.cs (1)
26protected override async Task OnAfterRenderAsync(bool firstRender)
HtmlRendering\HtmlRootComponent.cs (3)
16internal HtmlRootComponent(StaticHtmlRenderer renderer, int componentId, Task quiescenceTask) 24/// Gets a <see cref="Task"/> that completes when the component hierarchy has completed asynchronous tasks such as loading. 26public Task QuiescenceTask { get; }
HtmlRendering\StaticHtmlRenderer.cs (4)
24private static readonly Task CanceledRenderTask = Task.FromCanceled(new CancellationToken(canceled: true)); 71var quiescenceTask = RenderRootComponentAsync(componentId, initialParameters); 86protected override Task UpdateDisplayAsync(in RenderBatch renderBatch)
JSComponents\JSComponentInterop.cs (2)
176var callback = jsObjectReference is null ? null : new Func<Task>( 184var callback = jsObjectReference is null ? null : new Func<object, Task>(
Routing\FocusOnNavigate.cs (1)
54protected override async Task OnAfterRenderAsync(bool firstRender)
Routing\NavigationLock.cs (3)
47Task IComponent.SetParametersAsync(ParameterView parameters) 71return Task.CompletedTask; 74async Task IHandleAfterRender.OnAfterRenderAsync()
src\Components\Shared\src\DefaultAntiforgeryStateProvider.cs (1)
28return Task.CompletedTask;
Virtualization\Virtualize.cs (3)
126/// <returns>A <see cref="Task"/> representing the completion of the operation.</returns> 127public async Task RefreshDataAsync() 185protected override async Task OnAfterRenderAsync(bool firstRender)
Web\ErrorBoundary.cs (1)
20protected override async Task OnErrorAsync(Exception exception)
Web\WebEventCallbackFactoryEventArgsExtensions.cs (10)
36public static EventCallback<ClipboardEventArgs> Create(this EventCallbackFactory factory, object receiver, Func<ClipboardEventArgs, Task> callback) 68public static EventCallback<DragEventArgs> Create(this EventCallbackFactory factory, object receiver, Func<DragEventArgs, Task> callback) 100public static EventCallback<ErrorEventArgs> Create(this EventCallbackFactory factory, object receiver, Func<ErrorEventArgs, Task> callback) 132public static EventCallback<FocusEventArgs> Create(this EventCallbackFactory factory, object receiver, Func<FocusEventArgs, Task> callback) 164public static EventCallback<KeyboardEventArgs> Create(this EventCallbackFactory factory, object receiver, Func<KeyboardEventArgs, Task> callback) 196public static EventCallback<MouseEventArgs> Create(this EventCallbackFactory factory, object receiver, Func<MouseEventArgs, Task> callback) 227public static EventCallback<PointerEventArgs> Create(this EventCallbackFactory factory, object receiver, Func<PointerEventArgs, Task> callback) 259public static EventCallback<ProgressEventArgs> Create(this EventCallbackFactory factory, object receiver, Func<ProgressEventArgs, Task> callback) 291public static EventCallback<TouchEventArgs> Create(this EventCallbackFactory factory, object receiver, Func<TouchEventArgs, Task> callback) 323public static EventCallback<WheelEventArgs> Create(this EventCallbackFactory factory, object receiver, Func<WheelEventArgs, Task> callback)
WebRenderer.cs (1)
161public Task DispatchEventAsync(JsonElement eventDescriptor, JsonElement eventArgs)
Microsoft.AspNetCore.Components.Web.Tests (136)
Forms\BrowserFileTest.cs (1)
57public async Task OpenReadStream_ReturnsStreamWhoseDisposalReleasesTheJSObject_ToleratesDisposalException()
Forms\EditFormTest.cs (7)
30public async Task ThrowsIfBothEditContextAndModelAreSupplied() 48public async Task ThrowsIfBothEditContextAndModelAreNull() 62public async Task ReturnsEditContextWhenModelParameterUsed() 83public async Task ReturnsEditContextWhenEditContextParameterUsed(bool createFieldPath) 101public async Task DoesNotAddSSRContentWhenNoMappingContextPresent() 131public async Task AddSSRContentWhenMappingContextPresent() 176public async Task CanOverrideMethodWhenMappingContextPresent()
Forms\InputBaseTest.cs (22)
12public async Task ThrowsIfEditContextChanges() 26public async Task ThrowsIfNoValueExpressionIsSupplied() 38public async Task GetsCurrentValueFromValueParameter() 57public async Task ExposesEditContextToSubclass() 76public async Task ExposesFieldIdentifierToSubclass() 95public async Task CanReadBackChangesToCurrentValue() 116public async Task CanRenderWithoutEditContext() 133public async Task WritingToCurrentValueInvokesValueChangedIfDifferent() 156public async Task WritingToCurrentValueDoesNotInvokeValueChangedIfUnchanged() 179public async Task WritingToCurrentValueNotifiesEditContext() 200public async Task SuppliesFieldClassCorrespondingToFieldState() 234public async Task CssClassCombinesClassWithFieldClass() 259public async Task SuppliesCurrentValueAsStringWithFormatting() 276public async Task ParsesCurrentValueAsStringWhenChanged_Valid() 306public async Task ParsesCurrentValueAsStringWhenChanged_Invalid() 341public async Task ClearsParsingValidationMessagesWhenDisposed() 365public async Task RespondsToValidationStateChangeNotifications() 401public async Task UnsubscribesFromValidationStateChangeNotifications() 427public async Task AriaAttributeIsRenderedWhenTheValidationStateIsInvalidOnFirstRender() 460public async Task UserSpecifiedAriaValueIsNotChangedIfInvalid() 494public async Task AriaAttributeRemovedWhenStateChangesToValidFromInvalid() 565public async Task SetCurrentValueAsStringAsync(string value)
Forms\InputDateTest.cs (3)
9public async Task ValidationErrorUsesDisplayAttributeName() 35public async Task InputElementIsAssignedSuccessfully() 59public async Task SetCurrentValueAsStringAsync(string value)
Forms\InputNumberTest.cs (3)
9public async Task ValidationErrorUsesDisplayAttributeName() 35public async Task InputElementIsAssignedSuccessfully() 59public async Task SetCurrentValueAsStringAsync(string value)
Forms\InputRadioTest.cs (4)
14public async Task ThrowsOnFirstRenderIfInputRadioHasNoGroup() 28public async Task GroupGeneratesNameGuidWhenInvalidNameSupplied() 46public async Task RadioInputContextExistsWhenValidNameSupplied() 62public async Task InputElementIsAssignedSuccessfully()
Forms\InputSelectTest.cs (11)
9public async Task ParsesCurrentValueWhenUsingNotNullableEnumWithNotEmptyValue() 28public async Task ParsesCurrentValueWhenUsingNotNullableEnumWithEmptyValue() 47public async Task ParsesCurrentValueWhenUsingNullableEnumWithNotEmptyValue() 66public async Task ParsesCurrentValueWhenUsingNullableEnumWithEmptyValue() 86public async Task ParsesCurrentValueWhenUsingNotNullableGuid() 107public async Task ParsesCurrentValueWhenUsingNullableGuid() 128public async Task ParsesCurrentValueWhenUsingNotNullableInt() 148public async Task ParsesCurrentValueWhenUsingNullableInt() 167public async Task ValidationErrorUsesDisplayAttributeName() 193public async Task InputElementIsAssignedSuccessfully() 242public async Task SetCurrentValueAsStringAsync(string value)
Forms\InputTextAreaTest.cs (1)
9public async Task InputElementIsAssignedSuccessfully()
Forms\InputTextTest.cs (1)
9public async Task InputElementIsAssignedSuccessfully()
Forms\Mapping\SupplyParameterFromFormTest.cs (4)
13public async Task FindCascadingParameters_HandlesSupplyParameterFromFormValues() 32public async Task FindCascadingParameters_HandlesSupplyParameterFromFormValues_WithMappingScopeName() 104public Task SetParametersAsync(ParameterView parameters) 105=> Task.CompletedTask;
HtmlRendering\HtmlRendererTest.cs (62)
21public async Task RenderComponentAsync_ThrowsIfNotOnSyncContext() 34public async Task HtmlContent_Write_ThrowsIfNotOnSyncContext() 47public async Task RenderComponentAsync_CanRenderEmptyElement() 68public async Task RenderComponentAsync_CanRenderSimpleComponent() 91public async Task RenderComponentAsync_HtmlEncodesContent() 114public async Task RenderComponentAsync_DoesNotEncodeMarkup() 137public async Task RenderComponentAsync_CanRenderWithAttributes() 161public async Task RenderComponentAsync_SkipsDuplicatedAttribute() 194public async Task RenderComponentAsync_HtmlEncodesAttributeValues() 219public async Task RenderComponentAsync_CanRenderBooleanAttributes() 242public async Task RenderComponentAsync_DoesNotRenderBooleanAttributesWhenValueIsFalse() 265public async Task RenderComponentAsync_CanRenderWithChildren() 290public async Task RenderComponentAsync_CanRenderWithMultipleChildren() 322public async Task RenderComponentAsync_MarksSelectedOptionsAsSelected() 370public async Task RenderComponentAsync_RendersValueAttributeAsTextContentOfTextareaElement() 395public async Task RenderComponentAsync_RendersTextareaElementWithoutValueAttribute() 420public async Task RenderComponentAsync_RendersTextareaElementWithoutValueAttributeOrTextContent() 444public async Task RenderComponentAsync_ValueAttributeOfTextareaElementOverridesTextContent() 468public async Task RenderComponentAsync_RendersSelfClosingElement() 492public async Task RenderComponentAsync_RendersSelfClosingElementWithTextComponentAsNormalElement() 515public async Task RenderComponentAsync_RendersSelfClosingElementBySkippingElementReferenceCapture() 540public async Task RenderComponentAsync_MarksSelectedOptionsAsSelected_WithOptGroups() 579public async Task RenderComponentAsync_CanRenderComponentAsyncWithChildrenComponents() 610public async Task RenderComponentAsync_ComponentReferenceNoops() 642public async Task RenderComponentAsync_CanPassParameters() 678public async Task RenderComponentAsync_CanRenderComponentAsyncWithRenderFragmentContent() 704public async Task RenderComponentAsync_ElementRefsNoops() 744public Task SetParametersAsync(ParameterView parameters) 747return Task.CompletedTask; 752public async Task CanRender_AsyncComponent() 774public async Task CanRender_NestedAsyncComponents() 801public async Task RenderComponentAsync_CanCauseRerenderingOfEarlierComponents() 835public async Task RenderComponentAsync_CanOutputToTextWriter() 862public async Task BeginRenderingComponent_CanObserveStateBeforeAndAfterQuiescence() 873var quiescenceTask = result.QuiescenceTask; 885public async Task RenderComponentAsync_ThrowsSync() 906public async Task RenderComponentAsync_ThrowsAsync() 910var services = GetServiceProvider(collection => collection.AddSingleton(new AsyncLoadingComponentCompletion { Task = Task.Delay(0) })); 926public async Task BeginRenderingComponent_ThrowsSync() 947public async Task BeginRenderingComponent_ThrowsAsyncDuringWaitForQuiescenceAsync() 972public async Task RenderComponentAsync_CanRenderScriptTag_WithJavaScriptEncodedContent() 1013public async Task RenderComponentAsync_IgnoresNamedEvents() 1035public async Task RenderComponentAsync_DoesNotAddHiddenInputForNamedSubmitEvents_WithoutFormMappingScope() 1058public async Task RenderComponentAsync_AddsHiddenInputForNamedSubmitEvents_WithDefaultFormMappingContext() 1083public async Task RenderComponentAsync_AddsHiddenInputForNamedSubmitEvents_InsideNamedFormMappingScope() 1120public async Task RenderComponentAsync_AddsActionAttributeWithCurrentUrlToFormWithoutAttributes_WhenNoActionSpecified( 1142public async Task RenderComponentAsync_AddsActionAttributeWithCurrentUrlToFormWithAttributes_WhenNoActionSpecified() 1164public async Task RenderComponentAsync_DoesNotAddActionAttributeWithCurrentUrl_WhenActionIsExplicitlySpecified() 1186public async Task RenderComponentAsync_DoesNotAddActionAttributeWithCurrentUrl_WhenNoNavigationManagerIsRegistered() 1222protected override async Task OnInitializedAsync() 1225await Task.Yield(); 1252protected override async Task OnInitializedAsync() 1255await Task.Delay(Value * 100); 1275public Task SetParametersAsync(ParameterView parameters) 1279return Task.CompletedTask; 1307public Task SetParametersAsync(ParameterView parameters) 1310return Task.CompletedTask; 1321protected override async Task OnInitializedAsync() 1325await Task.Yield(); 1342protected override async Task OnParametersSetAsync() 1345await Task.Yield(); 1368public Task Task { get; init; }
src\Components\Shared\test\AutoRenderComponent.cs (3)
18public virtual Task SetParametersAsync(ParameterView parameters) 22return Task.CompletedTask; 28var t = _renderHandle.Dispatcher.InvokeAsync(() => _renderHandle.Render(BuildRenderTree));
src\Components\Shared\test\TestRenderer.cs (10)
48public Task NextRenderResultTask { get; set; } = Task.CompletedTask; 63var task = Dispatcher.InvokeAsync(() => base.RenderRootComponentAsync(componentId, parameters ?? ParameterView.Empty)); 67public new Task RenderRootComponentAsync(int componentId) 70public new Task RenderRootComponentAsync(int componentId, ParameterView parameters) 73public Task DispatchEventAsync(ulong eventHandlerId, EventArgs args) 76public new Task DispatchEventAsync(ulong eventHandlerId, EventFieldInfo eventFieldInfo, EventArgs args) 79private static Task UnwrapTask(Task task) 111protected override Task UpdateDisplayAsync(in RenderBatch renderBatch)
Virtualization\VirtualizeTest.cs (4)
16public async Task Virtualize_ThrowsWhenGivenNonPositiveItemSize() 35public async Task Virtualize_ThrowsWhenGivenMultipleItemSources() 54public async Task Virtualize_ThrowsWhenGivenNoItemSources() 73public async Task Virtualize_DispatchesExceptionsFromItemsProviderThroughRenderer()
Microsoft.AspNetCore.Components.WebAssembly (42)
Hosting\WebAssemblyCultureProvider.cs (1)
102public static partial Task LoadSatelliteAssemblies(string[] culturesToLoad);
Hosting\WebAssemblyHost.cs (6)
102/// <returns>A <see cref="Task"/> which represents exit of the application.</returns> 108public Task RunAsync() 116internal async Task RunAsyncCore(CancellationToken cancellationToken, WebAssemblyCultureProvider? cultureProvider = null) 177var pendingRenders = new List<Task>(count + initialOperationCount); 193await Task.WhenAll(pendingRenders); 211private static void AddWebRootComponents(WebAssemblyRenderer renderer, RootComponentOperationBatch operationBatch, List<Task> pendingRenders)
HotReload\WebAssemblyHotReload.cs (2)
29internal static async Task InitializeAsync() 78private static partial Task ReceiveHotReloadAsync();
Rendering\NullDispatcher.cs (5)
16public override Task InvokeAsync(Action workItem) 21return Task.CompletedTask; 24public override Task InvokeAsync(Func<Task> workItem) 35return Task.FromResult(workItem());
Rendering\WebAssemblyDispatcher.cs (6)
18public override Task InvokeAsync(Action workItem) 27return Task.CompletedTask; 57return Task.FromResult(workItem()); 79public override Task InvokeAsync(Func<Task> workItem) 94var state = ((TaskCompletionSource tcs, Func<Task> workItem))o!;
Rendering\WebAssemblyRenderer.cs (3)
87public Task AddComponentAsync([DynamicallyAccessedMembers(Component)] Type componentType, ParameterView parameters, string domElementSelector) 133protected override unsafe Task UpdateDisplayAsync(in RenderBatch batch) 162return Task.CompletedTask;
Services\DefaultWebAssemblyJSRuntime.cs (2)
161=> Task.FromResult<Stream>(PullFromJSDataStream.CreateJSDataStream(this, jsStreamReference, totalLength, cancellationToken)); 164protected override Task TransmitStreamAsync(long streamId, DotNetStreamReference dotNetStreamReference)
Services\LazyAssemblyLoader.cs (2)
64return Task.FromResult<IEnumerable<Assembly>>(loadedAssemblies); 75var loadedStatus = await Task.WhenAll(pendingLoads);
Services\WebAssemblyNavigationInterception.cs (2)
12public Task EnableNavigationInterceptionAsync() 15return Task.CompletedTask;
Services\WebAssemblyNavigationManager.cs (1)
59async Task PerformNavigationAsync()
Services\WebAssemblyScrollToLocationHash.cs (2)
12public Task RefreshScrollPositionForHash(string locationAbsolute) 23return Task.CompletedTask;
src\Components\Shared\src\DefaultAntiforgeryStateProvider.cs (1)
28return Task.CompletedTask;
src\Components\Shared\src\TransmitDataStreamToJS.cs (1)
15internal static async Task TransmitStreamAsync(IJSRuntime runtime, string methodIdentifier, long streamId, DotNetStreamReference dotNetStreamReference)
src\Components\Shared\src\WebRootComponentManager.cs (5)
35public async Task AddRootComponentAsync( 59public Task UpdateRootComponentAsync( 128public Task UpdateAsync( 163return Task.CompletedTask; 179public Task RenderAsync(Renderer renderer)
src\Shared\Components\PrerenderComponentApplicationStore.cs (3)
48return Task.FromResult((IDictionary<string, byte[]>)ExistingState); 55public Task PersistStateAsync(IReadOnlyDictionary<string, byte[]> state) 69return Task.CompletedTask;
Microsoft.AspNetCore.Components.WebAssembly.Server (7)
ContentEncodingNegotiator.cs (1)
33public Task InvokeAsync(HttpContext context)
TargetPickerUi.cs (6)
47/// <returns>The <see cref="Task"/>.</returns> 48public async Task DisplayFirefox(HttpContext context) 50static async Task SendMessageToBrowser(NetworkStream toStream, ExpandoObject args, CancellationToken token) 97static async Task EvaluateOnBrowser(NetworkStream toStream, string? to, string text, CancellationToken token) 262/// <returns>The <see cref="Task"/>.</returns> 263public async Task Display(HttpContext context)
Microsoft.AspNetCore.Components.WebAssembly.Server.Tests (18)
ContentEncodingNegotiatorTests.cs (18)
13public async Task RespectsAcceptEncodingQuality() 18RequestDelegate next = (ctx) => Task.CompletedTask; 36public async Task RespectsIdentity() 40RequestDelegate next = (ctx) => Task.CompletedTask; 56public async Task SkipsNonExistingFiles() 61RequestDelegate next = (ctx) => Task.CompletedTask; 79public async Task UsesPreferredServerEncodingForEqualQualityValues() 84RequestDelegate next = (ctx) => Task.CompletedTask; 102public async Task SkipNonExistingFilesWhenSearchingForServerPreferencesPreferences() 107RequestDelegate next = (ctx) => Task.CompletedTask; 125public async Task AnyUsesServerPreference() 130RequestDelegate next = (ctx) => Task.CompletedTask; 148public async Task AnySkipsNonExistingFiles() 153RequestDelegate next = (ctx) => Task.CompletedTask; 171public async Task AnyDoesNotPickEncodingIfNoFilesFound() 175RequestDelegate next = (ctx) => Task.CompletedTask; 191public async Task AnyRespectsServerPreference() 196RequestDelegate next = (ctx) => Task.CompletedTask;
Microsoft.AspNetCore.Components.WebAssembly.Tests (12)
Hosting\WebAssemblyHostTest.cs (7)
18public async Task RunAsync_CanExitBasedOnCancellationToken() 29var task = host.RunAsyncCore(cts.Token, cultureProvider); 38public async Task RunAsync_CallingTwiceCausesException() 47var task = host.RunAsyncCore(cts.Token, cultureProvider); 60public async Task DisposeAsync_CanDisposeAfterCallingRunAsync() 76var task = host.RunAsyncCore(cts.Token, cultureProvider); 93return new ValueTask(Task.CompletedTask);
PullFromJSDataStreamTest.cs (5)
30public async Task ReceiveData_SuccessReadsBackStream_UsingByteArrayBuffer() 52public async Task ReceiveData_SuccessReadsBackStream_UsingMemoryBuffer() 64public async Task ReceiveData_JSProvidesInsufficientData_Throws() 77public async Task ReceiveData_JSProvidesExcessData_Throws() 91public async Task ReceiveData_JSProvidesExcessData_Throws2()
Microsoft.AspNetCore.Components.WebView (27)
IpcReceiver.cs (3)
25private readonly Func<string, string, Task> _onAttachMessage; 27public IpcReceiver(Func<string, string, Task> onAttachMessage) 32public async Task OnMessageReceivedAsync(PageContext pageContext, string message)
IpcSender.cs (2)
92private void NotifyErrors(Task task) 96async Task AwaitAndNotify()
Services\WebViewJSRuntime.cs (2)
55=> Task.FromResult<Stream>(PullFromJSDataStream.CreateJSDataStream(this, jsStreamReference, totalLength, cancellationToken)); 57protected override Task TransmitStreamAsync(long streamId, DotNetStreamReference dotNetStreamReference)
Services\WebViewNavigationInterception.cs (2)
12public Task EnableNavigationInterceptionAsync() => Task.CompletedTask;
Services\WebViewNavigationManager.cs (2)
36async Task HandleLocationChangingAsync() 63async Task PerformNavigationAsync()
Services\WebViewRenderer.cs (2)
45protected override Task UpdateDisplayAsync(in RenderBatch renderBatch) 67public new Task RenderRootComponentAsync(int componentId, ParameterView parameters)
Services\WebViewScrollToLocationHash.cs (1)
25public async Task RefreshScrollPositionForHash(string locationAbsolute)
src\Components\Shared\src\ArrayBuilderMemoryStream.cs (4)
77public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 82return Task.CompletedTask; 92public override Task FlushAsync(CancellationToken cancellationToken) => Task.CompletedTask;
src\Components\Shared\src\TransmitDataStreamToJS.cs (1)
15internal static async Task TransmitStreamAsync(IJSRuntime runtime, string methodIdentifier, long streamId, DotNetStreamReference dotNetStreamReference)
WebViewManager.cs (8)
89public Task AddRootComponentAsync(Type componentType, string selector, ParameterView parameters) 111return Task.CompletedTask; 119public Task RemoveRootComponentAsync(string selector) 134return Task.CompletedTask; 174/// <returns>Returns a <see cref="Task"/> representing <c>true</c> if the <paramref name="workItem"/> was called, or <c>false</c> if it was not called because Blazor is not currently running.</returns> 214internal async Task AttachToPageAsync(string baseUrl, string startUrl) 230var pendingRenders = new List<Task>(_rootComponentsBySelector.Count); 240await Task.WhenAll(pendingRenders);
Microsoft.AspNetCore.Components.WebView.Photino (18)
PhotinoDispatcher.cs (5)
23public override Task InvokeAsync(Action workItem) 28return Task.CompletedTask; 34public override Task InvokeAsync(Func<Task> workItem) 48return Task.FromResult(workItem());
PhotinoSynchronizationContext.cs (12)
30private static readonly Action<Task, object> BackgroundWorkThunk = (Task task, object state) => 59public Task InvokeAsync(Action action) 83public Task InvokeAsync(Func<Task> asyncAction) 85var completion = new PhotinoSynchronizationTaskCompletionSource<Func<Task>, object>(asyncAction); 88var completion = (PhotinoSynchronizationTaskCompletionSource<Func<Task>, object>)state; 169Task antecedent; 217private Task Enqueue(Task antecedent, SendOrPostCallback d, object state, bool forceAsync = false) 309public Task Task = Task.CompletedTask;
PhotinoWebViewManager.cs (1)
35Task.Factory.StartNew(message =>
Microsoft.AspNetCore.Components.WebView.Test (9)
WebViewManagerTests.cs (9)
11public async Task CanRenderRootComponentAsync() 31public async Task CanRenderRootComponent_AfterThePageIsAttachedAsync() 53public async Task AttachingToNewPage_DisposesExistingScopeAsync() 81public async Task CanDisposeWebViewManagerWithAsyncDisposableServices() 98public async Task AddRootComponentsWithExistingSelector_Throws() 129public Task SetParametersAsync(ParameterView parameters) 138return Task.CompletedTask; 153public Task SetParametersAsync(ParameterView parameters) 162return Task.CompletedTask;
Microsoft.AspNetCore.Components.WebViewE2E.Test (4)
BasicBlazorHybridTest.cs (3)
95Task.Run(async () => 107await Task.Delay(1000); 185await Task.Delay(WaitTimeInMS);
WebViewManagerE2ETests.cs (1)
22public async Task CanLaunchPhotinoWebViewAndClickButton()
Microsoft.AspNetCore.ConcurrencyLimiter (3)
ConcurrencyLimiterMiddleware.cs (2)
45/// <returns>A <see cref="Task"/> that completes when the request leaves.</returns> 46public async Task Invoke(HttpContext context)
ConcurrencyLimiterOptions.cs (1)
20return Task.CompletedTask;
Microsoft.AspNetCore.ConcurrencyLimiter.Microbenchmarks (13)
QueueEmptyOverhead.cs (7)
40public async Task Baseline() 49public async Task WithEmptyQueueOverhead_QueuePolicy() 58public async Task WithEmptyQueueOverhead_StackPolicy() 66private static async Task YieldsThread(HttpContext context) 68await Task.Yield(); 71private static Task CompletesImmediately(HttpContext context) 73return Task.CompletedTask;
QueueFullOverhead.cs (2)
45private async Task IncrementAndCheck(HttpContext context) 52await Task.Yield();
QueueRequestsOverwritten.cs (4)
45private async Task IncrementRejections(HttpContext context) 52await Task.Yield(); 55private async Task WaitForever(HttpContext context) 57await Task.Delay(int.MaxValue);
Microsoft.AspNetCore.ConcurrencyLimiter.Tests (33)
ConcurrencyLimiterEventSourceTests.cs (2)
44public async Task TracksQueueLength() 85public async Task TracksDurationSpentInQueue()
MiddlewareTests.cs (14)
13public async Task RequestsCallNextIfQueueReturnsTrue() 22return Task.CompletedTask; 30public async Task RequestRejectsIfQueueReturnsFalse() 39return Task.CompletedTask; 49public async Task RequestsDoesNotEnterIfQueueFull() 70var task1 = middleware.Invoke(new DefaultHttpContext()); 74var task2 = middleware.Invoke(new DefaultHttpContext()); 93var task1 = middleware.Invoke(new DefaultHttpContext()); 103public async Task QueueOnExitCalledEvenIfNextErrors() 126public async Task ExceptionThrownDuringOnRejected() 158var firstRequest = middleware.Invoke(new DefaultHttpContext()); 175var thirdRequest = middleware.Invoke(new DefaultHttpContext()); 182public async Task MiddlewareOnlyCallsGetResultOnce() 191await Task.CompletedTask;
PolicyTests\QueuePolicyTests.cs (2)
26public async Task WaitsIfNoSpaceAvailable() 60public async Task IsEncapsulated()
PolicyTests\StackPolicyTests.cs (5)
11public async Task BaseFunctionality() 36public async Task OldestRequestOverwritten() 84public async Task ExitRequestsPreserveSemaphoreState() 108public async Task StaleRequestsAreProperlyOverwritten() 135public async Task OneTryEnterAsyncOneOnExit()
TaskExtensions.cs (7)
12public static async Task OrThrowIfOtherFails(this Task task, Task otherTask) 14var completed = await Task.WhenAny(task, otherTask); 28public static async Task<T> OrThrowIfOtherFails<T>(this Task<T> task, Task otherTask) 30await OrThrowIfOtherFails((Task)task, otherTask);
TestUtils.cs (3)
17OnRejected = onRejected ?? (context => Task.CompletedTask), 21next: next ?? (context => Task.CompletedTask), 85this(state => Task.FromResult(onTryEnter(state))
Microsoft.AspNetCore.Connections.Abstractions (18)
ConnectionBuilder.cs (1)
42return Task.CompletedTask;
ConnectionBuilderExtensions.cs (8)
32/// If you aren't calling the next function, use <see cref="Run(IConnectionBuilder, Func{ConnectionContext, Task})"/> instead. 34/// Prefer using <see cref="Use(IConnectionBuilder, Func{ConnectionContext, ConnectionDelegate, Task})"/> for better performance as shown below: 46public static IConnectionBuilder Use(this IConnectionBuilder connectionBuilder, Func<ConnectionContext, Func<Task>, Task> middleware) 52Func<Task> simpleNext = () => next(context); 60/// If you aren't calling the next function, use <see cref="Run(IConnectionBuilder, Func{ConnectionContext, Task})"/> instead. 65public static IConnectionBuilder Use(this IConnectionBuilder connectionBuilder, Func<ConnectionContext, ConnectionDelegate, Task> middleware) 76public static IConnectionBuilder Run(this IConnectionBuilder connectionBuilder, Func<ConnectionContext, Task> middleware)
ConnectionDelegate.cs (2)
12/// <returns>A <see cref="Task"/> that represents the connection lifetime. When the task completes, the connection will be closed.</returns> 13public delegate Task ConnectionDelegate(ConnectionContext connection);
ConnectionHandler.cs (2)
17/// <returns>A <see cref="Task"/> that represents the connection lifetime. When the task completes, the connection is complete.</returns> 18public abstract Task OnConnectedAsync(ConnectionContext connection);
Features\IConnectionCompleteFeature.cs (1)
20void OnCompleted(Func<object, Task> callback, object state);
Features\IStatefulReconnectFeature.cs (1)
28public void OnReconnected(Func<PipeWriter, Task> notifyOnReconnect);
MultiplexedConnectionBuilder.cs (1)
42return Task.CompletedTask;
MultiplexedConnectionDelegate.cs (2)
12/// <returns>A <see cref="Task"/> that represents the connection lifetime. When the task completes, the connection will be closed.</returns> 13public delegate Task MultiplexedConnectionDelegate(MultiplexedConnectionContext connection);
Microsoft.AspNetCore.CookiePolicy (1)
CookiePolicyMiddleware.cs (1)
63public Task Invoke(HttpContext context)
Microsoft.AspNetCore.CookiePolicy.Test (61)
CookieConsentTests.cs (40)
19public async Task ConsentChecksOffByDefault() 28return Task.CompletedTask; 34public async Task ConsentEnabledForTemplateScenario() 47return Task.CompletedTask; 53public async Task NonEssentialCookiesWithOptionsExcluded() 66return Task.CompletedTask; 72public async Task NonEssentialCookiesCanBeAllowedViaOnAppendCookie() 92return Task.CompletedTask; 98public async Task NeedsConsentDoesNotPreventEssentialCookies() 111return Task.CompletedTask; 117public async Task EssentialCookiesCanBeExcludedByOnAppendCookie() 141return Task.CompletedTask; 147public async Task HasConsentReadsRequestCookie() 164return Task.CompletedTask; 170public async Task HasConsentIgnoresInvalidRequestCookie() 187return Task.CompletedTask; 193public async Task GrantConsentSetsCookie() 214return Task.CompletedTask; 234public async Task GrantConsentAppliesPolicyToConsentCookie() 264return Task.CompletedTask; 278public async Task GrantConsentWhenAlreadyHasItDoesNotSetCookie() 302return Task.CompletedTask; 309public async Task GrantConsentAfterResponseStartsSetsHasConsentButDoesNotSetCookie() 342public async Task WithdrawConsentWhenNotHasConsentNoOps() 363return Task.CompletedTask; 370public async Task WithdrawConsentDeletesCookie() 395return Task.CompletedTask; 413public async Task WithdrawConsentAppliesPolicyToDeleteCookie() 442return Task.CompletedTask; 455public async Task WithdrawConsentAfterResponseHasStartedDoesNotDeleteCookie() 493public async Task DeleteCookieDoesNotRequireConsent() 507return Task.CompletedTask; 520public async Task OnDeleteCookieCanSuppressCookie() 541return Task.CompletedTask; 548public async Task CreateConsentCookieMatchesGrantConsentCookie() 571return Task.CompletedTask; 592public async Task CreateConsentCookieAppliesPolicy() 624return Task.CompletedTask; 645public async Task CreateConsentCookieMatchesGrantConsentCookieWhenCookieValueIsCustom() 669return Task.CompletedTask;
CookiePolicyTests.cs (21)
27return Task.FromResult(0); 35return Task.FromResult(0); 45return Task.FromResult(0); 49public async Task SecureAlwaysSetsSecure() 69public async Task SecureNoneLeavesSecureUnchanged() 89public async Task SecureSameUsesRequest() 118public async Task HttpOnlyAlwaysSetsItAlways() 138public async Task HttpOnlyNoneLeavesItAlone() 158public async Task SameSiteStrictSetsItAlways() 179public async Task SameSiteLaxSetsItAlways() 200public async Task SameSiteNoneSetsItAlways() 221public async Task SameSiteUnspecifiedLeavesItAlone() 243public async Task CookiePolicyCanHijackAppend() 261return Task.FromResult(0); 282public async Task CookiePolicyCanHijackDelete() 300return Task.FromResult(0); 319public async Task CookiePolicyCallsCookieFeature() 358public async Task CookiePolicyAppliesToCookieAuth() 409public async Task CookiePolicyAppliesToCookieAuthChunks() 511public async Task Execute(TestServer server) 521private async Task RunTest(
Microsoft.AspNetCore.Cors (11)
Infrastructure\CorsMiddleware.cs (8)
18private readonly Func<object, Task> OnResponseStartingDelegate = OnResponseStarting; 89public Task Invoke(HttpContext context, ICorsPolicyProvider corsPolicyProvider) 126return Task.CompletedTask; 161async Task InvokeCoreAwaited(HttpContext context, Task<CorsPolicy?> policyTask) 168private Task EvaluateAndApplyPolicy(HttpContext context, CorsPolicy? corsPolicy) 184return Task.CompletedTask; 193private static Task OnResponseStarting(object state) 204return Task.CompletedTask;
Infrastructure\CorsOptions.cs (2)
62PolicyMap[name] = (policy, Task.FromResult(policy)); 79PolicyMap[name] = (policy, Task.FromResult(policy));
Infrastructure\DefaultCorsPolicyProvider.cs (1)
12private static readonly Task<CorsPolicy?> NullResult = Task.FromResult<CorsPolicy?>(null);
Microsoft.AspNetCore.Cors.Test (48)
CorsMiddlewareTests.cs (46)
24public async Task CorsRequest_MatchesPolicy_OnCaseInsensitiveAccessControlRequestMethod(string accessControlRequestMethod) 64public async Task CorsRequest_MatchPolicy_SetsResponseHeaders() 109public async Task PreFlight_MatchesPolicy_OnCaseInsensitiveOptionsMethod(string preflightMethod) 156public async Task PreFlight_MatchesPolicy_SetsResponseHeaders() 221public async Task PreFlight_WithCredentialsAllowed_ReflectsRequestHeaders() 292public async Task PreFlightRequest_DoesNotMatchPolicy_SetsResponseHeadersAndReturnsNoContent() 335public async Task CorsRequest_DoesNotMatchPolicy_DoesNotSetHeaders() 375public async Task Uses_PolicyProvider_AsFallback() 382.Returns(Task.FromResult<CorsPolicy>(null)) 404public async Task DoesNotSetHeaders_ForNoPolicy() 411.Returns(Task.FromResult<CorsPolicy>(null)) 435public async Task PreFlight_MatchesDefaultPolicy_SetsResponseHeaders() 508public async Task CorsRequest_SetsResponseHeaders() 567public async Task CorsRequest_SetsResponseHeader_IfExceptionHandlerClearsResponse() 638public async Task Invoke_WithCustomPolicyProviderThatReturnsAsynchronously_Works() 682public async Task Invoke_HasEndpointWithNoMetadata_RunsCors() 689.Returns(Task.FromResult<CorsPolicy>(null)) 699httpContext.SetEndpoint(new Endpoint(c => Task.CompletedTask, EndpointMetadataCollection.Empty, "Test endpoint")); 712public async Task Invoke_HasEndpointWithEnableMetadata_MiddlewareHasPolicyName_RunsCorsWithPolicyName() 719.Returns(Task.FromResult<CorsPolicy>(null)) 729httpContext.SetEndpoint(new Endpoint(c => Task.CompletedTask, new EndpointMetadataCollection(new EnableCorsAttribute("MetadataPolicyName")), "Test endpoint")); 742public async Task Invoke_HasEndpointWithEnableMetadata_HasSignificantDisableCors_ReturnsNoContentForPreflightRequest() 756httpContext.SetEndpoint(new Endpoint(c => Task.CompletedTask, new EndpointMetadataCollection(new EnableCorsAttribute(), new DisableCorsAttribute()), "Test endpoint")); 769public async Task Invoke_HasEndpointWithEnableMetadata_HasSignificantDisableCors_ExecutesNextMiddleware() 781return Task.CompletedTask; 788httpContext.SetEndpoint(new Endpoint(c => Task.CompletedTask, new EndpointMetadataCollection(new EnableCorsAttribute(), new DisableCorsAttribute()), "Test endpoint")); 803public async Task Invoke_HasEndpointWithEnableMetadata_MiddlewareHasPolicy_RunsCorsWithPolicyName() 811.Returns(Task.FromResult<CorsPolicy>(null)) 821httpContext.SetEndpoint(new Endpoint(c => Task.CompletedTask, new EndpointMetadataCollection(new EnableCorsAttribute("MetadataPolicyName")), "Test endpoint")); 834public async Task Invoke_HasEndpointRequireCorsMetadata_MiddlewareHasPolicy_RunsCorsWithPolicyName() 843.Returns(Task.FromResult<CorsPolicy>(null)) 856httpContext.SetEndpoint(new Endpoint(c => Task.CompletedTask, new EndpointMetadataCollection(new CorsPolicyMetadata(metadataPolicy)), "Test endpoint")); 872public async Task Invoke_HasEndpointWithEnableMetadataWithNoName_RunsCorsWithStaticPolicy() 880.Returns(Task.FromResult<CorsPolicy>(null)) 893httpContext.SetEndpoint(new Endpoint(c => Task.CompletedTask, new EndpointMetadataCollection(new EnableCorsAttribute()), "Test endpoint")); 909public async Task Invoke_HasEndpointWithDisableMetadata_SkipCors() 916.Returns(Task.FromResult<CorsPolicy>(null)) 926httpContext.SetEndpoint(new Endpoint(c => Task.CompletedTask, new EndpointMetadataCollection(new DisableCorsAttribute()), "Test endpoint")); 939public async Task Invoke_HasEndpointWithMutlipleMetadata_SkipCorsBecauseOfMetadataOrder() 946.Returns(Task.FromResult<CorsPolicy>(null)) 956httpContext.SetEndpoint(new Endpoint(c => Task.CompletedTask, new EndpointMetadataCollection(new EnableCorsAttribute("MetadataPolicyName"), new DisableCorsAttribute()), "Test endpoint")); 969public async Task Invoke_InvokeFlagSet() 983httpContext.SetEndpoint(new Endpoint(c => Task.CompletedTask, new EndpointMetadataCollection(new EnableCorsAttribute("MetadataPolicyName"), new DisableCorsAttribute()), "Test endpoint")); 994public async Task Invoke_WithoutOrigin_InvokeFlagSet() 1008httpContext.SetEndpoint(new Endpoint(c => Task.CompletedTask, new EndpointMetadataCollection(new EnableCorsAttribute("MetadataPolicyName"), new DisableCorsAttribute()), "Test endpoint")); 1018public async Task Invoke_WithoutEndpoint_InvokeFlagSet()
DefaultCorsPolicyProviderTests.cs (2)
12public async Task UsesTheDefaultPolicyName() 32public async Task GetsNamedPolicy(string policyName)
Microsoft.AspNetCore.DataProtection (5)
Internal\DataProtectionHostedService.cs (4)
29public Task StartAsync(CancellationToken token) 46return Task.CompletedTask; 49public Task StopAsync(CancellationToken token) => Task.CompletedTask;
KeyManagement\KeyRingProvider.cs (1)
366existingTask = Task.Factory.StartNew(
Microsoft.AspNetCore.DataProtection.Tests (12)
HostingTests.cs (7)
20public async Task WebhostLoadsKeyRingBeforeServerStarts() 47public async Task GenericHostLoadsKeyRingBeforeServerStarts() 74public async Task StartupContinuesOnFailureToLoadKey() 118public Task StartAsync<TContext>(IHttpApplication<TContext> application, CancellationToken cancellationToken) 121return Task.CompletedTask; 124public Task StopAsync(CancellationToken cancellationToken) => Task.CompletedTask;
KeyManagement\KeyRingProviderTests.cs (5)
691var backgroundGetKeyRingTask = Task.Run(() => 808public async Task MultipleThreadsSeeExpiredCachedValue() 842tasks[i] = Task.Run(() => 849var actualKeyRings = await Task.WhenAll(tasks); 872await Task.Delay(500);
Microsoft.AspNetCore.Diagnostics (33)
DeveloperExceptionPage\DeveloperExceptionPageMiddleware.cs (1)
53public Task Invoke(HttpContext context)
DeveloperExceptionPage\DeveloperExceptionPageMiddlewareImpl.cs (6)
40private readonly Func<ErrorContext, Task> _exceptionHandler; 105public async Task Invoke(HttpContext context) 179private Task DisplayException(ErrorContext errorContext) 199private async Task DisplayExceptionContent(ErrorContext errorContext) 254private Task DisplayCompilationException( 316private Task DisplayRuntimeException(HttpContext context, Exception ex)
DeveloperExceptionPage\Views\CompilationErrorPage.Designer.cs (1)
52public async override global::System.Threading.Tasks.Task ExecuteAsync()
DeveloperExceptionPage\Views\ErrorPage.Designer.cs (1)
59public async override global::System.Threading.Tasks.Task ExecuteAsync()
ExceptionHandler\ExceptionHandlerMiddleware.cs (1)
47public Task Invoke(HttpContext context)
ExceptionHandler\ExceptionHandlerMiddlewareImpl.cs (9)
27private readonly Func<object, Task> _clearCacheHeadersDelegate; 71public Task Invoke(HttpContext context) 77var task = _next(context); 83return Task.CompletedTask; 93static async Task Awaited(ExceptionHandlerMiddlewareImpl middleware, HttpContext context, Task task) 113private async Task HandleException(HttpContext context, ExceptionDispatchInfo edi) 253private static Task ClearCacheHeaders(object state) 260return Task.CompletedTask;
src\Shared\Diagnostics\BaseView.cs (2)
61public async Task ExecuteAsync(HttpContext context) 74public abstract Task ExecuteAsync();
src\Shared\RazorViews\BaseView.cs (3)
64public async Task ExecuteAsync(Stream stream) 80public async Task ExecuteAsync(HttpContext context) 97public abstract Task ExecuteAsync();
StatusCodePage\StatusCodePagesExtensions.cs (4)
53public static IApplicationBuilder UseStatusCodePages(this IApplicationBuilder app, Func<StatusCodeContext, Task> handler) 103return Task.CompletedTask; 112return Task.CompletedTask; 163private static Func<StatusCodeContext, Task> CreateHandler(string pathFormat, string? queryFormat, RequestDelegate? next = null)
StatusCodePage\StatusCodePagesMiddleware.cs (1)
39public async Task Invoke(HttpContext context)
StatusCodePage\StatusCodePagesOptions.cs (1)
57public Func<StatusCodeContext, Task> HandleAsync { get; set; }
WelcomePage\Views\Obsolete\WelcomePage.cs (1)
26public override async Task ExecuteAsync()
WelcomePage\Views\WelcomePage.Designer.cs (1)
24public async override global::System.Threading.Tasks.Task ExecuteAsync()
WelcomePage\WelcomePageMiddleware.cs (1)
38public Task Invoke(HttpContext context)
Microsoft.AspNetCore.Diagnostics.Abstractions (2)
IDeveloperPageExceptionFilter.cs (2)
18Task HandleExceptionAsync(ErrorContext errorContext, Func<ErrorContext, Task> next);
Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore (12)
DatabaseDeveloperPageExceptionFilter.cs (2)
45public async Task HandleExceptionAsync(ErrorContext errorContext, Func<ErrorContext, Task> next)
DatabaseErrorPageMiddleware.cs (1)
75public virtual async Task Invoke(HttpContext httpContext)
MigrationsEndPointMiddleware.cs (3)
51public virtual Task Invoke(HttpContext context) 63private async Task InvokeCore(HttpContext context) 131private static async Task WriteErrorToResponse(HttpResponse response, string error)
src\Shared\Diagnostics\BaseView.cs (2)
61public async Task ExecuteAsync(HttpContext context) 74public abstract Task ExecuteAsync();
src\Shared\RazorViews\BaseView.cs (3)
64public async Task ExecuteAsync(Stream stream) 80public async Task ExecuteAsync(HttpContext context) 97public abstract Task ExecuteAsync();
Views\DatabaseErrorPage.Designer.cs (1)
38public async override global::System.Threading.Tasks.Task ExecuteAsync()
Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Tests (17)
DatabaseDeveloperPageExceptionFilterTests.cs (8)
19public async Task NonDbExceptions_NotHandled() 35return Task.CompletedTask; 42public async Task Wrapped_DbExceptions_HandlingFails_InvokesNextFilter() 57return Task.CompletedTask; 68public async Task DbExceptions_HandlingFails_InvokesNextFilter() 83return Task.CompletedTask; 94public async Task DbExceptions_HandlingFails_ReturnsIfResponseStarted() 112return Task.CompletedTask;
DatabaseErrorPageTest.cs (9)
18public async Task No_database_or_migrations_only_displays_scaffold_first_migration() 43public async Task No_database_with_migrations_only_displays_apply_migrations() 68public async Task Existing_database_with_migrations_only_displays_apply_migrations() 93public async Task Existing_database_with_migrations_and_pending_model_changes_only_displays_apply_migrations() 118public async Task Pending_model_changes_only_displays_scaffold_next_migration() 143public async Task Exception_details_are_displayed() 166public async Task Inner_exception_details_are_displayed() 190public async Task MigrationsEndPointPath_is_respected() 215public async Task PathBase_is_respected()
Microsoft.AspNetCore.Diagnostics.HealthChecks (3)
HealthCheckMiddleware.cs (1)
41public async Task InvokeAsync(HttpContext httpContext)
HealthCheckOptions.cs (1)
71public Func<HttpContext, HealthReport, Task> ResponseWriter { get; set; } = HealthCheckResponseWriters.WriteMinimalPlaintext;
HealthCheckResponseWriters.cs (1)
16public static Task WriteMinimalPlaintext(HttpContext httpContext, HealthReport result)
Microsoft.AspNetCore.Diagnostics.HealthChecks.Tests (45)
HealthCheckEndpointRouteBuilderExtensionsTest.cs (2)
48public async Task MapHealthChecks_ReturnsOk() 86public async Task MapHealthChecks_WithOptions_ReturnsOk()
HealthCheckMiddlewareSampleTest.cs (4)
14public async Task BasicStartup() 36public async Task CustomWriterStartup() 59public async Task LivenessProbeStartup_Liveness() 81public async Task LivenessProbeStartup_Readiness()
HealthCheckMiddlewareTests.cs (39)
43public async Task IgnoresRequestThatDoesNotMatchPath() 70public async Task MatchIsCaseInsensitive() 97public async Task ReturnsPlainTextStatus() 127public async Task StatusCodeIs200IfNoChecks() 157public async Task StatusCodeIs200IfAllChecksHealthy() 190public async Task StatusCodeIs200IfCheckIsDegraded() 223public async Task StatusCodeIs503IfCheckIsUnhealthy() 237.AddAsyncCheck("Foo", () => Task.FromResult(HealthCheckResult.Healthy("A-ok!"))) 238.AddAsyncCheck("Bar", () => Task.FromResult(HealthCheckResult.Unhealthy("Pretty bad."))) 239.AddAsyncCheck("Baz", () => Task.FromResult(HealthCheckResult.Healthy("A-ok!"))); 256public async Task StatusCodeIs503IfCheckHasUnhandledException() 270.AddAsyncCheck("Foo", () => Task.FromResult(HealthCheckResult.Healthy("A-ok!"))) 272.AddAsyncCheck("Baz", () => Task.FromResult(HealthCheckResult.Healthy("A-ok!"))); 289public async Task CanUseCustomWriter() 316.AddAsyncCheck("Foo", () => Task.FromResult(HealthCheckResult.Healthy("A-ok!"))) 317.AddAsyncCheck("Bar", () => Task.FromResult(HealthCheckResult.Unhealthy("Pretty bad."))) 318.AddAsyncCheck("Baz", () => Task.FromResult(HealthCheckResult.Healthy("A-ok!"))); 336public async Task NoResponseWriterReturnsEmptyBody() 353.AddAsyncCheck("Foo", () => Task.FromResult(HealthCheckResult.Healthy("A-ok!"))) 354.AddAsyncCheck("Bar", () => Task.FromResult(HealthCheckResult.Unhealthy("Pretty bad."))) 355.AddAsyncCheck("Baz", () => Task.FromResult(HealthCheckResult.Healthy("A-ok!"))); 371public async Task CanSetCustomStatusCodes() 406public async Task SetsCacheHeaders() 438public async Task CanSuppressCacheHeaders() 473public async Task CanFilterChecks() 490.AddAsyncCheck("Foo", () => Task.FromResult(HealthCheckResult.Healthy("A-ok!"))) 492.AddAsyncCheck("Bar", () => Task.FromResult(HealthCheckResult.Unhealthy("A-ok!"))) 493.AddAsyncCheck("Baz", () => Task.FromResult(HealthCheckResult.Healthy("A-ok!"))); 510public async Task CanListenWithoutPath_AcceptsRequest() 540public async Task CanListenWithPath_AcceptsRequestWithExtraSlash() 568public async Task CanListenWithPath_AcceptsRequestWithCaseInsensitiveMatch() 598public async Task CanListenWithPath_RejectsRequestWithExtraSegments() 627public async Task CanListenWithPath_MultipleMiddleware_LeastSpecificFirst() 664public async Task CanListenWithPath_MultipleMiddleware_MostSpecificFirst() 700public async Task CanListenOnPort_AcceptsRequest_OnSpecifiedPort() 738public async Task CanListenOnPortWithoutPath_AcceptsRequest_OnSpecifiedPort() 776public async Task CanListenOnPort_RejectsRequest_OnOtherPort() 812public async Task CanListenOnPort_MultipleMiddleware() 856public async Task CanListenOnPort_MultipleMiddleware_DifferentPorts()
Microsoft.AspNetCore.Diagnostics.Tests (90)
DeveloperExceptionPageMiddlewareTest.cs (23)
27public async Task ExceptionIsSetOnProblemDetailsContext() 75public async Task ExceptionHandlerFeatureIsAvailableInCustomizeProblemDetailsWhenUsingExceptionPage() 134public async Task ExceptionHandlerPathFeatureIsAvailableInCustomizeProblemDetailsWhenUsingExceptionPage() 193public async Task UnhandledErrorsWriteToDiagnosticWhenUsingExceptionPage() 230public async Task ErrorPageWithAcceptHeaderForHtmlReturnsHtml() 267public async Task ErrorPageWithoutAcceptHeaderForHtmlReturnsPlainText() 303public async Task ErrorPageShowsEndpointMetadata() 338public async Task StatusCodeFromBadHttpRequestExceptionIsPreserved() 373public async Task ExceptionPageFiltersAreApplied() 407public async Task ExceptionFilterCallingNextWorks() 445public async Task ExceptionPageFiltersAreAppliedInOrder() 536public async Task NullInfoInCompilationException_ShouldNotThrowExceptionGeneratingExceptionPage( 574public async Task UnhandledError_ExceptionNameTagAdded() 651public Task HandleExceptionAsync(ErrorContext context, Func<ErrorContext, Task> next) 659public Task HandleExceptionAsync(ErrorContext context, Func<ErrorContext, Task> next) 667public Task HandleExceptionAsync(ErrorContext context, Func<ErrorContext, Task> next) 675public Task HandleExceptionAsync(ErrorContext context, Func<ErrorContext, Task> next) 683public Task HandleExceptionAsync(ErrorContext context, Func<ErrorContext, Task> next)
ExceptionHandlerMiddlewareTest.cs (27)
33public async Task ExceptionIsSetOnProblemDetailsContext() 81public async Task Invoke_ExceptionThrownResultsInClearedRouteValuesAndEndpoint() 85httpContext.SetEndpoint(new Endpoint((_) => Task.CompletedTask, new EndpointMetadataCollection(), "Test")); 93return Task.CompletedTask; 102public async Task Invoke_ExceptionHandlerCaptureRouteValuesAndEndpoint() 106var endpoint = new Endpoint((_) => Task.CompletedTask, new EndpointMetadataCollection(), "Test"); 117return Task.CompletedTask; 126public async Task IExceptionHandlers_CallNextIfNotHandled() 151public async Task IExceptionHandlers_SkipIfOneHandle() 176public async Task IExceptionHandlers_CallOptionExceptionHandlerIfNobodyHandles() 185return Task.CompletedTask; 207public async Task Metrics_NoExceptionThrown() 214var middleware = CreateMiddleware(_ => Task.CompletedTask, optionsAccessor, exceptionHandlers, meterFactory); 230public async Task Metrics_ExceptionThrown_Handled_Reported() 251public async Task Metrics_ExceptionThrown_ResponseStarted_Skipped() 278public async Task Metrics_ExceptionThrown_DefaultSettings_Handled_Reported() 298public async Task Metrics_ExceptionThrown_Handled_UseOriginalRoute() 301var originalEndpointBuilder = new RouteEndpointBuilder(c => Task.CompletedTask, RoutePatternFactory.Parse("/path"), 0); 322ExceptionHandler = (c) => Task.CompletedTask 358public async Task Metrics_ExceptionThrown_Handled_UseNewRoute() 361var originalEndpointBuilder = new RouteEndpointBuilder(c => Task.CompletedTask, RoutePatternFactory.Parse("/path"), 0); 364var newEndpointBuilder = new RouteEndpointBuilder(c => Task.CompletedTask, RoutePatternFactory.Parse("/new"), 0); 388return Task.CompletedTask; 425public async Task Metrics_ExceptionThrown_Unhandled_Reported() 432return Task.CompletedTask; 495exceptionHandler ??= c => Task.CompletedTask; 511next ??= c => Task.CompletedTask;
ExceptionHandlerTest.cs (21)
28public async Task OnlyHandles_UnhandledExceptions(HttpStatusCode expectedStatusCode) 68public async Task DoesNotHandle_UnhandledExceptions_WhenResponseAlreadyStarted() 123public async Task ClearsResponseBuffer_BeforeRequestIsReexecuted() 199public async Task ClearsCacheHeaders_SetByReexecutionPathHandlers() 255public async Task DoesNotModifyCacheHeaders_WhenNoExceptionIsThrown() 313public async Task ExceptionHandlerSucceeded_IfExceptionHandlerResponseHasStarted() 380public async Task DoesNotClearCacheHeaders_WhenResponseHasAlreadyStarted() 455public async Task HandledErrorsWriteToDiagnosticWhenUsingExceptionHandler() 537public async Task ExceptionHandlerNotFound_ThrowsIOEWithOriginalError() 606public async Task ExceptionHandler_CanReturn404Responses_WhenAllowed() 625return Task.CompletedTask; 660public async Task ExceptionHandlerWithOwnBuilder() 702public async Task ExceptionHandlerWithPathWorksAfterUseRoutingIfGlobalRouteBuilderUsed() 753public async Task ExceptionHandlerWithOptionsWorksAfterUseRoutingIfGlobalRouteBuilderUsed() 807public async Task ExceptionHandlerWithAddWorksAfterUseRoutingIfGlobalRouteBuilderUsed() 859public async Task ExceptionHandlerWithExceptionHandlerNotReplacedWithGlobalRouteBuilder() 917public async Task UnhandledError_ExceptionNameTagAdded() 971public async Task UnhandledError_MultipleHandlers_ExceptionNameTagAddedOnce() 994return Task.CompletedTask; 1009return Task.CompletedTask; 1041public async Task UnhandledError_ErrorAfterHandler_ExceptionNameTagAddedOnce()
StatusCodeMiddlewareTest.cs (19)
18public async Task Redirect_StatusPage() 36return Task.FromResult(1); 72public async Task Reexecute_CanRetrieveInformationAboutOriginalRequest() 98return Task.FromResult(1); 133public async Task Reexecute_ClearsEndpointAndRouteData() 157httpContext.SetEndpoint(new Endpoint((_) => Task.CompletedTask, new EndpointMetadataCollection(), "Test")); 160return Task.CompletedTask; 195public async Task Reexecute_CaptureEndpointAndRouteData() 199var endpoint = new Endpoint((_) => Task.CompletedTask, new EndpointMetadataCollection(), "Test"); 216return Task.CompletedTask; 229return Task.CompletedTask; 248public async Task Reexecute_WorksAfterUseRoutingWithGlobalRouteBuilder() 263return Task.CompletedTask; 284public async Task SkipStatusCodePages_SupportsEndpoints() 299return Task.CompletedTask; 318public async Task SkipStatusCodePages_SupportsSkipIfUsedBeforeRouting() 335return Task.CompletedTask; 356public async Task SkipStatusCodePages_WorksIfUsedBeforeRouting() 373return Task.CompletedTask;
Microsoft.AspNetCore.FunctionalTests (13)
WebApplicationFunctionalTests.cs (3)
14public async Task LoggingConfigurationSectionPassedToLoggerByDefault() 57public async Task EnvironmentSpecificLoggingConfigurationSectionPassedToLoggerByDefault() 100public async Task LoggingConfigurationReactsToRuntimeChanges()
WebHostFunctionalTests.cs (10)
16public async Task Start_RequestDelegate_Url() 22public async Task Start_RouteBuilder_Url() 28public async Task StartWith_IApplicationBuilder_Url() 34public async Task CreateDefaultBuilder_InitializeWithDefaults() 59public async Task CreateDefaultBuilderOfT_InitializeWithDefaults() 86public async Task CreateDefaultBuilder_InitializesDependencyInjectionSettingsBasedOnEnv(string environment, string expected) 151public async Task RunsInIISExpressInProcess() 184private async Task ExecuteStartOrStartWithTest(Func<DeploymentResult, Task<HttpResponseMessage>> getResponse, string applicationName) 204private async Task ExecuteTestApp(string applicationName, 205Func<DeploymentResult, ILogger, Task> assertAction,
Microsoft.AspNetCore.Grpc.JsonTranscoding (24)
Internal\CallHandlers\ServerCallHandlerBase.cs (6)
37public Task HandleCallAsync(HttpContext httpContext) 51var handleCallTask = HandleCallAsyncCore(httpContext, serverCallContext); 55return Task.CompletedTask; 67static async Task AwaitHandleCall(JsonTranscodingServerCallContext serverCallContext, Method<TRequest, TResponse> method, bool isStreaming, JsonSerializerOptions serializerOptions, Task handleCall) 80protected abstract Task HandleCallAsyncCore(HttpContext httpContext, JsonTranscodingServerCallContext serverCallContext);
Internal\CallHandlers\ServerStreamingServerCallHandler.cs (1)
27protected override async Task HandleCallAsyncCore(HttpContext httpContext, JsonTranscodingServerCallContext serverCallContext)
Internal\CallHandlers\UnaryServerCallHandler.cs (1)
29protected override async Task HandleCallAsyncCore(HttpContext httpContext, JsonTranscodingServerCallContext serverCallContext)
Internal\HttpContextStreamWriter.cs (6)
16private Task? _writeTask; 32Task IAsyncStreamWriter<TResponse>.WriteAsync(TResponse message, CancellationToken cancellationToken) 37public Task WriteAsync(TResponse message) 42private async Task WriteAsyncCore(TResponse message, CancellationToken cancellationToken) 84private async Task WriteMessageAndDelimiter(TResponse message, CancellationToken cancellationToken) 113var writeTask = _writeTask;
Internal\JsonTranscodingServerCallContext.cs (2)
102internal async Task ProcessHandlerErrorAsync(Exception ex, string method, bool isStreaming, JsonSerializerOptions options) 206protected override Task WriteResponseHeadersAsyncCore(Metadata responseHeaders)
src\Grpc\JsonTranscoding\src\Shared\Server\DuplexStreamingServerMethodInvoker.cs (3)
63private async Task ResolvedInterceptorInvoker(IAsyncStreamReader<TRequest> requestStream, IServerStreamWriter<TResponse> responseStream, ServerCallContext resolvedContext) 91/// <returns>A <see cref="Task"/> that represents the asynchronous method.</returns> 92public async Task Invoke(HttpContext httpContext, ServerCallContext serverCallContext, IAsyncStreamReader<TRequest> requestStream, IServerStreamWriter<TResponse> responseStream)
src\Grpc\JsonTranscoding\src\Shared\Server\ServerStreamingServerMethodInvoker.cs (3)
63private async Task ResolvedInterceptorInvoker(TRequest request, IServerStreamWriter<TResponse> responseStream, ServerCallContext resolvedContext) 91/// <returns>A <see cref="Task"/> that represents the asynchronous method.</returns> 92public async Task Invoke(HttpContext httpContext, ServerCallContext serverCallContext, TRequest request, IServerStreamWriter<TResponse> streamWriter)
src\Shared\ValueTaskExtensions\ValueTaskExtensions.cs (2)
13public static Task GetAsTask(this in ValueTask<FlushResult> valueTask) 20return Task.CompletedTask;
Microsoft.AspNetCore.Grpc.JsonTranscoding.IntegrationTests (41)
Infrastructure\SyncPoint.cs (5)
23public Task WaitForSyncPoint() => _atSyncPoint.Task; 43public Task WaitToContinue() 49public static Func<Task> Create(out SyncPoint syncPoint, bool runContinuationsAsynchronously = true) 62public static Func<Task> Create(int count, out SyncPoint[] syncPoints, bool runContinuationsAsynchronously = true) 78return Task.CompletedTask;
RouteTests.cs (18)
25public async Task ComplexParameter_MatchUrl_SuccessResult() 30return Task.FromResult(new HelloReply { Message = $"Hello {request.Name}!" }); 48public async Task MultipleComplexCatchAll_MatchUrl_SuccessResult() 53return Task.FromResult(new HelloReply { Message = $"One - Hello {request.Name}!" }); 57return Task.FromResult(new HelloReply { Message = $"Two - Hello {request.Name}!" }); 86public async Task ComplexCatchAllParameter_NestedField_MatchUrl_SuccessResult() 91return Task.FromResult(new HelloReply { Message = $"Hello {request.Name.FirstName} {request.Name.LastName}!" }); 109public async Task SimpleCatchAllParameter_PrefixSuffixSlashes_MatchUrl_SuccessResult() 114return Task.FromResult(new HelloReply { Message = $"Hello {request.Name}!" }); 132public async Task ParameterVerb_MatchUrl_SuccessResult() 137return Task.FromResult(new HelloReply { Message = $"Hello {request.Name} one!" }); 141return Task.FromResult(new HelloReply { Message = $"Hello {request.Name} two!" }); 176public async Task CatchAllVerb_MatchUrl_SuccessResult() 181return Task.FromResult(new HelloReply { Message = $"Hello {request.Name} one!" }); 185return Task.FromResult(new HelloReply { Message = $"Hello {request.Name} two!" }); 220public async Task PostVerb_MatchUrl_SuccessResult() 225return Task.FromResult(new HelloReply { Message = $"Hello {request.Name} one!" }); 229return Task.FromResult(new HelloReply { Message = $"Hello {request.Name} two!" });
ServerStreamingTests.cs (6)
23public async Task GetWithRouteParameter_WriteOne_SuccessResult() 26async Task ServerStreamingMethod(HelloRequest request, IServerStreamWriter<HelloReply> writer, ServerCallContext context) 46public async Task GetWithRouteParameter_WriteMultiple_SuccessResult() 50async Task ServerStreamingMethod(HelloRequest request, IServerStreamWriter<HelloReply> writer, ServerCallContext context) 83public async Task GetWithRouteParameter_WriteMultiple_CancellationBefore_CallCanceled() 87async Task ServerStreamingMethod(HelloRequest request, IServerStreamWriter<HelloReply> writer, ServerCallContext context)
UnaryTests.cs (12)
26public async Task GetWithRouteParameter_MatchUrl_SuccessResult() 31return Task.FromResult(new HelloReply { Message = $"Hello {request.Name}!" }); 49public async Task WriteResponseHeadersAsync_SendHeaders_HeadersSentBeforeResult() 87public async Task WriteResponseHeadersAsync_CallTwice_Error() 130public async Task AuthContext_BasicRequest_Unauthenticated() 137return Task.FromResult(new HelloReply { Message = $"Hello {request.Name}!" }); 160public async Task Request_SupportedCharset_Success(string? charset) 165return Task.FromResult(new HelloReply { Message = $"Hello {request.Name}!" }); 196public async Task Request_UnsupportedCharset_Error(string? charset, string errorMessage) 201return Task.FromResult(new HelloReply { Message = $"Hello {request.Name}!" }); 227public async Task Request_SendEnumString_Success() 232return Task.FromResult(new HelloReply { Message = $"Hello {request.Name}!" });
Microsoft.AspNetCore.Grpc.JsonTranscoding.Tests (106)
artifacts\obj\Microsoft.AspNetCore.Grpc.JsonTranscoding.Tests\Release\net9.0\Proto\TranscodingGrpc.cs (3)
170public virtual global::System.Threading.Tasks.Task ServerStreamingGetOption(global::Transcoding.HelloRequest request, grpc::IServerStreamWriter<global::Transcoding.HelloReply> responseStream, grpc::ServerCallContext context) 1228public virtual global::System.Threading.Tasks.Task GetServerStreaming(global::Transcoding.HelloRequest request, grpc::IServerStreamWriter<global::Transcoding.HelloReply> responseStream, grpc::ServerCallContext context) 1240public virtual global::System.Threading.Tasks.Task GetBidiStreaming(grpc::IAsyncStreamReader<global::Transcoding.HelloRequest> requestStream, grpc::IServerStreamWriter<global::Transcoding.HelloReply> responseStream, grpc::ServerCallContext context)
Infrastructure\SyncPoint.cs (5)
23public Task WaitForSyncPoint() => _atSyncPoint.Task; 43public Task WaitToContinue() 49public static Func<Task> Create(out SyncPoint syncPoint, bool runContinuationsAsynchronously = true) 62public static Func<Task> Create(int count, out SyncPoint[] syncPoints, bool runContinuationsAsynchronously = true) 78return Task.CompletedTask;
ServerStreamingServerCallHandlerTests.cs (6)
35public async Task HandleCallAsync_WriteMultipleMessages_Returned() 86public async Task HandleCallAsync_MessageThenError_MessageThenErrorReturned() 127public async Task HandleCallAsync_MessageThenRpcException_MessageThenErrorReturned() 169public async Task HandleCallAsync_ErrorWithDetailedErrors_DetailedErrorResponse() 174return Task.FromException<HelloReply>(new Exception("Exception!")); 206public async Task HandleCallAsync_HttpBody_WriteMultipleMessages_Returned()
TestObjects\Services\HttpBodyService.cs (1)
16return Task.FromResult(new HttpBody
UnaryServerCallHandlerTests.cs (91)
44public async Task HandleCallAsync_MatchingRouteValue_SetOnRequestMessage() 51return Task.FromResult(new HelloReply { Message = $"Hello {r.Name}" }); 88public async Task HandleCallAsync_ResponseBodySet_ResponseReturned(string name) 95return Task.FromResult(new HelloReply { Message = r.Name }); 124public async Task HandleCallAsync_NullProperty_ResponseReturned() 129return Task.FromResult(new HelloReply { NullableMessage = null }); 157public async Task HandleCallAsync_ResponseBodySetToRepeatedField_ArrayReturned() 164return Task.FromResult(new HelloReply { Values = { "One", "Two", "" } }); 187public async Task HandleCallAsync_RootBodySet_SetOnRequestMessage() 194return Task.FromResult(new HelloReply { Message = $"Hello {r.Name}" }); 222public async Task HandleCallAsync_SubBodySet_SetOnRequestMessage() 229return Task.FromResult(new HelloReply { Message = $"Hello {r.Name}" }); 262public async Task HandleCallAsync_SubRepeatedBodySet_SetOnRequestMessage() 269return Task.FromResult(new HelloReply { Message = $"Hello {r.Name}" }); 312public async Task HandleCallAsync_SubRepeatedMessageBodySet_SetOnRequestMessage() 319return Task.FromResult(new HelloReply { Message = $"Hello {r.Name}" }); 362public async Task HandleCallAsync_SubMapBodySet_SetOnRequestMessage() 369return Task.FromResult(new HelloReply { Message = $"Hello {r.Name}" }); 412public async Task HandleCallAsync_SubMapMessageBodySet_SetOnRequestMessage() 419return Task.FromResult(new HelloReply { Message = $"Hello {r.Name}" }); 462public async Task HandleCallAsync_SubMapIntBodySet_SetOnRequestMessage() 469return Task.FromResult(new HelloReply { Message = $"Hello {r.Name}" }); 512public async Task HandleCallAsync_MatchingQueryStringValues_SetOnRequestMessage() 519return Task.FromResult(new HelloReply()); 540public async Task HandleCallAsync_MatchingQueryStringValues_JsonName_SetOnRequestMessage() 547return Task.FromResult(new HelloReply()); 566public async Task HandleCallAsync_MatchingQueryStringValues_JsonNamePriority_JsonName_SetOnRequestMessage() 574return Task.FromResult(new HelloReply()); 602public async Task HandleCallAsync_MatchingQueryStringValues_JsonNamePriority_FieldNameFallback_SetOnRequestMessage() 610return Task.FromResult(new HelloReply()); 638public async Task HandleCallAsync_MatchingQueryStringValues_JsonNameAndValueObject_SetOnRequestMessage() 645return Task.FromResult(new HelloReply()); 664public async Task HandleCallAsync_MatchingQueryStringValues_JsonNameHidesFieldName_SetOnRequestMessage() 671return Task.FromResult(new HelloReply()); 691public async Task HandleCallAsync_SuccessfulResponse_DefaultValuesInResponseJson() 698return Task.FromResult(new HelloReply()); 727public async Task HandleCallAsync_MalformedRequestBody_BadRequestReturned(string json, string expectedError) 732return Task.FromResult(new HelloReply()); 759public async Task HandleCallAsync_MalformedRequestBody_RepeatedBody_BadRequestReturned(string json, string expectedError) 764return Task.FromResult(new HelloReply()); 794public async Task HandleCallAsync_BadContentType_BadRequestReturned(string contentType) 799return Task.FromResult(new HelloReply()); 822public async Task HandleCallAsync_RpcExceptionReturned_StatusReturned() 827return Task.FromException<HelloReply>(new RpcException(new Status(StatusCode.Unauthenticated, "Detail!"), "Message!")); 846public async Task HandleCallAsync_RpcExceptionThrown_StatusReturned() 875public async Task HandleCallAsync_RpcExceptionThrown_StatusDetailsReturned() 956public async Task HandleCallAsync_OtherExceptionThrown_StatusDetailsReturned() 1034public async Task HandleCallAsync_OtherExceptionThrown_StatusReturned() 1062public async Task HandleCallAsync_EnableDetailedErrors_OtherExceptionThrown_StatusReturned() 1092public async Task HandleCallAsync_StatusSet_StatusReturned() 1098return Task.FromResult(new HelloReply()); 1117public async Task HandleCallAsync_HttpBodyRequest_RawRequestAvailable() 1130return Task.FromResult(new HelloReply { Message = $"Hello {name}!" }); 1165public async Task HandleCallAsync_HttpBodyRequestLarge_RawRequestAvailable(int requestSize, bool sendContentLength) 1175return Task.FromResult(new HelloReply { Message = $"Hello {requestData.Length}!" }); 1213public async Task HandleCallAsync_NullBody_WrapperType_Error() 1218return Task.FromResult(new HelloReply()); 1244public async Task HandleCallAsync_WrapperType_Success(string requestJson, float? expectedValue) 1251return Task.FromResult(new HelloReply()); 1274public async Task HandleCallAsync_HttpBodyRequest_NoBody_RawRequestAvailable() 1284return Task.FromResult(new HelloReply()); 1304public async Task HandleCallAsync_SubHttpBodyRequest_RawRequestAvailable() 1311return Task.FromResult(new HelloReply { Message = $"Hello {r.Name}" }); 1341public async Task HandleCallAsync_HttpBodyResponse_BodyReturned() 1346return Task.FromResult(new HttpBody 1372public async Task HandleCallAsync_UserState_HttpContextInUserState() 1380return Task.FromResult(new HelloReply()); 1394public async Task HandleCallAsync_HasInterceptor_InterceptorCalled() 1402return Task.FromResult(new HelloReply()); 1428public async Task HandleCallAsync_GetHostAndMethodAndPeer_MatchHandler() 1440return Task.FromResult(new HelloReply()); 1456public async Task HandleCallAsync_ExceptionThrown_StatusReturned() 1480public async Task HandleCallAsync_MatchingRepeatedQueryStringValues_SetOnRequestMessage() 1487return Task.FromResult(new HelloReply()); 1508public async Task HandleCallAsync_DataTypes_SetOnRequestMessage() 1515return Task.FromResult(new HelloReply()); 1566public async Task HandleCallAsync_GetHttpContext_ReturnValue() 1572return Task.FromResult(new HelloReply()); 1580public async Task HandleCallAsync_ServerCallContextFeature_ReturnValue() 1586return Task.FromResult(new HelloReply()); 1599public async Task HandleCallAsync_IntegerEnum_SetOnRequestMessage(string value, HelloRequest.Types.DataTypes.Types.NestedEnum expectedEnum) 1616public async Task HandleCallAsync_InvalidEnum_Error(string value) 1639return handler != null ? handler(r, c) : Task.FromResult(new HelloReply()); 1652public async Task HandleCallAsync_Wrappers_SetOnRequestMessage() 1659return Task.FromResult(new HelloReply()); 1694public async Task HandleCallAsync_Any_Success() 1701return Task.FromResult(new HelloReply 1743public async Task HandleCallAsync_MatchingQueryStringValues_CustomDeserialization_SetOnRequestMessage() 1750return Task.FromResult(new HelloReply()); 1779public async Task HandleCallAsync_MatchingQueryStringValues_KnownType_FieldSetter_SetOnRequestMessage() 1786return Task.FromResult(new HelloReply());
Microsoft.AspNetCore.Grpc.Microbenchmarks (1)
artifacts\obj\Microsoft.AspNetCore.Grpc.Microbenchmarks\Release\net9.0\Proto\ChatGrpc.cs (1)
84public virtual global::System.Threading.Tasks.Task Chat(grpc::IAsyncStreamReader<global::Chat.ChatMessage> requestStream, grpc::IServerStreamWriter<global::Chat.ChatMessage> responseStream, grpc::ServerCallContext context)
Microsoft.AspNetCore.Grpc.Swagger.Tests (5)
Services\GreeterService.cs (1)
22return Task.FromResult(new HelloReply { Message = $"Hello {request.Name}" });
Services\ParametersService.cs (4)
13return Task.FromResult(new ParamResponse { Message = "DemoParametersOne Response" }); 18return Task.FromResult(new ParamResponse { Message = "DemoParametersTwo Response" }); 23return Task.FromResult(new ParamResponse { Message = "DemoParametersThree Response " }); 28return Task.FromResult(new ParamResponse { Message = "DemoParametersFour Response" });
Microsoft.AspNetCore.HeaderPropagation (1)
HeaderPropagationMiddleware.cs (1)
43public Task Invoke(HttpContext context)
Microsoft.AspNetCore.HeaderPropagation.Tests (34)
HeaderPropagationIntegrationTest.cs (8)
19public async Task HeaderPropagation_WithoutMiddleware_Throws() 77public async Task HeaderPropagation_OutsideOfIncomingRequest_Throws() 99public async Task HeaderInRequest_AddCorrectValue() 122public async Task MultipleHeaders_HeadersInRequest_AddAllHeaders() 151public async Task Builder_UseHeaderPropagation_Without_AddHeaderPropagation_Throws() 171public async Task HeaderInRequest_OverrideHeaderPerClient_AddCorrectValue() 235return Task.FromResult(new HttpResponseMessage()); 248public Task InvokeAsync(HttpContext _)
HeaderPropagationMessageHandlerTest.cs (15)
39public async Task HeaderInState_AddCorrectValue() 54public async Task HeaderInState_WithMultipleValues_AddAllValues() 69public async Task HeaderInState_RequestWithContent_ContentHeaderPresent_DoesNotAddIt() 83public async Task HeaderInState_RequestWithContent_ContentHeaderNotPresent_AddValue() 97public async Task HeaderInState_WithMultipleValues_RequestWithContent_ContentHeaderNotPresent_AddAllValues() 111public async Task HeaderInState_WithOutboundName_UseOutboundName() 126public async Task NoHeaderInState_DoesNotAddIt() 139public async Task HeaderInState_NotInOptions_DoesNotAddIt() 152public async Task MultipleHeadersInState_AddsAll() 173public async Task HeaderEmptyInState_DoNotAddIt(string headerValue) 190public async Task HeaderInState_HeaderAlreadyInOutgoingRequest_DoesNotOverrideIt(string outgoingValue, 209public async Task HeaderInState_HeaderTwiceInOptions_DoesNotAddItTwice() 225public async Task HeaderInState_HeaderTwiceInOptionsWithDifferentNames_AddsBoth() 243public async Task TwoHeadersInState_BothHeadersInOptionsWithSameName_AddsFirst() 269return Task.FromResult(new HttpResponseMessage());
HeaderPropagationMiddlewareTest.cs (11)
18return Task.CompletedTask; 36public async Task HeaderInRequest_AddCorrectValue() 51public async Task NoHeaderInRequest_DoesNotAddIt() 64public async Task HeaderInRequest_NotInOptions_DoesNotAddIt() 77public async Task MultipleHeadersInRequest_AddAllHeaders() 98public async Task HeaderEmptyInRequest_DoesNotAddIt(string headerValue) 114public async Task UsesValueFilter(string[] filterValues, string[] expectedValues) 142public async Task PreferValueFilter_OverRequestHeader() 157public async Task PreferEmptyValuesFromValueFilter_OverRequestHeader() 171public async Task EmptyValuesFromValueFilter_DoesNotAddIt() 184public async Task MultipleEntries_AddsFirstToProduceValue()
Microsoft.AspNetCore.HostFiltering (3)
HostFilteringMiddleware.cs (3)
53public Task Invoke(HttpContext context) 66private static Task HostValidationFailed(HttpContext context, MiddlewareConfiguration middlewareConfiguration) 77return Task.CompletedTask;
Microsoft.AspNetCore.HostFiltering.Tests (11)
HostFilteringMiddlewareTests.cs (11)
19public async Task MissingConfigThrows() 40public async Task AllowsMissingHost(bool allowed, int status) 66return Task.CompletedTask; 81public async Task AllowsEmptyHost(bool allowed, int status) 108return Task.CompletedTask; 110app.Run(c => Task.CompletedTask); 137public async Task AllowsSpecifiedHost(string hosturl, string allowedHost) 161app.Run(c => Task.CompletedTask); 189public async Task RejectsMismatchedHosts(string hosturl, string allowedHost) 225public async Task SupportsDynamicOptionsReload() 252app.Run(c => Task.CompletedTask);
Microsoft.AspNetCore.Hosting (19)
GenericHost\GenericWebHostService.cs (2)
62public async Task StartAsync(CancellationToken cancellationToken) 189public async Task StopAsync(CancellationToken cancellationToken)
Internal\HostedServiceExecutor.cs (2)
17public async Task StartAsync(CancellationToken token) 25public async Task StopAsync(CancellationToken token)
Internal\HostingApplication.cs (1)
87public Task ProcessRequestAsync(Context context)
Internal\WebHost.cs (2)
124public async Task StartAsync(CancellationToken cancellationToken = default) 279public async Task StopAsync(CancellationToken cancellationToken = default)
src\Shared\ErrorPage\ErrorPage.Designer.cs (1)
52public async override global::System.Threading.Tasks.Task ExecuteAsync()
src\Shared\RazorViews\BaseView.cs (3)
64public async Task ExecuteAsync(Stream stream) 80public async Task ExecuteAsync(HttpContext context) 97public abstract Task ExecuteAsync();
WebHostExtensions.cs (8)
23/// <returns>A <see cref="Task"/> that completes when the <see cref="IWebHost"/> stops.</returns> 24public static async Task StopAsync(this IWebHost host, TimeSpan timeout) 44/// <returns>A <see cref="Task"/> that completes when shutdown is triggered via Ctrl+C or SIGTERM.</returns> 45public static async Task WaitForShutdownAsync(this IWebHost host, CancellationToken token = default) 79public static async Task RunAsync(this IWebHost host, CancellationToken token = default) 108private static async Task RunAsync(this IWebHost host, CancellationToken token, string? startupMessage) 152private static async Task WaitForTokenShutdownAsync(this IWebHost host, CancellationToken cancellationToken) 162await Task.Delay(Timeout.Infinite, applicationLifetime.ApplicationStopping)
Microsoft.AspNetCore.Hosting.Abstractions (4)
IWebHost.cs (4)
32/// <returns>A <see cref="Task"/> that completes when the <see cref="IWebHost"/> starts.</returns> 33Task StartAsync(CancellationToken cancellationToken = default); 39/// <returns>A <see cref="Task"/> that completes when the <see cref="IWebHost"/> stops.</returns> 40Task StopAsync(CancellationToken cancellationToken = default);
Microsoft.AspNetCore.Hosting.FunctionalTests (5)
LinkedApplicationTests.cs (1)
13public async Task LinkedApplicationWorks()
ShutdownTests.cs (3)
25public async Task ShutdownTestRun() 34public async Task ShutdownTestWaitForShutdown() 39private async Task ExecuteShutdownTest(string testName, string shutdownMechanic)
WebHostBuilderTests.cs (1)
20public async Task InjectedStartup_DefaultApplicationNameIsEntryAssembly(TestVariant variant)
Microsoft.AspNetCore.Hosting.Server.Abstractions (3)
IHttpApplication.cs (1)
25Task ProcessRequestAsync(TContext context);
IServer.cs (2)
24Task StartAsync<TContext>(IHttpApplication<TContext> application, CancellationToken cancellationToken) where TContext : notnull; 30Task StopAsync(CancellationToken cancellationToken);
Microsoft.AspNetCore.Hosting.Tests (116)
Fakes\GenericWebHost.cs (2)
28public Task StartAsync(CancellationToken cancellationToken = default) => _host.StartAsync(cancellationToken); 30public Task StopAsync(CancellationToken cancellationToken = default) => _host.StopAsync(cancellationToken);
GenericWebHostBuilderTests.cs (4)
143public Task StartAsync<TContext>(IHttpApplication<TContext> application, CancellationToken cancellationToken) => Task.CompletedTask; 144public Task StopAsync(CancellationToken cancellationToken) => Task.CompletedTask;
HostingApplicationDiagnosticsTests.cs (2)
23public async Task EventCountersAndMetricsValues() 844ctx => Task.CompletedTask,
HostingApplicationTests.cs (1)
193ctx => Task.CompletedTask,
HostingMetricsTests.cs (3)
117public async Task StartListeningDuringRequest_NotMeasured() 136var processRequestTask = hostingApplication.ProcessRequestAsync(context1); 196requestDelegate ??= ctx => Task.CompletedTask;
Internal\HostingEventSourceTests.cs (1)
177public async Task VerifyCountersFireWithCorrectValues()
src\Shared\SyncPoint\SyncPoint.cs (5)
18public Task WaitForSyncPoint() => _atSyncPoint.Task; 32public Task WaitToContinue() 38public static Func<Task> Create(out SyncPoint syncPoint) 51public static Func<Task> Create(int count, out SyncPoint[] syncPoints) 67return Task.CompletedTask;
WebHostBuilderTests.cs (36)
41public async Task StartupMissing_Fallback(IWebHostBuilder builder) 53public async Task StartupStaticCtorThrows_Fallback(IWebHostBuilder builder) 83public async Task MultipleUseStartupCallsLastWins(IWebHostBuilder builder) 110public async Task UseStartupFactoryWorks(IWebHostBuilder builder) 131public async Task StartupCtorThrows_Fallback(IWebHostBuilder builder) 144public async Task StartupCtorThrows_TypeLoadException(IWebHostBuilder builder) 157public async Task IHostApplicationLifetimeRegisteredEvenWhenStartupCtorThrows_Fallback(IWebHostBuilder builder) 174public async Task StartupConfigureServicesThrows_Fallback(IWebHostBuilder builder) 187public async Task StartupConfigureThrows_Fallback(IWebHostBuilder builder) 290public async Task MultipleStartupAssembliesSpecifiedOnlyAddAssemblyOnce(IWebHostBuilder builder) 847public async Task UseStartupImplementingIStartupWorks() 962public async Task ExternalContainerInstanceCanBeUsedForEverything() 1193public async Task Build_DoesNotThrowIfUnloadableAssemblyNameInHostingStartupAssembliesAndCaptureStartupErrorsTrue(IWebHostBuilder builder) 1288public async Task StartupFiltersDoNotRunIfNotApplicationConfigured(IWebHostBuilder builder) 1343public async Task ThrowingFromHostedServiceFailsStartAsync(IWebHostBuilder builder) 1367public async Task ThrowingFromHostedServiceStopsOtherHostedServicesFromRunningStartAsync(IWebHostBuilder builder) 1396public async Task HostedServicesStartedBeforeServer(IWebHostBuilder builder) 1432public Task StartAsync(CancellationToken cancellationToken) 1436return Task.CompletedTask; 1439public Task StopAsync(CancellationToken cancellationToken) 1441return Task.CompletedTask; 1456public Task StartAsync<TContext>(IHttpApplication<TContext> application, CancellationToken cancellationToken) 1460return Task.CompletedTask; 1463public Task StopAsync(CancellationToken cancellationToken) 1465return Task.CompletedTask; 1516private async Task AssertResponseContains(RequestDelegate app, string expectedText) 1528public Task StartAsync(CancellationToken cancellationToken) 1533public Task StopAsync(CancellationToken cancellationToken) 1544public Task StartAsync(CancellationToken cancellationToken) 1547return Task.CompletedTask; 1550public Task StopAsync(CancellationToken cancellationToken) 1553return Task.CompletedTask; 1575public Task StartAsync<TContext>(IHttpApplication<TContext> application, CancellationToken cancellationToken) 1592return Task.CompletedTask; 1595public Task StopAsync(CancellationToken cancellationToken) => Task.CompletedTask;
WebHostTests.AsyncDisposable.cs (1)
11public async Task DisposingHostCallsDisposeAsyncOnProvider()
WebHostTests.cs (61)
25public async Task WebHostThrowsWithNoServer() 38public async Task NoDefaultAddressesAndDoNotPreferHostingUrlsIfNotConfigured() 50public async Task UsesLegacyConfigurationForAddressesAndDoNotPreferHostingUrlsIfNotConfigured() 88public async Task UsesNewConfigurationOverLegacyConfigForAddressesAndDoNotPreferHostingUrlsIfNotConfigured() 120public async Task PreferHostingUrlsWhenAddressIsConfigured() 156public async Task WebHostShutsDownWhenTokenTriggers() 171var runInBackground = host.RunAsync(cts.Token); 194public async Task WebHostStopAsyncUsesDefaultTimeoutIfGivenTokenDoesNotFire() 207return Task.Run(() => 226var task = host.StopAsync(cts.Token); 228Assert.Equal(task, await Task.WhenAny(task, Task.Delay(TimeSpan.FromSeconds(10)))); 233public async Task WebHostStopAsyncUsesDefaultTimeoutIfNoTokenProvided() 246return Task.Run(() => 262var task = host.StopAsync(); 264Assert.Equal(task, await Task.WhenAny(task, Task.Delay(TimeSpan.FromSeconds(10)))); 269public async Task WebHostStopAsyncCanBeCancelledEarly() 282return Task.Run(() => 300var task = host.StopAsync(cts.Token); 303Assert.Equal(task, await Task.WhenAny(task, Task.Delay(TimeSpan.FromSeconds(8)))); 346var runHostAndVerifyApplicationStopped = Task.Run(async () => 357Task.Run(() => lifetime.StopApplication()); 370public async Task WebHostDisposesServiceProvider() 403public async Task WebHostNotifiesApplicationStarted() 424public async Task WebHostNotifiesAllIApplicationLifetimeCallbacksEvenIfTheyThrow() 457public async Task WebHostDoesNotNotifyAllIApplicationLifetimeEventsCallbacksIfTheyThrow() 481public async Task WebHostStopApplicationDoesNotFireStopOnHostedService() 521public async Task HostedServiceCanInjectApplicationLifetime() 545public async Task HostedServiceStartNotCalledIfWebHostNotStarted() 569public async Task WebHostStopApplicationFiresStopOnHostedService() 622public async Task WebHostDisposeApplicationFiresStopOnHostedService() 666public async Task WebHostDoesNotNotifyAllIHostedServicesAndIApplicationLifetimeCallbacksIfTheyThrow() 705public async Task WebHostInjectsHostingEnvironment() 860public async Task IsEnvironment_Extension_Is_Case_Insensitive() 872public async Task WebHost_CreatesDefaultRequestIdentifierFeature_IfNotPresent() 883return Task.CompletedTask; 894public async Task WebHost_DoesNot_CreateDefaultRequestIdentifierFeature_IfPresent() 904return Task.CompletedTask; 922public async Task WebHost_InvokesConfigureMethodsOnlyOnce() 938public async Task WebHost_HttpContextUseAfterRequestEnd_Fails() 948return Task.CompletedTask; 1019public async Task DisposeAsync_DisposesAppConfiguration() 1043public async Task DoesNotCallServerStopIfServerStartHasNotBeenCalled() 1062public async Task DoesNotCallServerStopIfServerStartHasNotBeenCalledIHostedService() 1162public Task StartAsync(CancellationToken token) 1165return Task.CompletedTask; 1168public Task StopAsync(CancellationToken token) 1171return Task.CompletedTask; 1193public Task StartAsync(CancellationToken token) 1196return Task.CompletedTask; 1198public Task StopAsync(CancellationToken token) 1201return Task.CompletedTask; 1247public Task StartAsync<TContext>(IHttpApplication<TContext> application, CancellationToken cancellationToken) 1263return Task.CompletedTask; 1266public Task StopAsync(CancellationToken cancellationToken) 1276return Task.CompletedTask; 1430public void OnCompleted(Func<object, Task> callback, object state) { } 1432public void OnStarting(Func<object, Task> callback, object state) { }
Microsoft.AspNetCore.Hosting.TestSites (4)
Program.cs (4)
66public Task StartAsync<TContext>(IHttpApplication<TContext> application, CancellationToken cancellationToken) 68return Task.CompletedTask; 71public Task StopAsync(CancellationToken cancellationToken) 73return Task.CompletedTask;
Microsoft.AspNetCore.Hosting.WindowsServices.Tests (8)
WebHostServiceTests.cs (8)
20public async Task StopBeforeServiceStarted() 30() => Task.Delay(OperationTimeout, applicationLifetime.ApplicationStopped)); 34public async Task StopAfterServiceStarted() 44() => Task.Delay(OperationTimeout, applicationLifetime.ApplicationStopped)); 54public Task StartAsync<TContext>(IHttpApplication<TContext> application, CancellationToken cancellationToken) 58return Task.CompletedTask; 61public Task StopAsync(CancellationToken cancellationToken) => Task.CompletedTask;
Microsoft.AspNetCore.Http (26)
Builder\ApplicationBuilder.cs (1)
192return Task.CompletedTask;
Features\FormFeature.cs (1)
167_parsedFormTask = Task.FromResult(Form);
Features\HttpResponseFeature.cs (2)
37public virtual void OnStarting(Func<object, Task> callback, object state) 42public virtual void OnCompleted(Func<object, Task> callback, object state)
Features\RequestBodyPipeFeature.cs (1)
44return Task.CompletedTask;
Features\TlsConnectionFeature.cs (1)
19return Task.FromResult(ClientCertificate);
FormFile.cs (1)
99public async Task CopyToAsync(Stream target, CancellationToken cancellationToken = default(CancellationToken))
Internal\DefaultHttpResponse.cs (5)
127public override void OnStarting(Func<object, Task> callback, object state) 134public override void OnCompleted(Func<object, Task> callback, object state) 155public override Task StartAsync(CancellationToken cancellationToken = default) 159return Task.CompletedTask; 165public override Task CompleteAsync() => HttpResponseBodyFeature.CompleteAsync();
Internal\ReferenceReadStream.cs (3)
118public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 135public override Task FlushAsync(CancellationToken cancellationToken) 137return Task.CompletedTask;
SendFileFallback.cs (1)
23public static async Task SendFileAsync(Stream destination, string filePath, long offset, long? count, CancellationToken cancellationToken)
src\Http\Shared\StreamCopyOperationInternal.cs (2)
20public static Task CopyToAsync(Stream source, Stream destination, long? count, CancellationToken cancel) 32public static async Task CopyToAsync(Stream source, Stream destination, long? count, int bufferSize, CancellationToken cancel)
src\Shared\ValueTaskExtensions\ValueTaskExtensions.cs (2)
13public static Task GetAsTask(this in ValueTask<FlushResult> valueTask) 20return Task.CompletedTask;
StreamResponseBodyFeature.cs (4)
86public virtual async Task SendFileAsync(string path, long offset, long? count, CancellationToken cancellationToken) 100public virtual Task StartAsync(CancellationToken cancellationToken = default) 107return Task.CompletedTask; 115public virtual async Task CompleteAsync()
Timeouts\RequestTimeoutsMiddleware.cs (2)
29public Task Invoke(HttpContext context) 96async Task SetTimeoutAsync()
Microsoft.AspNetCore.Http.Abstractions (39)
Extensions\HttpResponseWritingExtensions.cs (5)
26public static Task WriteAsync(this HttpResponse response, string text, CancellationToken cancellationToken = default(CancellationToken)) 43public static Task WriteAsync(this HttpResponse response, string text, Encoding encoding, CancellationToken cancellationToken = default(CancellationToken)) 52var startAsyncTask = response.StartAsync(cancellationToken); 64private static async Task StartAndWriteAsyncAwaited(this HttpResponse response, string text, Encoding encoding, CancellationToken cancellationToken, Task startAsyncTask)
Extensions\MapMiddleware.cs (2)
40public Task Invoke(HttpContext context) 55private async Task InvokeCore(HttpContext context, PathString matchedPath, PathString remainingPath)
Extensions\MapWhenMiddleware.cs (1)
45public Task Invoke(HttpContext context)
Extensions\UseExtensions.cs (5)
17/// Prefer using <see cref="Use(IApplicationBuilder, Func{HttpContext, RequestDelegate, Task})"/> for better performance as shown below: 29public static IApplicationBuilder Use(this IApplicationBuilder app, Func<HttpContext, Func<Task>, Task> middleware) 35Func<Task> simpleNext = () => next(context); 48public static IApplicationBuilder Use(this IApplicationBuilder app, Func<HttpContext, RequestDelegate, Task> middleware)
Extensions\UseMiddlewareExtensions.cs (6)
86if (!typeof(Task).IsAssignableFrom(invokeMethod.ReturnType)) 88throw new InvalidOperationException(Resources.FormatException_UseMiddlewareNonTaskReturnType(InvokeMethodName, InvokeAsyncMethodName, nameof(Task))); 199private static Func<T, HttpContext, IServiceProvider, Task> ReflectionFallback<T>(MethodInfo methodInfo, ParameterInfo[] parameters) 221return (Task)methodInfo.Invoke(middleware, BindingFlags.DoNotWrapExceptions, binder: null, methodArguments, culture: null)!; 225private static Func<T, HttpContext, IServiceProvider, Task> CompileExpression<T>(MethodInfo methodInfo, ParameterInfo[] parameters) 290var lambda = Expression.Lambda<Func<T, HttpContext, IServiceProvider, Task>>(body, instanceArg, httpContextArg, providerArg);
Extensions\UsePathBaseMiddleware.cs (2)
39public Task Invoke(HttpContext context) 50private async Task InvokeCore(HttpContext context, PathString matchedPath, PathString remainingPath)
HttpResponse.cs (10)
19private static readonly Func<object, Task> _callbackDelegate = callback => ((Func<Task>)callback)(); 20private static readonly Func<object, Task> _disposeDelegate = state => 31return Task.CompletedTask; 91public abstract void OnStarting(Func<object, Task> callback, object state); 103public virtual void OnStarting(Func<Task> callback) => OnStarting(_callbackDelegate, callback); 110public abstract void OnCompleted(Func<object, Task> callback, object state); 128public virtual void OnCompleted(Func<Task> callback) => OnCompleted(_callbackDelegate, callback); 149public virtual Task StartAsync(CancellationToken cancellationToken = default) { throw new NotImplementedException(); } 156public virtual Task CompleteAsync() { throw new NotImplementedException(); }
HttpResults\EmptyHttpResult.cs (2)
22public Task ExecuteAsync(HttpContext httpContext) 26return Task.CompletedTask;
HttpResults\IResult.cs (1)
16Task ExecuteAsync(HttpContext httpContext);
IMiddleware.cs (2)
16/// <returns>A <see cref="Task"/> that represents the execution of this middleware.</returns> 17Task InvokeAsync(HttpContext context, RequestDelegate next);
RequestDelegate.cs (1)
11public delegate Task RequestDelegate(HttpContext context);
src\Shared\ValueTaskExtensions\ValueTaskExtensions.cs (2)
13public static Task GetAsTask(this in ValueTask<FlushResult> valueTask) 20return Task.CompletedTask;
Microsoft.AspNetCore.Http.Abstractions.Tests (77)
EndpointHttpContextExtensionsTests.cs (6)
45var initial = new Endpoint(c => Task.CompletedTask, EndpointMetadataCollection.Empty, "Test endpoint"); 78var endpoint = new Endpoint(c => Task.CompletedTask, EndpointMetadataCollection.Empty, "Test endpoint"); 92var initialEndpoint = new Endpoint(c => Task.CompletedTask, EndpointMetadataCollection.Empty, "Test endpoint"); 100var endpoint = new Endpoint(c => Task.CompletedTask, EndpointMetadataCollection.Empty, "Test endpoint"); 114var initialEndpoint = new Endpoint(c => Task.CompletedTask, EndpointMetadataCollection.Empty, "Test endpoint"); 135var initialEndpoint = new Endpoint(c => Task.CompletedTask, EndpointMetadataCollection.Empty, "Test endpoint");
HttpResponseWritingExtensionsTests.cs (4)
11public async Task WritingText_WriteText() 20public async Task WritingText_MultipleWrites() 31public async Task WritingTextThatRequiresMultipleSegmentsWorks(Encoding encoding) 52public async Task WritingTextWithPassedInEncodingWorks(Encoding encoding)
MapPathMiddlewareTests.cs (10)
12private static Task Success(HttpContext context) 17return Task.FromResult<object?>(null); 25private static Task NotImplemented(HttpContext context) 54public async Task PathMatchFunc_BranchTaken(string matchPath, string basePath, string requestPath, string expectedPathBase, string expectedPath) 84public async Task PathMatchAction_BranchTaken(string matchPath, string basePath, string requestPath) 112public async Task PathMatchAction_BranchTaken_WithPreserveMatchedPathSegment(string matchPath, string basePath, string requestPath) 142public async Task PathMismatchFunc_PassedThrough(string matchPath, string basePath, string requestPath) 164public async Task PathMismatchAction_PassedThrough(string matchPath, string basePath, string requestPath) 179public async Task ChainedRoutes_Success() 272return context => Task.CompletedTask;
MapPredicateMiddlewareTests.cs (7)
14private static Task Success(HttpContext context) 17return Task.FromResult<object>(null!); 25private static Task NotImplemented(HttpContext context) 60public async Task PredicateTrue_BranchTaken() 72public async Task PredicateTrueAction_BranchTaken() 84public async Task PredicateFalseAction_PassThrough() 97public async Task ChainedPredicates_Success()
UseExtensionsTests.cs (4)
11public async Task UseCallsNextMiddleware() 35return Task.CompletedTask; 48public async Task ThrowFromMiddlewareFlowsBackToInvoke() 69return Task.CompletedTask;
UseMiddlewareTest.cs (29)
49nameof(Task)), 63nameof(Task)), 120public async Task UseMiddleware_ThrowsIfArgCantBeResolvedFromContainer() 161public async Task UseMiddlewareWithIMiddlewareThrowsIfNoIMiddlewareFactoryRegistered() 178public async Task UseMiddlewareWithIMiddlewareThrowsIfMiddlewareFactoryCreateReturnsNull() 201public async Task UseMiddlewareWithIMiddlewareWorks() 224public async Task InvokeAsync(HttpContext context, RequestDelegate next) 281public Task Invoke(HttpContext context, ref IServiceProvider? sp1, out IServiceProvider? sp2) 285return Task.FromResult(0); 293public Task Invoke(HttpContext context, object value) => Task.CompletedTask; 300public Task Invoke(HttpContext context, IServiceProvider provider) => Task.CompletedTask; 307public Task Invoke() => Task.CompletedTask; 314public Task InvokeAsync() => Task.CompletedTask; 340public Task Invoke(HttpContext context) => Task.CompletedTask; 342public Task Invoke(HttpContext context, int i) => Task.CompletedTask; 349public Task InvokeAsync(HttpContext context) => Task.CompletedTask; 351public Task InvokeAsync(HttpContext context, int i) => Task.CompletedTask; 358public Task Invoke(HttpContext context) => Task.CompletedTask; 360public Task InvokeAsync(HttpContext context) => Task.CompletedTask;
UsePathBaseExtensionsTests.cs (11)
75public Task RequestPathBaseContainingPathBase_IsSplit(string registeredPathBase, string pathBase, string requestPath, string expectedPathBase, string expectedPath) 89public Task RequestPathBaseNotContainingPathBase_IsNotSplit(string registeredPathBase, string pathBase, string requestPath, string expectedPathBase, string expectedPath) 105public Task PathBaseNeverEndsWithSlash(string registeredPathBase, string pathBase, string requestPath, string expectedPathBase, string expectedPath) 113public Task PathBaseAndPathPreserveRequestCasing(string registeredPathBase, string pathBase, string requestPath, string expectedPathBase, string expectedPath) 125public Task PathBaseCanHaveUnicodeCharacters(string registeredPathBase, string pathBase, string requestPath, string expectedPathBase, string expectedPath) 137public Task PathBaseCanHavePercentCharacters(string registeredPathBase, string pathBase, string requestPath, string expectedPathBase, string expectedPath) 143public async Task PathBaseWorksAfterUseRoutingIfGlobalRouteBuilderUsed() 168public async Task PathBaseWorksBeforeUseRoutingIfGlobalRouteBuilderUsed() 190public async Task PathBaseWorksWithoutUseRoutingWithWebApplication() 209private static async Task TestPathBase(string registeredPathBase, string pathBase, string requestPath, string expectedPathBase, string expectedPath) 218return Task.FromResult(0);
UseWhenExtensionsTests.cs (6)
26public async Task PredicateTrue_BranchTaken_WillRejoin() 54public async Task PredicateTrue_BranchTaken_CanTerminate() 82public async Task PredicateFalse_PassThrough() 123private static Func<HttpContext, Func<Task>, Task> Increment(string key, bool terminate = false) 145return terminate ? Task.FromResult<object?>(null) : next();
Microsoft.AspNetCore.Http.Connections (67)
Internal\HttpConnectionContext.cs (21)
62internal Func<PipeWriter, Task>? NotifyOnReconnect { get; set; } 128internal Task? DisposeAndRemoveTask { get; set; } 139public Task PreviousPollTask { get; set; } = Task.CompletedTask; 141public Task? ApplicationTask { get; set; } 248public async Task DisposeAsync(bool closeGracefully = false) 250Task disposeTask; 266var applicationTask = ApplicationTask ?? Task.CompletedTask; 267var transportTask = TransportTask ?? Task.CompletedTask; 294private async Task WaitOnTasks(Task applicationTask, Task transportTask, bool closeGracefully) 336var result = await Task.WhenAny(applicationTask, transportTask); 408Task currentRequestTask, 443Task currentRequestTask, 626private async Task ExecuteApplication(ConnectionDelegate connectionDelegate) 633await Task.Yield(); 733public void OnReconnected(Func<PipeWriter, Task> notifyOnReconnect)
Internal\HttpConnectionDispatcher.cs (15)
61public async Task ExecuteAsync(HttpContext context, HttpConnectionDispatcherOptions options, ConnectionDelegate connectionDelegate) 102public async Task ExecuteNegotiateAsync(HttpContext context, HttpConnectionDispatcherOptions options) 121private async Task ExecuteAsync(HttpContext context, ConnectionDelegate connectionDelegate, HttpConnectionDispatcherOptions options, ConnectionLogScope logScope) 156if (connection.TryActivatePersistentConnection(connectionDelegate, sse, Task.CompletedTask, context, _logger)) 211var reconnectTask = Task.CompletedTask; 228reconnectTask = connection.NotifyOnReconnect?.Invoke(connection.Transport.Output) ?? Task.CompletedTask; 256var resultTask = await Task.WhenAny(connection.ApplicationTask!, connection.TransportTask!); 269await ((Task)connection.TransportTask!).ConfigureAwait(ConfigureAwaitOptions.SuppressThrowing); 328private async Task DoPersistentConnection(HttpConnectionContext connection) 331await Task.WhenAny(connection.ApplicationTask!, connection.TransportTask!); 336private async Task ProcessNegotiate(HttpContext context, HttpConnectionDispatcherOptions options, ConnectionLogScope logScope) 449private async Task ProcessSend(HttpContext context) 542private async Task ProcessDeleteAsync(HttpContext context)
Internal\HttpConnectionManager.cs (4)
117private async Task ExecuteTimerLoop() 190var tasks = new List<Task>(_connections.Count); 200Task.WaitAll(tasks.ToArray(), TimeSpan.FromSeconds(5)); 203internal async Task DisposeAndRemoveAsync(HttpConnectionContext connection, bool closeGracefully, HttpConnectionStopStatus status)
Internal\Transports\IHttpTransport.cs (1)
13/// <returns>A <see cref="Task"/> that completes when the transport has finished processing</returns>
Internal\Transports\WebSocketsServerTransport.cs (13)
60public async Task ProcessSocketAsync(WebSocket socket) 64var receiving = StartReceiving(socket); 65var sending = StartSending(socket, ignoreFirstCancel); 68var trigger = await Task.WhenAny(receiving, sending); 83var resultTask = await Task.WhenAny(sending, Task.Delay(_options.CloseTimeout, delayCts.Token)); 111var resultTask = await Task.WhenAny(receiving, Task.Delay(_options.CloseTimeout, delayCts.Token)); 131private async Task StartReceiving(WebSocket socket) 200private async Task StartSending(WebSocket socket, bool ignoreFirstCancel)
ServerSentEventsMessageFormatter.cs (2)
15public static async Task WriteMessageAsync(ReadOnlySequence<byte> payload, Stream output, CancellationToken token) 66private static async Task WriteMessageToMemory(Stream output, ReadOnlySequence<byte> payload)
src\Shared\ValueTaskExtensions\ValueTaskExtensions.cs (2)
13public static Task GetAsTask(this in ValueTask<FlushResult> valueTask) 20return Task.CompletedTask;
src\SignalR\common\Shared\AwaitableThreadPool.cs (1)
29Task.Run(continuation);
src\SignalR\common\Shared\MemoryBufferWriter.cs (4)
138public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) 191private async Task CopyToSlowAsync(Stream destination, CancellationToken cancellationToken) 277public override Task FlushAsync(CancellationToken cancellationToken) => Task.CompletedTask;
src\SignalR\common\Shared\PipeWriterStream.cs (2)
56public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 72return new ValueTask(Task.FromCanceled(cancellationToken));
src\SignalR\common\Shared\TaskCache.cs (2)
8public static readonly Task<bool> True = Task.FromResult(true); 9public static readonly Task<bool> False = Task.FromResult(false);
Microsoft.AspNetCore.Http.Connections.Client (54)
HttpConnection.cs (11)
34private static readonly Task<string?> _noAccessToken = Task.FromResult<string?>(null); 178/// <returns>A <see cref="Task"/> that represents the asynchronous start.</returns> 184public Task StartAsync(CancellationToken cancellationToken = default) 194/// <returns>A <see cref="Task"/> that represents the asynchronous start.</returns> 200public async Task StartAsync(TransferFormat transferFormat, CancellationToken cancellationToken = default) 208private async Task StartAsyncCore(TransferFormat transferFormat, CancellationToken cancellationToken) 245/// <returns>A <see cref="Task"/> that represents the asynchronous dispose.</returns> 258private async Task DisposeAsyncCore() 304private async Task SelectAndStartTransport(TransferFormat transferFormat, CancellationToken cancellationToken) 342_accessTokenProvider = () => Task.FromResult<string?>(accessToken); 512private async Task StartTransport(Uri connectUrl, HttpTransportType transportType, TransferFormat transferFormat,
Internal\ITransport.cs (2)
14Task StartAsync(Uri url, TransferFormat transferFormat, CancellationToken cancellationToken = default); 15Task StopAsync();
Internal\LongPollingTransport.cs (11)
30internal Task Running { get; private set; } = Task.CompletedTask; 43public async Task StartAsync(Uri url, TransferFormat transferFormat, CancellationToken cancellationToken = default) 71private async Task ProcessAsync(Uri url) 76var receiving = Poll(url, _transportCts.Token); 77var sending = SendUtils.SendMessages(url, _application, _httpClient, _logger); 80var trigger = await Task.WhenAny(receiving, sending).ConfigureAwait(false); 113public async Task StopAsync() 141private async Task Poll(Uri pollUrl, CancellationToken cancellationToken) 228private async Task SendDeleteRequest(Uri url)
Internal\SendUtils.cs (2)
19public static async Task SendMessages(Uri sendUrl, IDuplexPipe application, HttpClient httpClient, ILogger logger, CancellationToken cancellationToken = default) 100protected override Task SerializeToStreamAsync(Stream stream, TransportContext? context)
Internal\ServerSentEventsTransport.cs (10)
32internal Task Running { get; private set; } = Task.CompletedTask; 47public async Task StartAsync(Uri url, TransferFormat transferFormat, CancellationToken cancellationToken = default) 89private async Task ProcessAsync(Uri url, HttpResponseMessage response) 94var receiving = ProcessEventStream(response, _transportCts.Token); 95var sending = SendUtils.SendMessages(url, _application, _httpClient, _logger, _inputCts.Token); 98var trigger = await Task.WhenAny(receiving, sending).ConfigureAwait(false); 127private async Task ProcessEventStream(HttpResponseMessage response, CancellationToken cancellationToken) 222public async Task StopAsync()
Internal\WebSocketsTransport.cs (16)
47private Func<PipeWriter, Task>? _notifyOnReconnect; 49internal Task Running { get; private set; } = Task.CompletedTask; 56public void OnReconnected(Func<PipeWriter, Task> notifyOnReconnect) 287public async Task StartAsync(Uri url, TransferFormat transferFormat, CancellationToken cancellationToken = default) 337private async Task ProcessSocketAsync(WebSocket socket, Uri url, bool isReconnect) 344var receiving = StartReceiving(socket); 345var sending = StartSending(socket, ignoreFirstCanceled: isReconnect); 354var trigger = await Task.WhenAny(receiving, sending).ConfigureAwait(false); 367var resultTask = await Task.WhenAny(sending, Task.Delay(_closeTimeout, _stopCts.Token)).ConfigureAwait(false); 433private async Task StartReceiving(WebSocket socket) 530private async Task StartSending(WebSocket socket, bool ignoreFirstCanceled) 655public async Task StopAsync()
src\SignalR\common\Shared\PipeWriterStream.cs (2)
56public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 72return new ValueTask(Task.FromCanceled(cancellationToken));
Microsoft.AspNetCore.Http.Connections.Tests (223)
HttpConnectionDispatcherTests.cs (159)
55public async Task NegotiateVersionZeroReservesConnectionIdAndReturnsIt() 79public async Task NegotiateReservesConnectionTokenAndConnectionIdAndReturnsIt() 105public async Task CheckThatThresholdValuesAreEnforced() 127await dispatcher.ExecuteAsync(context, options, c => Task.CompletedTask); 130var writeTask = connection.Application.Output.WriteAsync(new[] { (byte)'b', (byte)'y', (byte)'t', (byte)'e', (byte)'s' }); 142public async Task InvalidNegotiateProtocolVersionThrows() 170public async Task NoNegotiateVersionInQueryStringThrowsWhenMinProtocolVersionIsSet() 200public async Task CheckThatThresholdValuesAreEnforcedWithSends(HttpTransportType transportType) 239var executeTask = dispatcher.ExecuteAsync(context, new HttpConnectionDispatcherOptions(), app); 255public async Task NegotiateReturnsAvailableTransportsAfterFilteringByOptions(HttpTransportType transports) 290public async Task EndpointsThatAcceptConnectionId404WhenUnknownConnectionIdProvided(HttpTransportType transportType) 333public async Task EndpointsThatAcceptConnectionId404WhenUnknownConnectionIdProvidedForPost() 369public async Task PostNotAllowedForWebSocketConnections() 407public async Task PostReturns404IfConnectionDisposed() 446public async Task TransportEndingGracefullyWaitsOnApplication(HttpTransportType transportType) 486var task = dispatcher.ExecuteAsync(context, new HttpConnectionDispatcherOptions(), app); 507public async Task TransportEndingGracefullyWaitsOnApplicationLongPolling() 550var task = dispatcher.ExecuteAsync(context, new HttpConnectionDispatcherOptions(), app); 573public async Task PostSendsToConnection(HttpTransportType transportType) 623public async Task PostSendsToConnectionInParallel(HttpTransportType transportType) 637var executeTask1 = DispatcherExecuteAsync(dispatcher, connection, callerTracker, waitTcs.Task); 638var executeTask2 = DispatcherExecuteAsync(dispatcher, connection, callerTracker, waitTcs.Task); 642await Task.WhenAll(executeTask1, executeTask2); 645async Task DispatcherExecuteAsync(HttpConnectionDispatcher dispatcher, HttpConnectionContext connection, SemaphoreSlim callerTracker, Task waitTask) 679private readonly Task _waitTask; 681public TrackingMemoryStream(SemaphoreSlim callerTracker, Task waitTask) 687public override async Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) 709public async Task ResponsesForLongPollingHaveCacheHeaders() 733var pollTask = dispatcher.ExecuteAsync(pollContext, options, app); 742public async Task HttpContextFeatureForLongpollingWorksBetweenPolls() 789var task = dispatcher.ExecuteAsync(context, new HttpConnectionDispatcherOptions(), app); 844public async Task EndpointsThatRequireConnectionId400WhenNoConnectionIdProvided(HttpTransportType transportType) 884public async Task IOExceptionWhenReadingRequestReturns400Response(HttpTransportType transportType) 913await dispatcher.ExecuteAsync(context, new HttpConnectionDispatcherOptions(), c => Task.CompletedTask); 921public async Task EndpointsThatRequireConnectionId400WhenNoConnectionIdProvidedForPost() 954public async Task EndPointThatOnlySupportsLongPollingRejectsOtherTransports(HttpTransportType transportType, int status) 966public async Task EndPointThatOnlySupportsSSERejectsOtherTransports(HttpTransportType transportType, int status) 978public async Task EndPointThatOnlySupportsWebSockesRejectsOtherTransports(HttpTransportType transportType, int status) 988public async Task EndPointThatOnlySupportsWebSocketsAndSSERejectsLongPolling(HttpTransportType transportType, int status) 997public async Task CompletedEndPointEndsConnection() 1025public async Task SynchronousExceptionEndsConnection() 1057public async Task CompletedEndPointEndsLongPollingConnection() 1089public async Task Metrics() 1128public async Task Metrics_ListenStartAfterConnection_Empty() 1180public async Task LongPollingTimeoutSets200StatusCode() 1220public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) 1243public override async Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 1269public async Task LongPollingConnectionClosesWhenSendTimeoutReached() 1296var dispatcherTask = dispatcher.ExecuteAsync(context, options, app); 1317public async Task SSEConnectionClosesWhenSendTimeoutReached() 1335var dispatcherTask = dispatcher.ExecuteAsync(context, options, app); 1356public async Task WebSocketConnectionClosesWhenSendTimeoutReached() 1379var dispatcherTask = dispatcher.ExecuteAsync(context, options, app); 1400public async Task WebSocketTransportTimesOutWhenCloseFrameNotReceived() 1421var task = dispatcher.ExecuteAsync(context, options, app); 1430public async Task RequestToActiveConnectionId409ForStreamingTransports(HttpTransportType transportType) 1451var request1 = dispatcher.ExecuteAsync(context1, options, app); 1460var webSocketTask = Task.CompletedTask; 1475public async Task RequestToActiveConnectionIdKillsPreviousConnectionLongPolling() 1494var request1 = dispatcher.ExecuteAsync(context1, options, app); 1503await Task.Delay(15); 1510var request2 = dispatcher.ExecuteAsync(context2, options, app); 1523await Task.Delay(15); 1540public async Task MultipleRequestsToActiveConnectionId409ForLongPolling() 1561var request1 = dispatcher.ExecuteAsync(context1, options, app); 1570var request2 = dispatcher.ExecuteAsync(context2, options, app); 1577var completedTask = await Task.WhenAny(request1, request2).DefaultTimeout(); 1604public async Task RequestToDisposedConnectionIdReturns404(HttpTransportType transportType) 1635public async Task ConnectionStateSetToInactiveAfterPoll() 1653var task = dispatcher.ExecuteAsync(context, options, app); 1670public async Task BlockingConnectionWorksWithStreamingConnections() 1688var task = dispatcher.ExecuteAsync(context, options, app); 1704public async Task BlockingConnectionWorksWithLongPollingConnection() 1724var task = dispatcher.ExecuteAsync(context, options, app); 1746public async Task AttemptingToPollWhileAlreadyPollingReplacesTheCurrentPoll() 1765var task1 = dispatcher.ExecuteAsync(context1, options, app); 1769var task2 = dispatcher.ExecuteAsync(context2, options, app); 1793public async Task TransferModeSet(HttpTransportType transportType, TransferFormat? expectedTransferFormats) 1825public async Task LongPollingKeepsWindowsPrincipalAndIdentityBetweenRequests() 1862var connectionHandlerTask = dispatcher.ExecuteAsync(context, options, app); 1877public async Task LongPollingKeepsWindowsIdentityWithoutWindowsPrincipalBetweenRequests() 1914var connectionHandlerTask = dispatcher.ExecuteAsync(context, options, app); 1932public async Task WindowsIdentityNotClosed(HttpTransportType transportType) 1977public async Task SetsInherentKeepAliveFeatureOnFirstLongPollingRequest() 2009public async Task DeleteEndpointRejectsRequestToTerminateNonLongPollingTransport(HttpTransportType transportType) 2050public async Task DeleteEndpointGracefullyTerminatesLongPolling() 2069var pollTask = dispatcher.ExecuteAsync(context, options, app); 2103public async Task DeleteEndpointGracefullyTerminatesLongPollingEvenWhenBetweenPolls() 2151public async Task DeleteEndpointTerminatesLongPollingWithHangingApplication() 2174var pollTask = dispatcher.ExecuteAsync(context, options, app); 2206public async Task PollCanReceiveFinalMessageAfterAppCompletes() 2258public async Task NegotiateDoesNotReturnWebSocketsWhenNotAvailable() 2284public async Task NegotiateDoesNotReturnUseStatefulReconnectWhenNotEnabledOnServer() 2313public async Task NegotiateDoesNotReturnUseStatefulReconnectWhenEnabledOnServerButNotRequestedByClient() 2342public async Task NegotiateReturnsUseStatefulReconnectWhenEnabledOnServerAndRequestedByClient() 2371public async Task ReconnectStopsPreviousConnection() 2392var initialWebSocketTask = dispatcher.ExecuteAsync(context, options, app); 2414return Task.CompletedTask; 2422var newWebSocketTask = dispatcher.ExecuteAsync(context, options, app); 2446public async Task DisableReconnectDisallowsReplacementConnection() 2466var initialWebSocketTask = dispatcher.ExecuteAsync(context, options, app); 2488return Task.CompletedTask; 2529public override async Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) 2538public async Task WriteThatIsDisposedBeforeCompleteReturns404() 2580var sendTask = dispatcher.ExecuteAsync(context, options, app); 2586var disposeTask = connection.DisposeAsync().DefaultTimeout(); 2601public async Task CanDisposeWhileWriteLockIsBlockedOnBackpressureAndResponseReturns404() 2643var sendTask = dispatcher.ExecuteAsync(context, options, app); 2658public async Task LongPollingCanPollIfWritePipeHasBackpressure() 2700var sendTask = dispatcher.ExecuteAsync(context, options, app).DefaultTimeout(); 2714public async Task ErrorDuringPollWillCloseConnection() 2745var pollTask = dispatcher.ExecuteAsync(pollContext, options, app); 2757public async Task LongPollingConnectionClosingTriggersConnectionClosedToken() 2780var pollTask = dispatcher.ExecuteAsync(context, options, app); 2814public async Task SSEConnectionClosingTriggersConnectionClosedToken() 2840public async Task WebSocketConnectionClosingTriggersConnectionClosedToken() 2870public async Task ServerClosingClosesWebSocketConnection() 2889var executeTask = dispatcher.ExecuteAsync(context, options, app); 2918public async Task AbortingConnectionAbortsHttpContextAndTriggersConnectionClosedToken() 2951public async Task ServicesAvailableWithLongPolling() 2975var pollTask = dispatcher.ExecuteAsync(pollContext, options, app); 3002public async Task ServicesPreserveScopeWithLongPolling() 3032var pollTask = dispatcher.ExecuteAsync(pollContext, options, app); 3057public async Task DisposeLongPollingConnectionDisposesServiceScope() 3104public async Task LongRunningActivityTagSetOnExecuteAsync() 3140public async Task ConnectionClosedRequestedTriggeredOnAuthExpiration() 3161var pollTask = dispatcher.ExecuteAsync(context, options, app); 3192public async Task AuthenticationExpirationSetOnAuthenticatedConnectionWithJWT(HttpTransportType transportType) 3227return Task.CompletedTask; 3269AccessTokenProvider = () => Task.FromResult(token), 3292public async Task AuthenticationExpirationSetOnAuthenticatedConnectionWithCookies(HttpTransportType transportType) 3354public async Task AuthenticationExpirationUsesCorrectScheme(HttpTransportType transportType) 3389return Task.CompletedTask; 3431AccessTokenProvider = () => Task.FromResult(token), 3451public async Task AuthenticationExpirationSetToMaxValueByDefault() 3491public async Task RequestTimeoutDisabledWhenConnected(HttpTransportType transportType) 3564public async Task DisableRequestTimeoutInLongPolling() 3588var pollTask = dispatcher.ExecuteAsync(context, options, app); 3682private static async Task CheckTransportSupported(HttpTransportType supportedTransports, HttpTransportType transportType, int status, ILoggerFactory loggerFactory) 3806public override Task OnConnectedAsync(ConnectionContext connection) 3815public override Task OnConnectedAsync(ConnectionContext connection) 3819return Task.CompletedTask; 3825public override Task OnConnectedAsync(ConnectionContext connection) 3833public override Task OnConnectedAsync(ConnectionContext connection) 3835return Task.CompletedTask; 3841public override async Task OnConnectedAsync(ConnectionContext connection) 3876public Task Started => _startedTcs.Task; 3878public override async Task OnConnectedAsync(ConnectionContext connection) 3903public override async Task OnConnectedAsync(ConnectionContext connection) 3933public override async Task OnConnectedAsync(ConnectionContext connection) 3960public override async Task OnConnectedAsync(ConnectionContext connection) 3990public override async Task OnConnectedAsync(ConnectionContext connection) 4032private Task NotifyReconnect(PipeWriter writer) 4037return Task.CompletedTask; 4043public override void OnCompleted(Func<object, Task> callback, object state) 4047public override void OnStarting(Func<object, Task> callback, object state)
HttpConnectionManagerTests.cs (18)
71public async Task DisposingConnectionsClosesBothSidesOfThePipe(ConnectionStates states) 86connection.ApplicationTask = Task.FromException(new Exception("Application failed")); 87connection.TransportTask = Task.Run(async () => 105connection.TransportTask = Task.FromException<bool>(new Exception("Application failed")); 106connection.ApplicationTask = Task.Run(async () => 115connection.ApplicationTask = Task.CompletedTask; 116connection.TransportTask = Task.FromResult(true); 242public async Task CloseConnectionsEndsAllPendingConnections() 249connection.ApplicationTask = Task.Run(async () => 263connection.TransportTask = Task.Run(async () => 284public async Task DisposingConnectionMultipleTimesWaitsOnConnectionClose() 302await Task.WhenAll(firstTask, secondTask).DefaultTimeout(); 307public async Task DisposingConnectionMultipleGetsExceptionFromTransportOrApp() 334public async Task DisposingConnectionMultipleGetsCancellation() 358public async Task DisposeInactiveConnection() 374public async Task DisposeInactiveConnectionWithNoPipes() 391public async Task ApplicationLifetimeIsHookedUp() 410public async Task ApplicationLifetimeCanStartBeforeHttpConnectionManagerInitialized()
LongPollingTests.cs (4)
21public async Task Set204StatusCodeWhenChannelComplete() 41public async Task Set200StatusCodeWhenTimeoutTokenFires() 63public async Task FrameSentAsSingleResponse() 86public async Task MultipleFramesSentAsSingleResponse()
MapConnectionHandlerTests.cs (5)
385public async Task MapConnectionHandlerWithWebSocketSubProtocolSetsProtocol() 432public override async Task OnConnectedAsync(ConnectionContext connection) 452public override Task OnConnectedAsync(ConnectionContext connection) 460public override Task OnConnectedAsync(ConnectionContext connection) 474public override Task OnConnectedAsync(ConnectionContext connection)
ServerSentEventsMessageFormatterTests.cs (2)
18public async Task WriteTextMessageFromSingleSegment(string encoded, string payload) 30public async Task WriteTextMessageFromMultipleSegments(string encoded, string payload)
ServerSentEventsTests.cs (5)
20public async Task SSESetsContentType() 41public async Task SSETurnsResponseBufferingOff() 62public async Task SSEWritesMessages() 84public async Task SSEWritesVeryLargeMessages() 112public async Task SSEAddsAppropriateFraming(string message, string expected)
src\Shared\SyncPoint\SyncPoint.cs (5)
18public Task WaitForSyncPoint() => _atSyncPoint.Task; 32public Task WaitToContinue() 38public static Func<Task> Create(out SyncPoint syncPoint) 51public static Func<Task> Create(int count, out SyncPoint[] syncPoints) 67return Task.CompletedTask;
TestWebSocketConnectionFeature.cs (6)
34public Task Accepted => _accepted.Task; 50return Task.FromResult<WebSocket>(serverSocket); 94public override async Task CloseAsync(WebSocketCloseStatus closeStatus, string statusDescription, CancellationToken cancellationToken) 109public override async Task CloseOutputAsync(WebSocketCloseStatus closeStatus, string statusDescription, CancellationToken cancellationToken) 191public override async Task SendAsync(ArraySegment<byte> buffer, WebSocketMessageType messageType, bool endOfMessage, CancellationToken cancellationToken) 253private async Task SendMessageAsync(WebSocketMessage webSocketMessage, CancellationToken cancellationToken)
WebSocketsTests.cs (19)
29public async Task ReceivedFramesAreWrittenToChannel(string webSocketMessageType) 41var transport = ws.ProcessSocketAsync(await feature.AcceptAsync()); 76public async Task WebSocketTransportSetsMessageTypeBasedOnTransferFormatFeature(TransferFormat transferFormat, string expectedMessageType) 89var transport = ws.ProcessSocketAsync(await feature.AcceptAsync()); 118public async Task TransportCommunicatesErrorToApplicationWhenClientDisconnectsAbnormally() 127async Task CompleteApplicationAfterTransportCompletes() 149var transport = ws.ProcessSocketAsync(await feature.AcceptAsync()); 170public async Task ClientReceivesInternalServerErrorWhenTheApplicationFails() 182var transport = ws.ProcessSocketAsync(await feature.AcceptAsync()); 201public async Task TransportClosesOnCloseTimeoutIfClientDoesNotSendCloseFrame() 219var transport = ws.ProcessSocketAsync(serverSocket); 235public async Task TransportFailsOnTimeoutWithErrorWhenApplicationFailsAndClientDoesNotSendCloseFrame() 253var transport = ws.ProcessSocketAsync(serverSocket); 269public async Task ServerGracefullyClosesWhenApplicationEndsThenClientSendsCloseFrame() 288var transport = ws.ProcessSocketAsync(serverSocket); 308public async Task ServerGracefullyClosesWhenClientSendsCloseFrameThenApplicationEnds() 327var transport = ws.ProcessSocketAsync(serverSocket); 347public async Task SubProtocolSelectorIsUsedToSelectSubProtocol() 399public async Task MultiSegmentSendWillNotSendEmptyEndOfMessageFrame()
Microsoft.AspNetCore.Http.Extensions (76)
HttpResponseJsonExtensions.cs (14)
35public static Task WriteAsJsonAsync<TValue>( 57public static Task WriteAsJsonAsync<TValue>( 79public static Task WriteAsJsonAsync<TValue>( 112public static Task WriteAsJsonAsync<TValue>( 131static async Task WriteAsJsonAsyncSlow(HttpResponse response, TValue value, JsonTypeInfo<TValue> jsonTypeInfo) 152public static Task WriteAsJsonAsync( 172static async Task WriteAsJsonAsyncSlow(HttpResponse response, object? value, JsonTypeInfo jsonTypeInfo) 184private static async Task WriteAsJsonAsyncSlow<TValue>( 208public static Task WriteAsJsonAsync( 231public static Task WriteAsJsonAsync( 254public static Task WriteAsJsonAsync( 280private static async Task WriteAsJsonAsyncSlow( 305public static Task WriteAsJsonAsync( 327async Task WriteAsJsonAsyncSlow()
RequestDelegateFactory.cs (44)
106private static readonly MemberExpression CompletedTaskExpr = Expression.Property(null, (PropertyInfo)GetMemberInfo<Func<Task>>(() => Task.CompletedTask)); 314private static Func<object?, HttpContext, Task>? CreateTargetableRequestDelegate( 522if (returnType == typeof(Task)) 1074if (returnType == typeof(Task)) 1225private static Func<object?, HttpContext, Task> HandleRequestBodyAndCompileRequestDelegate(Expression responseWritingMethodCall, RequestDelegateFactoryContext factoryContext) 1232var continuation = Expression.Lambda<Func<object?, HttpContext, object?[], Task>>( 1252return Expression.Lambda<Func<object?, HttpContext, Task>>( 1266private static Func<object?, HttpContext, Task> HandleRequestBodyAndCompileRequestDelegateForJson(Expression responseWritingMethodCall, RequestDelegateFactoryContext factoryContext) 1280var continuation = Expression.Lambda<Func<object?, HttpContext, object?, object?[], Task>>( 1317var continuation = Expression.Lambda<Func<object?, HttpContext, object?, Task>>( 1399private static Func<object?, HttpContext, Task> HandleRequestBodyAndCompileRequestDelegateForForm( 1415var continuation = Expression.Lambda<Func<object?, HttpContext, object?, object?[], Task>>( 1449var continuation = Expression.Lambda<Func<object?, HttpContext, object?, Task>>( 2359private static Task ExecuteValueTaskOfObject(ValueTask<object> valueTask, HttpContext httpContext, JsonTypeInfo<object> jsonTypeInfo) 2361static async Task ExecuteAwaited(ValueTask<object> valueTask, HttpContext httpContext, JsonTypeInfo<object> jsonTypeInfo) 2374private static Task ExecuteTaskOfObject(Task<object> task, HttpContext httpContext, JsonTypeInfo<object> jsonTypeInfo) 2376static async Task ExecuteAwaited(Task<object> task, HttpContext httpContext, JsonTypeInfo<object> jsonTypeInfo) 2389private static Task ExecuteAwaitedReturn(object obj, HttpContext httpContext, JsonTypeInfo<object> jsonTypeInfo) 2394private static Task ExecuteTaskOfTFast<T>(Task<T> task, HttpContext httpContext, JsonTypeInfo<T> jsonTypeInfo) 2398static async Task ExecuteAwaited(Task<T> task, HttpContext httpContext, JsonTypeInfo<T> jsonTypeInfo) 2411private static Task ExecuteTaskOfT<T>(Task<T> task, HttpContext httpContext, JsonTypeInfo<T> jsonTypeInfo) 2415static async Task ExecuteAwaited(Task<T> task, HttpContext httpContext, JsonTypeInfo<T> jsonTypeInfo) 2428private static Task ExecuteTaskOfString(Task<string?> task, HttpContext httpContext) 2433static async Task ExecuteAwaited(Task<string> task, HttpContext httpContext) 2446private static Task ExecuteWriteStringResponseAsync(HttpContext httpContext, string text) 2452private static Task ExecuteValueTask(ValueTask task) 2454static async Task ExecuteAwaited(ValueTask task) 2462return Task.CompletedTask; 2468private static ValueTask<object?> ExecuteTaskWithEmptyResult(Task task) 2470static async ValueTask<object?> ExecuteAwaited(Task task) 2501private static Task ExecuteValueTaskOfTFast<T>(ValueTask<T> task, HttpContext httpContext, JsonTypeInfo<T> jsonTypeInfo) 2503static async Task ExecuteAwaited(ValueTask<T> task, HttpContext httpContext, JsonTypeInfo<T> jsonTypeInfo) 2516private static Task ExecuteValueTaskOfT<T>(ValueTask<T> task, HttpContext httpContext, JsonTypeInfo<T> jsonTypeInfo) 2518static async Task ExecuteAwaited(ValueTask<T> task, HttpContext httpContext, JsonTypeInfo<T> jsonTypeInfo) 2531private static Task ExecuteValueTaskOfString(ValueTask<string?> task, HttpContext httpContext) 2535static async Task ExecuteAwaited(ValueTask<string> task, HttpContext httpContext) 2548private static Task ExecuteValueTaskResult<T>(ValueTask<T?> task, HttpContext httpContext) where T : IResult 2550static async Task ExecuteAwaited(ValueTask<T> task, HttpContext httpContext) 2563private static async Task ExecuteTaskResult<T>(Task<T?> task, HttpContext httpContext) where T : IResult 2570private static async Task ExecuteResultWriteResponse(IResult? result, HttpContext httpContext) 2577private static Task WriteJsonResponseFast<T>(HttpResponse response, T value, JsonTypeInfo<T> jsonTypeInfo) 2580private static Task WriteJsonResponse<T>(HttpResponse response, T? value, JsonTypeInfo<T> jsonTypeInfo) 2775private static void EnsureRequestTaskNotNull(Task? task)
SendFileResponseExtensions.cs (6)
25public static Task SendFileAsync(this HttpResponse response, IFileInfo file, CancellationToken cancellationToken = default) 43public static Task SendFileAsync(this HttpResponse response, IFileInfo file, long offset, long? count, CancellationToken cancellationToken = default) 59public static Task SendFileAsync(this HttpResponse response, string fileName, CancellationToken cancellationToken = default) 77public static Task SendFileAsync(this HttpResponse response, string fileName, long offset, long? count, CancellationToken cancellationToken = default) 85private static async Task SendFileAsyncCore(HttpResponse response, IFileInfo file, long offset, long? count, CancellationToken cancellationToken) 112private static async Task SendFileAsyncCore(HttpResponse response, string fileName, long offset, long? count, CancellationToken cancellationToken = default)
src\Http\Shared\StreamCopyOperationInternal.cs (2)
20public static Task CopyToAsync(Stream source, Stream destination, long? count, CancellationToken cancel) 32public static async Task CopyToAsync(Stream source, Stream destination, long? count, int bufferSize, CancellationToken cancel)
src\Shared\ObjectMethodExecutor\ObjectMethodExecutorFSharpSupport.cs (6)
39/// or to a <see cref="Task"/>, if <c>TResult</c> is <see href="https://fsharp.github.io/fsharp-core-docs/reference/fsharp-core-unit-0.html">FSharp.Core.Unit</see>. 49/// to a <see cref="Task{TResult}"/>, or to a <see cref="Task"/>, if <c>TResult</c> is <see href="https://fsharp.github.io/fsharp-core-docs/reference/fsharp-core-unit-0.html">FSharp.Core.Unit</see>; 53/// When this method returns, contains the type of the closed generic instantiation of <see cref="Task{TResult}"/> or of <see cref="Task"/> that will be returned 114/// to a void-returning <see cref="Task"/> or <see cref="ValueTask"/>. 145var typeDef when typeDef == typeof(Task<>) && IsFSharpUnit(genericAwaitableType.GetGenericArguments()[0]) => (typeof(Task), MakeTaskOfUnitToTaskExpression(genericAwaitableType)), 155return Expression.Lambda(Expression.Convert(closedGenericTaskParam, typeof(Task)), closedGenericTaskParam);
src\Shared\RouteHandlers\ExecuteHandlerHelper.cs (2)
12public static Task ExecuteReturnAsync(object obj, HttpContext httpContext, JsonTypeInfo<object> jsonTypeInfo) 39public static Task WriteJsonResponseAsync<T>(HttpResponse response, T? value, JsonTypeInfo<T> jsonTypeInfo)
StreamCopyOperation.cs (2)
18public static Task CopyToAsync(Stream source, Stream destination, long? count, CancellationToken cancel) 28public static Task CopyToAsync(Stream source, Stream destination, long? count, int bufferSize, CancellationToken cancel)
Microsoft.AspNetCore.Http.Extensions.Tests (477)
HttpRequestJsonExtensionsTests.cs (14)
35public async Task ReadFromJsonAsyncGeneric_NonJsonContentType_ThrowError() 50public async Task ReadFromJsonAsyncGeneric_NoBodyContent_ThrowError() 65public async Task ReadFromJsonAsyncGeneric_ValidBodyContent_ReturnValue() 80public async Task ReadFromJsonAsyncGeneric_WithOptions_ReturnValue() 101public async Task ReadFromJsonAsyncGeneric_Utf8Encoding_ReturnValue() 119public async Task ReadFromJsonAsyncGeneric_Utf16Encoding_ReturnValue() 134public async Task ReadFromJsonAsyncGeneric_WithCancellationToken_CancellationRaised() 154public async Task ReadFromJsonAsyncGeneric_InvalidEncoding_ThrowError() 168public async Task ReadFromJsonAsync_ValidBodyContent_ReturnValue() 183public async Task ReadFromJsonAsync_Utf16Encoding_ReturnValue() 198public async Task ReadFromJsonAsync_InvalidEncoding_ThrowError() 212public async Task ReadFromJsonAsync_WithOptions_ReturnValue() 233public async Task ReadFromJsonAsync_WithTypeInfo_ReturnValue() 255public async Task ReadFromJsonAsync_WithGenericTypeInfo_ReturnValue()
HttpResponseJsonExtensionsTests.cs (28)
18public async Task WriteAsJsonAsyncGeneric_SimpleValue_JsonResponse() 37public async Task WriteAsJsonAsyncGeneric_NullValue_JsonResponse() 55public async Task WriteAsJsonAsyncGeneric_WithOptions_JsonResponse() 88public async Task WriteAsJsonAsyncGeneric_CustomStatusCode_StatusCodeUnchanged() 105public async Task WriteAsJsonAsyncGeneric_WithContentType_JsonResponseWithCustomContentType() 120public async Task WriteAsJsonAsyncGeneric_WithCancellationToken_CancellationRaised() 129var writeTask = context.Response.WriteAsJsonAsync(1, cts.Token); 139public async Task WriteAsJsonAsyncGeneric_ObjectWithStrings_CamcelCaseAndNotEscaped() 159public async Task WriteAsJsonAsync_SimpleValue_JsonResponse() 178public async Task WriteAsJsonAsync_NullValue_JsonResponse() 196public async Task WriteAsJsonAsync_NullType_ThrowsArgumentNullException() 208public async Task WriteAsJsonAsync_NullResponse_ThrowsArgumentNullException() 220public async Task WriteAsJsonAsync_ObjectWithStrings_CamcelCaseAndNotEscaped() 240public async Task WriteAsJsonAsync_CustomStatusCode_StatusCodeUnchanged() 257public async Task WriteAsJsonAsyncGeneric_AsyncEnumerable() 275await Task.Yield(); 282public async Task WriteAsJsonAsync_AsyncEnumerable() 300await Task.Yield(); 307public async Task WriteAsJsonAsyncGeneric_AsyncEnumerable_ClosedConnecton() 330await Task.Yield(); 341public async Task WriteAsJsonAsync_AsyncEnumerable_ClosedConnecton() 364await Task.Yield(); 375public async Task WriteAsJsonAsync_AsyncEnumerable_UserPassedTokenThrows() 398await Task.Yield(); 409public async Task WriteAsJsonAsyncGeneric_AsyncEnumerable_UserPassedTokenThrows() 432await Task.Yield(); 443public async Task WriteAsJsonAsyncGeneric_WithJsonTypeInfo_JsonResponse() 464public async Task WriteAsJsonAsync_NullValue_WithJsonTypeInfo_JsonResponse()
ParameterBindingMethodCacheTests.cs (7)
219public async Task FindBindAsyncMethod_FindsCorrectMethodOnClass() 250public async Task FindBindAsyncMethod_FindsSingleArgBindAsync() 381public async Task FindBindAsyncMethod_FindsForClassImplicitlyImplementingIBindableFromHttpContext() 399public async Task FindBindAsyncMethod_FindsForClassExplicitlyImplementingIBindableFromHttpContext() 417public async Task FindBindAsyncMethod_FindsFallbackMethodWhenPreferredMethodsReturnTypeIsWrong() 433public async Task FindBindAsyncMethod_FindsFallbackMethodFromInheritedWhenPreferredMethodIsInvalid() 449public async Task FindBindAsyncMethod_FindsMethodFromStaticAbstractInterfaceWhenValidNonInterfaceMethodAlsoExists()
ProblemDetailsDefaultWriterTest.cs (16)
22public async Task WriteAsync_Works() 60public async Task WriteAsync_Works_ProperCasing() 92public async Task WriteAsync_Works_ProperCasing_ValidationProblemDetails() 124public async Task WriteAsync_Works_WhenReplacingProblemDetailsUsingSetter() 165public async Task WriteAsync_Works_WithJsonContext() 205public async Task WriteAsync_Works_WithMultipleJsonContext() 245public async Task WriteAsync_Works_WithHttpValidationProblemDetails() 285public async Task WriteAsync_Works_WithHttpValidationProblemDetails_AndJsonContext() 328public async Task WriteAsync_Works_WithCustomDerivedProblemDetails() 371public async Task WriteAsync_Works_WithCustomDerivedProblemDetails_AndJsonContext() 414public async Task WriteAsync_Works_WithCustomDerivedProblemDetails_AndMultipleJsonContext() 457public async Task WriteAsync_AddExtensions() 500public async Task WriteAsync_AddExtensions_WithJsonContext() 546public async Task WriteAsync_Applies_Defaults() 568public async Task WriteAsync_Applies_CustomConfiguration() 608public async Task WriteAsync_UsesStatusCode_FromProblemDetails_WhenSpecified(
ProblemDetailsServiceTest.cs (6)
11public async Task WriteAsync_Skip_NextWriters_WhenResponseAlreadyStarted() 37public async Task TryWriteAsync_ReturnsTrue_WhenAtLeastOneWriterCanWrite() 64public async Task WriteAsync_Throws_WhenNoWriterRegistered() 79public async Task WriteAsync_Throws_WhenNoWriterCanWrite() 95public async Task TryWriteAsync_ReturnsFalse_WhenNoWriterRegistered() 114public async Task TryWriteAsync_ReturnsFalse_WhenNoWriterCanWrite()
RequestDelegateFactoryTests.cs (100)
54Task TaskTestAction(HttpContext httpContext) 57return Task.CompletedTask; 71Task StaticTaskTestAction(HttpContext httpContext) 74return Task.CompletedTask; 91new object[] { (Func<HttpContext, Task>)TaskTestAction }, 94new object[] { (Func<HttpContext, Task>)StaticTaskTestAction }, 102public async Task RequestDelegateInvokesAction(Delegate @delegate) 131public async Task StaticMethodInfoOverloadWorksWithBasicReflection() 164public async Task NonStaticMethodInfoOverloadWorksWithBasicReflection() 238public async Task NullRouteParametersPrefersRouteOverQueryString() 267public async Task CreatingDelegateWithInstanceMethodInfoCreatesInstancePerCall() 478await Task.Yield(); 496await Task.Yield(); 579public async Task RequestDelegateHandlesDoesNotHandleArraysFromQueryStringWhenBodyIsInferred(Delegate action, string[]? queryValues, object? expectedParameterValue) 601public async Task RequestDelegateHandlesOptionalArraysFromNullQueryString() 625public async Task RequestDelegateHandlesNullableStringValuesFromExplicitQueryStringSource() 660public async Task RequestDelegateHandlesNullableStringValuesFromExplicitQueryStringSourceForUnpresentedValues() 688public async Task RequestDelegateCanAwaitValueTasksThatAreNotImmediatelyCompleted() 743public async Task RequestDelegateThrowsForTryParsableFailuresIfThrowOnBadRequestWithNonOptionalArrays() 841public async Task RequestDelegatePopulatesFromBodyParameter(Delegate action) 884public async Task RequestDelegateRejectsEmptyBodyGivenExplicitFromBodyParameter(Delegate action) 1135public async Task RequestDelegateRequiresServiceForAllImplicitFromServiceParameters(Delegate action) 1151public async Task RequestDelegateWithExplicitFromServiceParameters(Delegate action) 1168public async Task RequestDelegatePopulatesParametersFromServiceWithAndWithoutAttribute(Delegate action) 1193public async Task RequestDelegatePopulatesHttpContextParameterWithoutAttribute() 1213public async Task RequestDelegatePassHttpContextRequestAbortedAsCancellationToken() 1237public async Task RequestDelegatePassHttpContextUserAsClaimsPrincipal() 1258public async Task RequestDelegatePassHttpContextRequestAsHttpRequest() 1278public async Task RequestDelegatePassesHttpContextRresponseAsHttpResponse() 1309Task<JsonTodo> TaskTestAction() => Task.FromResult<JsonTodo>(originalTodo); 1312await Task.Yield(); 1319await Task.Yield(); 1339public async Task RequestDelegateWritesMembersFromChildTypesToJsonResponseBody_WithJsonPolymorphicOptions(Delegate @delegate) 1371public async Task RequestDelegateWritesJsonTypeDiscriminatorToJsonResponseBody_WithJsonPolymorphicOptions(Delegate @delegate) 1422Task<CustomResult> TaskTestAction() => Task.FromResult(new CustomResult(resultString)); 1427static Task<CustomResult> StaticTaskTestAction() => Task.FromResult(new CustomResult("Still not enough tests!")); 1435static Task<object> StaticTaskOfIResultAsObject() => Task.FromResult<object>(new CustomResult("Still not enough tests!")); 1440Task<StructResult> TaskTestStructAction() => Task.FromResult(new StructResult(resultString)); 1472public async Task RequestDelegateUsesCustomIResult(Delegate @delegate) 1495Task<IResult?> TaskTestAction() => Task.FromResult<IResult?>(null); 1511public async Task RequestDelegateThrowsInvalidOperationExceptionOnNullDelegate(Delegate @delegate, string message) 1556public async Task RequestDelegateHandlesRouteParamOptionality(Delegate @delegate, string paramName, string? routeParam, bool isInvalid, string? expectedResponse) 1661public async Task RequestDelegateHandlesBindAsyncOptionality(Delegate routeHandler, bool includeReferer, bool isInvalid, bool isStruct) 1732public async Task RequestDelegateHandlesServiceParamOptionality(Delegate @delegate, bool hasService, bool isInvalid) 1767public async Task CanSetStringParamAsOptionalWithNullabilityDisability(bool provideValue, string expectedResponse) 1797public async Task CanSetParseableStringParamAsOptionalWithNullabilityDisability(bool provideValue, string expectedResponse) 1827public async Task TreatsUnknownNullabilityAsOptionalForReferenceType(bool provideValue, string expectedResponse) 1857public async Task CanExecuteRequestDelegateWithResultsExtension() 1899public async Task RequestDelegateCanProcessUriValues(Delegate @delegate, string uri, string expectedResponse) 1922public async Task RequestDelegateThrowsBadHttpRequestExceptionWhenReadingOversizeFormResultsIn413BadRequest() 1955public async Task RequestDelegateThrowsBadHttpRequestExceptionWhenReadingOversizeJsonBodyResultsIn413BadRequest() 2150public async Task RequestDelegateFactory_InvokesFilters_OnMethodInfoWithNullTargetFactory() 2186public async Task RequestDelegateFactory_InvokesFilters_OnMethodInfoWithProvidedTargetFactory() 2246await Task.Yield(); 2257await Task.Yield(); 2273public async Task CanInvokeFilter_OnFSharpAsyncOfTReturningHandler(Delegate @delegate) 2315Task TaskMethod() 2317return Task.CompletedTask; 2322return Task.FromResult(default(FSharp.Core.Unit)!); 2332await Task.Yield(); 2335async Task TaskWithYieldMethod() 2337await Task.Yield(); 2346await Task.Yield(); 2356new object[] { (Func<Task>)TaskMethod }, 2360new object[] { (Func<Task>)TaskWithYieldMethod}, 2368public async Task CanInvokeFilter_OnVoidReturningHandler(Delegate @delegate) 2395public async Task CanInvokeFilter_OnTaskModifyingHttpContext() 2399async Task HandlerWithTaskAwait(HttpContext c) 2402await Task.Yield(); 2422var request = requestDelegate(httpContext); 2442await Task.Yield(); 2448return Task.FromResult(new TodoStruct { Name = "Test todo" }); 2453await Task.Yield(); 2468await Task.Yield(); 2487public async Task CanInvokeFilter_OnHandlerReturningTasksOfStruct(Delegate @delegate) 2632var @delegate = () => Task.FromResult(new AddsCustomEndpointMetadataResult()); 2693var @delegate = () => Task.FromResult(new CountsDefaultEndpointMetadataResult()); 2945var @delegate = (Todo todo) => Task.FromResult(new RemovesAcceptsMetadataResult()); 3040RequestDelegate initialRequestDelegate = static (context) => Task.CompletedTask; 3068RequestDelegate requestDelegate = static context => Task.CompletedTask; 3082public async Task RDF_CanAssertOnEmptyResult() 3124public async Task RequestDelegateFactory_AsParameters_SupportsNullableRequiredMember() 3178public async Task RequestDelegateFactory_AsParameters_SupportsRequiredMember_NullabilityDisabled() 3295public Task ExecuteAsync(HttpContext httpContext) => Task.CompletedTask; 3327public Task ExecuteAsync(HttpContext httpContext) => throw new NotImplementedException(); 3337public Task ExecuteAsync(HttpContext httpContext) => throw new NotImplementedException(); 3348public Task ExecuteAsync(HttpContext httpContext) => Task.CompletedTask; 3413public Task ExecuteAsync(HttpContext httpContext) => throw new NotImplementedException(); 3604public Task ExecuteAsync(HttpContext httpContext) 3619public Task ExecuteAsync(HttpContext httpContext) 3745public Task StartAsync(CancellationToken cancellationToken = default) 3748return Task.CompletedTask; 3751public Task CompleteAsync() 3754return Task.CompletedTask; 3757public Task SendFileAsync(string path, long offset, long? count, CancellationToken cancellationToken = default) 3760return Task.CompletedTask; 3767public void OnStarting(Func<object, Task> callback, object state) 3771public void OnCompleted(Func<object, Task> callback, object state)
RequestDelegateFactoryTests.FormMapping.cs (7)
18public async Task SupportsFormMappingOptionsInMetadata() 65public async Task SupportsFormMappingOptionsInMetadataFormFormWithAttributeName() 112public async Task SupportsMergingFormMappingOptionsInMetadata() 178public async Task SupportsFormMappingWithRecordTypes() 208public async Task SupportsRecursiveProperties() 238public async Task SupportsRecursivePropertiesWithRecursionLimit() 286public async Task SupportsFormFileSourcesInDto()
RequestDelegateGenerator\CompileTimeCreationTests.AsParameters.cs (3)
18public async Task RequestDelegateThrowsWhenNullableParameterList(string parameterType) 66public async Task BuildRequestDelegateEmitsDiagnosticForInvalidParameterListConstructor( 92public async Task BuildRequestDelegateThrowsNotSupportedExceptionForNestedParametersList(string parameterType)
RequestDelegateGenerator\CompileTimeCreationTests.cs (22)
20public async Task MapGet_WithRequestDelegate_DoesNotGenerateSources() 36public async Task MapAction_ExplicitRouteParamWithInvalidName_SimpleReturn() 49public async Task SupportsSameInterceptorsFromDifferentFiles() 75public async Task SupportsDifferentInterceptorsFromSameLocation() 101public async Task SupportsMapCallOnNewLine() 152public async Task SourceMapsAllPathsInAttribute() 189public async Task EmitsDiagnosticForUnsupportedAnonymousMethod(bool isAsync) 205public async Task EmitsDiagnosticForGenericTypeParam() 257public async Task EmitsDiagnosticForPrivateOrProtectedTypes(string accessibility) 309public async Task HandlesEndpointsWithAndWithoutDiagnostics() 366public async Task MapAction_BindAsync_NullableReturn() 392public async Task MapAction_BindAsync_StructType() 416public async Task MapAction_NoJsonTypeInfoResolver_ThrowsException() 447public async Task RequestDelegateThrowsInvalidOperationExceptionOnNullDelegate(string innerSource, string message) 464public async Task AwaitableRequestDelegateThrowsNullReferenceExceptionOnUnannotatedNullDelegate(string innerSource) 481public async Task SupportsHandlersWithSameSignatureButDifferentParameterNames(string sourceAttribute) 536public async Task SupportsHandlersWithSameSignatureButDifferentParameterNamesFromInferredJsonBody() 580public async Task MapAction_NoParam_FSharpAsyncReturn_NotCoercedToTaskAtCompileTime(string source) 599public async Task MapAction_NoParam_TaskLikeOfUnitReturn_NotConvertedToVoidReturningAtCompileTime(string source) 616public async Task SkipsMapWithIncorrectNamespaceAndAssembly() 687public async Task TestHandlingOfGenericWithNullableReferenceTypes() 742public async Task RequestDelegateGenerator_SkipsComplexFormParameter()
RequestDelegateGenerator\CompileTimeCreationTests.Routes.cs (3)
8public async Task SupportsRoutePatternInVariable() 31public async Task SupportsRoutePatternInConst() 54public async Task SupportsComputedRoutePattern()
RequestDelegateGenerator\CompileTimeIncrementalityTests.cs (4)
14public async Task MapAction_SameReturnType_DoesNotTriggerUpdate() 31public async Task MapAction_DifferentRoutePattern_DoesNotTriggerUpdate() 48public async Task MapAction_ChangeReturnType_TriggersUpdate() 65public async Task MapAction_ChangeBodyParamNullability_TriggersUpdate_ForSourceOnly()
RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (4)
240internal static async Task VerifyResponseJsonBodyAsync<T>(HttpContext httpContext, Action<T> check, int expectedStatusCode = 200) 252internal static async Task VerifyResponseJsonNodeAsync(HttpContext httpContext, Action<JsonNode> check, int expectedStatusCode = 200, string expectedContentType = "application/json; charset=utf-8") 262internal static async Task VerifyResponseBodyAsync(HttpContext httpContext, string expectedBody, int expectedStatusCode = 200) 346internal async Task VerifyAgainstBaselineUsingFile(Compilation compilation, [CallerMemberName] string callerName = "")
RequestDelegateGenerator\RequestDelegateCreationTests.Arrays.cs (19)
22public async Task MapAction_ExplicitQuery_ComplexTypeArrayParam() 43public async Task MapAction_ExplicitHeader_ComplexTypeArrayParam() 64public async Task MapAction_ExplicitHeader_StringArrayParam() 85public async Task MapAction_ExplicitHeader_NullableStringArrayParam() 156public async Task RequestDelegateHandlesArraysFromQueryString(string typeName, string[] queryValues, object expectedParameterValue) 183public async Task MapAction_ImplicitQuery_ComplexTypeArrayParam() 204public async Task MapAction_ExplicitQuery_StringArrayParam() 225public async Task MapAction_ImplicitQuery_StringArrayParam() 246public async Task MapAction_ImplicitQuery_NullableStringArrayParam_QueryNotPresent() 266public async Task MapAction_ImplicitQuery_NullableStringArrayParam_EmptyQueryValues() 287public async Task MapAction_ExplicitQuery_NullableStringArrayParam() 308public async Task MapAction_ImplicitQuery_NullableStringArrayParam() 329public async Task MapPost_WithArrayQueryString_ShouldFail() 350public async Task MapPost_WithArrayQueryString_AndBody_ShouldUseBody() 377public async Task MapMethods_Post_WithArrayQueryString_AndBody_ShouldUseBody() 404public async Task MapMethods_Get_WithArrayQueryString_AndBody_ShouldUseQueryString() 431public async Task MapMethods_PostAndGet_WithArrayQueryString_AndBody_ShouldUseQueryString() 458public async Task MapMethods_PostAndPut_WithArrayQueryString_AndBody_ShouldUseBody() 484public async Task RequestDelegateHandlesArraysFromExplicitQueryStringSource()
RequestDelegateGenerator\RequestDelegateCreationTests.AsParameters.cs (11)
13public async Task RequestDelegatePopulatesFromRouteParameterBased_FromParameterList() 36public async Task RequestDelegatePopulatesFromQueryParameter_FromParameterList() 80public async Task RequestDelegatePopulatesFromHeaderParameter_FromParameterList(string type) 187public async Task RequestDelegatePopulatesFromParameterList(string innerSource) 208public async Task RequestDelegatePopulatesFromParameterListUsesDefaultValue() 229public async Task VerifyAsParametersBaseline() 263public async Task RequestDelegatePopulatesFromParameterListAndSkipReadOnlyProperties() 295public async Task RequestDelegatePopulatesFromMultipleParameterLists() 323public async Task RequestDelegatePopulatesFromBindAsyncParameterList() 352public async Task RequestDelegatePopulatesFromMetadataProviderParameterList() 369public async Task RequestDelegateFactory_AsParameters_SupportsRequiredMember()
RequestDelegateGenerator\RequestDelegateCreationTests.BindAsync.cs (9)
45public async Task MapAction_BindAsync_Optional_Provided(string bindAsyncType) 66public async Task MapAction_BindAsync_NonOptional_Provided(string bindAsyncType) 87public async Task MapAction_BindAsync_Optional_NotProvided(string bindAsyncType, bool expectException) 117public async Task MapAction_BindAsync_NonOptional_NotProvided(string bindAsyncType, bool expectException) 153public async Task MapAction_BindAsync_Snapshot() 186public async Task MapAction_BindAsync_ExceptionsAreUncaught() 202public async Task BindAsyncWithBodyArgument() 258public async Task BindAsyncRunsBeforeBodyBinding() 314public async Task MapAction_BindAsync_MismatchedNullability()
RequestDelegateGenerator\RequestDelegateCreationTests.cs (18)
27public async Task MapAction_SingleSpecialTypeParam_StringReturn(string parameterType) 48public async Task MapAction_MultipleSpecialTypeParam_StringReturn() 79public async Task MapAction_MultilineLambda() 101public async Task Multiple_MapAction_NoParam_StringReturn() 115public async Task Multiple_MapAction_WithParams_StringReturn() 205public async Task MapAction_ExplicitHeaderParam_SimpleReturn(string source, string requestData, int expectedStatusCode, string expectedBody) 262public async Task MapAction_ExplicitServiceParam_SimpleReturn(string source, bool hasService, bool isValid) 289public async Task MapAction_ExplicitServiceParam_SimpleReturn_Snapshot() 337public async Task MapAction_ExplicitSource_SimpleReturn_Snapshot() 380public async Task CanApplyFiltersOnHandlerWithVariousArguments(string handlerMethod, string expectedBody) 401public async Task CanApplyFiltersOnAsyncHandler() 419public async Task MapAction_InferredTryParse_NonOptional_Provided() 444public async Task RequestDelegateCreation_SupportMapMethods() 470public async Task RequestDelegateCreation_SupportMapMethods_InvalidRequestMethod() 492public async Task RequestDelegateCreation_SupportsMap() 517public async Task RequestDelegateCreation_SupportsMapFallback() 542public async Task RequestDelegateCreation_SupportsMapFallback_NoRoute() 567public async Task RequestDelegateHandlesStringValuesFromExplicitQueryStringSource()
RequestDelegateGenerator\RequestDelegateCreationTests.Filters.cs (14)
15public async Task RequestDelegateInvokesFiltersButNotHandler_OnArgumentError() 43public async Task RequestDelegateInvokesFilters_OnDelegateWithTarget() 77public async Task RequestDelegateCanInvokeSingleEndpointFilter_ThatProvidesCustomErrorMessage() 110public async Task RequestDelegateCanInvokeMultipleEndpointFilters_ThatTouchArguments() 156public async Task RequestDelegateCanInvokeEndpointFilter_ThatUsesMethodInfo() 196public async Task RequestDelegateCanInvokeEndpointFilter_ThatReadsEndpointMetadata() 248public async Task RequestDelegateCanInvokeSingleEndpointFilter_ThatModifiesBodyParameter() 277public async Task RequestDelegateCanInvokeSingleEndpointFilter_ThatModifiesResult() 312public async Task RequestDelegateCanInvokeMultipleEndpointFilters_ThatModifyArgumentsAndResult() 388public async Task CanInvokeFilter_OnTaskOfTReturningHandler(string innerSource) 445public async Task CanInvokeFilter_OnValueTaskOfTReturningHandler(string innerSource) 511public async Task CanInvokeFilter_OnVoidReturningHandler(string innerSource) 534public async Task CanInvokeFilter_OnVoidReturningHandler_WithModifyingResult(string innerSource) 602public async Task CanInvokeFilter_OnHandlerReturningTasksOfStruct(string innerSource)
RequestDelegateGenerator\RequestDelegateCreationTests.Forms.cs (28)
19public async Task RequestDelegatePopulatesFromIFormFileCollectionParameter() 54public async Task RequestDelegatePopulatesFromIFormFileCollectionParameterWithAttribute() 89public async Task RequestDelegatePopulatesFromIFormFileParameter() 119public async Task RequestDelegatePopulatesFromOptionalIFormFileParameter() 157public async Task RequestDelegatePopulatesFromMultipleRequiredIFormFileParameters() 200public async Task RequestDelegatePopulatesFromOptionalMissingIFormFileParameter() 243public async Task RequestDelegatePopulatesFromIFormFileParameterWithMetadata() 273public async Task RequestDelegatePopulatesFromIFormFileAndBoundParameter() 315public async Task RequestDelegateRejectsNonFormContent(bool shouldThrow) 331var request = requestDelegate(httpContext); 352public async Task RequestDelegateSets400ResponseIfRequiredFileNotSpecified() 380public async Task RequestDelegatePopulatesFromBothFormFileCollectionAndFormFileParameters() 427public async Task RequestDelegatePopulatesFromIFormFileParameterIfRequestContainsSecureHeader( 469public async Task RequestDelegatePopulatesFromIFormFileParameterIfRequestHasClientCertificate() 533public async Task RequestDelegatePopulatesFromIFormCollectionParameter(HttpContent content, string contentType) 580public async Task RequestDelegatePopulatesFromIFormCollectionParameterWithAttribute(HttpContent content, string contentType) 627public async Task RequestDelegatePopulatesFromOptionalFormParameter(HttpContent content, string contentType) 655public async Task RequestDelegatePopulatesFromMultipleRequiredFormParameters(HttpContent content, string contentType) 688public async Task RequestDelegatePopulatesFromOptionalMissingFormParameter(HttpContent content, string contentType) 719public async Task RequestDelegatePopulatesFromFormParameterWithMetadata(HttpContent content, string contentType) 748public async Task RequestDelegatePopulatesFromFormAndBoundParameter(HttpContent content, string contentType) 809public async Task RequestDelegatePopulatesFromBothIFormCollectionAndIFormFileParameters(string innerSource) 858public async Task RequestDelegateSets400ResponseIfRequiredFormItemNotSpecified(HttpContent content, string contentType) 884public async Task RequestDelegatePopulatesTryParsableParametersFromForm() 911public async Task RequestDelegateLogsIOExceptionsForFormAsDebugDoesNotAbortAndNeverThrows(bool throwOnBadRequests) 948public async Task RequestDelegateLogsMalformedFormAsDebugAndSets400Response() 982public async Task RequestDelegateThrowsForMalformedFormIfThrowOnBadRequest() 1022public async Task RequestDelegateValidateGeneratedFormCode()
RequestDelegateGenerator\RequestDelegateCreationTests.JsonBody.cs (10)
79public async Task MapAction_ExplicitBodyParam_ComplexReturn(string source, Todo requestData, int expectedStatusCode, string expectedBody) 98public async Task MapAction_ExplicitBodyParam_ComplexReturn_Returns400ForEmptyBody() 114public async Task MapAction_ExplicitBodyParam_ComplexReturn_Snapshot() 221public async Task RequestDelegatePopulatesFromImplicitRawBodyParameter(string source) 261public async Task RequestDelegatePopulatesFromExplicitRawBodyParameter(string source) 302public async Task RequestDelegatePopulatesFromImplicitRawBodyParameterPipeReader(string source) 343public async Task RequestDelegatePopulatesFromExplicitRawBodyParameterPipeReader(string source) 383public async Task RequestDelegateAllowsEmptyBodyStructGivenCorrectlyConfiguredFromBodyParameter() 408public async Task RequestDelegateHandlesRequiredBodyStruct() 456public async Task AllowEmptyOverridesOptionality(string innerSource, bool allowsEmptyRequest)
RequestDelegateGenerator\RequestDelegateCreationTests.JsonBodyOrService.cs (5)
45public async Task MapAction_JsonBodyOrService_SimpleReturn(string source, bool hasBody, Todo requestData, bool hasService, int expectedStatusCode, string expectedBody) 65public async Task MapAction_JsonBodyOrService_HandlesBothJsonAndService() 112public async Task RequestDelegateHandlesBodyParamOptionality(string innerSource, bool hasBody, bool isInvalid, string expectedBody) 184public async Task RequestDelegateRejectsEmptyBodyGivenImplicitFromBodyParameter(string innerSource) 208public async Task SupportsResolvingImplicitServiceWithJsonSupportOn()
RequestDelegateGenerator\RequestDelegateCreationTests.KeyServices.cs (10)
13public async Task SupportsSingleKeyedServiceWithStringKey() 30public async Task ThrowsIfKeyedAndNonKeyedAttributesOnSameParameter() 53public async Task SupportsKeyedServicesWithNullAndStringEmptyKeys() 79public async Task SupportsSingleKeyedServiceWithCharKey() 99public async Task SupportsSingleKeyedServiceWithPrimitiveKeyTypes(object key) 116public async Task ThrowsForUnregisteredRequiredKeyService() 132public async Task DoesNotThrowForUnregisteredOptionalKeyService() 148public async Task SupportsMultipleKeyedServiceWithStringKey() 174public async Task SupportsMultipleKeyedAndNonKeyedServices() 204public async Task ThrowsIfDiContainerDoesNotSupportKeyedServices()
RequestDelegateGenerator\RequestDelegateCreationTests.Logging.cs (17)
17public async Task RequestDelegateLogsStringValuesFromExplicitQueryStringSourceForUnpresentedValuesFailuresAsDebugAndSets400Response() 83public async Task RequestDelegateLogsTryParsableFailuresAsDebugAndSets400Response() 131public async Task RequestDelegateThrowsForTryParsableFailuresIfThrowOnBadRequest() 169public async Task RequestDelegateThrowsForTryParsableFailuresIfThrowOnBadRequestWithArrays() 206public async Task RequestDelegateLogsBindAsyncFailuresAndSets400Response() 250public async Task RequestDelegateThrowsForBindAsyncFailuresIfThrowOnBadRequest() 286public async Task RequestDelegateLogsSingleArgBindAsyncFailuresAndSets400Response() 330public async Task RequestDelegateThrowsForSingleArgBindAsyncFailuresIfThrowOnBadRequest() 367public async Task RequestDelegateRejectsNonJsonContent(bool shouldThrow) 388var request = endpoint.RequestDelegate(httpContext); 413public async Task RequestDelegateWithBindAndImplicitBodyRejectsNonJsonContent(bool shouldThrow) 437var request = endpoint.RequestDelegate(httpContext); 462public async Task RequestDelegateLogsIOExceptionsAsDebugDoesNotAbortAndNeverThrows(bool throwOnBadRequests) 499public async Task RequestDelegateLogsJsonExceptionsAsDebugAndSets400Response() 540public async Task RequestDelegateThrowsForJsonExceptionsIfThrowOnBadRequest() 580public async Task RequestDelegateLogsMalformedJsonAsDebugAndSets400Response() 620public async Task RequestDelegateThrowsForMalformedJsonIfThrowOnBadRequest()
RequestDelegateGenerator\RequestDelegateCreationTests.Metadata.cs (33)
26public async Task MapAction_ReturnsString_Has_Metadata() 42public async Task MapAction_ReturnsTodo_Has_Metadata() 58public async Task MapAction_ReturnsVoid_Has_No_Metadata() 72public async Task MapAction_ReturnsTaskOfString_Has_Metadata() 86public async Task MapAction_ReturnsTask_Has_No_Metadata() 98public async Task MapAction_ReturnsValueTaskOfString_Has_Metadata() 112public async Task MapAction_ReturnsValueTask_Has_No_Metadata() 124public async Task MapAction_ReturnsValidationProblemResult_Has_Metadata() 140public async Task MapAction_TakesCustomMetadataEmitter_Has_Metadata() 155public async Task MapAction_ReturnsCustomMetadataEmitter_Has_Metadata() 168public async Task Create_AddJsonResponseType_AsMetadata() 182public async Task Create_AddPlaintextResponseType_AsMetadata() 196public async Task Create_DiscoversMetadata_FromParametersImplementingIEndpointParameterMetadataProvider() 212public async Task Create_DiscoversMetadata_FromParametersImplementingIEndpointMetadataProvider() 227public async Task Create_DiscoversEndpointMetadata_FromReturnTypeImplementingIEndpointMetadataProvider() 242public async Task Create_DiscoversEndpointMetadata_FromTaskWrappedReturnTypeImplementingIEndpointMetadataProvider() 257public async Task Create_DiscoversEndpointMetadata_FromValueTaskWrappedReturnTypeImplementingIEndpointMetadataProvider() 272public async Task Create_AllowsRemovalOfDefaultMetadata_ByReturnTypesImplementingIEndpointMetadataProvider() 288public async Task Create_AllowsRemovalOfDefaultMetadata_ByTaskWrappedReturnTypesImplementingIEndpointMetadataProvider() 303public async Task Create_AllowsRemovalOfDefaultMetadata_ByValueTaskWrappedReturnTypesImplementingIEndpointMetadataProvider() 318public async Task Create_AllowsRemovalOfDefaultMetadata_ByParameterTypesImplementingIEndpointParameterMetadataProvider() 333public async Task Create_AllowsRemovalOfDefaultMetadata_ByParameterTypesImplementingIEndpointMetadataProvider() 348public async Task Create_SetsApplicationServices_OnEndpointMetadataContext() 368public async Task Create_SetsApplicationServices_OnEndpointParameterMetadataContext() 388public async Task Create_CombinesDefaultMetadata_AndMetadataFromReturnTypesImplementingIEndpointMetadataProvider() 404public async Task Create_CombinesDefaultMetadata_AndMetadataFromTaskWrappedReturnTypesImplementingIEndpointMetadataProvider() 421public async Task AndMetadataFromValueTaskWrappedReturnTypesImplementingIEndpointMetadataProvider() 438public async Task Create_CombinesDefaultMetadata_AndMetadataFromParameterTypesImplementingIEndpointParameterMetadataProvider() 454public async Task Create_CombinesDefaultMetadata_AndMetadataFromParameterTypesImplementingIEndpointMetadataProvider() 470public async Task Create_CombinesDefaultMetadata_AndMetadataFromParameterTypesImplementingIEndpointMetadataProvider_AndNonMetadataProviderParameter() 486public async Task Create_FlowsRoutePattern_ToMetadataProvider() 501public async Task InferMetadata_ThenCreate_CombinesAllMetadata_InCorrectOrder() 542public async Task Create_CombinesPropertiesAsParameterMetadata_AndTopLevelParameter()
RequestDelegateGenerator\RequestDelegateCreationTests.QueryParameters.cs (5)
38public async Task RequestDelegateHandlesQueryParamOptionality(string innerSource, string paramName, string queryParam, bool isInvalid, string expectedResponse) 84public async Task MapAction_SingleNullableStringParam_WithEmptyQueryStringValueProvided_StringReturn() 108public async Task MapAction_MultipleStringParam_StringReturn() 129public async Task MapAction_ExplicitParsableParameter_StringReturn() 164public async Task MapAction_ExplicitQueryParam_NameTest(string name, string lookupName)
RequestDelegateGenerator\RequestDelegateCreationTests.Responses.cs (24)
26public async Task MapAction_NoParam_StringReturn(string source, string httpMethod, string expectedBody) 42public async Task MapAction_NoParam_StringReturn_WithFilter() 73public async Task MapAction_NoParam_AnyReturn(string source, string expectedBody) 106public async Task MapAction_NoParam_ComplexReturn(string source) 130public async Task MapAction_NoParam_ExtensionResult(string source) 158public async Task MapAction_NoParam_TaskOfTReturn(string source, string expectedBody) 183public async Task MapAction_NoParam_ValueTaskOfTReturn(string source, string expectedBody) 211public async Task MapAction_NoParam_TaskLikeOfObjectReturn(string source, string expectedBody) 228public async Task MapAction_HandlesCompletedTaskReturn() 296public async Task RequestDelegateWritesAsJsonResponseBody_WithJsonSerializerContext(string delegateName, string delegateSource) 327public async Task RequestDelegateWritesAsJsonResponseBody_UnspeakableType(bool useJsonContext) 367public async Task RequestDelegateWritesAsJsonResponseBody_UnspeakableType_InFilter(bool useJsonContext) 398public async Task SupportsIResultWithExplicitInterfaceImplementation() 458public async Task RequestDelegateWritesComplexReturnValueAsJsonResponseBody(string source) 475public async Task RequestDelegateWritesComplexStructReturnValueAsJsonResponseBody() 560public async Task RequestDelegateWritesMembersFromChildTypesToJsonResponseBody(string source) 640public async Task RequestDelegateWritesMembersFromChildTypesToJsonResponseBody_WithJsonPolymorphicOptionsAndConfiguredJsonOptions(string source) 663public async Task RequestDelegateWritesJsonTypeDiscriminatorToJsonResponseBody_WithJsonPolymorphicOptionsAndConfiguredJsonOptions(string source) 751public async Task RequestDelegateWritesStringReturnValueAndSetContentTypeWhenNull(string source) 770public async Task RequestDelegateWritesStringReturnDoNotChangeContentType(string source) 828public async Task RequestDelegateWritesBoolReturnValue(string source) 884public async Task RequestDelegateWritesIntReturnValue(string source) 966public async Task RequestDelegateWritesNullReturnNullValue(string source) 986public async Task MapAction_ProducesCorrectContentType(string source, string expectedContentType)
RequestDelegateGenerator\RequestDelegateCreationTests.RouteParameter.cs (7)
45public async Task MapAction_ExplicitRouteParam_SimpleReturn(string source, string requestData, int expectedStatusCode, string expectedBody) 105public async Task MapAction_RouteOrQueryParam_SimpleReturn(string source, bool hasRoute, bool hasQuery, int expectedStatusCode, string expectedBody) 126public async Task SpecifiedQueryParametersDoNotFallbackToRouteValues() 143public async Task SpecifiedRouteParametersDoNotFallbackToQueryString() 180public async Task MapAction_ExplicitRouteParam_RouteNames(string routeParameterName) 193public async Task Returns400IfNoMatchingRouteValueForRequiredParam() 212public async Task RequestDelegatePopulatesFromRouteParameterBasedOnParameterName()
RequestDelegateGenerator\RequestDelegateCreationTests.SpecialTypes.cs (8)
25public async Task RequestDelegatePopulatesHttpContextParameterWithoutAttribute() 44public async Task RequestDelegatePassHttpContextRequestAbortedAsCancellationToken() 67public async Task RequestDelegatePassHttpContextUserAsClaimsPrincipal() 88public async Task RequestDelegatePassHttpContextRequestAsHttpRequest() 107public async Task RequestDelegatePassesHttpContextResponseAsHttpResponse() 126public async Task RequestDelegatePopulatesHttpContextParametersWithoutAttribute_FromParameterList() 212public async Task RequestDelegatePopulatesParametersWithDefaultValues(string type, string defaultValue, object expectedValue, bool declareConst) 260public async Task RequestDelegatePopulatesDecimalWithDefaultValuesAndCultureSet()
RequestDelegateGenerator\RequestDelegateCreationTests.TryParse.cs (9)
65public async Task MapAction_SingleParsable_StringReturn(string typeName, string queryStringInput, object expectedParameterValue) 106public async Task MapAction_DateTime_StringReturn(string queryStringInput, string expectedBody) 138public async Task MapAction_DateTimeOffset_StringReturn(string queryStringInput, string expectedBody) 157public async Task MapAction_TryParsePrecedenceCheck(string parameterType, string result) 180public async Task MapAction_SingleComplexTypeParam_StringReturn() 204public async Task MapAction_ExplicitIParsable() 221public async Task MapAction_SingleEnumParam_StringReturn() 246public async Task RequestDelegatePopulatesUnattributedTryParsableParametersFromRouteValue(string typeName, string routeValue, object expectedParameterValue) 268public async Task RequestDelegateUsesTryParseOverBindAsyncGivenExplicitAttribute(string source)
RequestDelegateGenerator\RuntimeCreationTests.ComplexFormBinding.cs (7)
15public async Task SupportsBindingComplexTypeFromForm_UrlEncoded() 47public async Task SupportsBindingComplexTypeFromForm_Multipart() 83public async Task SupportsBindingDictionaryFromForm_UrlEncoded() 116public async Task SupportsBindingDictionaryFromForm_Multipart() 153public async Task SupportsBindingInvalidDictionaryFromForm_Multipart() 192public async Task SupportsBindingListFromForm_UrlEncoded() 225public async Task SupportsBindingListFromForm_Multipart()
RequestDelegateGenerator\RuntimeCreationTests.cs (3)
19public async Task MapAction_BindAsync_WithWrongType_IsNotUsed(string bindAsyncType) 34public async Task MapAction_FSharpAsyncReturn_IsAwaitable(string source, string expectedBody) 48public async Task MapAction_AwaitableOfUnitReturn_ConvertedToVoidReturning(string source)
RequestDelegateGenerator\SharedTypes.cs (13)
624public Task ExecuteAsync(HttpContext httpContext) => throw new NotImplementedException(); 637public Task ExecuteAsync(HttpContext httpContext) => Task.CompletedTask; 675public Task ExecuteAsync(HttpContext httpContext) => throw new NotImplementedException(); 931public Task ExecuteAsync(HttpContext httpContext) => Task.CompletedTask; 975Task IResult.ExecuteAsync(HttpContext httpContext) 979return Task.CompletedTask; 1056await Task.CompletedTask; 1072await Task.CompletedTask; 1081await Task.CompletedTask; 1090await Task.CompletedTask; 1106await Task.CompletedTask;
ResponseExtensionTests.cs (2)
63public void OnCompleted(Func<object, Task> callback, object state) 68public void OnStarting(Func<object, Task> callback, object state)
SendFileResponseExtensionsTests.cs (11)
12public Task SendFileWhenFileNotFoundThrows() 19public async Task SendFileWorks() 35public async Task SendFile_FallsBackToBodyStream() 48public async Task SendFile_Stream_ThrowsWhenCanceled() 62public async Task SendFile_Feature_ThrowsWhenCanceled() 74public async Task SendFile_Stream_AbortsSilentlyWhenRequestCanceled() 88public async Task SendFile_Feature_AbortsSilentlyWhenRequestCanceled() 113public Task CompleteAsync() 123public Task SendFileAsync(string path, long offset, long? length, CancellationToken cancellation) 131return Task.FromResult(0); 134public Task StartAsync(CancellationToken token = default)
Microsoft.AspNetCore.Http.Features (9)
IFormFile.cs (1)
57Task CopyToAsync(Stream target, CancellationToken cancellationToken = default(CancellationToken));
IHttpResponseBodyFeature.cs (3)
31Task StartAsync(CancellationToken cancellationToken = default); 41Task SendFileAsync(string path, long offset, long? count, CancellationToken cancellationToken = default); 48Task CompleteAsync();
IHttpResponseFeature.cs (3)
38/// <see cref="OnStarting(Func{object, Task}, object)"/> should no longer be called. 52void OnStarting(Func<object, Task> callback, object state); 60void OnCompleted(Func<object, Task> callback, object state);
ISession.cs (2)
34Task LoadAsync(CancellationToken cancellationToken = default(CancellationToken)); 40Task CommitAsync(CancellationToken cancellationToken = default(CancellationToken));
Microsoft.AspNetCore.Http.Microbenchmarks (27)
RequestDelegateGeneratorBenchmarks.cs (1)
23public async Task Setup()
RequestTimeoutsMiddlewareBenchmark.cs (9)
21async context => { await Task.Yield(); }, 27async context => { await Task.Yield(); }, 45await Task.Delay(TimeSpan.FromMicroseconds(2)); 60public async Task NoMetadataNoDefault() 67public async Task DefaultTimeout() 75public async Task DefaultTimeoutOverriddenByDisable() 86public async Task TimeoutMetadata() 97public async Task NamedPolicyMetadata() 108public async Task TimeoutFires()
src\Http\Http.Extensions\test\RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (4)
240internal static async Task VerifyResponseJsonBodyAsync<T>(HttpContext httpContext, Action<T> check, int expectedStatusCode = 200) 252internal static async Task VerifyResponseJsonNodeAsync(HttpContext httpContext, Action<JsonNode> check, int expectedStatusCode = 200, string expectedContentType = "application/json; charset=utf-8") 262internal static async Task VerifyResponseBodyAsync(HttpContext httpContext, string expectedBody, int expectedStatusCode = 200) 346internal async Task VerifyAgainstBaselineUsingFile(Compilation compilation, [CallerMemberName] string callerName = "")
src\Http\Http.Extensions\test\RequestDelegateGenerator\SharedTypes.cs (13)
624public Task ExecuteAsync(HttpContext httpContext) => throw new NotImplementedException(); 637public Task ExecuteAsync(HttpContext httpContext) => Task.CompletedTask; 675public Task ExecuteAsync(HttpContext httpContext) => throw new NotImplementedException(); 931public Task ExecuteAsync(HttpContext httpContext) => Task.CompletedTask; 975Task IResult.ExecuteAsync(HttpContext httpContext) 979return Task.CompletedTask; 1056await Task.CompletedTask; 1072await Task.CompletedTask; 1081await Task.CompletedTask; 1090await Task.CompletedTask; 1106await Task.CompletedTask;
Microsoft.AspNetCore.Http.Results (80)
Accepted.cs (2)
59public Task ExecuteAsync(HttpContext httpContext) 75return Task.CompletedTask;
AcceptedAtRoute.cs (2)
77public Task ExecuteAsync(HttpContext httpContext) 102return Task.CompletedTask;
AcceptedAtRouteOfT.cs (1)
91public Task ExecuteAsync(HttpContext httpContext)
AcceptedOfT.cs (1)
75public Task ExecuteAsync(HttpContext httpContext)
BadRequest.cs (2)
34public Task ExecuteAsync(HttpContext httpContext) 45return Task.CompletedTask;
BadRequestOfT.cs (1)
45public Task ExecuteAsync(HttpContext httpContext)
ChallengeHttpResult.cs (1)
70public async Task ExecuteAsync(HttpContext httpContext)
Conflict.cs (2)
34public Task ExecuteAsync(HttpContext httpContext) 45return Task.CompletedTask;
ConflictOfT.cs (1)
45public Task ExecuteAsync(HttpContext httpContext)
ContentHttpResult.cs (1)
58public Task ExecuteAsync(HttpContext httpContext)
Created.cs (2)
59public Task ExecuteAsync(HttpContext httpContext) 75return Task.CompletedTask;
CreatedAtRoute.cs (2)
77public Task ExecuteAsync(HttpContext httpContext) 102return Task.CompletedTask;
CreatedAtRouteOfT.cs (1)
91public Task ExecuteAsync(HttpContext httpContext)
CreatedOfT.cs (1)
74public Task ExecuteAsync(HttpContext httpContext)
FileContentHttpResult.cs (2)
107public Task ExecuteAsync(HttpContext httpContext) 126Task.CompletedTask :
FileStreamHttpResult.cs (1)
113public async Task ExecuteAsync(HttpContext httpContext)
ForbidHttpResult.cs (1)
81public async Task ExecuteAsync(HttpContext httpContext)
HttpResultsHelper.cs (4)
26public static Task WriteResultAsJsonAsync<TValue>( 35return Task.CompletedTask; 64public static Task WriteResultAsContentAsync( 89return Task.CompletedTask;
InternalServerError.cs (2)
34public Task ExecuteAsync(HttpContext httpContext) 45return Task.CompletedTask;
InternalServerErrorOfT.cs (1)
45public Task ExecuteAsync(HttpContext httpContext)
JsonHttpResultOfT.cs (2)
89public Task ExecuteAsync(HttpContext httpContext) 105return Task.CompletedTask;
NoContent.cs (2)
33public Task ExecuteAsync(HttpContext httpContext) 45return Task.CompletedTask;
NotFound.cs (2)
33public Task ExecuteAsync(HttpContext httpContext) 44return Task.CompletedTask;
NotFoundOfT.cs (1)
44public Task ExecuteAsync(HttpContext httpContext)
Ok.cs (2)
33public Task ExecuteAsync(HttpContext httpContext) 44return Task.CompletedTask;
OkOfT.cs (1)
44public Task ExecuteAsync(HttpContext httpContext)
PhysicalFileHttpResult.cs (3)
108public Task ExecuteAsync(HttpContext httpContext) 136Task.CompletedTask : 140private static Task ExecuteCoreAsync(HttpContext httpContext, RangeItemHeaderValue? range, long rangeLength, string fileName)
ProblemHttpResult.cs (1)
49public async Task ExecuteAsync(HttpContext httpContext)
PushStreamHttpResult.cs (6)
16private readonly Func<Stream, Task> _streamWriterCallback; 24internal PushStreamHttpResult(Func<Stream, Task> streamWriterCallback, string? contentType) 38Func<Stream, Task> streamWriterCallback, 55Func<Stream, Task> streamWriterCallback, 101public Task ExecuteAsync(HttpContext httpContext) 120Task.CompletedTask :
RedirectHttpResult.cs (2)
89public Task ExecuteAsync(HttpContext httpContext) 121return Task.CompletedTask;
RedirectToRouteHttpResult.cs (2)
157public Task ExecuteAsync(HttpContext httpContext) 190return Task.CompletedTask;
Results.cs (1)
456Func<Stream, Task> streamWriterCallback,
ResultsOfT.Generated.cs (5)
40public Task ExecuteAsync(HttpContext httpContext) 104public Task ExecuteAsync(HttpContext httpContext) 177public Task ExecuteAsync(HttpContext httpContext) 259public Task ExecuteAsync(HttpContext httpContext) 350public Task ExecuteAsync(HttpContext httpContext)
SignInHttpResult.cs (1)
56public Task ExecuteAsync(HttpContext httpContext)
SignOutHttpResult.cs (1)
70public async Task ExecuteAsync(HttpContext httpContext)
src\Http\Shared\StreamCopyOperationInternal.cs (2)
20public static Task CopyToAsync(Stream source, Stream destination, long? count, CancellationToken cancel) 32public static async Task CopyToAsync(Stream source, Stream destination, long? count, int bufferSize, CancellationToken cancel)
src\Shared\ResultsHelpers\FileResultHelper.cs (2)
29internal static async Task WriteFileAsync(HttpContext context, Stream fileStream, RangeItemHeaderValue? range, long rangeLength) 56internal static async Task WriteFileAsync(HttpContext context, ReadOnlyMemory<byte> buffer, RangeItemHeaderValue? range, long rangeLength)
StatusCodeHttpResult.cs (2)
37public Task ExecuteAsync(HttpContext httpContext) 48return Task.CompletedTask;
TypedResults.cs (1)
476Func<Stream, Task> streamWriterCallback,
UnauthorizedHttpResult.cs (2)
30public Task ExecuteAsync(HttpContext httpContext) 41return Task.CompletedTask;
UnprocessableEntity.cs (2)
34public Task ExecuteAsync(HttpContext httpContext) 45return Task.CompletedTask;
UnprocessableEntityOfT.cs (1)
45public Task ExecuteAsync(HttpContext httpContext)
Utf8ContentHttpResult.cs (1)
49public Task ExecuteAsync(HttpContext httpContext)
ValidationProblem.cs (1)
52public Task ExecuteAsync(HttpContext httpContext)
VirtualFileHttpResult.cs (3)
102public Task ExecuteAsync(HttpContext httpContext) 131Task.CompletedTask : 135private static Task ExecuteCoreAsync(HttpContext httpContext, RangeItemHeaderValue? range, long rangeLength, IFileInfo fileInfo)
Microsoft.AspNetCore.Http.Results.Tests (236)
AcceptedAtRouteOfTResultTests.cs (3)
36public async Task ExecuteResultAsync_FormatsData() 86public async Task ExecuteResultAsync_SetsStatusCodeAndLocationHeader(object values) 104public async Task ExecuteResultAsync_ThrowsIfRouteUrlIsNull()
AcceptedAtRouteResultTests.cs (2)
40public async Task ExecuteResultAsync_SetsStatusCodeAndLocationHeader(object values) 58public async Task ExecuteResultAsync_ThrowsIfRouteUrlIsNull()
AcceptedOfTResultTests.cs (2)
17public async Task ExecuteResultAsync_FormatsData() 33public async Task ExecuteResultAsync_SetsStatusCodeAndLocationHeader()
AcceptedResultTests.cs (1)
17public async Task ExecuteAsync_SetsStatusCodeAndLocationHeader()
BadRequestOfTResultTests.cs (3)
46public async Task BadRequestObjectResult_ExecuteAsync_SetsStatusCode() 63public async Task BadRequestObjectResult_ExecuteResultAsync_FormatsData() 85public async Task BadRequestObjectResult_ExecuteResultAsync_UsesStatusCodeFromResultTypeForProblemDetails()
BadRequestResultTests.cs (1)
29public async Task BadRequestObjectResult_ExecuteAsync_SetsStatusCode()
ChallengeResultTests.cs (2)
15public async Task ChallengeResult_ExecuteAsync() 30public async Task ChallengeResult_ExecuteAsync_NoSchemes()
ConflictOfTResultTests.cs (2)
45public async Task ConflictObjectResult_ExecuteAsync_SetsStatusCode() 62public async Task ConflictObjectResult_ExecuteResultAsync_FormatsData()
ConflictResultTests.cs (1)
30public async Task ConflictObjectResult_ExecuteAsync_SetsStatusCode()
ContentResultTests.cs (2)
15public async Task ContentResult_ExecuteAsync_Response_NullContent_SetsContentTypeAndEncoding() 102public async Task ContentResult_ExecuteAsync_SetContentTypeAndEncoding_OnResponse(
CreatedAtRouteOfTResultTests.cs (2)
56public async Task CreatedAtRouteResult_ReturnsStatusCode_SetsLocationHeader(object values) 74public async Task CreatedAtRouteResult_ThrowsOnNullUrl()
CreatedAtRouteResultTests.cs (2)
39public async Task CreatedAtRouteResult_ReturnsStatusCode_SetsLocationHeader(object values) 57public async Task CreatedAtRouteResult_ThrowsOnNullUrl()
CreatedOfTResultTests.cs (3)
46public async Task CreatedResult_ReturnsStatusCode_SetsLocationHeader() 62public async Task CreatedResult_OverwritesLocationHeader() 79public async Task CreatedResult_ExecuteResultAsync_FormatsData()
CreatedResultTests.cs (2)
31public async Task CreatedResult_ReturnsStatusCode_SetsLocationHeader() 47public async Task CreatedResult_OverwritesLocationHeader()
EmptyResultTests.cs (1)
11public async Task EmptyResult_DoesNothing()
FileContentResultTests.cs (1)
14protected override Task ExecuteAsync(
ForbidResultTests.cs (9)
16public async Task ExecuteResultAsync_InvokesForbidAsyncOnAuthenticationService() 22.Returns(Task.CompletedTask) 35public async Task ExecuteResultAsync_InvokesForbidAsyncOnAllConfiguredSchemes() 42.Returns(Task.CompletedTask) 46.Returns(Task.CompletedTask) 68public async Task ExecuteResultAsync_InvokesForbidAsyncWithAuthProperties(AuthenticationProperties expected) 74.Returns(Task.CompletedTask) 88public async Task ExecuteResultAsync_InvokesForbidAsyncWithAuthProperties_WhenAuthenticationSchemesIsEmpty( 95.Returns(Task.CompletedTask)
HttpFileStreamResultTests.cs (1)
11protected override Task ExecuteAsync(
HttpResultsHelperTests.cs (7)
18public async Task WriteResultAsJsonAsync_Works_ForValueTypes(bool useJsonContext) 49public async Task WriteResultAsJsonAsync_Works_ForReferenceTypes(bool useJsonContext) 81public async Task WriteResultAsJsonAsync_Works_ForChildTypes(bool useJsonContext) 115public async Task WriteResultAsJsonAsync_Works_UsingBaseType_ForChildTypes(bool useJsonContext) 149public async Task WriteResultAsJsonAsync_Works_UsingBaseType_ForChildTypes_WithJsonPolymorphism(bool useJsonContext) 183public async Task WriteResultAsJsonAsync_Works_UsingUnspeakableType(bool useJsonContext) 226await Task.Yield();
InternalServerErrorOfTResultTests.cs (3)
46public async Task InternalServerErrorObjectResult_ExecuteAsync_SetsStatusCode() 63public async Task InternalServerErrorObjectResult_ExecuteResultAsync_FormatsData() 85public async Task InternalServerErrorObjectResult_ExecuteResultAsync_UsesStatusCodeFromResultTypeForProblemDetails()
InternalServerErrorResultTests.cs (1)
29public async Task InternalServerErrorObjectResult_ExecuteAsync_SetsStatusCode()
JsonResultTests.cs (9)
20public async Task JsonResult_ExecuteAsync_WithNullValue_Works() 38public async Task JsonResult_ExecuteAsync_SetsStatusCode() 56public async Task JsonResult_ExecuteAsync_JsonSerializesBody() 78public async Task JsonResult_ExecuteAsync_JsonSerializesBody_WithOptions() 115public async Task ExecuteAsync_UsesDefaults_ForProblemDetails() 144public async Task ExecuteAsync_UsesDefaults_ForValidationProblemDetails() 173public async Task ExecuteAsync_UsesDefaults_HttpStatusCodesWithoutTypes() 205public async Task ExecuteAsync_SetsProblemDetailsStatus_ForValidationProblemDetails() 224public async Task ExecuteAsync_GetsStatusCodeFromProblemDetails()
LocalRedirectResultTests.cs (3)
58public async Task Execute_ReturnsExpectedValues() 83public async Task Execute_Throws_ForNonLocalUrl( 104public async Task Execute_Throws_ForNonLocalUrlTilde(
NotFoundOfTResultTests.cs (1)
52public async Task NotFoundObjectResult_ExecuteSuccessful()
NotFoundResultTests.cs (1)
28public async Task NotFoundObjectResult_ExecuteSuccessful()
OkOfTResultTests.cs (2)
44public async Task OkObjectResult_ExecuteAsync_FormatsData() 66public async Task OkObjectResult_ExecuteAsync_SetsStatusCode()
OkResultTests.cs (1)
28public async Task OkObjectResult_ExecuteAsync_SetsStatusCode()
PhysicalFileResultTest.cs (1)
11protected override Task ExecuteAsync(
ProblemResultTests.cs (6)
18public async Task ExecuteAsync_UsesDefaults_ForProblemDetails() 47public async Task ExecuteAsync_UsesDefaultsFromProblemDetailsServoce_ForProblemDetails() 79public async Task ExecuteAsync_UsesDefaults_ForValidationProblemDetails() 108public async Task ExecuteAsync_SetsTitleFromReasonPhrases_WhenNotInDefaults() 140public async Task ExecuteAsync_IncludeErrors_ForValidationProblemDetails() 172public async Task ExecuteAsync_GetsStatusCodeFromProblemDetails()
PushStreamResultTests.cs (4)
13public async Task PushStreamResultsExposeTheResponseBody() 74var result = new PushStreamHttpResult(s => Task.CompletedTask, "content-type"); 89var result = Assert.IsAssignableFrom<IFileHttpResult>(new PushStreamHttpResult(s => Task.CompletedTask, contentType) { FileDownloadName = downloadName }); 102var result = Assert.IsAssignableFrom<IContentTypeHttpResult>(new PushStreamHttpResult(s => Task.CompletedTask, contentType) { FileDownloadName = downloadName });
RedirectResultTests.cs (1)
36protected override Task ExecuteAsync(HttpContext httpContext, string contentPath)
RedirectToRouteResultTests.cs (4)
15public async Task RedirectToRoute_Execute_ThrowsOnNullUrl() 33public async Task ExecuteResultAsync_UsesRouteName_ToGenerateLocationHeader() 52public async Task ExecuteResultAsync_WithFragment_PassesCorrectValuesToRedirect() 70public async Task ExecuteResultAsync_WithFragment_PassesCorrectValuesToRedirect_WithPreserveMethod()
ResultsOfTTests.Generated.cs (61)
41public async Task ResultsOfTResult1TResult2_ExecuteResult_ExecutesAssignedResult(int input) 103public async Task ResultsOfTResult1TResult2_AcceptsIResult_AsFirstTypeArg(int input, Type expectedResultType) 128public async Task ResultsOfTResult1TResult2_AcceptsIResult_AsSecondTypeArg(int input, Type expectedResultType) 154public async Task ResultsOfTResult1TResult2_AcceptsNestedResultsOfT_AsFirstTypeArg(int input, Type expectedResultType) 181public async Task ResultsOfTResult1TResult2_AcceptsNestedResultsOfT_AsSecondTypeArg(int input, Type expectedResultType) 255public async Task ResultsOfTResult1TResult2TResult3_ExecuteResult_ExecutesAssignedResult(int input) 319public async Task ResultsOfTResult1TResult2TResult3_AcceptsIResult_AsFirstTypeArg(int input, Type expectedResultType) 346public async Task ResultsOfTResult1TResult2TResult3_AcceptsIResult_AsSecondTypeArg(int input, Type expectedResultType) 373public async Task ResultsOfTResult1TResult2TResult3_AcceptsIResult_AsThirdTypeArg(int input, Type expectedResultType) 401public async Task ResultsOfTResult1TResult2TResult3_AcceptsNestedResultsOfT_AsFirstTypeArg(int input, Type expectedResultType) 430public async Task ResultsOfTResult1TResult2TResult3_AcceptsNestedResultsOfT_AsSecondTypeArg(int input, Type expectedResultType) 459public async Task ResultsOfTResult1TResult2TResult3_AcceptsNestedResultsOfT_AsThirdTypeArg(int input, Type expectedResultType) 538public async Task ResultsOfTResult1TResult2TResult3TResult4_ExecuteResult_ExecutesAssignedResult(int input) 604public async Task ResultsOfTResult1TResult2TResult3TResult4_AcceptsIResult_AsFirstTypeArg(int input, Type expectedResultType) 633public async Task ResultsOfTResult1TResult2TResult3TResult4_AcceptsIResult_AsSecondTypeArg(int input, Type expectedResultType) 662public async Task ResultsOfTResult1TResult2TResult3TResult4_AcceptsIResult_AsThirdTypeArg(int input, Type expectedResultType) 691public async Task ResultsOfTResult1TResult2TResult3TResult4_AcceptsIResult_AsFourthTypeArg(int input, Type expectedResultType) 721public async Task ResultsOfTResult1TResult2TResult3TResult4_AcceptsNestedResultsOfT_AsFirstTypeArg(int input, Type expectedResultType) 752public async Task ResultsOfTResult1TResult2TResult3TResult4_AcceptsNestedResultsOfT_AsSecondTypeArg(int input, Type expectedResultType) 783public async Task ResultsOfTResult1TResult2TResult3TResult4_AcceptsNestedResultsOfT_AsThirdTypeArg(int input, Type expectedResultType) 814public async Task ResultsOfTResult1TResult2TResult3TResult4_AcceptsNestedResultsOfT_AsFourthTypeArg(int input, Type expectedResultType) 898public async Task ResultsOfTResult1TResult2TResult3TResult4TResult5_ExecuteResult_ExecutesAssignedResult(int input) 966public async Task ResultsOfTResult1TResult2TResult3TResult4TResult5_AcceptsIResult_AsFirstTypeArg(int input, Type expectedResultType) 997public async Task ResultsOfTResult1TResult2TResult3TResult4TResult5_AcceptsIResult_AsSecondTypeArg(int input, Type expectedResultType) 1028public async Task ResultsOfTResult1TResult2TResult3TResult4TResult5_AcceptsIResult_AsThirdTypeArg(int input, Type expectedResultType) 1059public async Task ResultsOfTResult1TResult2TResult3TResult4TResult5_AcceptsIResult_AsFourthTypeArg(int input, Type expectedResultType) 1090public async Task ResultsOfTResult1TResult2TResult3TResult4TResult5_AcceptsIResult_AsFifthTypeArg(int input, Type expectedResultType) 1122public async Task ResultsOfTResult1TResult2TResult3TResult4TResult5_AcceptsNestedResultsOfT_AsFirstTypeArg(int input, Type expectedResultType) 1155public async Task ResultsOfTResult1TResult2TResult3TResult4TResult5_AcceptsNestedResultsOfT_AsSecondTypeArg(int input, Type expectedResultType) 1188public async Task ResultsOfTResult1TResult2TResult3TResult4TResult5_AcceptsNestedResultsOfT_AsThirdTypeArg(int input, Type expectedResultType) 1221public async Task ResultsOfTResult1TResult2TResult3TResult4TResult5_AcceptsNestedResultsOfT_AsFourthTypeArg(int input, Type expectedResultType) 1254public async Task ResultsOfTResult1TResult2TResult3TResult4TResult5_AcceptsNestedResultsOfT_AsFifthTypeArg(int input, Type expectedResultType) 1343public async Task ResultsOfTResult1TResult2TResult3TResult4TResult5TResult6_ExecuteResult_ExecutesAssignedResult(int input) 1413public async Task ResultsOfTResult1TResult2TResult3TResult4TResult5TResult6_AcceptsIResult_AsFirstTypeArg(int input, Type expectedResultType) 1446public async Task ResultsOfTResult1TResult2TResult3TResult4TResult5TResult6_AcceptsIResult_AsSecondTypeArg(int input, Type expectedResultType) 1479public async Task ResultsOfTResult1TResult2TResult3TResult4TResult5TResult6_AcceptsIResult_AsThirdTypeArg(int input, Type expectedResultType) 1512public async Task ResultsOfTResult1TResult2TResult3TResult4TResult5TResult6_AcceptsIResult_AsFourthTypeArg(int input, Type expectedResultType) 1545public async Task ResultsOfTResult1TResult2TResult3TResult4TResult5TResult6_AcceptsIResult_AsFifthTypeArg(int input, Type expectedResultType) 1578public async Task ResultsOfTResult1TResult2TResult3TResult4TResult5TResult6_AcceptsIResult_AsSixthTypeArg(int input, Type expectedResultType) 1612public async Task ResultsOfTResult1TResult2TResult3TResult4TResult5TResult6_AcceptsNestedResultsOfT_AsFirstTypeArg(int input, Type expectedResultType) 1647public async Task ResultsOfTResult1TResult2TResult3TResult4TResult5TResult6_AcceptsNestedResultsOfT_AsSecondTypeArg(int input, Type expectedResultType) 1682public async Task ResultsOfTResult1TResult2TResult3TResult4TResult5TResult6_AcceptsNestedResultsOfT_AsThirdTypeArg(int input, Type expectedResultType) 1717public async Task ResultsOfTResult1TResult2TResult3TResult4TResult5TResult6_AcceptsNestedResultsOfT_AsFourthTypeArg(int input, Type expectedResultType) 1752public async Task ResultsOfTResult1TResult2TResult3TResult4TResult5TResult6_AcceptsNestedResultsOfT_AsFifthTypeArg(int input, Type expectedResultType) 1787public async Task ResultsOfTResult1TResult2TResult3TResult4TResult5TResult6_AcceptsNestedResultsOfT_AsSixthTypeArg(int input, Type expectedResultType) 1850public Task ExecuteAsync(HttpContext httpContext) 1853return Task.CompletedTask; 1863public Task ExecuteAsync(HttpContext httpContext) => Task.CompletedTask; 1877public Task ExecuteAsync(HttpContext httpContext) => Task.CompletedTask; 1891public Task ExecuteAsync(HttpContext httpContext) => Task.CompletedTask; 1905public Task ExecuteAsync(HttpContext httpContext) => Task.CompletedTask; 1919public Task ExecuteAsync(HttpContext httpContext) => Task.CompletedTask; 1933public Task ExecuteAsync(HttpContext httpContext) => Task.CompletedTask; 1946public Task ExecuteAsync(HttpContext httpContext) => Task.CompletedTask;
ResultsTests.cs (3)
303_ => Results.Stream((s) => Task.CompletedTask, contentType, fileDownloadName, lastModified, entityTag) 374Assert.Throws<ArgumentNullException>("streamWriterCallback", () => TypedResults.Stream(default(Func<Stream, Task>))); 1688(() => Results.Stream(s => Task.CompletedTask, null, null, null, null), typeof(PushStreamHttpResult)),
SignInResultTests.cs (6)
16public async Task ExecuteAsync_InvokesSignInAsyncOnAuthenticationManager() 23.Returns(Task.CompletedTask) 37public async Task ExecuteAsync_InvokesSignInAsyncOnAuthenticationManagerWithDefaultScheme() 44.Returns(Task.CompletedTask) 57public async Task ExecuteAsync_InvokesSignInAsyncOnConfiguredScheme() 65.Returns(Task.CompletedTask)
SignOutResultTests.cs (7)
15public async Task ExecuteAsync_NoArgsInvokesDefaultSignOut() 21.Returns(Task.CompletedTask) 34public async Task ExecuteAsync_InvokesSignOutAsyncOnAuthenticationManager() 40.Returns(Task.CompletedTask) 53public async Task ExecuteAsync_InvokesSignOutAsyncOnAllConfiguredSchemes() 60.Returns(Task.CompletedTask) 64.Returns(Task.CompletedTask)
src\Shared\ResultsTests\FileContentResultTestBase.cs (11)
19protected abstract Task ExecuteAsync( 28public async Task WriteFileAsync_CopiesBuffer_ToOutputStream() 49public async Task WriteFileAsync_PreconditionStateShouldProcess_WritesRangeRequested( 92public async Task WriteFileAsync_IfRangeHeaderValid_WritesRangeRequest() 131public async Task WriteFileAsync_RangeProcessingNotEnabled_RangeRequestIgnored() 165public async Task WriteFileAsync_IfRangeHeaderInvalid_RangeRequestIgnored() 202public async Task WriteFileAsync_PreconditionStateUnspecified_RangeRequestIgnored(string rangeString) 233public async Task WriteFileAsync_PreconditionStateUnspecified_RangeRequestedNotSatisfiable(string rangeString) 265public async Task WriteFileAsync_PreconditionFailed_RangeRequestedIgnored() 299public async Task WriteFileAsync_NotModified_RangeRequestedIgnored() 334public async Task ExecuteResultAsync_SetsSuppliedContentTypeAndEncoding()
src\Shared\ResultsTests\FileStreamResultTestBase.cs (13)
16protected abstract Task ExecuteAsync( 29public async Task WriteFileAsync_PreconditionStateShouldProcess_WritesRangeRequested(long? start, long? end, string expectedString, long contentLength) 71public async Task WriteFileAsync_IfRangeHeaderValid_WritesRequestedRange() 112public async Task WriteFileAsync_RangeProcessingNotEnabled_RangeRequestedIgnored() 149public async Task WriteFileAsync_IfRangeHeaderInvalid_RangeRequestedIgnored() 189public async Task WriteFileAsync_PreconditionStateUnspecified_RangeRequestIgnored(string rangeString) 222public async Task WriteFileAsync_PreconditionStateUnspecified_RangeRequestedNotSatisfiable(string rangeString) 256public async Task WriteFileAsync_RangeRequested_PreconditionFailed() 292public async Task WriteFileAsync_NotModified_RangeRequestedIgnored() 331public async Task WriteFileAsync_RangeRequested_FileLengthZeroOrNull(long? fileLength) 372public async Task WriteFileAsync_CopiesProvidedStream_ToOutputStream() 396public async Task SetsSuppliedContentTypeAndEncoding() 422public async Task HeadRequest_DoesNotWriteToBody_AndClosesReadStream()
src\Shared\ResultsTests\PhysicalFileResultTestBase.cs (19)
22protected abstract Task ExecuteAsync( 35public async Task WriteFileAsync_WritesRangeRequested(long? start, long? end, long contentLength) 66public async Task WriteFileAsync_IfRangeHeaderValid_WritesRequestedRange() 98public async Task WriteFileAsync_RangeProcessingNotEnabled_RangeRequestedIgnored() 125public async Task WriteFileAsync_IfRangeHeaderInvalid_RangeRequestedIgnored() 155public async Task WriteFileAsync_RangeHeaderMalformed_RangeRequestIgnored(string rangeString) 183public async Task WriteFileAsync_RangeRequestedNotSatisfiable(string rangeString) 212public async Task WriteFileAsync_RangeRequested_PreconditionFailed() 239public async Task WriteFileAsync_RangeRequested_NotModified() 267public async Task ExecuteResultAsync_CallsSendFileAsync_IfIHttpSendFilePresent() 274.Returns(Task.FromResult<int>(0)); 291public async Task ExecuteResultAsync_CallsSendFileAsyncWithRequestedRange_IfIHttpSendFilePresent(long? start, long? end, long contentLength) 323public async Task ExecuteResultAsync_SetsSuppliedContentTypeAndEncoding() 344public async Task ExecuteResultAsync_WorksWithAbsolutePaths() 376public async Task ExecuteAsync_ThrowsNotSupported_ForNonRootedPaths(string path) 433public Task CompleteAsync() 443public Task SendFileAsync(string path, long offset, long? length, CancellationToken cancellation) 449return Task.CompletedTask; 452public Task StartAsync(CancellationToken cancellation = default)
src\Shared\ResultsTests\RedirectResultTestBase.cs (3)
16protected abstract Task ExecuteAsync(HttpContext httpContext, string contentPath); 21public async Task Execute_ReturnsContentPath_WhenItDoesNotStartWithTilde( 44public async Task Execute_ReturnsAppRelativePath_WhenItStartsWithTilde(
src\Shared\ResultsTests\VirtualFileResultTestBase.cs (20)
25protected abstract Task ExecuteAsync( 38public async Task WriteFileAsync_WritesRangeRequested( 78public async Task WriteFileAsync_IfRangeHeaderValid_WritesRequestedRange() 115public async Task WriteFileAsync_RangeProcessingNotEnabled_RangeRequestedIgnored() 148public async Task WriteFileAsync_IfRangeHeaderInvalid_RangeRequestedIgnored() 184public async Task WriteFileAsync_RangeHeaderMalformed_RangeRequestIgnored(string rangeString) 218public async Task WriteFileAsync_RangeRequestedNotSatisfiable(string rangeString) 254public async Task WriteFileAsync_RangeRequested_PreconditionFailed() 285public async Task WriteFileAsync_RangeRequested_NotModified() 321public async Task ExecuteResultAsync_CallsSendFileAsyncWithRequestedRange_IfIHttpSendFilePresent(long? start, long? end, long contentLength) 358public async Task ExecuteResultAsync_SetsSuppliedContentTypeAndEncoding() 376public async Task ExecuteResultAsync_ReturnsFileContentsForRelativePaths() 399public async Task ExecuteResultAsync_ReturnsFiles_ForDifferentPaths(string path) 421public async Task ExecuteResultAsync_TrimsTilde_BeforeInvokingFileProvider(string path) 439public async Task ExecuteResultAsync_WorksWithNonDiskBasedFiles() 465public async Task ExecuteResultAsync_ThrowsFileNotFound_IfFileProviderCanNotFindTheFile() 536public Task CompleteAsync() 546public Task SendFileAsync(string path, long offset, long? length, CancellationToken cancellation) 553return Task.FromResult(0); 556public Task StartAsync(CancellationToken cancellation = default)
TypedResultsTests.cs (2)
348Assert.Throws<ArgumentNullException>("streamWriterCallback", () => TypedResults.Stream(default(Func<Stream, Task>))); 387_ => (IResult)TypedResults.Stream((s) => Task.CompletedTask, contentType, fileDownloadName, lastModified, entityTag)
UnprocessableEntityOfTResultTests.cs (2)
44public async Task UnprocessableEntityObjectResult_ExecuteAsync_SetsStatusCode() 61public async Task UnprocessableEntityObjectResult_ExecuteResultAsync_FormatsData()
UnprocessableEntityResultTests.cs (1)
29public async Task UnprocessableEntityObjectResult_ExecuteAsync_SetsStatusCode()
Utf8ContentResultTests.cs (2)
31public async Task Utf8ContentExecutionWorks() 49public async Task Utf8TextResultCopiesData()
ValidationProblemResultTests.cs (1)
20public async Task ExecuteAsync_UsesDefaults_ForProblemDetails()
VirtualFileResultTests.cs (1)
11protected override Task ExecuteAsync(HttpContext httpContext, string path, string contentType, DateTimeOffset? lastModified = null, EntityTagHeaderValue entityTag = null, bool enableRangeProcessing = false)
Microsoft.AspNetCore.Http.Tests (89)
ApplicationBuilderTests.cs (11)
14public async Task BuildReturnsCallableDelegate() 26public async Task BuildReturnDelegateThatDoesNotSetStatusCodeIfResponseHasStarted() 51public async Task BuildImplicitlyThrowsForMatchedEndpointAsLastStep() 61return Task.CompletedTask; 80public async Task BuildLogAtRequestPipelineEnd() 106public async Task BuildDoesNotLogOrChangeStatusWithTerminalMiddleware() 116return Task.CompletedTask; 134return Task.CompletedTask; 143return Task.CompletedTask; 185public void OnCompleted(Func<object, Task> callback, object state) 190public void OnStarting(Func<object, Task> callback, object state)
DefaultHttpContextTests.cs (10)
204public async Task RequestServicesAreDisposedOnCompleted() 231public async Task RequestServicesAreDisposedAsynOnCompleted() 428public List<(Func<object, Task> callback, object state)> CompletedCallbacks = new List<(Func<object, Task> callback, object state)>(); 437public void OnCompleted(Func<object, Task> callback, object state) 442public void OnStarting(Func<object, Task> callback, object state) 463public Task CommitAsync(CancellationToken cancellationToken) 465return Task.FromResult(0); 468public Task LoadAsync(CancellationToken cancellationToken) 470return Task.FromResult(0);
Features\FakeResponseFeature.cs (5)
8List<Tuple<Func<object, Task>, object>> _onCompletedCallbacks = new List<Tuple<Func<object, Task>, object>>(); 10public override void OnCompleted(Func<object, Task> callback, object state) 12_onCompletedCallbacks.Add(new Tuple<Func<object, Task>, object>(callback, state)); 15public async Task CompleteAsync()
Features\FormFeatureTests.cs (16)
12public async Task ReadFormAsync_0ContentLength_ReturnsEmptyForm() 29public async Task FormFeatureReadsOptionsFromDefaultHttpContext() 49public async Task ReadFormAsync_SimpleData_ReturnsParsedFormCollection(bool bufferRequest) 84public async Task ReadFormAsync_SimpleData_ReplacePipeReader_ReturnsParsedFormCollection(bool bufferRequest) 199public async Task ReadForm_EmptyMultipart_ReturnsParsedFormCollection(bool bufferRequest) 234public async Task ReadForm_MultipartWithField_ReturnsParsedFormCollection(bool bufferRequest) 271public async Task ReadFormAsync_MultipartWithFile_ReturnsParsedFormCollection(bool bufferRequest) 319public async Task ReadFormAsync_MultipartWithFileAndQuotedBoundaryString_ReturnsParsedFormCollection(bool bufferRequest) 356public async Task ReadFormAsync_MultipartWithEncodedFilename_ReturnsParsedFormCollection(bool bufferRequest) 404public async Task ReadFormAsync_MultipartWithFieldAndFile_ReturnsParsedFormCollection(bool bufferRequest) 451public async Task ReadFormAsync_NonFormOrFieldContentDisposition_ValueCountLimitExceeded_Throw(bool bufferRequest) 475public async Task ReadFormAsync_ValueCountLimitExceeded_Throw(bool bufferRequest) 499public async Task ReadFormAsync_ValueCountLimitExceededWithFiles_Throw(bool bufferRequest) 523public async Task ReadFormAsync_ValueCountLimitExceededWithMixedDisposition_Throw(bool bufferRequest) 552public async Task ReadFormAsync_MultipartWithFieldAndMediumFile_ReturnsParsedFormCollection(bool bufferRequest, int fileSize) 596public async Task ReadFormAsync_MultipartWithInvalidContentDisposition_Throw()
Features\RequestBodyPipeFeatureTests.cs (2)
28public async Task RequestBodyGetsDataFromSecondStream() 42public async Task RequestBodyDoesZeroByteRead()
Features\StreamResponseBodyFeatureTests.cs (3)
9public async Task CompleteAsyncCallsStartAsync() 23public async Task CompleteAsyncWontCallsStartAsyncIfAlreadyStarted() 62public override Task StartAsync(CancellationToken cancellationToken = default)
HttpContextAccessorTests.cs (6)
9public async Task HttpContextAccessor_GettingHttpContextReturnsHttpContext() 17await Task.Delay(100); 31public async Task HttpContextAccessor_GettingHttpContextReturnsNullHttpContextIfSetToNull() 76public async Task HttpContextAccessor_GettingHttpContextReturnsNullHttpContextIfChanged() 122public async Task HttpContextAccessor_GettingHttpContextDoesNotFlowIfAccessorSetToNull() 151public async Task HttpContextAccessor_GettingHttpContextDoesNotFlowIfExecutionContextDoesNotFlow()
Internal\DefaultHttpResponseTests.cs (14)
102responseMock.Verify(m => m.OnCompleted(It.IsAny<Func<object, Task>>(), It.IsAny<object>()), Times.Never); 106public async Task ResponseStart_CallsFeatureIfSet() 110mock.Setup(o => o.StartAsync(It.IsAny<CancellationToken>())).Returns(Task.CompletedTask); 124public async Task ResponseStart_CallsFeatureIfSetWithProvidedCancellationToken() 130mock.Setup(o => o.StartAsync(It.Is<CancellationToken>((localCt) => localCt.Equals(ct)))).Returns(Task.CompletedTask); 144public async Task ResponseStart_DoesNotCallStartIfHasStartedIsTrue() 149startMock.Setup(o => o.StartAsync(It.IsAny<CancellationToken>())).Returns(Task.CompletedTask); 163public async Task ResponseStart_CallsResponseBodyFlushIfNotSet() 175public async Task RegisterForDisposeHandlesDisposeAsyncIfObjectImplementsIAsyncDisposable() 193private readonly List<(Func<object, Task>, object)> _callbacks = new(); 201public void OnCompleted(Func<object, Task> callback, object state) 206public void OnStarting(Func<object, Task> callback, object state) 211public async Task ExecuteOnCompletedCallbacks() 270public override Task FlushAsync(CancellationToken cancellationToken)
Internal\ReferenceReadStreamTests.cs (2)
53public async Task WriteAsync_Throws() 67public async Task FlushAsync_DoesNotThrow()
Timeouts\RequestTimeoutsMiddlewareTests.cs (20)
13public async Task DefaultTimeoutWhenNoEndpoint() 26public async Task DefaultTimeoutWhenNoMetadata() 42public async Task TimeoutFromMetadataPolicy() 58public async Task TimeoutFromMetadataAttributeWithPolicy() 73public async Task TimeoutFromMetadataAttributeWithTimeSpan() 88public async Task SkipWhenNoDefaultTimeout() 105public async Task TimeoutsAttributeWithPolicyWinsOverDefault() 121public async Task TimeoutsAttributeWithTimeSpanWinsOverDefault() 137public async Task TimeoutsPolicyWinsOverDefault() 153public async Task DisableTimeoutAttributeSkipTheMiddleware() 174public async Task ThrowExceptionWhenPolicyNotFound() 187public async Task HandleTimeoutExceptionDefaultPolicy() 203public async Task HandleTimeoutExceptionFromDefaultPolicy() 220public async Task HandleTimeoutExceptionFromEndpointPolicy() 240public async Task SkipHandleTimeoutException() 294return Task.CompletedTask; 305return Task.CompletedTask; 315return Task.CompletedTask; 323Task next(HttpContext context) 337return Task.CompletedTask;
Microsoft.AspNetCore.HttpLogging (23)
BufferingStream.cs (2)
226public override Task FlushAsync(CancellationToken cancellationToken) 256public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
FileLoggerProcessor.cs (8)
31private readonly Task _outputTask; 103_outputTask = Task.Run(ProcessLogQueue); 119private async Task ProcessLogQueue() 144await Task.Delay(_flushInterval, _cancellationTokenSource.Token); 155private async Task WriteMessagesAsync(List<string> messages, CancellationToken cancellationToken) 260internal virtual async Task WriteMessageAsync(string message, StreamWriter streamWriter, CancellationToken cancellationToken) 333public virtual Task OnFirstWrite(StreamWriter streamWriter, CancellationToken cancellationToken) 335return Task.CompletedTask;
HttpLoggingMiddleware.cs (2)
49public Task Invoke(HttpContext context) 70private async Task InvokeInternal(HttpContext context, HttpLoggingOptions options,
ResponseBufferingStream.cs (5)
69public override async Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 148public async Task SendFileAsync(string path, long offset, long? count, CancellationToken cancellation) 154public async Task StartAsync(CancellationToken token = default) 160public async Task CompleteAsync() 172public override async Task FlushAsync(CancellationToken cancellationToken)
src\Shared\TaskToApm.cs (3)
32public static IAsyncResult Begin(Task task, AsyncCallback? callback, object? state) => 69internal readonly Task _task; 77internal TaskAsyncResult(Task task, object? state, AsyncCallback? callback)
W3CLoggerProcessor.cs (2)
25public override async Task OnFirstWrite(StreamWriter streamWriter, CancellationToken cancellationToken) 120internal override Task WriteMessageAsync(string message, StreamWriter streamWriter, CancellationToken cancellationToken)
W3CLoggingMiddleware.cs (1)
70public async Task Invoke(HttpContext context)
Microsoft.AspNetCore.HttpLogging.Tests (119)
FileLoggerProcessorTests.cs (16)
28public async Task WritesToTextFile() 62public async Task RollsTextFilesBasedOnDate() 110public async Task RollsTextFilesBasedOnSize() 150public async Task RespectsMaxFileCount() 205public async Task StopsLoggingAfter10000Files() 265public async Task InstancesWriteToSameDirectory() 351public async Task WritesToNewFileOnNewInstance() 414public async Task RollsTextFilesWhenFirstLogOfDayIsMissing() 483public async Task WritesToNewFileOnOptionsChange(bool fieldsChanged, bool headersChanged) 548private async Task WaitForFile(string filePath, int length) 552await Task.Delay(100); 567await Task.Delay(10); 571private async Task WaitForCondition(Func<bool> waitForLog) 575await Task.Delay(10); 579private async Task WaitForRoll(string filePath) 583await Task.Delay(100);
HttpLoggingMiddlewareTests.cs (81)
51return Task.CompletedTask; 61return Task.CompletedTask; 71return Task.CompletedTask; 81return Task.CompletedTask; 91return Task.CompletedTask; 101public async Task NoopWhenLoggingDisabled() 116public async Task DefaultRequestInfoOnlyHeadersAndRequestInfo() 145public async Task RequestLogsAllRequestInfo() 177public async Task RequestPropertiesLogs() 209public async Task RequestHeadersLogs() 242public async Task UnknownRequestHeadersRedacted() 268public async Task CanConfigureRequestAllowList() 290public async Task LogsMessageIfNotConsumed() 308public async Task RequestBodyReadingWorks(string expected) 339public async Task RequestBodyCopyToWorks(string expected) 367public async Task RequestBodyCopyToAsyncWorks(string expected) 394public async Task RequestBodyReadingLimitLongCharactersWorks() 431public async Task RequestBodyReadingLimitWorks() 467public async Task PartialReadBodyStillLogs() 492public async Task ZeroByteReadStillLogsRequestBody() 524public async Task VerifyDefaultMediaTypeHeaders(string contentType) 559public async Task RejectedContentTypes(string contentType) 597public async Task DifferentEncodingsWork() 635public async Task CharsetHonoredIfSupported() 674public async Task CharsetNotHonoredIfNotSupported() 712public async Task RequestInterceptorCanDisableRequestAndResponseLogs() 730public async Task RequestInterceptorCanEnableRequestAndResponseLogs() 757public async Task RequestInterceptorCanAugmentRequestLogs() 785public async Task RequestInterceptorCanReplaceRequestLogs() 814public async Task DefaultResponseInfoOnlyHeadersAndRequestInfo() 834public async Task ResponseInfoLogsAll() 858public async Task DurationLogs() 880public async Task ResponseWithExceptionBeforeBodyLogged() 904public async Task ResponseWithExceptionAfterBodyLogged() 930public async Task StatusCodeLogs() 954public async Task ResponseHeadersLogs() 978public async Task ResponseHeadersRedacted() 987return Task.CompletedTask; 998public async Task AllowedResponseHeadersModify() 1010return Task.CompletedTask; 1023public async Task ResponseBodyWritingWorks(string expected) 1043public async Task ResponseBodyNotLoggedIfEmpty() 1051return Task.CompletedTask; 1063public async Task ResponseBodyWritingLimitWorks() 1085public async Task FirstWriteResponseHeadersLogged() 1107var middlewareTask = middleware.Invoke(httpContext); 1123public async Task StartAsyncResponseHeadersLogged() 1145var middlewareTask = middleware.Invoke(httpContext); 1159public async Task UnrecognizedMediaType() 1180public async Task NoMediaType() 1195public async Task UpgradeToWebSocketLogsResponseStatusCodeWhenResponseIsFlushed() 1226var middlewareTask = middleware.Invoke(httpContext); 1238public async Task UpgradeWithCombineLogs_OneLog() 1299public async Task UpgradeToWebSocketLogsResponseHeadersWhenResponseIsFlushed() 1330var middlewareTask = middleware.Invoke(httpContext); 1342public async Task UpgradeToWebSocketDoesNotLogWhenResponseIsFlushedIfLoggingOptionsAreOtherThanResponseStatusCodeOrResponseHeaders() 1373var middlewareTask = middleware.Invoke(httpContext); 1388public async Task LogsWrittenOutsideUpgradeWrapperIfUpgradeDoesNotOccur(bool isUpgradableRequest) 1409var middlewareTask = middleware.Invoke(httpContext); 1423public async Task UpgradeToWebSocketLogsWrittenOnlyOnce(HttpLoggingFields loggingFields) 1460public async Task OriginalUpgradeFeatureIsRestoredBeforeMiddlewareCompletes(HttpLoggingFields loggingFields) 1484var middlewareTask = middleware.Invoke(httpContext); 1501public async Task CombineLogs_OneLog(HttpLoggingFields fields, bool hasRequestBody, bool hasResponseBody) 1570public async Task CombineLogs_Exception_RequestLogged() 1610public async Task ResponseInterceptorCanDisableResponseLogs() 1638public async Task ResponseInterceptorCanEnableResponseLogs() 1666public async Task ResponseInterceptorCanAugmentResponseLogs() 1694public async Task ResponseInterceptorCanReplaceResponseLogs() 1724public async Task HttpLoggingAttributeWithLessOptionsAppliesToEndpoint() 1739public async Task HttpLoggingAttributeWithMoreOptionsAppliesToEndpoint() 1754public async Task HttpLoggingAttributeCanRestrictHeaderOutputOnEndpoint() 1769public async Task HttpLoggingAttributeCanModifyRequestAndResponseSizeOnEndpoint() 1786public async Task InterceptorCanSeeAndOverrideAttributeSettings() 1814public async Task HttpLoggingExtensionWithLessOptionsAppliesToEndpoint() 1829public async Task HttpLoggingExtensionWithMoreOptionsAppliesToEndpoint() 1844public async Task HttpLoggingExtensionCanRestrictHeaderOutputOnEndpoint() 1859public async Task HttpLoggingExtensionCanModifyRequestAndResponseSizeOnEndpoint() 1876public async Task InterceptorCanSeeAndOverrideExtensions() 1904public async Task MultipleInterceptorsRun() 1980app ?? (c => Task.CompletedTask), 1988private static async Task RequestResponseApp(HttpContext context)
HttpLoggingServicesExtensionsTests.cs (1)
50public async Task UseHttpLogging_DoNotThrowWithoutOptions()
TestW3CLoggerProcessor.cs (3)
43public Task WaitForWrites(int numWrites) 49return Task.CompletedTask; 57public override async Task OnFirstWrite(StreamWriter streamWriter, CancellationToken cancellationToken)
W3CLoggerTests.cs (2)
14public async Task WritesDateTime() 57public async Task HandlesNullValuesAsync()
W3CLoggingMiddlewareTests.cs (16)
25return Task.CompletedTask; 32return Task.CompletedTask; 39public async Task NoopWhenLoggingDisabled() 49return Task.CompletedTask; 67public async Task DefaultDoesNotLogOptionalFields() 76return Task.CompletedTask; 105public async Task LogsAdditionalRequestHeaders() 118return Task.CompletedTask; 151public async Task LogCookie() 162return Task.CompletedTask; 181public async Task LogsAdditionalRequestHeaders_WithNoOtherOptions() 193return Task.CompletedTask; 217public async Task OmitsDuplicateAdditionalRequestHeaders() 238return Task.CompletedTask; 272public async Task TimeTakenIsInMilliseconds() 282return Task.CompletedTask;
Microsoft.AspNetCore.HttpOverrides (8)
CertificateForwardingFeature.cs (3)
28set => _certificateTask = value is not null ? Task.FromResult<X509Certificate2?>(value) : null; 38_certificateTask = Task.FromResult<X509Certificate2?>(certificate); 44return Task.FromResult<X509Certificate2?>(null);
CertificateForwardingMiddleware.cs (2)
46/// <returns>A <see cref="Task"/>.</returns> 47public Task Invoke(HttpContext httpContext)
ForwardedHeadersMiddleware.cs (1)
110public Task Invoke(HttpContext context)
HttpMethodOverrideMiddleware.cs (2)
36public Task Invoke(HttpContext context) 59private async Task InvokeCore(HttpContext context)
Microsoft.AspNetCore.HttpOverrides.Tests (53)
CertificateForwardingTest.cs (5)
38public async Task VerifyHeaderIsUsedIfNoCertificateAlreadySet() 76public async Task VerifyHeaderOverridesCertificateEvenAlreadySet() 115public async Task VerifySettingTheAzureHeaderOnTheForwarderOptionsWorks() 153public async Task VerifyACustomHeaderFailsIfTheHeaderIsNotPresent() 191public async Task VerifyArrHeaderEncodedCertFailsOnBadEncoding()
ForwardedHeadersMiddlewareTest.cs (36)
18public async Task XForwardedForDefaultSettingsChangeRemoteIpAndPort() 53public async Task XForwardedForFirstValueIsInvalid(int limit, string header, string expectedIp, int expectedPort) 107public async Task XForwardedForForwardLimit(int limit, string header, string expectedIp, int expectedPort, string remainingHeader, bool requireSymmetry) 150public async Task XForwardedForLoopback(string originalIp, bool expectForwarded) 216public async Task XForwardedForForwardKnownIps(int limit, string header, string knownIPs, string expectedIp, int expectedPort, bool requireSymmetry) 255public async Task XForwardedForOverrideBadIpDoesntChangeRemoteIp() 284public async Task XForwardedHostOverrideChangesRequestHost() 348public async Task XForwardedHostAllowsValidCharacters(string hostHeader) 367return Task.FromResult(0); 433public async Task XForwardedHostFailsForInvalidCharacters(string hostHeader) 452return Task.FromResult(0); 484public async Task XForwardedHostAllowsSpecifiedHost(string hostHeader, string allowedHost) 503return Task.FromResult(0); 535public async Task XForwardedHostFailsMismatchedHosts(string hostHeader, string allowedHost) 554return Task.FromResult(0); 570public async Task XForwardedHostStopsAtFirstUnspecifiedHost() 590return Task.FromResult(0); 613public async Task XForwardedProtoOverrideChangesRequestProtocol(int limit, string header, string expected) 660public async Task XForwardedProtoAcceptsValidProtocols(string scheme) 679return Task.FromResult(0); 717public async Task XForwardedProtoRejectsInvalidProtocols(string scheme) 736return Task.FromResult(0); 761public async Task XForwardedProtoOverrideLimitedByXForwardedForCount(int limit, string protoHeader, string forHeader, string expected) 803public async Task XForwardedProtoOverrideCanBeIndependentOfXForwardedForCount(int limit, string protoHeader, string forHeader, string expected) 847public async Task XForwardedProtoOverrideLimitedByLoopback(string protoHeader, string forHeader, string remoteIp, bool loopback, string expected) 896public async Task AllForwardsEnabledChangeRequestRemoteIpHostProtocolAndPathBase() 931public async Task AllOptionsDisabledRequestDoesntChange() 966public async Task PartiallyEnabledForwardsPartiallyChangesRequest() 1004public async Task XForwardForIPv4ToIPv6Mapping(string forHeader, string knownProxies, string knownNetworks, string expectedRemoteIp) 1051public async Task ForwardersWithDIOptionsRunsOnce(int limit, string header, string expectedScheme, string remainingHeader) 1091public async Task ForwardersWithDirectOptionsRunsTwice(int limit, string header, string expectedScheme, string remainingHeader) 1133public async Task XForwardedPrefixReplaceEmptyPathBase( 1173public async Task XForwardedPrefixReplaceNonEmptyPathBase( 1213public async Task XForwardedPrefixInvalidPath(string forwardedPrefix) 1248public async Task XForwardedPrefixParameterCountMismatch( 1299public async Task XForwardedPrefixTruncateConsumedValues(
HttpMethodOverrideMiddlewareTest.cs (12)
15public async Task XHttpMethodOverrideHeaderAvaiableChangesRequestMethod() 30return Task.FromResult(0); 46public async Task XHttpMethodOverrideHeaderUnavaiableDoesntChangeRequestMethod() 61return Task.FromResult(0); 76public async Task XHttpMethodOverrideFromGetRequestDoesntChangeMethodType() 91return Task.FromResult(0); 106public async Task FormFieldAvailableChangesRequestMethod() 124return Task.FromResult(0); 144public async Task FormFieldUnavailableDoesNotChangeRequestMethod() 162return Task.FromResult(0); 181public async Task FormFieldEmptyDoesNotChangeRequestMethod() 199return Task.FromResult(0);
Microsoft.AspNetCore.HttpsPolicy (3)
HstsMiddleware.cs (1)
62public Task Invoke(HttpContext context)
HttpsRedirectionMiddleware.cs (2)
78public Task Invoke(HttpContext context) 114return Task.CompletedTask;
Microsoft.AspNetCore.HttpsPolicy.Tests (19)
HstsMiddlewareTests.cs (9)
35_ = new HstsMiddleware(innerHttpContext => Task.CompletedTask, options: null); 40public async Task SetOptionsWithDefault_SetsMaxAgeToCorrectValue() 81public async Task SetOptionsThroughConfigure_SetsHeaderCorrectly(int maxAge, bool includeSubDomains, bool preload, string expected) 127public async Task SetOptionsThroughHelper_SetsHeaderCorrectly(int maxAge, bool includeSubDomains, bool preload, string expected) 172public async Task DefaultExcludesCommonLocalhostDomains_DoesNotSetHstsHeader(string hostUrl) 222public async Task AllowLocalhostDomainsIfListIsReset_SetHstsHeader(string hostUrl) 277public async Task AddExcludedDomains_DoesNotAddHstsHeader(string hostUrl) 329public async Task WhenRequestIsInsecure_DoesNotAddHstsHeader() 376public async Task WhenRequestIsSecure_AddsHstsHeader()
HttpsPolicyTests.cs (1)
26public async Task SetsBothHstsAndHttpsRedirection_RedirectOnFirstRequest_HstsOnSecondRequest(int statusCode, int? tlsPort, int maxAge, bool includeSubDomains, bool preload, string expectedHstsHeader, string expectedUrl)
HttpsRedirectionMiddlewareTests.cs (9)
21public async Task SetOptions_NotEnabledByDefault() 71public async Task SetOptions_SetStatusCodeHttpsPort(int statusCode, int? httpsPort, string expected) 127public async Task SetOptionsThroughHelperMethod_SetStatusCodeAndHttpsPort(int statusCode, int? httpsPort, string expectedUrl) 186public async Task SetHttpsPortEnvironmentVariableAndServerFeature_ReturnsCorrectStatusCodeOnResponse( 232public async Task SetServerAddressesFeature_SingleHttpsAddress_Success() 283public async Task SetServerAddressesFeature_MultipleHttpsAddresses_Throws() 318public async Task SetServerAddressesFeature_MultipleHttpsAddressesWithSamePort_Success() 371public async Task NoServerAddressFeature_DoesNotThrow_DoesNotRedirect() 413public async Task SetNullAddressFeature_DoesNotThrow()
Microsoft.AspNetCore.Identity (40)
DataProtectorTokenProvider.cs (1)
189return Task.FromResult(false);
IdentityApiEndpointRouteBuilderExtensions.cs (1)
388async Task SendConfirmationEmailAsync(TUser user, UserManager<TUser> userManager, HttpContext context, string email, bool isChange = false)
IdentityCookiesBuilderExtensions.cs (1)
105OnRedirectToReturnUrl = _ => Task.CompletedTask
IdentityServiceCollectionExtensions.cs (3)
85OnRedirectToReturnUrl = _ => Task.CompletedTask 206protected override Task HandleSignInAsync(ClaimsPrincipal user, AuthenticationProperties? properties) 211protected override Task HandleSignOutAsync(AuthenticationProperties? properties)
IEmailSender.cs (1)
20Task SendEmailAsync(string email, string subject, string htmlMessage);
IEmailSenderOfT.cs (3)
20Task SendConfirmationLinkAsync(TUser user, string email, string confirmationLink); 30Task SendPasswordResetLinkAsync(TUser user, string email, string resetLink); 40Task SendPasswordResetCodeAsync(TUser user, string email, string resetCode);
ISecurityStampValidator.cs (2)
21/// <returns>The <see cref="Task"/> that represents the asynchronous validation operation.</returns> 22Task ValidateAsync(CookieValidatePrincipalContext context);
NoOpEmailSender.cs (3)
14/// This method does nothing other return <see cref="Task.CompletedTask"/>. It should be replaced by a custom implementation 17public Task SendEmailAsync(string email, string subject, string htmlMessage) => Task.CompletedTask;
SecurityStampValidator.cs (6)
92protected virtual async Task SecurityStampVerified(TUser user, CookieValidatePrincipalContext context) 135/// <returns>The <see cref="Task"/> that represents the asynchronous validation operation.</returns> 136public virtual async Task ValidateAsync(CookieValidatePrincipalContext context) 177/// <returns>The <see cref="Task"/> that represents the asynchronous validation operation.</returns> 178public static Task ValidatePrincipalAsync(CookieValidatePrincipalContext context) 190public static Task ValidateAsync<TValidator>(CookieValidatePrincipalContext context) where TValidator : ISecurityStampValidator
SecurityStampValidatorOptions.cs (1)
22public Func<SecurityStampRefreshingPrincipalContext, Task>? OnRefreshingPrincipal { get; set; }
SignInManager.cs (13)
162public virtual async Task RefreshSignInAsync(TUser user) 194public virtual Task SignInAsync(TUser user, bool isPersistent, string? authenticationMethod = null) 205public virtual Task SignInAsync(TUser user, AuthenticationProperties authenticationProperties, string? authenticationMethod = null) 223public virtual Task SignInWithClaimsAsync(TUser user, bool isPersistent, IEnumerable<Claim> additionalClaims) 233public virtual async Task SignInWithClaimsAsync(TUser user, AuthenticationProperties? authenticationProperties, IEnumerable<Claim> additionalClaims) 251public virtual async Task SignOutAsync() 449public virtual async Task RememberTwoFactorClientAsync(TUser user) 461public virtual Task ForgetTwoFactorClientAsync() 724/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> of the operation.</returns> 909return Task.FromResult(SignInResult.LockedOut); 934/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> of the operation.</returns> 935protected virtual async Task ResetLockout(TUser user) 964var resetLockoutTask = ResetLockout(user);
src\Shared\DefaultMessageEmailSender.cs (3)
12public Task SendConfirmationLinkAsync(TUser user, string email, string confirmationLink) => 15public Task SendPasswordResetLinkAsync(TUser user, string email, string resetLink) => 18public Task SendPasswordResetCodeAsync(TUser user, string email, string resetCode) =>
TwoFactorSecurityStampValidator.cs (2)
52protected override Task SecurityStampVerified(TUser user, CookieValidatePrincipalContext context) 53=> Task.CompletedTask;
Microsoft.AspNetCore.Identity.EntityFrameworkCore (75)
RoleStore.cs (16)
115/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 116protected virtual async Task SaveChanges(CancellationToken cancellationToken) 199return Task.FromResult(ConvertIdToString(role.Id)!); 213return Task.FromResult(role.Name); 222/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 223public virtual Task SetRoleNameAsync(TRole role, string? roleName, CancellationToken cancellationToken = default(CancellationToken)) 229return Task.CompletedTask; 298return Task.FromResult(role.NormalizedName); 307/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 308public virtual Task SetNormalizedRoleNameAsync(TRole role, string? normalizedName, CancellationToken cancellationToken = default(CancellationToken)) 314return Task.CompletedTask; 350/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 351public virtual Task AddClaimAsync(TRole role, Claim claim, CancellationToken cancellationToken = default(CancellationToken)) 358return Task.FromResult(false); 367/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 368public virtual async Task RemoveClaimAsync(TRole role, Claim claim, CancellationToken cancellationToken = default(CancellationToken))
UserOnlyStore.cs (27)
137/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 138protected Task SaveChanges(CancellationToken cancellationToken) 140return AutoSaveChanges ? Context.SaveChangesAsync(cancellationToken) : Task.CompletedTask; 148/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> of the creation operation.</returns> 164/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> of the update operation.</returns> 190/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> of the update operation.</returns> 215/// The <see cref="Task"/> that represents the asynchronous operation, containing the user matching the specified <paramref name="userId"/> if it exists. 231/// The <see cref="Task"/> that represents the asynchronous operation, containing the user matching the specified <paramref name="normalizedUserName"/> if it exists. 305/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 306public override Task AddClaimsAsync(TUser user, IEnumerable<Claim> claims, CancellationToken cancellationToken = default(CancellationToken)) 315return Task.FromResult(false); 325/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 326public override async Task ReplaceClaimAsync(TUser user, Claim claim, Claim newClaim, CancellationToken cancellationToken = default(CancellationToken)) 347/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 348public override async Task RemoveClaimsAsync(TUser user, IEnumerable<Claim> claims, CancellationToken cancellationToken = default(CancellationToken)) 369/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 370public override Task AddLoginAsync(TUser user, UserLoginInfo login, 378return Task.FromResult(false); 388/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 389public override async Task RemoveLoginAsync(TUser user, string loginProvider, string providerKey, 408/// The <see cref="Task"/> for the asynchronous operation, containing a list of <see cref="UserLoginInfo"/> for the specified <paramref name="user"/>, if any. 427/// The <see cref="Task"/> for the asynchronous operation, containing the user, if any which matched the specified login provider and key. 464/// The <see cref="Task"/> contains a list of users, if any, that contain the specified claim. 497protected override Task AddUserTokenAsync(TUserToken token) 500return Task.CompletedTask; 508protected override Task RemoveUserTokenAsync(TUserToken token) 511return Task.CompletedTask;
UserStore.cs (32)
139/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 140protected Task SaveChanges(CancellationToken cancellationToken) 142return AutoSaveChanges ? Context.SaveChangesAsync(cancellationToken) : Task.CompletedTask; 150/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> of the creation operation.</returns> 166/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> of the update operation.</returns> 192/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> of the update operation.</returns> 217/// The <see cref="Task"/> that represents the asynchronous operation, containing the user matching the specified <paramref name="userId"/> if it exists. 233/// The <see cref="Task"/> that represents the asynchronous operation, containing the user matching the specified <paramref name="normalizedUserName"/> if it exists. 316/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 317public override async Task AddToRoleAsync(TUser user, string normalizedRoleName, CancellationToken cancellationToken = default(CancellationToken)) 338/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 339public override async Task RemoveFromRoleAsync(TUser user, string normalizedRoleName, CancellationToken cancellationToken = default(CancellationToken)) 420/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 421public override Task AddClaimsAsync(TUser user, IEnumerable<Claim> claims, CancellationToken cancellationToken = default(CancellationToken)) 430return Task.FromResult(false); 440/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 441public override async Task ReplaceClaimAsync(TUser user, Claim claim, Claim newClaim, CancellationToken cancellationToken = default(CancellationToken)) 462/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 463public override async Task RemoveClaimsAsync(TUser user, IEnumerable<Claim> claims, CancellationToken cancellationToken = default(CancellationToken)) 484/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 485public override Task AddLoginAsync(TUser user, UserLoginInfo login, 493return Task.FromResult(false); 503/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 504public override async Task RemoveLoginAsync(TUser user, string loginProvider, string providerKey, 523/// The <see cref="Task"/> for the asynchronous operation, containing a list of <see cref="UserLoginInfo"/> for the specified <paramref name="user"/>, if any. 542/// The <see cref="Task"/> for the asynchronous operation, containing the user, if any which matched the specified login provider and key. 579/// The <see cref="Task"/> contains a list of users, if any, that contain the specified claim. 602/// The <see cref="Task"/> contains a list of users, if any, that are in the specified role. 640protected override Task AddUserTokenAsync(TUserToken token) 643return Task.CompletedTask; 651protected override Task RemoveUserTokenAsync(TUserToken token) 654return Task.CompletedTask;
Microsoft.AspNetCore.Identity.EntityFrameworkCore.Test (50)
CustomPocoTest.cs (6)
28public async Task CanUpdateNameGuid() 50public async Task CanUpdateNameString() 72public async Task CanCreateUserInt() 92public async Task CanCreateUserIntViaSet() 113public async Task CanUpdateNameInt() 135public async Task CanUpdateNameIntWithSet()
DefaultPocoTest.cs (1)
42public async Task EnsureStartupUsageWorks()
SqlStoreOnlyUsersTestBase.cs (7)
104public async Task DeleteUserRemovesTokensTest() 133public async Task CanCreateUsingManager() 141private async Task LazyLoadTestSetup(TestUserDbContext db, TUser user) 159public async Task LoadFromDbFindByIdTest() 175public async Task LoadFromDbFindByNameTest() 190public async Task LoadFromDbFindByLoginTest() 205public async Task LoadFromDbFindByEmailTest()
SqlStoreTestBase.cs (10)
155public async Task DeleteRoleNonEmptySucceedsTest() 180public async Task DeleteUserRemovesFromRoleTest() 203public async Task DeleteUserRemovesTokensTest() 232public async Task CanCreateUsingManager() 240private async Task LazyLoadTestSetup(TestDbContext db, TUser user) 265public async Task LoadFromDbFindByIdTest() 281public async Task LoadFromDbFindByNameTest() 296public async Task LoadFromDbFindByLoginTest() 311public async Task GetSecurityStampThrowsIfNull() 322public async Task LoadFromDbFindByEmailTest()
src\Identity\test\Shared\ApiConsistencyTestBase.cs (1)
42where typeof(Task).IsAssignableFrom(method.ReturnType)
src\Identity\test\Shared\MockHelpers.cs (1)
50.Returns(Task.FromResult(IdentityResult.Success)).Verifiable();
UserOnlyCustomContextTest.cs (1)
87public async Task EnsureStartupUsageWorks()
UserOnlyTest.cs (2)
48public async Task EnsureStartupUsageWorks() 64public async Task FindByEmailThrowsWithTwoUsersWithSameEmail()
UserStoreEncryptPersonalDataTest.cs (6)
71public async Task CanRotateKeysAndStillFind() 166public Task CustomPersonalDataPropertiesCanBeProtected() 174public Task CustomPersonalDataPropertiesCanBeNotProtected() 177private async Task CustomPersonalDataPropertiesAreProtected<TContext>(bool protect) 300public override Task CanFindUsersViaUserQueryable() 301=> Task.CompletedTask;
UserStoreTest.cs (12)
64public async Task SqlUserStoreMethodsThrowWhenDisposedTest() 97public async Task UserStorePublicNullCheckTest() 163public async Task CanCreateUsingManager() 173public async Task TwoUsersSamePasswordDifferentHash() 185public async Task FindByEmailThrowsWithTwoUsersWithSameEmail() 199public async Task AddUserToUnknownRoleFails() 209public async Task ConcurrentUpdatesWillFail() 240public async Task ConcurrentUpdatesWillFailWithDetachedUser() 269public async Task DeleteAModifiedUserWillFail() 299public async Task ConcurrentRoleUpdatesWillFail() 330public async Task ConcurrentRoleUpdatesWillFailWithDetachedRole() 360public async Task DeleteAModifiedRoleWillFail()
UserStoreWithGenericsTest.cs (3)
97public async Task CanAddRemoveUserClaimWithIssuer() 125public async Task RemoveClaimWithIssuerOnlyAffectsUser() 154public async Task CanReplaceUserClaimWithIssuer()
Microsoft.AspNetCore.Identity.FunctionalTests (97)
AuthorizationTests.cs (4)
40public async Task AnonymousUserCantAccessAuthorizedPages(string url) 77public async Task AuthenticatedUserCanAccessAuthorizedPages(string url) 112public async Task AnonymousUserCanAccessNotAuthorizedPages(string url) 137public async Task AnonymousUserAllowedAccessToPages_WithGlobalAuthorizationFilter(string url)
Infrastructure\FunctionalTestsServiceCollectionExtensions.cs (1)
38return Task.CompletedTask;
LoginTests.cs (16)
23public async Task CanLogInWithAPreviouslyRegisteredUser() 40public async Task CanLogInWithAPreviouslyRegisteredUser_WithGlobalAuthorizeFilter() 63public async Task CanLogInWithTwoFactorAuthentication() 83public async Task CanLogInWithTwoFactorAuthentication_WithGlobalAuthorizeFilter() 109public async Task CanLogInWithRecoveryCode() 129public async Task CanLogInWithRecoveryCode_WithGlobalAuthorizeFilter() 154public async Task CannotLogInWithoutRequiredEmailConfirmation() 178public async Task CannotLogInWithoutRequiredEmailConfirmation_WithGlobalAuthorizeFilter() 203public async Task CanLogInAfterConfirmingEmail() 230public async Task CanResendConfirmingEmail() 257public async Task CanLogInAfterConfirmingEmail_WithGlobalAuthorizeFilter() 285public async Task CanLoginWithASocialLoginProvider() 306public async Task CanLoginWithASocialLoginProvider_WithGlobalAuthorizeFilter() 328public async Task CanLogInAfterResettingThePassword() 358public async Task CanResetPassword_WithGlobalAuthorizeFilter() 388public async Task UserNotLockedOut_AfterMaxFailedAccessAttempts_WithGlobalAuthorizeFilter()
ManagementTests.cs (12)
25public async Task CanEnableTwoFactorAuthentication() 41public async Task CannotEnableTwoFactorAuthenticationWithoutCookieConsent() 57public async Task CanConfirmEmail() 81public async Task CanChangeEmail() 112public async Task CanChangePassword() 147public async Task CanSetPasswordWithExternalLogin() 187public async Task CanRemoveExternalLogin() 215public async Task CanSeeExternalLoginProviderDisplayName() 237public async Task CanResetAuthenticator() 274public async Task CanDownloadPersonalData(bool twoFactor, bool social) 334public async Task GetOnDownloadPersonalData_ReturnsNotFound() 350public async Task CanDeleteUser()
MapIdentityApiTests.cs (47)
41public async Task CanRegisterUser(string addIdentityMode) 50public async Task RegisterFailsGivenNoEmail() 60public async Task RegisterFailsGivenInvalidEmail(string addIdentityMode) 71public async Task RegisterFailsGivenDuplicateEmail(string addIdentityMode) 82public async Task LoginFailsGivenUnregisteredUser() 92public async Task LoginFailsGivenWrongPassword() 104public async Task CanLoginWithBearerToken(string addIdentityMode) 130public async Task CanChangeAccessTokenResponseJsonOptions(string addIdentityMode) 161public async Task CanCustomizeBearerTokenExpiration() 205public async Task CanLoginWithCookies() 228public async Task CannotLoginWithCookiesWithOnlyCoreServices() 240public async Task CanReadBearerTokenFromQueryString() 251return Task.CompletedTask; 273public async Task Returns401UnauthorizedStatusGivenNoBearerTokenOrCookie(string addIdentityMode) 289public async Task CanUseRefreshToken(string addIdentityMode) 308public async Task Returns401UnauthorizedStatusGivenNullOrEmptyRefreshToken() 321public async Task CanCustomizeRefreshTokenExpiration() 378public async Task RefreshReturns401UnauthorizedIfSecurityStampChanges() 397public async Task RefreshUpdatesUserFromStore() 423public async Task LoginCanBeLockedOut() 452public async Task LockoutCanBeDisabled() 478public async Task AccountConfirmationCanBeEnabled() 503public async Task EmailConfirmationCanBeEnabled() 528public async Task EmailConfirmationCanBeResent() 566public async Task AccountConfirmationEmailCanBeCustomized() 587public async Task CanAddEndpointsToMultipleRouteGroupsForSameUserType() 616public async Task CanAddEndpointsToMultipleRouteGroupsForMultipleUsersTypes() 664public async Task CanEnableAndLoginWithTwoFactor(string addIdentityMode) 722public async Task CanLoginWithRecoveryCodeAndDisableTwoFactor() 774public async Task CanResetSharedKey() 821public async Task CanResetRecoveryCodes() 890public async Task CanUsePersistentTwoFactorCookies() 948public async Task CanResetPassword() 1019public async Task CanChangeEmail(string addIdentityModes) 1110public async Task CannotUpdateClaimsDuringInfoPostWithCookies() 1195public async Task CanChangePasswordWithoutResetEmail() 1218public async Task MustSendValidRequestToSendEmailChangeConfirmation() 1380private async Task RegisterAsync(HttpClient client, string? groupPrefix = null, string? email = null) 1446private static async Task AssertProblemAsync(HttpResponseMessage response, string? detail, string? title = null, HttpStatusCode status = HttpStatusCode.Unauthorized) 1456private static async Task AssertValidationProblemAsync(HttpResponseMessage response, string error) 1501return Task.FromResult(true); 1514public Task SendEmailAsync(string email, string subject, string htmlMessage) 1517return Task.CompletedTask; 1526public Task SendConfirmationLinkAsync(ApplicationUser user, string email, string confirmationLink) 1530return Task.CompletedTask; 1533public Task SendPasswordResetCodeAsync(ApplicationUser user, string email, string resetCode) => 1536public Task SendPasswordResetLinkAsync(ApplicationUser user, string email, string resetLink) =>
NoIdentityAddedTests.cs (1)
22public async Task QueryingIdentityEndpointsReturnsNotFoundWhenIdentityIsNotPresent(string endpoint)
Pages\Account\Login.cs (1)
76public async Task LoginWrongPasswordAsync(string userName, string password)
RegistrationTests.cs (12)
24public async Task CanRegisterAUser() 41public async Task CanRegisterAUserWithRequiredConfirmation() 65public Task SendEmailAsync(string email, string subject, string htmlMessage) 66=> Task.CompletedTask; 70public async Task RegisterWithRealConfirmationDoesNotShowLink() 95public async Task CanRegisterAUser_WithGlobalAuthorizeFilter() 113public async Task CanRegisterWithASocialLoginProviderFromLogin() 133public async Task CanRegisterWithASocialLoginProviderFromLoginWithConfirmation() 155public async Task CanRegisterWithASocialLoginProviderFromLoginWithConfirmationAndRealEmailSender() 181public async Task CanRegisterWithASocialLoginProviderFromRegister() 201public async Task CanRegisterWithASocialLoginProvider_WithGlobalAuthorizeFilter() 222public async Task RegisterWithASocialLoginProviderSetsAuthenticationMethodClaim()
UserStories.cs (3)
47internal static async Task LoginFailsWithWrongPasswordAsync(HttpClient client, string userName, string password) 193internal static async Task ResendConfirmEmailAsync(HttpClient client, string email) 274internal static async Task AcceptCookiePolicy(HttpClient client)
Microsoft.AspNetCore.Identity.InMemory.Test (113)
ControllerTest.cs (4)
20public async Task VerifyAccountControllerSignIn(bool isPersistent) 26It.IsAny<AuthenticationProperties>())).Returns(Task.FromResult(0)).Verifiable(); 62public async Task VerifyAccountControllerExternalLoginWithTokensFlow() 80auth.Setup(a => a.AuthenticateAsync(context, It.IsAny<string>())).Returns(Task.FromResult(AuthenticateResult.NoResult()));
FunctionalTest.cs (10)
30public async Task CanChangePasswordOptions() 47public async Task CookieContainsRoleClaim() 69public async Task CanCreateMeLoginAndCookieStopsWorkingAfterExpiration(bool testCore) 117public async Task CanCreateMeLoginAndSecurityStampExtendsExpiration(bool rememberMe, bool testCore) 166public async Task CanAccessOldPrincipalDuringSecurityStampReplacement(bool testCore) 179return Task.FromResult(0); 219public async Task TwoFactorRememberCookieVerification(bool testCore) 248public async Task TwoFactorRememberCookieClearedBySecurityStampChange(bool testCore) 291private async Task<TestServer> CreateServer(Action<IServiceCollection> configureServices = null, Func<HttpContext, Task> testpath = null, Uri baseAddress = null, bool testCore = false) 405private static async Task DescribeAsync(HttpResponse res, AuthenticateResult result)
InMemoryStore.cs (26)
18public Task AddToRoleAsync(TUser user, string role, CancellationToken cancellationToken = default(CancellationToken)) 25return Task.FromResult(0); 29public Task RemoveFromRoleAsync(TUser user, string role, CancellationToken cancellationToken = default(CancellationToken)) 37return Task.FromResult(0); 47return Task.FromResult(roles); 54return Task.FromResult(result); 65return Task.FromResult<IList<TUser>>(new List<TUser>()); 67return Task.FromResult<IList<TUser>>(Users.Where(u => (u.Roles.Where(x => x.RoleId == role.Id).Any())).Select(x => x).ToList()); 75return Task.FromResult(IdentityResult.Success); 85return Task.FromResult(IdentityResult.Success); 90return Task.FromResult(role.Id); 95return Task.FromResult(role.Name); 98public Task SetRoleNameAsync(TRole role, string roleName, CancellationToken cancellationToken = default(CancellationToken)) 101return Task.FromResult(0); 107return Task.FromResult(IdentityResult.Success); 114return Task.FromResult(_roles[roleId]); 116return Task.FromResult<TRole>(null); 122Task.FromResult( 129return Task.FromResult<IList<Claim>>(claims); 132public Task AddClaimAsync(TRole role, Claim claim, CancellationToken cancellationToken = default(CancellationToken)) 135return Task.FromResult(0); 138public Task RemoveClaimAsync(TRole role, Claim claim, CancellationToken cancellationToken = default(CancellationToken)) 147return Task.FromResult(0); 152return Task.FromResult(role.NormalizedName); 155public Task SetNormalizedRoleNameAsync(TRole role, string normalizedName, CancellationToken cancellationToken = default(CancellationToken)) 158return Task.FromResult(0);
InMemoryUserStore.cs (71)
36return Task.FromResult<IList<Claim>>(claims); 39public Task AddClaimsAsync(TUser user, IEnumerable<Claim> claims, CancellationToken cancellationToken = default(CancellationToken)) 45return Task.FromResult(0); 48public Task ReplaceClaimAsync(TUser user, Claim claim, Claim newClaim, CancellationToken cancellationToken = default(CancellationToken)) 56return Task.FromResult(0); 59public Task RemoveClaimsAsync(TUser user, IEnumerable<Claim> claims, CancellationToken cancellationToken = default(CancellationToken)) 71return Task.FromResult(0); 74public Task SetEmailAsync(TUser user, string email, CancellationToken cancellationToken = default(CancellationToken)) 77return Task.FromResult(0); 82return Task.FromResult(user.Email); 87return Task.FromResult(user.NormalizedEmail); 90public Task SetNormalizedEmailAsync(TUser user, string normalizedEmail, CancellationToken cancellationToken = default(CancellationToken)) 93return Task.FromResult(0); 98return Task.FromResult(user.EmailConfirmed); 101public Task SetEmailConfirmedAsync(TUser user, bool confirmed, CancellationToken cancellationToken = default(CancellationToken)) 104return Task.FromResult(0); 110Task.FromResult( 116return Task.FromResult(user.LockoutEnd); 119public Task SetLockoutEndDateAsync(TUser user, DateTimeOffset? lockoutEnd, CancellationToken cancellationToken = default(CancellationToken)) 122return Task.FromResult(0); 128return Task.FromResult(user.AccessFailedCount); 131public Task ResetAccessFailedCountAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken)) 134return Task.FromResult(0); 139return Task.FromResult(user.AccessFailedCount); 144return Task.FromResult(user.LockoutEnabled); 147public Task SetLockoutEnabledAsync(TUser user, bool enabled, CancellationToken cancellationToken = default(CancellationToken)) 150return Task.FromResult(0); 158public virtual Task AddLoginAsync(TUser user, UserLoginInfo login, 169return Task.FromResult(0); 172public Task RemoveLoginAsync(TUser user, string loginProvider, string providerKey, 185return Task.FromResult(0); 192return Task.FromResult(result); 200return Task.FromResult(_logins[key]); 202return Task.FromResult<TUser>(null); 207return Task.FromResult(user.Id); 212return Task.FromResult(user.UserName); 215public Task SetUserNameAsync(TUser user, string userName, CancellationToken cancellationToken = default(CancellationToken)) 218return Task.FromResult(0); 224return Task.FromResult(IdentityResult.Success); 230return Task.FromResult(IdentityResult.Success); 237return Task.FromResult(_users[userId]); 239return Task.FromResult<TUser>(null); 249Task.FromResult( 260return Task.FromResult(IdentityResult.Success); 263public Task SetPasswordHashAsync(TUser user, string passwordHash, CancellationToken cancellationToken = default(CancellationToken)) 266return Task.FromResult(0); 271return Task.FromResult(user.PasswordHash); 276return Task.FromResult(user.PasswordHash != null); 279public Task SetPhoneNumberAsync(TUser user, string phoneNumber, CancellationToken cancellationToken = default(CancellationToken)) 282return Task.FromResult(0); 287return Task.FromResult(user.PhoneNumber); 292return Task.FromResult(user.PhoneNumberConfirmed); 295public Task SetPhoneNumberConfirmedAsync(TUser user, bool confirmed, CancellationToken cancellationToken = default(CancellationToken)) 298return Task.FromResult(0); 301public Task SetSecurityStampAsync(TUser user, string stamp, CancellationToken cancellationToken = default(CancellationToken)) 304return Task.FromResult(0); 309return Task.FromResult(user.SecurityStamp); 312public Task SetTwoFactorEnabledAsync(TUser user, bool enabled, CancellationToken cancellationToken = default(CancellationToken)) 315return Task.FromResult(0); 320return Task.FromResult(user.TwoFactorEnabled); 325return Task.FromResult(user.NormalizedUserName); 328public Task SetNormalizedUserNameAsync(TUser user, string userName, CancellationToken cancellationToken = default(CancellationToken)) 331return Task.FromResult(0); 342return Task.FromResult<IList<TUser>>(query.ToList()); 345public Task SetTokenAsync(TUser user, string loginProvider, string name, string value, CancellationToken cancellationToken) 366return Task.FromResult(0); 369public Task RemoveTokenAsync(TUser user, string loginProvider, string name, CancellationToken cancellationToken) 380return Task.FromResult(0); 390return Task.FromResult(tokenEntity?.TokenValue); 397public Task SetAuthenticatorKeyAsync(TUser user, string key, CancellationToken cancellationToken) 407public Task ReplaceCodesAsync(TUser user, IEnumerable<string> recoveryCodes, CancellationToken cancellationToken)
src\Identity\test\Shared\ApiConsistencyTestBase.cs (1)
42where typeof(Task).IsAssignableFrom(method.ReturnType)
src\Identity\test\Shared\MockHelpers.cs (1)
50.Returns(Task.FromResult(IdentityResult.Success)).Verifiable();
Microsoft.AspNetCore.Identity.Specification.Tests (117)
IdentitySpecificationTestBase.cs (24)
128public async Task CanCreateRoleTest() 145return Task.FromResult(IdentityResult.Failed(ErrorMessage)); 150return Task.FromResult(IdentityResult.Failed(ErrorMessage)); 155return Task.FromResult(IdentityResult.Failed(ErrorMessage)); 164public async Task BadValidatorBlocksCreateRole() 180public async Task CanChainRoleValidators() 198public async Task BadValidatorBlocksRoleUpdate() 215public async Task CanDeleteRole() 232public async Task CanAddRemoveRoleClaim() 271public async Task CanRoleFindById() 285public async Task CanRoleFindByName() 301public async Task CanUpdateRoleName() 320public virtual async Task CanQueryableRoles() 343public async Task CreateRoleFailsIfExists() 360public async Task CanAddUsersToRole() 385public async Task CanGetRolesForUser() 423public async Task RemoveUserFromRoleWithMultipleRoles() 446public async Task CanRemoveUsersFromRole() 476public async Task RemoveUserNotInRoleFails() 496public async Task AddUserToRoleFailsIfAlreadyInRole() 517public async Task AddUserToRolesIgnoresDuplicates() 537public async Task CanFindRoleByNameWithManager() 551public async Task CanFindRoleWithManager() 565public async Task CanGetUsersInRole()
UserManagerSpecificationTests.cs (93)
147return Task.FromResult(IdentityResult.Failed(ErrorMessage)); 152return Task.FromResult(IdentityResult.Failed(ErrorMessage)); 161return Task.FromResult(IdentityResult.Failed()); 166return Task.FromResult(IdentityResult.Failed()); 175public async Task PasswordValidatorWithNoErrorsCanBlockAddPassword() 190public async Task CreateUserWillSetCreateDateOnlyIfSupported() 203public async Task CanDeleteUser() 218public async Task CanUpdateUserName() 237public async Task CheckSetUserNameValidatesUser() 265public async Task SetUserNameUpdatesSecurityStamp() 283public async Task ResetAuthenticatorKeyUpdatesSecurityStamp() 299public async Task CheckSetEmailValidatesUser() 321public async Task CanUpdatePasswordUsingHasher() 341public async Task CanFindById() 354public async Task UserValidatorCanBlockCreate() 369public async Task UserValidatorCanBlockUpdate() 385public async Task CanChainUserValidators() 405public async Task UserValidatorBlocksShortEmailsWhenRequiresUniqueEmail(string email) 420public async Task UserValidatorBlocksInvalidEmailsWhenRequiresUniqueEmail(string email) 433public async Task PasswordValidatorCanBlockAddPassword() 450public async Task CanChainPasswordValidators() 468public async Task PasswordValidatorWithNoErrorsCanBlockChangePassword() 483public async Task PasswordValidatorWithNoErrorsCanBlockCreateUser() 497public async Task PasswordValidatorWithNoErrorsCanBlockResetPasswordWithStaticTokenProvider() 521public async Task PasswordValidatorCanBlockChangePassword() 538public async Task PasswordValidatorCanBlockCreateUser() 553public async Task CanCreateUserNoPassword() 572public async Task CanCreateUserAddLogin() 594public async Task CanCreateUserLoginAndAddPassword() 617public async Task AddPasswordFailsIfAlreadyHave() 633public async Task CanCreateUserAddRemoveLogin() 664public async Task CanRemovePassword() 684public async Task CanChangePassword() 704public async Task CanAddRemoveUserClaim() 733public async Task RemoveClaimOnlyAffectsUser() 766public async Task CanReplaceUserClaim() 789public async Task ReplaceUserClaimOnlyAffectsUser() 822public async Task ChangePasswordFallsIfPasswordWrong() 837public async Task AddDupeUserNameFails() 852public async Task AddDupeEmailAllowedByDefault() 867public async Task AddDupeEmailFailsWhenUniqueEmailRequired() 882public async Task UpdateSecurityStampActuallyChanges() 897public async Task AddDupeLoginFails() 916public async Task CanFindByEmail() 931public virtual async Task CanFindUsersViaUserQueryable() 951public async Task ConfirmEmailFalseByDefaultTest() 973return Task.FromResult(true); 987public async Task CanResetPasswordWithStaticTokenProvider() 1012public async Task PasswordValidatorCanBlockResetPasswordWithStaticTokenProvider() 1038public async Task ResetPasswordWithStaticTokenProviderFailsWithWrongToken() 1060public async Task CanGenerateAndVerifyUserTokenWithStaticTokenProvider() 1088public async Task CanConfirmEmailWithStaticToken() 1110public async Task ConfirmEmailWithStaticTokenFailsWithWrongToken() 1128public async Task ConfirmTokenFailsAfterPasswordChange() 1149public async Task SingleFailureLockout() 1171public async Task TwoFailureLockout() 1196public async Task ResetAccessCountPreventsLockout() 1224public async Task CanEnableLockoutManuallyAndLockout() 1252public async Task UserNotLockedOutWithNullDateTimeAndIsSetToNullDate() 1268public async Task LockoutFailsIfNotEnabled() 1286public async Task LockoutEndToUtcNowMinus1SecInUserShouldNotBeLockedOut() 1300public async Task LockoutEndToUtcNowSubOneSecondWithManagerShouldNotBeLockedOut() 1315public async Task LockoutEndToUtcNowPlus5ShouldBeLockedOut() 1330public async Task UserLockedOutWithDateTimeLocalKindNowPlus30() 1348public async Task SetPhoneNumberTest() 1365public async Task CanChangePhoneNumber() 1384public async Task ChangePhoneNumberTokenIsInt() 1398public async Task ChangePhoneNumberFailsWithWrongToken() 1416=> Task.FromResult(true); 1419=> Task.FromResult(purpose); 1422=> Task.FromResult(true); 1430public async Task ChangePhoneNumberWithCustomProvider() 1450public async Task ChangePhoneNumberFailsWithWrongPhoneNumber() 1470public async Task CanVerifyPhoneNumber() 1495public async Task CanChangeEmail() 1517public async Task CanChangeEmailOnlyIfEmailSame() 1541public async Task CanChangeEmailWithDifferentTokenProvider() 1566public async Task ChangeEmailTokensFailsAfterEmailChanged() 1589public async Task ChangeEmailFailsWithWrongToken() 1612public async Task ChangeEmailFailsWithEmail() 1636public async Task EmailFactorFailsAfterSecurityStampChangeTest() 1666public async Task EnableTwoFactorChangesSecurityStamp() 1683public async Task GenerateTwoFactorWithUnknownFactorProviderWillThrow() 1708public async Task GetValidTwoFactorTestEmptyWithNoProviders() 1723public async Task CanGetSetUpdateAndRemoveUserToken() 1747public async Task CanRedeemRecoveryCodeOnlyOnce() 1775public async Task RecoveryCodesInvalidAfterReplace() 1803public async Task CanGetValidTwoFactor() 1843public async Task PhoneFactorFailsAfterSecurityStampChangeTest() 1863public async Task VerifyTokenFromWrongTokenProviderFails() 1879public async Task VerifyWithWrongSmsTokenFails() 1893public async Task NullableDateTimeOperationTest() 1916public async Task CanGetUsersWithClaims()
Microsoft.AspNetCore.Identity.Test (361)
IdentityBuilderTest.cs (4)
338public Task SetNormalizedRoleNameAsync(PocoRole role, string normalizedName, CancellationToken cancellationToken = default(CancellationToken)) 343public Task SetNormalizedUserNameAsync(PocoUser user, string normalizedName, CancellationToken cancellationToken = default(CancellationToken)) 348public Task SetRoleNameAsync(PocoRole role, string roleName, CancellationToken cancellationToken = default(CancellationToken)) 353public Task SetUserNameAsync(PocoUser user, string userName, CancellationToken cancellationToken = default(CancellationToken))
IdentityUIScriptsTest.cs (2)
38public async Task IdentityUI_ScriptTags_SubresourceIntegrityCheck(ScriptTag scriptTag) 77public async Task IdentityUI_ScriptTags_FallbackSourceContent_Matches_CDNContent(ScriptTag scriptTag)
NoopRoleStore.cs (12)
10return Task.FromResult(IdentityResult.Success); 15return Task.FromResult(IdentityResult.Success); 20return Task.FromResult<string>(null); 23public Task SetRoleNameAsync(PocoRole role, string roleName, CancellationToken cancellationToken = default(CancellationToken)) 25return Task.FromResult(0); 30return Task.FromResult<PocoRole>(null); 35return Task.FromResult<PocoRole>(null); 44return Task.FromResult(IdentityResult.Success); 49return Task.FromResult<string>(null); 54return Task.FromResult<string>(null); 57public Task SetNormalizedRoleNameAsync(PocoRole role, string normalizedName, CancellationToken cancellationToken = default(CancellationToken)) 59return Task.FromResult(0);
NoopUserStore.cs (12)
10return Task.FromResult(user.Id); 15return Task.FromResult(user.UserName); 18public Task SetUserNameAsync(PocoUser user, string userName, CancellationToken cancellationToken = default(CancellationToken)) 20return Task.FromResult(0); 25return Task.FromResult(IdentityResult.Success); 30return Task.FromResult(IdentityResult.Success); 35return Task.FromResult<PocoUser>(null); 40return Task.FromResult<PocoUser>(null); 49return Task.FromResult(IdentityResult.Success); 54return Task.FromResult<string>(null); 57public Task SetNormalizedUserNameAsync(PocoUser user, string userName, CancellationToken cancellationToken = default(CancellationToken)) 59return Task.FromResult(0);
PasswordValidatorTest.cs (8)
20public async Task ValidateThrowsWithNullTest() 35public async Task FailsIfTooShortTests(string input) 50public async Task SuccessIfLongEnoughTests(string input) 64public async Task FailsWithoutRequiredNonAlphanumericTests(string input) 81public async Task SucceedsWithRequiredNonAlphanumericTests(string input) 97public async Task FailsWithoutRequiredUniqueCharsTests(string input, int uniqueChars) 118public async Task SucceedsWithRequiredUniqueCharsTests(string input, int uniqueChars) 138public async Task UberMixedRequiredTests(string input, Errors errorMask)
RetryHandler.cs (1)
53await Task.Delay(_waitIntervalBeforeRetry, cancellationToken);
RoleManagerTest.cs (16)
11public async Task CreateCallsStore() 18store.Setup(s => s.GetRoleNameAsync(role, CancellationToken.None)).Returns(Task.FromResult(role.Name)).Verifiable(); 19store.Setup(s => s.SetNormalizedRoleNameAsync(role, normalizer.NormalizeName(role.Name), CancellationToken.None)).Returns(Task.FromResult(0)).Verifiable(); 31public async Task UpdateCallsStore() 38store.Setup(s => s.GetRoleNameAsync(role, CancellationToken.None)).Returns(Task.FromResult(role.Name)).Verifiable(); 39store.Setup(s => s.SetNormalizedRoleNameAsync(role, normalizer.NormalizeName(role.Name), CancellationToken.None)).Returns(Task.FromResult(0)).Verifiable(); 59public async Task FindByNameCallsStoreWithNormalizedName() 65store.Setup(s => s.FindByNameAsync(normalizer.NormalizeName("Foo"), CancellationToken.None)).Returns(Task.FromResult(role)).Verifiable(); 77public async Task CanFindByNameCallsStoreWithoutNormalizedName() 82store.Setup(s => s.FindByNameAsync(role.Name, CancellationToken.None)).Returns(Task.FromResult(role)).Verifiable(); 95public async Task RoleExistsCallsStoreWithNormalizedName() 101store.Setup(s => s.FindByNameAsync(normalizer.NormalizeName("Foo"), CancellationToken.None)).Returns(Task.FromResult(role)).Verifiable(); 121public async Task RoleManagerPublicNullChecks() 134public async Task RoleStoreMethodsThrowWhenDisposed() 178public Task SetRoleNameAsync(PocoRole role, string roleName, CancellationToken cancellationToken = default(CancellationToken)) 203public Task SetNormalizedRoleNameAsync(PocoRole role, string normalizedName, CancellationToken cancellationToken = default(CancellationToken))
RoleValidatorTest.cs (2)
9public async Task ValidateThrowsWithNull() 24public async Task ValidateFailsWithTooShortRoleName(string input)
SecurityStampValidatorTest.cs (22)
26public Task ChallengeAsync(AuthenticationProperties properties) 31public Task ForbidAsync(AuthenticationProperties properties) 41public Task InitializeAsync(AuthenticationScheme scheme, HttpContext context) 46public Task SignInAsync(ClaimsPrincipal user, AuthenticationProperties properties) 51public Task SignOutAsync(AuthenticationProperties properties) 58public async Task OnValidatePrincipalThrowsWithEmptyServiceCollection() 71public async Task OnValidatePrincipalTestSuccess(bool isPersistent) 95private async Task RunApplicationCookieTest(PocoUser user, Mock<HttpContext> httpContext, bool shouldStampValidate, Func<Task> testCode) 118authService.Setup(c => c.SignOutAsync(httpContext.Object, IdentityConstants.TwoFactorRememberMeScheme, /*properties*/null)).Returns(Task.CompletedTask).Verifiable(); 131public async Task OnValidateIdentityRejectsWhenValidateSecurityStampFails() 154public async Task OnValidateIdentityAcceptsWhenStoreDoesNotSupportSecurityStamp() 197public async Task OnValidateIdentityRejectsWhenNoIssuedUtc() 213authService.Setup(c => c.SignOutAsync(httpContext.Object, IdentityConstants.TwoFactorRememberMeScheme, /*properties*/null)).Returns(Task.CompletedTask).Verifiable(); 236public async Task OnValidateIdentityDoesNotRejectsWhenNotExpired() 272public async Task OnValidateIdentityDoesNotExtendExpirationWhenSlidingIsDisabled() 287signInManager.Setup(s => s.ValidateSecurityStampAsync(It.IsAny<ClaimsPrincipal>())).Returns(Task.FromResult(user)); 288signInManager.Setup(s => s.CreateUserPrincipalAsync(It.IsAny<PocoUser>())).Returns(Task.FromResult(new ClaimsPrincipal(new ClaimsIdentity("auth")))); 320private async Task RunRememberClientCookieTest(bool shouldStampValidate, bool validationSuccess) 338authService.Setup(c => c.SignOutAsync(httpContext.Object, IdentityConstants.TwoFactorRememberMeScheme, /*properties*/null)).Returns(Task.CompletedTask).Verifiable(); 362public Task TwoFactorRememberClientOnValidatePrincipalTestSuccess() 366public Task TwoFactorRememberClientOnValidatePrincipalRejectsWhenValidateSecurityStampFails()
SignInManagerTest.cs (69)
31public async Task PasswordSignInReturnsLockedOutWhenLockedOut() 61public async Task CheckPasswordSignInReturnsLockedOutWhenLockedOut() 118public async Task CanPasswordSignIn(bool isPersistent) 141public async Task CanPasswordSignInWithNoLogger() 165public async Task PasswordSignInWorksWithNonTwoFactorStore() 193public async Task CheckPasswordOnlyResetLockoutWhenTfaNotEnabledOrRemembered(bool tfaEnabled, bool tfaRemembered) 235public async Task CheckPasswordAlwaysResetLockoutWhenQuirked() 263public async Task PasswordSignInRequiresVerification(bool supportsLockout) 275manager.Setup(m => m.GetValidTwoFactorProvidersAsync(user)).Returns(Task.FromResult(providers)).Verifiable(); 285It.IsAny<AuthenticationProperties>())).Returns(Task.FromResult(0)).Verifiable(); 300public async Task ExternalSignInRequiresVerificationIfNotBypassed(bool bypass) 313manager.Setup(m => m.GetValidTwoFactorProvidersAsync(user)).Returns(Task.FromResult(providers)).Verifiable(); 329It.IsAny<AuthenticationProperties>())).Returns(Task.FromResult(0)).Verifiable(); 346return Task.FromResult(true); 355public async Task CanTwoFactorAuthenticatorSignIn(string providerName, bool isPersistent, bool rememberClient) 383It.IsAny<AuthenticationProperties>())).Returns(Task.FromResult(0)).Verifiable(); 396public async Task TwoFactorAuthenticatorSignInFailWithoutLockout() 429public async Task TwoFactorAuthenticatorSignInAsyncReturnsLockedOut() 440return Task.FromResult(IdentityResult.Success); 444manager.Setup(m => m.IsLockedOutAsync(user)).Returns(() => Task.FromResult(lockedout)); 476public async Task IsTwoFactorEnabled(bool userManagerSupportsTwoFactor, bool userTwoFactorEnabled, bool hasValidProviders) 513public async Task CanTwoFactorRecoveryCodeSignIn(bool supportsLockout, bool externalLogin) 537It.IsAny<AuthenticationProperties>())).Returns(Task.FromResult(0)).Verifiable(); 538auth.Setup(a => a.SignOutAsync(context, IdentityConstants.ExternalScheme, It.IsAny<AuthenticationProperties>())).Returns(Task.FromResult(0)).Verifiable(); 539auth.Setup(a => a.SignOutAsync(context, IdentityConstants.TwoFactorUserIdScheme, It.IsAny<AuthenticationProperties>())).Returns(Task.FromResult(0)).Verifiable(); 562public async Task CanExternalSignIn(bool isPersistent, bool supportsLockout) 595public async Task CanResignIn( 617.Returns(Task.FromResult(authResult)).Verifiable(); 626signInManager.Setup(s => s.SignInWithClaimsAsync(user, It.IsAny<AuthenticationProperties>(), It.IsAny<IEnumerable<Claim>>())).Returns(Task.FromResult(0)).Verifiable(); 654public async Task CanTwoFactorSignIn(bool isPersistent, bool supportsLockout, bool externalLogin, bool rememberClient) 681It.IsAny<AuthenticationProperties>())).Returns(Task.FromResult(0)).Verifiable(); 684auth.Setup(a => a.SignOutAsync(context, IdentityConstants.ExternalScheme, It.IsAny<AuthenticationProperties>())).Returns(Task.FromResult(0)).Verifiable(); 685auth.Setup(a => a.SignOutAsync(context, IdentityConstants.TwoFactorUserIdScheme, It.IsAny<AuthenticationProperties>())).Returns(Task.FromResult(0)).Verifiable(); 697It.IsAny<AuthenticationProperties>())).Returns(Task.FromResult(0)).Verifiable(); 713public async Task TwoFactorSignInAsyncReturnsLockedOut() 724return Task.FromResult(IdentityResult.Success); 727manager.Setup(m => m.IsLockedOutAsync(user)).Returns(() => Task.FromResult(lockedout)); 748public async Task RememberClientStoresUserId() 761It.Is<AuthenticationProperties>(v => v.IsPersistent == true))).Returns(Task.FromResult(0)).Verifiable(); 774public async Task RememberBrowserSkipsTwoFactorVerificationSignIn(bool isPersistent) 782manager.Setup(m => m.GetValidTwoFactorProvidersAsync(user)).Returns(Task.FromResult(providers)).Verifiable(); 813public async Task SignOutCallsContextResponseSignOut() 819auth.Setup(a => a.SignOutAsync(context, IdentityConstants.ApplicationScheme, It.IsAny<AuthenticationProperties>())).Returns(Task.FromResult(0)).Verifiable(); 820auth.Setup(a => a.SignOutAsync(context, IdentityConstants.TwoFactorUserIdScheme, It.IsAny<AuthenticationProperties>())).Returns(Task.FromResult(0)).Verifiable(); 821auth.Setup(a => a.SignOutAsync(context, IdentityConstants.ExternalScheme, It.IsAny<AuthenticationProperties>())).Returns(Task.FromResult(0)).Verifiable(); 832public async Task PasswordSignInFailsWithWrongPassword() 857public async Task PasswordSignInFailsWithUnknownUser() 875public async Task PasswordSignInFailsWithWrongPasswordCanAccessFailedAndLockout() 884return Task.FromResult(IdentityResult.Success); 887manager.Setup(m => m.IsLockedOutAsync(user)).Returns(() => Task.FromResult(lockedout)); 902public async Task CheckPasswordSignInFailsWithWrongPasswordCanAccessFailedAndLockout() 911return Task.FromResult(IdentityResult.Success); 914manager.Setup(m => m.IsLockedOutAsync(user)).Returns(() => Task.FromResult(lockedout)); 931public async Task CanRequireConfirmedEmailForPasswordSignIn(bool confirmed) 983It.Is<AuthenticationProperties>(v => isPersistent == null || v.IsPersistent == isPersistent))).Returns(Task.FromResult(0)).Verifiable(); 989public async Task CanRequireConfirmedPhoneNumberForPasswordSignIn(bool confirmed) 1030public async Task GetExternalLoginInfoAsyncReturnsCorrectProviderDisplayName() 1061public async Task GetExternalLoginInfoAsyncWithOidcSubClaim() 1092public async Task ExternalLoginInfoAsyncReturnsAuthenticationPropertiesWithCustomValue() 1136public async Task CheckPasswordSignInFailsWhenResetLockoutFails(string signInManagerTypeName) 1159public async Task PasswordSignInWorksWhenResetLockoutReturnsNullIdentityResult(string signInManagerTypeName) 1184public async Task TwoFactorSignFailsWhenResetLockoutFails() 1222public async Task CheckPasswordSignInLockedOutResultIsDependentOnTheAccessFailedAsyncResult(IdentityResult accessFailedResult, SignInResult expectedSignInResult) 1248public async Task TwoFactorSignInLockedOutResultIsDependentOnTheAccessFailedAsyncResult(IdentityResult accessFailedResult, SignInResult expectedSignInResult) 1320protected override async Task ResetLockout(TUser user) 1337protected override Task ResetLockout(TUser user) 1344return Task.CompletedTask; 1360public Task<IEnumerable<AuthenticationScheme>> GetAllSchemesAsync() => Task.FromResult<IEnumerable<AuthenticationScheme>>(_defaultCookieSchemes.Values); 1361public Task<AuthenticationScheme> GetSchemeAsync(string name) => Task.FromResult(_defaultCookieSchemes.TryGetValue(name, out var scheme) ? scheme : null);
src\Identity\test\Shared\ApiConsistencyTestBase.cs (1)
42where typeof(Task).IsAssignableFrom(method.ReturnType)
src\Identity\test\Shared\MockHelpers.cs (1)
50.Returns(Task.FromResult(IdentityResult.Success)).Verifiable();
UserClaimsPrincipalFactoryTest.cs (2)
13public async Task CreateIdentityNullChecks() 40public async Task EnsureClaimsIdentityHasExpectedClaims(bool supportRoles, bool supportClaims, bool supportRoleClaims, bool supportsUserEmail)
UserManagerTest.cs (205)
63public async Task CreateCallsStore() 70store.Setup(s => s.GetUserNameAsync(user, CancellationToken.None)).Returns(Task.FromResult(user.UserName)).Verifiable(); 71store.Setup(s => s.SetNormalizedUserNameAsync(user, normalizer.NormalizeName(user.UserName), CancellationToken.None)).Returns(Task.FromResult(0)).Verifiable(); 83public async Task CreateUpdatesSecurityStampStore() 89store.Setup(s => s.GetSecurityStampAsync(user, CancellationToken.None)).Returns(Task.FromResult(user.SecurityStamp)).Verifiable(); 90store.Setup(s => s.SetSecurityStampAsync(user, It.IsAny<string>(), CancellationToken.None)).Returns(Task.FromResult(0)).Verifiable(); 102public async Task CreateCallsUpdateEmailStore() 109store.Setup(s => s.GetUserNameAsync(user, CancellationToken.None)).Returns(Task.FromResult(user.UserName)).Verifiable(); 110store.Setup(s => s.GetEmailAsync(user, CancellationToken.None)).Returns(Task.FromResult(user.Email)).Verifiable(); 111store.Setup(s => s.SetNormalizedEmailAsync(user, normalizer.NormalizeEmail(user.Email), CancellationToken.None)).Returns(Task.FromResult(0)).Verifiable(); 112store.Setup(s => s.SetNormalizedUserNameAsync(user, normalizer.NormalizeName(user.UserName), CancellationToken.None)).Returns(Task.FromResult(0)).Verifiable(); 124public async Task DeleteCallsStore() 141public async Task UpdateCallsStore() 147store.Setup(s => s.GetUserNameAsync(user, CancellationToken.None)).Returns(Task.FromResult(user.UserName)).Verifiable(); 148store.Setup(s => s.SetNormalizedUserNameAsync(user, normalizer.NormalizeName(user.UserName), CancellationToken.None)).Returns(Task.FromResult(0)).Verifiable(); 161public async Task UpdateWillUpdateNormalizedEmail() 167store.Setup(s => s.GetUserNameAsync(user, CancellationToken.None)).Returns(Task.FromResult(user.UserName)).Verifiable(); 168store.Setup(s => s.GetEmailAsync(user, CancellationToken.None)).Returns(Task.FromResult(user.Email)).Verifiable(); 169store.Setup(s => s.SetNormalizedUserNameAsync(user, normalizer.NormalizeName(user.UserName), CancellationToken.None)).Returns(Task.FromResult(0)).Verifiable(); 170store.Setup(s => s.SetNormalizedEmailAsync(user, normalizer.NormalizeEmail(user.Email), CancellationToken.None)).Returns(Task.FromResult(0)).Verifiable(); 183public async Task SetUserNameCallsStore() 189store.Setup(s => s.SetUserNameAsync(user, "foo", CancellationToken.None)).Returns(Task.FromResult(0)).Verifiable(); 190store.Setup(s => s.GetUserNameAsync(user, CancellationToken.None)).Returns(Task.FromResult("foo")).Verifiable(); 191store.Setup(s => s.SetNormalizedUserNameAsync(user, normalizer.NormalizeName("foo"), CancellationToken.None)).Returns(Task.FromResult(0)).Verifiable(); 192store.Setup(s => s.UpdateAsync(user, CancellationToken.None)).Returns(Task.FromResult(IdentityResult.Success)).Verifiable(); 204public async Task FindByIdCallsStore() 209store.Setup(s => s.FindByIdAsync(user.Id, CancellationToken.None)).Returns(Task.FromResult(user)).Verifiable(); 221public async Task FindByNameCallsStoreWithNormalizedName() 227store.Setup(s => s.FindByNameAsync(normalizer.NormalizeName(user.UserName), CancellationToken.None)).Returns(Task.FromResult(user)).Verifiable(); 239public async Task CanFindByNameCallsStoreWithoutNormalizedName() 244store.Setup(s => s.FindByNameAsync(user.UserName, CancellationToken.None)).Returns(Task.FromResult(user)).Verifiable(); 257public async Task FindByEmailCallsStoreWithNormalizedEmail() 263store.Setup(s => s.FindByEmailAsync(normalizer.NormalizeEmail(user.Email), CancellationToken.None)).Returns(Task.FromResult(user)).Verifiable(); 275public async Task CanFindByEmailCallsStoreWithoutNormalizedEmail() 280store.Setup(s => s.FindByEmailAsync(user.Email, CancellationToken.None)).Returns(Task.FromResult(user)).Verifiable(); 299public async Task FindByEmailCallsStoreWithCustomNormalizedEmail() 304store.Setup(s => s.FindByEmailAsync("@Foo", CancellationToken.None)).Returns(Task.FromResult(user)).Verifiable(); 317public async Task FindByNameCallsStoreWithCustomNormalizedName() 322store.Setup(s => s.FindByNameAsync("#Foo", CancellationToken.None)).Returns(Task.FromResult(user)).Verifiable(); 335public async Task AddToRolesCallsStore() 343.Returns(Task.FromResult(0)) 346.Returns(Task.FromResult(0)) 349.Returns(Task.FromResult(0)) 354.Returns(Task.FromResult(false)) 357.Returns(Task.FromResult(false)) 360.Returns(Task.FromResult(false)) 374public async Task AddToRolesCallsStoreWithCustomNameNormalizer() 381.Returns(Task.FromResult(0)) 384.Returns(Task.FromResult(0)) 387.Returns(Task.FromResult(0)) 392.Returns(Task.FromResult(false)) 395.Returns(Task.FromResult(false)) 398.Returns(Task.FromResult(false)) 413public async Task AddToRolesFailsIfUserInRole() 421.Returns(Task.FromResult(0)) 424.Returns(Task.FromResult(true)) 437public async Task RemoveFromRolesCallsStore() 445.Returns(Task.FromResult(0)) 448.Returns(Task.FromResult(0)) 451.Returns(Task.FromResult(0)) 455.Returns(Task.FromResult(true)) 458.Returns(Task.FromResult(true)) 461.Returns(Task.FromResult(true)) 474public async Task RemoveFromRolesFailsIfNotInRole() 482.Returns(Task.FromResult(0)) 485.Returns(Task.FromResult(true)) 488.Returns(Task.FromResult(false)) 501public async Task AddClaimsCallsStore() 508.Returns(Task.FromResult(0)) 522public async Task AddClaimCallsStore() 529.Returns(Task.FromResult(0)) 543public async Task UpdateClaimCallsStore() 551.Returns(Task.FromResult(0)) 553store.Setup(s => s.UpdateAsync(user, CancellationToken.None)).Returns(Task.FromResult(IdentityResult.Success)).Verifiable(); 565public async Task CheckPasswordWillRehashPasswordWhenNeeded() 578store.Setup(s => s.SetPasswordHashAsync(user, It.IsAny<string>(), CancellationToken.None)).Returns(Task.FromResult(0)).Verifiable(); 579store.Setup(x => x.UpdateAsync(It.IsAny<PocoUser>(), It.IsAny<CancellationToken>())).Returns(Task.FromResult(IdentityResult.Success)); 596public async Task CreateFailsWithNullSecurityStamp() 613public async Task UpdateFailsWithNullSecurityStamp() 630public async Task RemoveClaimsCallsStore() 637.Returns(Task.FromResult(0)) 651public async Task RemoveClaimCallsStore() 658.Returns(Task.FromResult(0)) 672public async Task CheckPasswordWithNullUserReturnsFalse() 687public async Task UsersEmailMethodsFailWhenStoreNotImplemented() 699public async Task UsersPhoneNumberMethodsFailWhenStoreNotImplemented() 709public async Task TokenMethodsThrowWithNoTokenProvider() 720public async Task PasswordMethodsFailWhenStoreNotImplemented() 733public async Task SecurityStampMethodsFailWhenStoreNotImplemented() 736store.Setup(x => x.GetUserIdAsync(It.IsAny<PocoUser>(), It.IsAny<CancellationToken>())).Returns(Task.FromResult(Guid.NewGuid().ToString())); 748public async Task LoginMethodsFailWhenStoreNotImplemented() 759public async Task ClaimMethodsFailWhenStoreNotImplemented() 868public Task SetNormalizedUserNameAsync(PocoUser user, string normalizedName, CancellationToken cancellationToken) 873public Task SetUserNameAsync(PocoUser user, string userName, CancellationToken cancellationToken) 902public async Task TwoFactorStoreMethodsFailWhenStoreNotImplemented() 912public async Task LockoutStoreMethodsFailWhenStoreNotImplemented() 925public async Task RoleMethodsFailWhenStoreNotImplemented() 938public async Task AuthTokenMethodsFailWhenStoreNotImplemented() 949public async Task AuthenticatorMethodsFailWhenStoreNotImplemented() 959public async Task RecoveryMethodsFailWhenStoreNotImplemented() 968private async Task VerifyException<TException>(Func<Task> code, string expectedMessage) where TException : Exception 983public async Task PasswordValidatorBlocksCreate() 993public async Task PasswordValidatorWithoutErrorsBlocksCreate() 1002public async Task ResetTokenCallNoopForTokenValueZero() 1016public async Task ManagerPublicNullChecks() 1046public async Task MethodsFailWithUnknownUserTest() 1147public async Task MethodsThrowWhenDisposedTest() 1204=> Task.FromResult(badResult); 1220return Task.FromResult<IList<Claim>>(new List<Claim>()); 1223public Task AddClaimsAsync(PocoUser user, IEnumerable<Claim> claim, CancellationToken cancellationToken = default(CancellationToken)) 1225return Task.FromResult(0); 1228public Task ReplaceClaimAsync(PocoUser user, Claim claim, Claim newClaim, CancellationToken cancellationToken = default(CancellationToken)) 1230return Task.FromResult(0); 1233public Task RemoveClaimsAsync(PocoUser user, IEnumerable<Claim> claim, CancellationToken cancellationToken = default(CancellationToken)) 1235return Task.FromResult(0); 1238public Task SetEmailAsync(PocoUser user, string email, CancellationToken cancellationToken = default(CancellationToken)) 1240return Task.FromResult(0); 1245return Task.FromResult(""); 1250return Task.FromResult(false); 1253public Task SetEmailConfirmedAsync(PocoUser user, bool confirmed, CancellationToken cancellationToken = default(CancellationToken)) 1255return Task.FromResult(0); 1260return Task.FromResult<PocoUser>(null); 1265return Task.FromResult<DateTimeOffset?>(DateTimeOffset.MinValue); 1268public Task SetLockoutEndDateAsync(PocoUser user, DateTimeOffset? lockoutEnd, CancellationToken cancellationToken = default(CancellationToken)) 1270return Task.FromResult(0); 1275return Task.FromResult(0); 1278public Task ResetAccessFailedCountAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken)) 1280return Task.FromResult(0); 1285return Task.FromResult(0); 1290return Task.FromResult(false); 1293public Task SetLockoutEnabledAsync(PocoUser user, bool enabled, CancellationToken cancellationToken = default(CancellationToken)) 1295return Task.FromResult(0); 1298public Task AddLoginAsync(PocoUser user, UserLoginInfo login, CancellationToken cancellationToken = default(CancellationToken)) 1300return Task.FromResult(0); 1303public Task RemoveLoginAsync(PocoUser user, string loginProvider, string providerKey, CancellationToken cancellationToken = default(CancellationToken)) 1305return Task.FromResult(0); 1310return Task.FromResult<IList<UserLoginInfo>>(new List<UserLoginInfo>()); 1315return Task.FromResult<PocoUser>(null); 1322public Task SetUserNameAsync(PocoUser user, string userName, CancellationToken cancellationToken = default(CancellationToken)) 1324return Task.FromResult(0); 1329return Task.FromResult(IdentityResult.Success); 1334return Task.FromResult(IdentityResult.Success); 1339return Task.FromResult(IdentityResult.Success); 1344return Task.FromResult<PocoUser>(null); 1349return Task.FromResult<PocoUser>(null); 1352public Task SetPasswordHashAsync(PocoUser user, string passwordHash, CancellationToken cancellationToken = default(CancellationToken)) 1354return Task.FromResult(0); 1359return Task.FromResult<string>(null); 1364return Task.FromResult(false); 1367public Task SetPhoneNumberAsync(PocoUser user, string phoneNumber, CancellationToken cancellationToken = default(CancellationToken)) 1369return Task.FromResult(0); 1374return Task.FromResult(""); 1379return Task.FromResult(false); 1382public Task SetPhoneNumberConfirmedAsync(PocoUser user, bool confirmed, CancellationToken cancellationToken = default(CancellationToken)) 1384return Task.FromResult(0); 1387public Task AddToRoleAsync(PocoUser user, string roleName, CancellationToken cancellationToken = default(CancellationToken)) 1389return Task.FromResult(0); 1392public Task RemoveFromRoleAsync(PocoUser user, string roleName, CancellationToken cancellationToken = default(CancellationToken)) 1394return Task.FromResult(0); 1399return Task.FromResult<IList<string>>(new List<string>()); 1404return Task.FromResult(false); 1407public Task SetSecurityStampAsync(PocoUser user, string stamp, CancellationToken cancellationToken = default(CancellationToken)) 1409return Task.FromResult(0); 1414return Task.FromResult(""); 1417public Task SetTwoFactorEnabledAsync(PocoUser user, bool enabled, CancellationToken cancellationToken = default(CancellationToken)) 1419return Task.FromResult(0); 1424return Task.FromResult(false); 1429return Task.FromResult<string>(null); 1434return Task.FromResult<string>(null); 1439return Task.FromResult<string>(null); 1442public Task SetNormalizedUserNameAsync(PocoUser user, string userName, CancellationToken cancellationToken = default(CancellationToken)) 1444return Task.FromResult(0); 1449return Task.FromResult<IList<PocoUser>>(new List<PocoUser>()); 1454return Task.FromResult<IList<PocoUser>>(new List<PocoUser>()); 1459return Task.FromResult(""); 1462public Task SetNormalizedEmailAsync(PocoUser user, string normalizedEmail, CancellationToken cancellationToken = default(CancellationToken)) 1464return Task.FromResult(0); 1474return Task.FromResult("Test"); 1479return Task.FromResult(true); 1484return Task.FromResult(true); 1503public Task AddClaimsAsync(PocoUser user, IEnumerable<Claim> claims, CancellationToken cancellationToken = default(CancellationToken)) 1508public Task ReplaceClaimAsync(PocoUser user, Claim claim, Claim newClaim, CancellationToken cancellationToken = default(CancellationToken)) 1513public Task RemoveClaimsAsync(PocoUser user, IEnumerable<Claim> claims, CancellationToken cancellationToken = default(CancellationToken)) 1518public Task SetEmailAsync(PocoUser user, string email, CancellationToken cancellationToken = default(CancellationToken)) 1533public Task SetEmailConfirmedAsync(PocoUser user, bool confirmed, CancellationToken cancellationToken = default(CancellationToken)) 1548public Task SetLockoutEndDateAsync(PocoUser user, DateTimeOffset? lockoutEnd, CancellationToken cancellationToken = default(CancellationToken)) 1558public Task ResetAccessFailedCountAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken)) 1573public Task SetLockoutEnabledAsync(PocoUser user, bool enabled, CancellationToken cancellationToken = default(CancellationToken)) 1578public Task AddLoginAsync(PocoUser user, UserLoginInfo login, CancellationToken cancellationToken = default(CancellationToken)) 1583public Task RemoveLoginAsync(PocoUser user, string loginProvider, string providerKey, CancellationToken cancellationToken = default(CancellationToken)) 1613public Task SetUserNameAsync(PocoUser user, string userName, CancellationToken cancellationToken = default(CancellationToken)) 1628public Task SetPasswordHashAsync(PocoUser user, string passwordHash, CancellationToken cancellationToken = default(CancellationToken)) 1643public Task SetPhoneNumberAsync(PocoUser user, string phoneNumber, CancellationToken cancellationToken = default(CancellationToken)) 1658public Task SetPhoneNumberConfirmedAsync(PocoUser user, bool confirmed, CancellationToken cancellationToken = default(CancellationToken)) 1663public Task SetTwoFactorEnabledAsync(PocoUser user, bool enabled, CancellationToken cancellationToken = default(CancellationToken)) 1673public Task AddToRoleAsync(PocoUser user, string roleName, CancellationToken cancellationToken = default(CancellationToken)) 1678public Task RemoveFromRoleAsync(PocoUser user, string roleName, CancellationToken cancellationToken = default(CancellationToken)) 1698public Task SetNormalizedUserNameAsync(PocoUser user, string userName, CancellationToken cancellationToken = default(CancellationToken)) 1733public Task SetNormalizedEmailAsync(PocoUser user, string normalizedEmail, CancellationToken cancellationToken = default(CancellationToken)) 1740public async Task CanCustomizeUserValidatorErrors() 1760.Returns(Task.FromResult(user2)) 1763.Returns(Task.FromResult(user2.Id)) 1766.Returns(Task.FromResult(user.UserName)) 1769.Returns(Task.FromResult(user.Email))
UserValidatorTest.cs (4)
9public async Task ValidateThrowsWithNull() 24public async Task ValidateFailsWithTooShortUserNames(string input) 46public async Task DefaultAlphaNumericOnlyUserNameValidation(string userName, bool expectSuccess) 73public async Task CanAllowNonAlphaNumericUserName(string userName, bool expectSuccess)
Microsoft.AspNetCore.Identity.UI (20)
Areas\Identity\Filters\ExternalLoginsPageFilter.cs (3)
13public async Task OnPageHandlerExecutionAsync(PageHandlerExecutingContext context, PageHandlerExecutionDelegate next) 26public Task OnPageHandlerSelectionAsync(PageHandlerSelectedContext context) 28return Task.CompletedTask;
Areas\Identity\Pages\V4\Account\Login.cshtml.cs (2)
83public virtual Task OnGetAsync([StringSyntax(StringSyntaxAttribute.Uri)] string? returnUrl = null) => throw new NotImplementedException(); 103public override async Task OnGetAsync(string? returnUrl = null)
Areas\Identity\Pages\V4\Account\Manage\Email.cshtml.cs (1)
97private async Task LoadAsync(TUser user)
Areas\Identity\Pages\V4\Account\Manage\EnableAuthenticator.cshtml.cs (1)
161private async Task LoadSharedKeyAndQrCodeUriAsync(TUser user)
Areas\Identity\Pages\V4\Account\Manage\Index.cshtml.cs (1)
78private async Task LoadAsync(TUser user)
Areas\Identity\Pages\V4\Account\Register.cshtml.cs (2)
84public virtual Task OnGetAsync([StringSyntax(StringSyntaxAttribute.Uri)] string? returnUrl = null) => throw new NotImplementedException(); 117public override async Task OnGetAsync(string? returnUrl = null)
Areas\Identity\Pages\V5\Account\Login.cshtml.cs (2)
83public virtual Task OnGetAsync([StringSyntax(StringSyntaxAttribute.Uri)] string? returnUrl = null) => throw new NotImplementedException(); 103public override async Task OnGetAsync(string? returnUrl = null)
Areas\Identity\Pages\V5\Account\Manage\Email.cshtml.cs (1)
97private async Task LoadAsync(TUser user)
Areas\Identity\Pages\V5\Account\Manage\EnableAuthenticator.cshtml.cs (1)
161private async Task LoadSharedKeyAndQrCodeUriAsync(TUser user)
Areas\Identity\Pages\V5\Account\Manage\Index.cshtml.cs (1)
78private async Task LoadAsync(TUser user)
Areas\Identity\Pages\V5\Account\Register.cshtml.cs (2)
84public virtual Task OnGetAsync([StringSyntax(StringSyntaxAttribute.Uri)] string? returnUrl = null) => throw new NotImplementedException(); 117public override async Task OnGetAsync(string? returnUrl = null)
src\Shared\DefaultMessageEmailSender.cs (3)
12public Task SendConfirmationLinkAsync(TUser user, string email, string confirmationLink) => 15public Task SendPasswordResetLinkAsync(TUser user, string email, string resetLink) => 18public Task SendPasswordResetCodeAsync(TUser user, string email, string resetCode) =>
Microsoft.AspNetCore.InternalTesting (34)
CollectDumpAttribute.cs (4)
21public Task OnTestStartAsync(TestContext context, CancellationToken cancellationToken) 23return Task.CompletedTask; 26public Task OnTestEndAsync(TestContext context, Exception exception, CancellationToken cancellationToken) 35return Task.CompletedTask;
ExceptionAssertions.cs (5)
50public static async Task<TException> ThrowsAsync<TException>(Func<Task> testCode, string exceptionMessage) 109public static Task<ArgumentException> ThrowsArgumentAsync(Func<Task> testCode, string paramName, string exceptionMessage) 115Func<Task> testCode, 164public static Task<ArgumentException> ThrowsArgumentNullOrEmptyAsync(Func<Task> testCode, string paramName) 188public static Task<ArgumentException> ThrowsArgumentNullOrEmptyStringAsync(Func<Task> testCode, string paramName)
ITestMethodLifecycle.cs (2)
19Task OnTestStartAsync(TestContext context, CancellationToken cancellationToken); 21Task OnTestEndAsync(TestContext context, Exception exception, CancellationToken cancellationToken);
LoggedTest\LoggedTestBase.cs (6)
95public virtual Task InitializeAsync(TestContext context, MethodInfo methodInfo, object[] testMethodArguments, ITestOutputHelper testOutputHelper) 101protected virtual Task InitializeCoreAsync(TestContext context) => Task.CompletedTask; 117Task ITestMethodLifecycle.OnTestStartAsync(TestContext context, CancellationToken cancellationToken) 123Task ITestMethodLifecycle.OnTestEndAsync(TestContext context, Exception exception, CancellationToken cancellationToken) 129return Task.CompletedTask;
src\Shared\TaskExtensions.cs (12)
34public static Task DefaultTimeout(this Task task, int milliseconds = DefaultTimeoutDuration, [CallerFilePath] string filePath = null, [CallerLineNumber] int lineNumber = default) 39public static Task DefaultTimeout(this Task task, TimeSpan timeout, [CallerFilePath] string filePath = null, [CallerLineNumber] int lineNumber = default) 44public static Task DefaultTimeout(this ValueTask task, int milliseconds = DefaultTimeoutDuration, [CallerFilePath] string filePath = null, [CallerLineNumber] int lineNumber = default) 49public static Task DefaultTimeout(this ValueTask task, TimeSpan timeout, [CallerFilePath] string filePath = null, [CallerLineNumber] int lineNumber = default) 96if (task == await Task.WhenAny(task, Task.Delay(timeout, cts.Token)).ConfigureAwait(false)) 109public static async Task TimeoutAfter(this Task task, TimeSpan timeout, 131if (task == await Task.WhenAny(task, Task.Delay(timeout, cts.Token)).ConfigureAwait(false))
xunit\AspNetTestAssemblyRunner.cs (2)
33protected override async Task AfterTestAssemblyStartingAsync() 85protected override async Task BeforeTestAssemblyFinishedAsync()
xunit\AspNetTestCollectionRunner.cs (2)
33protected override async Task AfterTestCollectionStartingAsync() 48protected override Task BeforeTestCollectionFinishedAsync()
xunit\AspNetTestRunner.cs (1)
97await Task.Delay(5000).ConfigureAwait(false);
Microsoft.AspNetCore.InternalTesting.Tests (64)
AspNetTestAssemblyRunnerTest.cs (10)
17public async Task ForAssemblyHasHigherPriorityThanConstructors() 32public async Task ConstructorWithMessageSinkHasHigherPriorityThanParameterlessConstructor() 46public async Task CalledInExpectedOrder_SuccessWithDispose() 65public async Task CalledInExpectedOrder_FailedWithDispose() 86public async Task CalledInExpectedOrder_SuccessWithAsyncDispose() 106public async Task CalledInExpectedOrder_FailedWithAsyncDispose() 202Task IAsyncLifetime.InitializeAsync() 205return Task.CompletedTask; 213Task IAsyncLifetime.DisposeAsync() 216return Task.CompletedTask;
AssemblyTestLogTests.cs (9)
38public Task ForAssemblyWritesToAssemblyBaseDirectory() => 98public Task TestLogEscapesIllegalFileNames() => 119public Task TestLogWritesToGlobalLogFile() => 180public Task TestLogCleansLogFiles_AfterSuccessfulRun() => 226public Task TestLogDoesNotCleanLogFiles_AfterFailedRun() => 271public Task TestLogTruncatesTestNameToAvoidLongPaths() => 315public Task TestLogEnumerateFilenamesToAvoidCollisions() => 366private static async Task RunTestLogFunctionalTest(Action<string> action) 383await Task.Delay(100);
CollectingEventListenerTest.cs (8)
19public async Task CollectingEventListenerTest() 23await Task.Yield(); 25await Task.Yield(); 27await Task.Yield(); 42public async Task CollectingEventListenerTest() 44await Task.Yield(); 46await Task.Yield(); 48await Task.Yield();
HttpClientSlimTest.cs (5)
18public async Task GetStringAsyncHttp() 27public async Task GetStringAsyncThrowsForErrorResponse() 36public async Task PostAsyncHttp() 45public async Task PostAsyncThrowsForErrorResponse() 68private HttpListener StartHost(out string address, int statusCode = 200, Func<HttpListenerContext, Task> handler = null)
TaskExtensionsTest.cs (19)
14public async Task TimeoutAfterTest() 17await Assert.ThrowsAsync<TimeoutException>(async () => await Task.Delay(30000, cts.Token).TimeoutAfter(TimeSpan.FromMilliseconds(50))); 22public async Task TimeoutAfter_DoesNotThrowWhenCompleted() 24await Task.FromResult(true).TimeoutAfter(TimeSpan.FromMilliseconds(30000)); 28public async Task TimeoutAfter_DoesNotThrow_WithinTimeoutPeriod() 30await Task.Delay(10).TimeoutAfter(TimeSpan.FromMilliseconds(30000)); 34public async Task DefaultTimeout_WithTimespan() 37await Assert.ThrowsAsync<TimeoutException>(async () => await Task.Delay(30000, cts.Token).DefaultTimeout(TimeSpan.FromMilliseconds(50))); 42public async Task DefaultTimeout_WithMilliseconds() 45await Assert.ThrowsAsync<TimeoutException>(async () => await Task.Delay(30000, cts.Token).DefaultTimeout(50)); 50public async Task DefaultTimeout_Message_ContainsLineNumber() 53await Assert.ThrowsAsync<TimeoutException>(async () => await Task.Delay(30000, cts.Token).DefaultTimeout(50)); 58public async Task DefaultTimeout_DoesNotThrowWhenCompleted() 60await Task.FromResult(true).DefaultTimeout(); 65public async Task Task_TimeoutAfter_DoesNotRethrow_NonWaitAsyncTimeouts(string message) 67async Task ExpectedTimeout() 69await Task.Delay(10); 78public async Task TaskT_TimeoutAfter_DoesNotRethrow_NonWaitAsyncTimeouts(string message) 82await Task.Delay(10);
TestableAspNetTestAssemblyRunner.cs (1)
101public Task AfterTestAssemblyStartingAsync_Public()
TestContextTest.cs (12)
21Task ITestMethodLifecycle.OnTestStartAsync(TestContext context, CancellationToken cancellationToken) 24return Task.CompletedTask; 27Task ITestMethodLifecycle.OnTestEndAsync(TestContext context, Exception exception, CancellationToken cancellationToken) 29return Task.CompletedTask; 46Task ITestMethodLifecycle.OnTestStartAsync(TestContext context, CancellationToken cancellationToken) 49return Task.CompletedTask; 52Task ITestMethodLifecycle.OnTestEndAsync(TestContext context, Exception exception, CancellationToken cancellationToken) 54return Task.CompletedTask; 72Task ITestMethodLifecycle.OnTestStartAsync(TestContext context, CancellationToken cancellationToken) 75return Task.CompletedTask; 78Task ITestMethodLifecycle.OnTestEndAsync(TestContext context, Exception exception, CancellationToken cancellationToken) 80return Task.CompletedTask;
Microsoft.AspNetCore.Localization (6)
AcceptLanguageHeaderRequestCultureProvider.cs (1)
48return Task.FromResult<ProviderCultureResult?>(new ProviderCultureResult(orderedLanguages));
CookieRequestCultureProvider.cs (1)
42return Task.FromResult<ProviderCultureResult?>(providerResultCulture);
QueryStringRequestCultureProvider.cs (1)
69return Task.FromResult<ProviderCultureResult?>(providerResultCulture);
RequestCultureProvider.cs (1)
18protected static readonly Task<ProviderCultureResult?> NullProviderCultureResult = Task.FromResult(default(ProviderCultureResult));
RequestLocalizationMiddleware.cs (2)
46/// <returns>A <see cref="Task"/> that completes when the middleware has completed processing.</returns> 47public async Task Invoke(HttpContext context)
Microsoft.AspNetCore.Localization.FunctionalTests (11)
LocalizationSampleTest.cs (1)
16public async Task LocalizationSampleSmokeTest()
LocalizationTest.cs (10)
16public Task Localization_ContentLanguageHeader() 25public Task Localization_CustomCulture() 34public Task Localization_GetAllStrings() 43public Task Localization_ResourcesInClassLibrary_ReturnLocalizedValue() 52public Task Localization_ResourcesInFolder_ReturnLocalizedValue() 61public Task Localization_ResourcesInFolder_ReturnLocalizedValue_WithCultureFallback() 70public Task Localization_ResourcesInFolder_ReturnNonLocalizedValue_CultureHierarchyTooDeep() 79public Task Localization_ResourcesAtRootFolder_ReturnLocalizedValue() 88public Task Localization_BuilderAPIs() 96private async Task RunTest(Type startupType, string culture, string expected)
Microsoft.AspNetCore.Localization.Routing (1)
RouteDataRequestCultureProvider.cs (1)
64return Task.FromResult<ProviderCultureResult?>(providerResultCulture);
Microsoft.AspNetCore.Localization.Routing.Tests (3)
RouteDataRequestCultureProviderTest.cs (3)
25public async Task GetCultureInfo_FromRouteData( 93public async Task GetDefaultCultureInfo_IfCultureKeysAreMissing() 144public async Task GetCultureInfo_FromRouteData_WithCustomKeys(
Microsoft.AspNetCore.Localization.Tests (40)
AcceptLanguageHeaderRequestCultureProviderTest.cs (8)
16public async Task GetFallbackLanguage_ReturnsFirstNonNullCultureFromSupportedCultureList() 39return Task.FromResult(0); 57public async Task GetFallbackLanguage_ReturnsFromSupportedCulture_AcceptLanguageListContainsSupportedCultures() 80return Task.FromResult(0); 97public async Task GetFallbackLanguage_ReturnsDefault_AcceptLanguageListDoesnotContainSupportedCultures() 120return Task.FromResult(0); 138public async Task OmitDefaultRequestCultureShouldNotThrowNullReferenceException_And_ShouldGetTheRightCulture() 166return Task.FromResult(0);
CookieRequestCultureProviderTest.cs (10)
20public async Task GetCultureInfoFromPersistentCookie() 53return Task.FromResult(0); 73public async Task GetDefaultCultureInfoIfCultureKeysAreMissingOrInvalid() 105return Task.FromResult(0); 122public async Task GetDefaultCultureInfoIfCookieDoesNotExist() 154return Task.FromResult(0); 169public async Task RequestLocalizationMiddleware_LogsDebugForUnsupportedCultures() 200app.Run(context => Task.CompletedTask); 229public async Task RequestLocalizationMiddleware_LogsDebugForUnsupportedUICultures() 260app.Run(context => Task.CompletedTask);
CustomRequestCultureProviderTest.cs (3)
17public async Task CustomRequestCultureProviderThatGetsCultureInfoFromUrl() 42return Task.FromResult(requestCulture); 50return Task.FromResult(0);
QueryStringRequestCultureProviderTest.cs (16)
16public async Task GetCultureInfoFromQueryString() 43return Task.FromResult(0); 58public async Task GetDefaultCultureInfoIfCultureKeysAreMissing() 77return Task.FromResult(0); 92public async Task GetDefaultCultureInfoIfCultureIsInSupportedCultureList() 118return Task.FromResult(0); 133public async Task GetDefaultCultureInfoIfUICultureIsNotInSupportedList() 159return Task.FromResult(0); 174public async Task GetSameCultureInfoIfCultureKeyIsMissing() 201return Task.FromResult(0); 216public async Task GetSameCultureInfoIfUICultureKeyIsMissing() 243return Task.FromResult(0); 258public async Task GetCultureInfoFromQueryStringWithCustomKeys() 290return Task.FromResult(0); 305public async Task GetTheRightCultureInfoRegardlessOfCultureNameCasing() 338return Task.FromResult(0);
RequestLocalizationMiddlewareTest.cs (2)
28public async Task RequestLocalizationMiddleware_ShouldFallBackToParentCultures_RegradlessOfHyphenSeparatorCheck(string requestedCulture, string parentCulture) 56await Task.CompletedTask;
RequestLocalizationOptionsExtensionsTest.cs (1)
15var provider = new CustomRequestCultureProvider(context => Task.FromResult(new ProviderCultureResult("ar-YE")));
Microsoft.AspNetCore.MiddlewareAnalysis (1)
AnalysisMiddleware.cs (1)
44public async Task Invoke(HttpContext httpContext)
Microsoft.AspNetCore.MiddlewareAnalysis.Tests (1)
MiddlewareAnalysisTests.cs (1)
16public async Task ExceptionWrittenToDiagnostics()
Microsoft.AspNetCore.Mvc.Abstractions (31)
Abstractions\IActionInvoker.cs (2)
18/// <returns>A <see cref="Task"/> which will complete when action processing has completed.</returns> 19Task InvokeAsync();
Filters\ActionExecutionDelegate.cs (1)
11/// A <see cref="Task"/> that on completion returns an <see cref="ActionExecutedContext"/>.
Filters\IAsyncActionFilter.cs (2)
18/// <returns>A <see cref="Task"/> that on completion indicates the filter has executed.</returns> 19Task OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next);
Filters\IAsyncAuthorizationFilter.cs (2)
16/// A <see cref="Task"/> that on completion indicates the filter has executed. 18Task OnAuthorizationAsync(AuthorizationFilterContext context);
Filters\IAsyncExceptionFilter.cs (2)
15/// <returns>A <see cref="Task"/> that on completion indicates the filter has executed.</returns> 16Task OnExceptionAsync(ExceptionContext context);
Filters\IAsyncResourceFilter.cs (2)
21/// A <see cref="Task"/> which will complete when the remainder of the pipeline completes. 23Task OnResourceExecutionAsync(
Filters\IAsyncResultFilter.cs (2)
34/// <returns>A <see cref="Task"/> that on completion indicates the filter has executed.</returns> 35Task OnResultExecutionAsync(ResultExecutingContext context, ResultExecutionDelegate next);
Filters\ResourceExecutionDelegate.cs (1)
10/// <returns>A <see cref="Task"/> that on completion returns a <see cref="ResourceExecutedContext"/>.</returns>
Filters\ResultExecutionDelegate.cs (1)
10/// <returns>A <see cref="Task"/> that on completion returns an <see cref="ResultExecutedContext"/>.</returns>
Formatters\IInputFormatter.cs (1)
26/// <returns>A <see cref="Task"/> that on completion deserializes the request body.</returns>
Formatters\InputFormatterResult.cs (9)
13private static readonly Task<InputFormatterResult> _failureAsync = Task.FromResult(_failure); 14private static readonly Task<InputFormatterResult> _noValueAsync = Task.FromResult(_noValue); 59/// Returns a <see cref="Task"/> that on completion provides an <see cref="InputFormatterResult"/> indicating 63/// A <see cref="Task"/> that on completion provides an <see cref="InputFormatterResult"/> indicating the 86/// Returns a <see cref="Task"/> that on completion provides an <see cref="InputFormatterResult"/> indicating 91/// A <see cref="Task"/> that on completion provides an <see cref="InputFormatterResult"/> indicating the 96return Task.FromResult(Success(model)); 113/// Returns a <see cref="Task"/> that on completion provides an <see cref="InputFormatterResult"/> indicating 117/// A <see cref="Task"/> that on completion provides an <see cref="InputFormatterResult"/> indicating the
Formatters\IOutputFormatter.cs (1)
24Task WriteAsync(OutputFormatterWriteContext context);
IActionResult.cs (1)
18Task ExecuteResultAsync(ActionContext context);
ModelBinding\IModelBinder.cs (2)
17/// A <see cref="Task"/> which will complete when the model binding process completes. 28Task BindModelAsync(ModelBindingContext bindingContext);
ModelBinding\IValueProviderFactory.cs (2)
16/// <returns>A <see cref="Task"/> that when completed will add an <see cref="IValueProvider"/> instance 18Task CreateValueProviderAsync(ValueProviderFactoryContext context);
Microsoft.AspNetCore.Mvc.Api.Analyzers (5)
AddResponseTypeAttributeCodeFixProvider.cs (2)
22public sealed override Task RegisterCodeFixesAsync(CodeFixContext context) 28return Task.CompletedTask;
ApiActionsDoNotRequireExplicitModelValidationCodeFixProvider.cs (3)
25public sealed override Task RegisterCodeFixesAsync(CodeFixContext context) 29return Task.CompletedTask; 34return Task.CompletedTask;
Microsoft.AspNetCore.Mvc.ApiExplorer (1)
ApiResponseTypeProvider.cs (1)
338declaredReturnType == typeof(Task) ||
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (7)
ApiResponseTypeProviderTest.cs (2)
823public override Task WriteResponseBodyAsync(OutputFormatterWriteContext context) => Task.CompletedTask;
DefaultApiDescriptionProviderTest.cs (3)
2379private Task ReturnsTask() 2625public Task ReturnsTask() 2837public override Task WriteResponseBodyAsync(OutputFormatterWriteContext context)
EndpointMetadataApiDescriptionProviderTest.cs (2)
179AssertVoid(GetApiDescription(() => Task.CompletedTask)); 1370var endpoint = new RouteEndpoint(httpContext => Task.CompletedTask, routePattern, 0, endpointMetadata, displayName);
Microsoft.AspNetCore.Mvc.Core (294)
ActionResult.cs (2)
20public virtual Task ExecuteResultAsync(ActionContext context) 23return Task.CompletedTask;
Authorization\AuthorizeFilter.cs (1)
159public virtual async Task OnAuthorizationAsync(AuthorizationFilterContext context)
Builder\ControllerEndpointRouteBuilderExtensions.cs (4)
194var builder = endpoints.MapFallback(context => Task.CompletedTask); 258var builder = endpoints.MapFallback(pattern, context => Task.CompletedTask); 318var builder = endpoints.MapFallback(context => Task.CompletedTask); 384var builder = endpoints.MapFallback(pattern, context => Task.CompletedTask);
ChallengeResult.cs (1)
91public override async Task ExecuteResultAsync(ActionContext context)
ContentResult.cs (1)
31public override Task ExecuteResultAsync(ActionContext context)
ControllerBase.cs (9)
2523/// <returns>A <see cref="Task"/> that on completion returns <c>true</c> if the update is successful.</returns> 2542/// <returns>A <see cref="Task"/> that on completion returns <c>true</c> if the update is successful.</returns> 2570/// <returns>A <see cref="Task"/> that on completion returns <c>true</c> if the update is successful.</returns> 2602/// <returns>A <see cref="Task"/> that on completion returns <c>true</c> if the update is successful.</returns> 2639/// <returns>A <see cref="Task"/> that on completion returns <c>true</c> if the update is successful.</returns> 2678/// <returns>A <see cref="Task"/> that on completion returns <c>true</c> if the update is successful.</returns> 2712/// <returns>A <see cref="Task"/> that on completion returns <c>true</c> if the update is successful.</returns> 2744/// <returns>A <see cref="Task"/> that on completion returns <c>true</c> if the update is successful.</returns> 2781/// <returns>A <see cref="Task"/> that on completion returns <c>true</c> if the update is successful.</returns>
Controllers\ControllerBinderDelegate.cs (1)
6internal delegate Task ControllerBinderDelegate(
Controllers\ControllerBinderDelegateProvider.cs (1)
52async Task Bind(ControllerContext controllerContext, object controller, Dictionary<string, object?> arguments)
FileContentResult.cs (1)
62public override Task ExecuteResultAsync(ActionContext context)
FileStreamResult.cs (1)
63public override Task ExecuteResultAsync(ActionContext context)
Filters\ActionFilterAttribute.cs (2)
31public virtual async Task OnActionExecutionAsync( 56public virtual async Task OnResultExecutionAsync(
Filters\ControllerActionFilter.cs (2)
18public Task OnActionExecutionAsync( 47private static async Task ExecuteActionFilter(
Filters\ControllerResultFilter.cs (2)
18public Task OnResultExecutionAsync( 47private static async Task ExecuteResultFilter(
Filters\ExceptionFilterAttribute.cs (2)
17public virtual Task OnExceptionAsync(ExceptionContext context) 22return Task.CompletedTask;
Filters\MiddlewareFilter.cs (1)
22public Task OnResourceExecutionAsync(ResourceExecutingContext context, ResourceExecutionDelegate next)
Filters\ResultFilterAttribute.cs (1)
28public virtual async Task OnResultExecutionAsync(
ForbidResult.cs (1)
91public override async Task ExecuteResultAsync(ActionContext context)
Formatters\HttpNoContentOutputFormatter.cs (3)
25if (context.ObjectType == typeof(void) || context.ObjectType == typeof(Task)) 34public Task WriteAsync(OutputFormatterWriteContext context) 43return Task.CompletedTask;
Formatters\InputFormatter.cs (1)
117/// <returns>A <see cref="Task"/> that on completion deserializes the request body.</returns>
Formatters\OutputFormatter.cs (2)
157public virtual Task WriteAsync(OutputFormatterWriteContext context) 182public abstract Task WriteResponseBodyAsync(OutputFormatterWriteContext context);
Formatters\StreamOutputFormatter.cs (1)
27public async Task WriteAsync(OutputFormatterWriteContext context)
Formatters\StringOutputFormatter.cs (2)
43public override Task WriteResponseBodyAsync(OutputFormatterWriteContext context, Encoding encoding) 51return Task.CompletedTask;
Formatters\SystemTextJsonOutputFormatter.cs (1)
61public sealed override async Task WriteResponseBodyAsync(OutputFormatterWriteContext context, Encoding selectedEncoding)
Formatters\TextInputFormatter.cs (1)
59/// <returns>A <see cref="Task"/> that on completion deserializes the request body.</returns>
Formatters\TextOutputFormatter.cs (4)
103public override Task WriteAsync(OutputFormatterWriteContext context) 142return Task.CompletedTask; 152public sealed override Task WriteResponseBodyAsync(OutputFormatterWriteContext context) 168public abstract Task WriteResponseBodyAsync(OutputFormatterWriteContext context, Encoding selectedEncoding);
HttpActionResult.cs (1)
29public override Task ExecuteResultAsync(ActionContext context)
Infrastructure\ActionMethodExecutor.cs (3)
198await (Task)executor.Execute(controller, arguments)!; 208await (Task)executor.Execute(controller, arguments)!; 212protected override bool CanExecute(ObjectMethodExecutor executor) => executor.MethodReturnType == typeof(Task);
Infrastructure\ContentResultExecutor.cs (1)
34public virtual async Task ExecuteAsync(ActionContext context, ContentResult result)
Infrastructure\ControllerActionInvoker.cs (27)
59private Task Next(ref State next, ref Scope scope, ref object? state, ref bool isCompleted) 75var task = BindArgumentsAsync(); 128var task = filter.OnActionExecutionAsync(actionExecutingContext, InvokeNextActionFilterAwaitedAsync); 208var task = InvokeNextActionFilterAsync(); 246var task = InvokeActionMethodAsync(); 269return Task.CompletedTask; 281return Task.CompletedTask; 289private Task InvokeNextActionFilterAsync() 299var lastTask = Next(ref next, ref scope, ref state, ref isCompleted); 315return Task.CompletedTask; 317static async Task Awaited(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, object? state, bool isCompleted) 349var task = InvokeNextActionFilterAsync(); 356return Task.FromResult<ActionExecutedContext>(_actionExecutedContext); 358static async Task<ActionExecutedContext> Awaited(ControllerActionInvoker invoker, Task task) 379private Task InvokeActionMethodAsync() 400return Task.CompletedTask; 402static async Task Awaited(ControllerActionInvoker invoker, ValueTask<IActionResult> actionResultValueTask) 407static async Task Logged(ControllerActionInvoker invoker) 454protected override Task InvokeInnerFilterAsync() 465var lastTask = Next(ref next, ref scope, ref state, ref isCompleted); 472return Task.CompletedTask; 478return Task.FromException(ex); 481static async Task Awaited(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, object? state, bool isCompleted) 512private Task BindArgumentsAsync() 520return Task.CompletedTask;
Infrastructure\FileContentResultExecutor.cs (4)
26public virtual Task ExecuteAsync(ActionContext context, FileContentResult result) 43return Task.CompletedTask; 56protected virtual Task WriteFileAsync(ActionContext context, FileContentResult result, RangeItemHeaderValue? range, long rangeLength) 63return Task.CompletedTask;
Infrastructure\FileResultExecutorBase.cs (1)
94protected static async Task WriteFileAsync(HttpContext context, Stream fileStream, RangeItemHeaderValue? range, long rangeLength)
Infrastructure\FileStreamResultExecutor.cs (3)
26public virtual async Task ExecuteAsync(ActionContext context, FileStreamResult result) 65protected virtual Task WriteFileAsync( 76return Task.CompletedTask;
Infrastructure\IActionResultExecutor.cs (2)
27/// <returns>A <see cref="Task"/> which represents the asynchronous operation.</returns> 28Task ExecuteAsync(ActionContext context, TResult result);
Infrastructure\LocalRedirectResultExecutor.cs (2)
36public virtual Task ExecuteAsync(ActionContext context, LocalRedirectResult result) 63return Task.CompletedTask;
Infrastructure\NonDisposableStream.cs (3)
139public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) 145public override Task FlushAsync(CancellationToken cancellationToken) 163public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
Infrastructure\ObjectResultExecutor.cs (4)
63/// A <see cref="Task"/> which will complete once the <see cref="ObjectResult"/> is written to the response. 65public virtual Task ExecuteAsync(ActionContext context, ObjectResult result) 83private Task ExecuteAsyncCore(ActionContext context, ObjectResult result, Type? objectType, object? value) 113return Task.CompletedTask;
Infrastructure\PhysicalFileResultExecutor.cs (5)
26public virtual Task ExecuteAsync(ActionContext context, PhysicalFileResult result) 54return Task.CompletedTask; 58protected virtual Task WriteFileAsync(ActionContext context, PhysicalFileResult result, RangeItemHeaderValue? range, long rangeLength) 63internal static Task WriteFileAsyncInternal( 75return Task.CompletedTask;
Infrastructure\RedirectResultExecutor.cs (2)
33public virtual Task ExecuteAsync(ActionContext context, RedirectResult result) 60return Task.CompletedTask;
Infrastructure\RedirectToActionResultExecutor.cs (2)
34public virtual Task ExecuteAsync(ActionContext context, RedirectToActionResult result) 66return Task.CompletedTask;
Infrastructure\RedirectToPageResultExecutor.cs (2)
34public virtual Task ExecuteAsync(ActionContext context, RedirectToPageResult result) 66return Task.CompletedTask;
Infrastructure\RedirectToRouteResultExecutor.cs (2)
34public virtual Task ExecuteAsync(ActionContext context, RedirectToRouteResult result) 62return Task.CompletedTask;
Infrastructure\ResourceInvoker.cs (71)
57public virtual Task InvokeAsync() 67Task task; 74return Awaited(this, Task.FromException(exception), scope); 84static async Task Awaited(ResourceInvoker invoker, Task task, IDisposable? scope) 96static async Task Logged(ResourceInvoker invoker) 213private Task InvokeFilterPipelineAsync() 232var lastTask = Next(ref next, ref scope, ref state, ref isCompleted); 239return Task.CompletedTask; 245return Task.FromException(ex); 248static async Task Awaited(ResourceInvoker invoker, Task lastTask, State next, Scope scope, object? state, bool isCompleted) 259protected abstract Task InvokeInnerFilterAsync(); 261protected virtual Task InvokeResultAsync(IActionResult result) 270static async Task Logged(ResourceInvoker invoker, IActionResult result) 289private Task Next(ref State next, ref Scope scope, ref object? state, ref bool isCompleted) 347var task = filter.OnAuthorizationAsync(authorizationContext); 483var task = filter.OnResourceExecutionAsync(resourceExecutingContext, InvokeNextResourceFilterAwaitedAsync); 561var task = InvokeNextResourceFilter(); 605var task = InvokeAlwaysRunResultFilters(); 654var task = InvokeNextExceptionFilterAsync(); 681var task = filter.OnExceptionAsync(exceptionContext); 721var task = InvokeNextExceptionFilterAsync(); 792var task = InvokeAlwaysRunResultFilters(); 809return Task.CompletedTask; 825var task = InvokeResultFilters(); 836var task = InvokeInnerFilterAsync(); 853return Task.CompletedTask; 857var task = InvokeResultFilters(); 886return Task.CompletedTask; 898return Task.CompletedTask; 916var task = InvokeNextResourceFilter(); 923return Task.FromResult<ResourceExecutedContext>(_resourceExecutedContext); 925static async Task<ResourceExecutedContext> Awaited(ResourceInvoker invoker, Task task) 945private Task InvokeNextResourceFilter() 956var lastTask = Next(ref next, ref scope, ref state, ref isCompleted); 972return Task.CompletedTask; 974static async Task Awaited(ResourceInvoker invoker, Task lastTask, State next, Scope scope, object? state, bool isCompleted) 997private Task InvokeNextExceptionFilterAsync() 1008var lastTask = Next(ref next, ref scope, ref state, ref isCompleted); 1015return Task.CompletedTask; 1021return Task.FromException(ex); 1024static async Task Awaited(ResourceInvoker invoker, Task lastTask, State next, Scope scope, object? state, bool isCompleted) 1045private Task InvokeAlwaysRunResultFilters() 1056var lastTask = ResultNext<IAlwaysRunResultFilter, IAsyncAlwaysRunResultFilter>(ref next, ref scope, ref state, ref isCompleted); 1063return Task.CompletedTask; 1069return Task.FromException(ex); 1072static async Task Awaited(ResourceInvoker invoker, Task lastTask, State next, Scope scope, object? state, bool isCompleted) 1083private Task InvokeResultFilters() 1094var lastTask = ResultNext<IResultFilter, IAsyncResultFilter>(ref next, ref scope, ref state, ref isCompleted); 1101return Task.CompletedTask; 1107return Task.FromException(ex); 1110static async Task Awaited(ResourceInvoker invoker, Task lastTask, State next, Scope scope, object? state, bool isCompleted) 1121private Task ResultNext<TFilter, TFilterAsync>(ref State next, ref Scope scope, ref object? state, ref bool isCompleted) 1180var task = filter.OnResultExecutionAsync(resultExecutingContext, InvokeNextResultFilterAwaitedAsync<TFilter, TFilterAsync>); 1262var task = InvokeNextResultFilterAsync<TFilter, TFilterAsync>(); 1312var task = InvokeResultAsync(_result); 1334return Task.CompletedTask; 1338return Task.CompletedTask; 1346private Task InvokeNextResultFilterAsync<TFilter, TFilterAsync>() 1358var lastTask = ResultNext<TFilter, TFilterAsync>(ref next, ref scope, ref state, ref isCompleted); 1375return Task.CompletedTask; 1377static async Task Awaited(ResourceInvoker invoker, Task lastTask, State next, Scope scope, object? state, bool isCompleted) 1412var task = InvokeNextResultFilterAsync<TFilter, TFilterAsync>(); 1419return Task.FromResult<ResultExecutedContext>(_resultExecutedContext); 1421static async Task<ResultExecutedContext> Awaited(ResourceInvoker invoker, Task task)
Infrastructure\SystemTextJsonResultExecutor.cs (1)
34public async Task ExecuteAsync(ActionContext context, JsonResult result)
Infrastructure\VirtualFileResultExecutor.cs (5)
34public virtual Task ExecuteAsync(ActionContext context, VirtualFileResult result) 62return Task.CompletedTask; 66protected virtual Task WriteFileAsync(ActionContext context, VirtualFileResult result, IFileInfo fileInfo, RangeItemHeaderValue? range, long rangeLength) 74internal static Task WriteFileAsyncInternal( 83return Task.CompletedTask;
JsonResult.cs (1)
70public override Task ExecuteResultAsync(ActionContext context)
LocalRedirectResult.cs (1)
87public override Task ExecuteResultAsync(ActionContext context)
ModelBinding\Binders\BinderTypeModelBinder.cs (1)
40public async Task BindModelAsync(ModelBindingContext bindingContext)
ModelBinding\Binders\BodyModelBinder.cs (1)
87public async Task BindModelAsync(ModelBindingContext bindingContext)
ModelBinding\Binders\ByteArrayModelBinder.cs (4)
29public Task BindModelAsync(ModelBindingContext bindingContext) 41return Task.CompletedTask; 52return Task.CompletedTask; 69return Task.CompletedTask;
ModelBinding\Binders\CancellationTokenModelBinder.cs (2)
16public Task BindModelAsync(ModelBindingContext bindingContext) 28return Task.CompletedTask;
ModelBinding\Binders\CollectionModelBinder.cs (1)
105public virtual async Task BindModelAsync(ModelBindingContext bindingContext)
ModelBinding\Binders\ComplexObjectModelBinder.cs (3)
49public Task BindModelAsync(ModelBindingContext bindingContext) 58return Task.CompletedTask; 66private async Task BindModelCoreAsync(ModelBindingContext bindingContext, int propertyData)
ModelBinding\Binders\ComplexTypeModelBinder.cs (5)
78public Task BindModelAsync(ModelBindingContext bindingContext) 87return Task.CompletedTask; 95private async Task BindModelCoreAsync(ModelBindingContext bindingContext, int propertyData) 303/// A <see cref="Task"/> that when completed will set <see cref="ModelBindingContext.Result"/> to the 306protected virtual Task BindProperty(ModelBindingContext bindingContext)
ModelBinding\Binders\DateTimeModelBinder.cs (3)
33public Task BindModelAsync(ModelBindingContext bindingContext) 47return Task.CompletedTask; 96return Task.CompletedTask;
ModelBinding\Binders\DecimalModelBinder.cs (3)
35public Task BindModelAsync(ModelBindingContext bindingContext) 49return Task.CompletedTask; 108return Task.CompletedTask;
ModelBinding\Binders\DictionaryModelBinder.cs (1)
110public override async Task BindModelAsync(ModelBindingContext bindingContext)
ModelBinding\Binders\DoubleModelBinder.cs (3)
35public Task BindModelAsync(ModelBindingContext bindingContext) 49return Task.CompletedTask; 108return Task.CompletedTask;
ModelBinding\Binders\FloatModelBinder.cs (3)
35public Task BindModelAsync(ModelBindingContext bindingContext) 49return Task.CompletedTask; 108return Task.CompletedTask;
ModelBinding\Binders\FormCollectionModelBinder.cs (1)
33public async Task BindModelAsync(ModelBindingContext bindingContext)
ModelBinding\Binders\FormFileModelBinder.cs (2)
34public async Task BindModelAsync(ModelBindingContext bindingContext) 135private async Task GetFormFilesAsync(
ModelBinding\Binders\HeaderModelBinder.cs (1)
49public async Task BindModelAsync(ModelBindingContext bindingContext)
ModelBinding\Binders\KeyedServicesModelBinder.cs (3)
22public Task BindModelAsync(ModelBindingContext bindingContext) 28return Task.CompletedTask; 41return Task.CompletedTask;
ModelBinding\Binders\KeyValuePairModelBinder.cs (1)
39public async Task BindModelAsync(ModelBindingContext bindingContext)
ModelBinding\Binders\ServicesModelBinder.cs (2)
20public Task BindModelAsync(ModelBindingContext bindingContext) 35return Task.CompletedTask;
ModelBinding\Binders\SimpleTypeModelBinder.cs (3)
35public Task BindModelAsync(ModelBindingContext bindingContext) 48return Task.CompletedTask; 104return Task.CompletedTask;
ModelBinding\Binders\TryParseModelBinder.cs (3)
43public Task BindModelAsync(ModelBindingContext bindingContext) 56return Task.CompletedTask; 95return Task.CompletedTask;
ModelBinding\FormFileValueProviderFactory.cs (3)
17public Task CreateValueProviderAsync(ValueProviderFactoryContext context) 28return Task.CompletedTask; 31private static async Task AddValueProviderAsync(ValueProviderFactoryContext context, HttpRequest request)
ModelBinding\FormValueProviderFactory.cs (3)
18public Task CreateValueProviderAsync(ValueProviderFactoryContext context) 29return Task.CompletedTask; 32private static async Task AddValueProviderAsync(ValueProviderFactoryContext context)
ModelBinding\JQueryFormValueProviderFactory.cs (3)
18public Task CreateValueProviderAsync(ValueProviderFactoryContext context) 29return Task.CompletedTask; 32private static async Task AddValueProviderAsync(ValueProviderFactoryContext context)
ModelBinding\JQueryQueryStringValueProviderFactory.cs (2)
16public Task CreateValueProviderAsync(ValueProviderFactoryContext context) 31return Task.CompletedTask;
ModelBinding\ModelBindingHelper.cs (5)
36/// <returns>A <see cref="Task"/> that on completion returns <c>true</c> if the update is successful</returns> 76/// <returns>A <see cref="Task"/> that on completion returns <c>true</c> if the update is successful</returns> 122/// <returns>A <see cref="Task"/> that on completion returns <c>true</c> if the update is successful</returns> 161/// <returns>A <see cref="Task"/> that on completion returns <c>true</c> if the update is successful</returns> 202/// <returns>A <see cref="Task"/> that on completion returns <c>true</c> if the update is successful</returns>
ModelBinding\NoOpBinder.cs (2)
12public Task BindModelAsync(ModelBindingContext bindingContext) 14return Task.CompletedTask;
ModelBinding\PlaceholderBinder.cs (1)
18public Task BindModelAsync(ModelBindingContext bindingContext)
ModelBinding\QueryStringValueProviderFactory.cs (2)
17public Task CreateValueProviderAsync(ValueProviderFactoryContext context) 32return Task.CompletedTask;
ModelBinding\RouteValueProviderFactory.cs (2)
14public Task CreateValueProviderAsync(ValueProviderFactoryContext context) 24return Task.CompletedTask;
ObjectResult.cs (1)
60public override Task ExecuteResultAsync(ActionContext context)
PhysicalFileResult.cs (1)
54public override Task ExecuteResultAsync(ActionContext context)
RedirectResult.cs (1)
89public override Task ExecuteResultAsync(ActionContext context)
RedirectToActionResult.cs (1)
167public override Task ExecuteResultAsync(ActionContext context)
RedirectToPageResult.cs (1)
205public override Task ExecuteResultAsync(ActionContext context)
RedirectToRouteResult.cs (1)
159public override Task ExecuteResultAsync(ActionContext context)
Routing\ActionConstraintMatcherPolicy.cs (2)
76public Task ApplyAsync(HttpContext httpContext, CandidateSet candidateSet) 96return Task.CompletedTask;
Routing\ActionEndpointFactory.cs (1)
218var builder = new RouteEndpointBuilder(context => Task.CompletedTask, pattern, route.Order)
Routing\AttributeRoute.cs (2)
45public Task RouteAsync(RouteContext context) 297public Task RouteAsync(RouteContext context)
Routing\DynamicControllerEndpointMatcherPolicy.cs (1)
58public async Task ApplyAsync(HttpContext httpContext, CandidateSet candidates)
Routing\MvcAttributeRouteHandler.cs (3)
42public Task RouteAsync(RouteContext context) 58return Task.CompletedTask; 85return Task.CompletedTask;
Routing\MvcRouteHandler.cs (4)
39public Task RouteAsync(RouteContext context) 47return Task.CompletedTask; 54return Task.CompletedTask; 73return Task.CompletedTask;
Routing\NullRouter.cs (2)
21public Task RouteAsync(RouteContext context) 23return Task.CompletedTask;
SignInResult.cs (1)
78public override Task ExecuteResultAsync(ActionContext context)
SignOutResult.cs (3)
90public override Task ExecuteResultAsync(ActionContext context) 98Task IResult.ExecuteAsync(HttpContext httpContext) 103private async Task ExecuteAsync(HttpContext httpContext)
src\Shared\ObjectMethodExecutor\ObjectMethodExecutorFSharpSupport.cs (6)
39/// or to a <see cref="Task"/>, if <c>TResult</c> is <see href="https://fsharp.github.io/fsharp-core-docs/reference/fsharp-core-unit-0.html">FSharp.Core.Unit</see>. 49/// to a <see cref="Task{TResult}"/>, or to a <see cref="Task"/>, if <c>TResult</c> is <see href="https://fsharp.github.io/fsharp-core-docs/reference/fsharp-core-unit-0.html">FSharp.Core.Unit</see>; 53/// When this method returns, contains the type of the closed generic instantiation of <see cref="Task{TResult}"/> or of <see cref="Task"/> that will be returned 114/// to a void-returning <see cref="Task"/> or <see cref="ValueTask"/>. 145var typeDef when typeDef == typeof(Task<>) && IsFSharpUnit(genericAwaitableType.GetGenericArguments()[0]) => (typeof(Task), MakeTaskOfUnitToTaskExpression(genericAwaitableType)), 155return Expression.Lambda(Expression.Convert(closedGenericTaskParam, typeof(Task)), closedGenericTaskParam);
src\Shared\ResultsHelpers\FileResultHelper.cs (2)
29internal static async Task WriteFileAsync(HttpContext context, Stream fileStream, RangeItemHeaderValue? range, long rangeLength) 56internal static async Task WriteFileAsync(HttpContext context, ReadOnlyMemory<byte> buffer, RangeItemHeaderValue? range, long rangeLength)
VirtualFileResult.cs (1)
60public override Task ExecuteResultAsync(ActionContext context)
Microsoft.AspNetCore.Mvc.Core.Test (813)
AcceptedAtActionResultTests.cs (4)
118public async Task ExecuteResultAsync_SetsObjectValueOfFormatter(object value) 127.Returns(Task.FromResult(0)); 147public async Task ExecuteResultAsync_SetsStatusCodeAndLocationHeader() 174public async Task ExecuteResultAsync_ThrowsIfActionUrlIsNullOrEmpty(string returnValue)
AcceptedAtRouteResultTests.cs (4)
49public async Task ExecuteResultAsync_SetsObjectValueOfFormatter(object value) 58.Returns(Task.FromResult(0)); 103public async Task ExecuteResultAsync_SetsStatusCodeAndLocationHeader(object values) 123public async Task ExecuteResultAsync_ThrowsIfRouteUrlIsNull()
AcceptedResultTests.cs (4)
45public async Task ExecuteResultAsync_SetsObjectValueOfFormatter(object value) 54.Returns(Task.FromResult(0)); 67public async Task ExecuteResultAsync_SetsStatusCodeAndLocationHeader() 85public async Task ExecuteResultAsync_OverwritesLocationHeader()
ActionResultOfTTest.cs (2)
123public Task ExecuteAsync(HttpContext httpContext) 124=> Task.CompletedTask;
ApplicationModels\AuthorizationApplicationModelProviderTest.cs (1)
159.Returns(Task.FromResult(authorizationPolicy))
ApplicationModels\DefaultApplicationModelProviderTest.cs (2)
1795public Task OnActionExecutionAsync( 1823public Task OnResourceExecutionAsync(ResourceExecutingContext context, ResourceExecutionDelegate next)
ApplicationModels\EndpointMetadataProviderTest.cs (8)
320=> Task.FromResult<AddsCustomEndpointMetadataResult>(null); 335=> Task.FromResult<AddsCustomEndpointMetadataActionResult>(null); 346=> Task.FromResult<RemovesAcceptsMetadataResult>(null); 357=> Task.FromResult<RemovesAcceptsMetadataActionResult>(null); 412public Task ExecuteAsync(HttpContext httpContext) => throw new NotImplementedException(); 421public Task ExecuteResultAsync(ActionContext context) => throw new NotImplementedException(); 451public Task ExecuteAsync(HttpContext httpContext) => throw new NotImplementedException(); 471public Task ExecuteResultAsync(ActionContext context) => throw new NotImplementedException();
ApplicationModels\InferParameterBindingInfoConventionTest.cs (1)
1153public Task BindModelAsync(ModelBindingContext bindingContext)
Authorization\AuthorizeFilterTest.cs (25)
31public async Task DefaultConstructor_DeniesAnonymousUsers() 53public async Task AuthorizeFilter_CreatedWithAuthorizeData_ThrowsWhenOnAuthorizationAsyncIsCalled() 69public async Task AuthorizeFilter_CreatedWithPolicy_ThrowsWhenOnAuthorizationAsyncIsCalled() 85public async Task AuthorizeFilterCanAuthorizeNonAuthenticatedUser() 100public async Task AuthorizeFilterWillCallPolicyProviderOnAuthorization() 129public async Task AuthorizeFilterCanAuthorizeNullUser() 143public async Task Invoke_ValidClaimShouldNotFail() 157public async Task Invoke_EmptyClaimsShouldChallengeAnonymousUser() 172public async Task Invoke_EmptyClaimsWithAllowAnonymousAttributeShouldNotRejectAnonymousUser() 188public async Task Invoke_EmptyClaimsShouldAuthorizeAuthenticatedUser() 202public async Task Invoke_AuthSchemesFailShouldSetEmptyPrincipalOnContext() 218public async Task Invoke_SingleValidClaimShouldSucceed() 241=> Task.FromResult(_true); 246return Task.FromResult(policyName == "true" ? _true : _false); 250=> Task.FromResult<AuthorizationPolicy>(null); 254public async Task AuthorizationFilterCombinesMultipleFiltersWithPolicyProvider() 276public async Task AuthorizationFilterCombinesMultipleFiltersWithDifferentPolicyProvider() 312public async Task AuthorizationFilterCombinesMultipleFilters() 330public async Task AuthorizationFilterIgnoresFirstFilterWhenCombining() 348public async Task AuthorizationFilterCombinesDerivedFilters() 374public async Task AuthZResourceShouldBeAuthorizationFilterContext() 388public async Task Invoke_RequireUnknownRoleShouldForbid() 403public async Task Invoke_InvalidClaimShouldForbid() 511public async Task GetEffectivePolicyAsync_CombinesPoliciesFromAuthFilters() 536public async Task GetEffectivePolicyAsync_CombinesPoliciesFromEndpoint()
ChallengeResultTest.cs (2)
18public async Task ChallengeResult_ExecuteResultAsync() 44public async Task ChallengeResult_ExecuteResultAsync_NoSchemes()
ContentResultTest.cs (3)
24public async Task ContentResult_ExecuteResultAsync_Response_NullContent_SetsContentTypeAndEncoding() 114public async Task ContentResult_ExecuteResultAsync_SetContentTypeAndEncoding_OnResponse( 222public async Task ContentResult_WritesDataCorrectly_ForDifferentContentSizes(string content, string contentType)
ControllerBaseTest.cs (12)
2609public async Task TryUpdateModel_FallsBackOnEmptyPrefix_IfNotSpecified() 2636public async Task TryUpdateModel_UsesModelTypeNameIfSpecified() 2664public async Task TryUpdateModel_UsesModelValueProviderIfSpecified() 2691public async Task TryUpdateModel_ReturnsFalse_IfValueProviderFactoryThrows() 2716public async Task TryUpdateModel_PropertyFilterOverload_UsesPassedArguments() 2749public async Task TryUpdateModel_PropertyFilterWithValueProviderOverload_UsesPassedArguments() 2783public async Task TryUpdateModel_IncludeExpressionOverload_UsesPassedArguments(string prefix) 2817public async Task TryUpdateModel_IncludeExpressionWithValueProviderOverload_UsesPassedArguments(string prefix) 2848public async Task TryUpdateModel_SupportsNullableExpressions() 2898public async Task TryUpdateModelNonGeneric_PropertyFilterWithValueProviderOverload_UsesPassedArguments() 2932public async Task TryUpdateModelNonGeneric_ModelTypeOverload_UsesPassedArguments() 2960public async Task TryUpdateModelNonGeneric_BindToBaseDeclaredType_ModelTypeOverload()
Controllers\ControllerBinderDelegateProviderTest.cs (28)
29public async Task CreateBinderDelegate_Delegate_DoesNotAddActionArgumentsOrCallBinderOrValidator_IfBindingIsNotAllowed_OnParameter() 85public async Task CreateBinderDelegate_Delegate_DoesNotAddActionArgumentsOrCallBinderOrValidator_IfBindingIsNotAllowed_OnProperty() 140public async Task CreateBinderDelegate_Delegate_DoesNotAddActionArguments_IfBinderReturnsNull() 155.Returns(Task.CompletedTask); 182public async Task CreateBinderDelegate_Delegate_DoesNotAddActionArguments_IfBinderDoesNotSetModel() 197.Returns(Task.CompletedTask); 224public async Task CreateBinderDelegate_Delegate_AddsActionArguments_IfBinderReturnsNotNull() 247.Returns(Task.CompletedTask); 275public async Task CreateBinderDelegate_Delegate_GetsMetadataFromParameter() 325public async Task CreateBinderDelegate_Delegate_GetsMetadataFromType_IsMetadataProviderIsNotDefaultMetadataProvider() 373public async Task CreateBinderDelegate_Delegate_CallsValidator_IfModelBinderSucceeds() 423public async Task CreateBinderDelegate_Delegate_DoesNotCallValidator_IfModelBinderFails() 441.Returns(Task.CompletedTask); 471public async Task CreateBinderDelegate_Delegate_CallsValidator_ForControllerProperties_IfModelBinderSucceeds() 519public async Task DoesNotValidate_ForControllerProperties_IfObjectValidatorDoesNotInheritFromBase() 566public async Task CreateBinderDelegate_Delegate_DoesNotCallValidator_ForControllerProperties_IfModelBinderFails() 584.Returns(Task.CompletedTask); 615public async Task CreateBinderDelegate_Delegate_SetsControllerProperties_ForReferenceTypes() 654public async Task CreateBinderDelegate_Delegate_AddsToCollectionControllerProperties() 694public async Task CreateBinderDelegate_Delegate_DoesNotSetNullValues_ForNonNullableProperties() 735public async Task CreateBinderDelegate_Delegate_SetsNullValues_ForNullableProperties() 776public async Task CreateBinderDelegate_Delegate_SupportsRequestPredicate_ForPropertiesAndParameters_NotBound() 839public async Task CreateBinderDelegate_Delegate_SupportsRequestPredicate_ForPropertiesAndParameters_Bound() 943public async Task CreateBinderDelegate_Delegate_SkipsReadOnlyControllerProperties( 987public async Task CreateBinderDelegate_Delegate_SetsMultipleControllerProperties() 1122public async Task MultipleActionParameter_ValidModelState(List<ParameterDescriptor> parameters) 1202public async Task BinderDelegateRecordsErrorWhenValueProviderThrowsValueProviderException() 1309return Task.CompletedTask;
Controllers\ControllerFactoryProviderTest.cs (1)
64public async Task CreateAsyncControllerReleaser_InvokesIControllerFactory_IfItIsNotDefaultControllerFactoryAsync()
Controllers\DefaultControllerActivatorTest.cs (3)
61public async Task ReleaseAsync_AsynchronouslyDisposesController_IfAsyncDisposableAsync() 75public async Task ReleaseAsync_SynchronouslyDisposesController_IfDisposableAsync() 89public async Task ReleaseAsync_SynchronouslyDisposesController_PrefersDisposeAsyncOverDispose()
Controllers\DefaultControllerFactoryTest.cs (1)
203public async Task DefaultControllerFactory_DelegatesAsyncDisposalToControllerActivatorAsync()
CreatedAtActionResultTests.cs (2)
21public async Task CreatedAtActionResult_ReturnsStatusCode_SetsLocationHeader() 45public async Task CreatedAtActionResult_ThrowsOnNullUrl()
CreatedAtRouteResultTests.cs (2)
40public async Task CreatedAtRouteResult_ReturnsStatusCode_SetsLocationHeader(object values) 59public async Task CreatedAtRouteResult_ThrowsOnNullUrl()
CreatedResultTests.cs (3)
62public async Task CreatedResult_ReturnsStatusCode_SetsLocationHeader() 79public async Task CreatedResult_ReturnsStatusCode_NotSetLocationHeader() 95public async Task CreatedResult_OverwritesLocationHeader()
FileContentResultTest.cs (1)
18protected override Task ExecuteAsync(
FileResultHelperTest.cs (11)
29public async Task ContentDispositionHeader_IsEncodedCorrectly() 53public async Task ContentDispositionHeader_IsEncodedCorrectly_ForUnicodeCharacters() 75public async Task ExecuteResultAsync_DoesNotSetContentDisposition_IfNotSpecified() 100public async Task ExecuteResultAsync_SetsContentDisposition_IfSpecified() 121public async Task ExecuteResultAsync_ThrowsException_IfCannotResolveLoggerFactory() 222public async Task SetsAcceptRangeHeader() 399public async Task IfModifiedSinceComparison_OnlyUsesWholeSeconds( 439public async Task IfUnmodifiedSinceComparison_OnlyUsesWholeSeconds(DateTimeOffset ifUnmodifiedSince, int expectedStatusCode) 497public override Task ExecuteResultAsync(ActionContext context) 511public Task ExecuteAsync(ActionContext context, EmptyFileResult result) 520return Task.FromResult(0);
FileStreamResultTest.cs (1)
16protected override Task ExecuteAsync(
Filters\ActionFilterAttributeTests.cs (5)
11public async Task ActionFilterAttribute_ActionFilter_SettingResult_ShortCircuits() 17public async Task ActionAttributeFilter_ActionFilter_Calls_OnActionExecuted() 23public async Task ActionAttributeFilter_ResultFilter_Calls_OnResultExecuted() 29public async Task ActionFilterAttribute_ResultFilter_SettingResult_DoesNotShortCircuit() 35public async Task ActionFilterAttribute_ResultFilter_SettingCancel_ShortCircuits()
Filters\MiddlewareFilterBuilderTest.cs (7)
76public async Task EndMiddleware_ThrowsException_WhenMiddleFeature_NotAvailable() 105public async Task EndMiddleware_DoesNotThrow_IfExceptionHandled() 138return Task.FromResult(context); 157public async Task EndMiddleware_PropagatesBackException_ToEarlierMiddleware() 200return Task.FromResult(context); 225public async Task EndMiddleware_PropagatesFullExceptionInfo_ToEarlierMiddleware() 268return Task.FromResult(context);
Filters\MiddlewareFilterTest.cs (13)
27public async Task MiddlewareFilter_SetsMiddlewareFilterFeature_OnExecution() 30Task requestDelegate(HttpContext context) => Task.FromResult(true); 47public async Task OnMiddlewareShortCircuit_DoesNotExecute_RestOfFilterPipeline() 56return Task.FromResult(true); // short circuit the request 84public async Task Multiple_MiddlewareFilters_ConcatsTheMiddlewarePipelines() 102return Task.FromResult(true); // short circuits the request 133public async Task UnhandledException_InMiddleware_PropagatesBackToInvoker() 165public async Task ExceptionThrownInMiddleware_CanBeHandled_ByEarlierMiddleware() 228() => Task.FromResult(new ResourceExecutedContext(new ActionContext(), new List<IFilterMetadata>()))); 412public override async Task InvokeAsync() 477public async Task OnResourceExecutionAsync(ResourceExecutingContext context, ResourceExecutionDelegate next) 497public Task ExecuteResultAsync(ActionContext context)
Filters\ResultFilterAttributeTest.cs (3)
13public async Task ResultFilterAttribute_ResultFilter_Calls_OnResultExecuted() 20public async Task ResultFilterAttribute_ResultFilter_SettingResult_DoesNotShortCircuit() 27public async Task ResultFilterAttribute_ResultFilter_SettingCancel_ShortCircuits()
ForbidResultTest.cs (9)
18public async Task ExecuteResultAsync_InvokesForbidAsyncOnAuthenticationService() 25.Returns(Task.CompletedTask) 44public async Task ExecuteResultAsync_InvokesForbidAsyncOnAllConfiguredSchemes() 52.Returns(Task.CompletedTask) 56.Returns(Task.CompletedTask) 83public async Task ExecuteResultAsync_InvokesForbidAsyncWithAuthProperties(AuthenticationProperties expected) 90.Returns(Task.CompletedTask) 110public async Task ExecuteResultAsync_InvokesForbidAsyncWithAuthProperties_WhenAuthenticationSchemesIsEmpty( 118.Returns(Task.CompletedTask)
Formatters\FormatterCollectionTest.cs (2)
50public override Task WriteResponseBodyAsync(OutputFormatterWriteContext context, Encoding selectedEncoding) 58public override Task WriteResponseBodyAsync(OutputFormatterWriteContext context, Encoding selectedEncoding)
Formatters\InputFormatterTest.cs (1)
410public async Task ReadAsync_WithEmptyRequest_ReturnsNoValueResultWhenExpected(bool allowEmptyInputValue, bool expectedIsModelSet)
Formatters\JsonInputFormatterTestBase.cs (26)
64public async Task JsonFormatterReadsIntValue() 85public async Task JsonFormatterReadsStringValue() 106public async Task JsonFormatterReadsNonUtf8Content() 128public virtual async Task JsonFormatter_EscapedKeys() 156public virtual async Task JsonFormatter_EscapedKeys_Bracket() 183public virtual async Task JsonFormatter_EscapedKeys_SingleQuote() 211public virtual async Task JsonFormatterReadsDateTimeValue() 233public async Task JsonFormatterReadsComplexTypes() 255public async Task ReadAsync_ReadsValidArray() 276public virtual Task ReadAsync_ReadsValidArray_AsListOfT() => ReadAsync_ReadsValidArray_AsList(typeof(List<int>)); 279public virtual Task ReadAsync_ReadsValidArray_AsIListOfT() => ReadAsync_ReadsValidArray_AsList(typeof(IList<int>)); 282public virtual Task ReadAsync_ReadsValidArray_AsCollectionOfT() => ReadAsync_ReadsValidArray_AsList(typeof(ICollection<int>)); 285public virtual Task ReadAsync_ReadsValidArray_AsEnumerableOfT() => ReadAsync_ReadsValidArray_AsList(typeof(IEnumerable<int>)); 287protected async Task ReadAsync_ReadsValidArray_AsList(Type requestedType) 308public virtual async Task ReadAsync_ArrayOfObjects_HasCorrectKey() 335public virtual async Task ReadAsync_AddsModelValidationErrorsToModelState() 361public virtual async Task ReadAsync_InvalidArray_AddsOverflowErrorsToModelState() 387public virtual async Task ReadAsync_InvalidComplexArray_AddsOverflowErrorsToModelState() 414public virtual async Task ReadAsync_UsesTryAddModelValidationErrorsToModelState() 442public async Task ReadAsync_WithInputThatDeserializesToNull_SetsModelOnlyIfAllowingEmptyInput( 468public async Task ReadAsync_ComplexPoco() 495public virtual async Task ReadAsync_NestedParseError() 519public virtual async Task ReadAsync_RequiredAttribute() 538public async Task ReadAsync_DoesNotDisposeBufferedReadStream() 561public async Task ReadAsync_WithEnableBufferingWorks() 585public async Task ReadAsync_WithEnableBufferingWorks_WithInputStreamAtOffset()
Formatters\JsonOutputFormatterTestBase.cs (3)
77public async Task WriteToStreamAsync_UsesCorrectCharacterEncoding( 110public async Task WriteResponseBodyAsync_Encodes() 141public async Task ErrorDuringSerialization_DoesNotCloseTheBrackets()
Formatters\NoContentFormatterTests.cs (4)
61[InlineData(typeof(Task))] 115public async Task WriteAsync_WritesTheStatusCode204() 134public async Task WriteAsync_DoesNotHaveContentLengthSet() 154public async Task WriteAsync_ContextStatusCodeSet_WritesSameStatusCode()
Formatters\OutputFormatterTests.cs (3)
196public override Task WriteResponseBodyAsync(OutputFormatterWriteContext context) 238public override Task WriteResponseBodyAsync(OutputFormatterWriteContext context) 240return Task.FromResult(true);
Formatters\StringOutputFormatterTests.cs (1)
129public async Task WriteAsync_DoesNotWriteNullStrings()
Formatters\SystemTextJsonInputFormatterTest.cs (13)
16public override Task ReadAsync_AddsModelValidationErrorsToModelState() 22public override Task ReadAsync_InvalidArray_AddsOverflowErrorsToModelState() 28public override Task ReadAsync_InvalidComplexArray_AddsOverflowErrorsToModelState() 34public override Task ReadAsync_UsesTryAddModelValidationErrorsToModelState() 40public override Task ReadAsync_RequiredAttribute() 47public override Task JsonFormatter_EscapedKeys() 53public override Task JsonFormatter_EscapedKeys_Bracket() 59public override Task JsonFormatter_EscapedKeys_SingleQuote() 65public async Task ReadAsync_SingleError() 90public async Task ReadAsync_DoesNotThrowFormatException() 111public async Task ReadAsync_DoesNotThrowOverflowException() 136public async Task ReadAsync_WithAllowInputFormatterExceptionMessages_RegistersJsonInputExceptionsAsInputFormatterException( 162public async Task ReadAsync_DoNotAllowInputFormatterExceptionMessages_DoesNotWrapJsonInputExceptions()
Formatters\SystemTextJsonOutputFormatterTest.cs (9)
24public async Task WriteResponseBodyAsync_AllowsConfiguringPreserveReferenceHandling() 63public async Task WriteResponseBodyAsync_WithNonUtf8Encoding_FormattingErrorsAreThrown() 87public async Task WriteResponseBodyAsync_ForLargeAsyncEnumerable() 117public async Task WriteResponseBodyAsync_AsyncEnumerableConnectionCloses() 149await Task.Yield(); 167public async Task WriteResponseBodyAsync_UsesJsonPolymorphismOptions(bool useJsonContext) 211public async Task WriteResponseBodyAsync_UsesJsonPolymorphismOptions_WithUnspeakableTypes(bool useJsonContext) 253await Task.Yield(); 337await Task.Yield();
Formatters\TextInputFormatterTest.cs (1)
13public async Task ReadAsync_ReturnsFailure_IfItCanNotUnderstandTheContentTypeEncoding()
Formatters\TextOutputFormatterTests.cs (5)
210public async Task WriteAsync_ReturnsNotAcceptable_IfSelectCharacterEncodingReturnsNull() 264public override Task WriteResponseBodyAsync(OutputFormatterWriteContext context, Encoding selectedEncoding) 266return Task.FromResult(true); 284public override Task WriteResponseBodyAsync(OutputFormatterWriteContext context, Encoding selectedEncoding) 286return Task.FromResult(true);
HttpActionResultTests.cs (2)
28public async Task HttpActionResult_InvokesInternalHttpResult() 40.Returns(() => Task.CompletedTask)
HttpNotFoundObjectResultTest.cs (1)
37public async Task HttpNotFoundObjectResult_ExecuteSuccessful()
HttpOkObjectResultTest.cs (1)
48public async Task HttpOkObjectResult_SetsStatusCode(object value)
HttpOkResultTest.cs (1)
26public async Task HttpOkResult_SetsStatusCode()
Infrastructure\ActionMethodExecutorTest.cs (12)
281public async Task ActionMethodExecutor_ExecutesActionsAsynchronouslyReturningActionResultSubType(bool withFilter) 419public async Task ActionMethodExecutor_ThrowsIfIConvertFromIActionResult_ReturnsNull(bool withFilter) 478public Task ReturnsTask() 481return Task.CompletedTask; 487return Task.Yield(); 490public Task<IActionResult> ReturnIActionResultAsync() => Task.FromResult((IActionResult)new StatusCodeResult(201)); 492public Task<ViewResult> ReturnActionResultAsync() => Task.FromResult(new ViewResult { StatusCode = 200 }); 494public Task<StatusCodeResult> ReturnsIActionResultSubTypeAsync() => Task.FromResult(new StatusCodeResult(200)); 496public Task<TestModel> ReturnsModelAsModelAsync() => Task.FromResult(new TestModel()); 498public Task<object> ReturnsModelAsObjectAsync() => Task.FromResult((object)new TestModel()); 500public Task<object> ReturnIActionResultAsObjectAsync() => Task.FromResult((object)new OkResult()); 502public Task<ActionResult<TestModel>> ReturnActionResultOFTAsync() => Task.FromResult(new ActionResult<TestModel>(new TestModel()));
Infrastructure\ActionResultTypeMapperTest.cs (1)
109public Task ExecuteAsync(HttpContext httpContext) => throw new NotImplementedException();
Infrastructure\ActionSelectionTableTest.cs (1)
558requestDelegate: context => Task.CompletedTask,
Infrastructure\AsyncEnumerableReaderTest.cs (13)
30public async Task TryGetReader_ReturnsReaderForIAsyncEnumerable() 48public async Task TryGetReader_ReturnsReaderForIAsyncEnumerableOfValueType() 100public async Task CachedDelegate_CanReadEnumerableInstanceMultipleTimes() 118public async Task CachedDelegate_CanReadEnumerableInstanceMultipleTimes_ThatProduceDifferentResults() 152public async Task Reader_ReadsIAsyncEnumerable_ImplementingMultipleAsyncEnumerableInterfaces() 171public async Task Reader_ThrowsIfBufferLimitIsReached() 190public async Task Reader_ThrowsIfIAsyncEnumerableThrows() 203public async Task Reader_PassesCancellationTokenToIAsyncEnumerable() 222await Task.Yield(); 229await Task.Yield(); 238await Task.Yield(); 245await Task.Yield(); 265await Task.Yield();
Infrastructure\ControllerActionInvokerTest.cs (68)
30public async Task Invoke_WritesDiagnostic_ActionSelected() 71public async Task Invoke_WritesDiagnostic_ActionInvoked() 102public async Task InvokeAction_ResourceFilter_WritesDiagnostic_Not_ShortCircuited() 145public async Task InvokeAction_ResourceFilter_WritesDiagnostic_ShortCircuited() 158.Returns(Task.FromResult(true)) 171return Task.FromResult(true); 199public async Task AddingValueProviderFactory_AtResourceFilter_IsAvailableInControllerContext() 229public async Task DeletingValueProviderFactory_AtResourceFilter_IsNotAvailableInControllerContext() 264public async Task InvokeAction_InvokesActionFilter() 289public async Task InvokeAction_InvokesAsyncActionFilter() 318public async Task InvokeAction_InvokesActionFilter_ShortCircuit() 324.Returns(Task.FromResult(true)) 375public async Task InvokeAction_InvokesAsyncActionFilter_ShortCircuit_WithResult() 381.Returns(Task.FromResult(true)) 400return Task.FromResult(true); 444public async Task InvokeAction_InvokesAsyncActionFilter_ShortCircuit_WithoutResult() 462return Task.FromResult(true); 499public async Task InvokeAction_InvokesAsyncActionFilter_ShortCircuit_WithResult_CallNext() 526public async Task InvokeAction_InvokesActionFilter_WithExceptionThrownByAction() 559public async Task InvokeAction_InvokesActionFilter_WithExceptionThrownByActionFilter() 602public async Task InvokeAction_InvokesAsyncActionFilter_WithExceptionThrownByActionFilter() 645public async Task InvokeAction_InvokesActionFilter_HandleException() 651.Returns<ActionContext>((context) => Task.FromResult(true)) 690public async Task InvokeAction_InvokesAsyncResourceFilter_WithActionResult_FromActionFilter() 727public async Task InvokeAction_InvokesAsyncResourceFilter_HandleException_FromActionFilter() 766public async Task InvokeAction_InvokesAsyncResourceFilter_HandlesException_FromExceptionFilter() 805public async Task InvokeAction_ExceptionBubbling_AsyncActionFilter_To_ResourceFilter() 853public async Task InvokeAction_AsyncAction_TaskReturnType() 878public async Task InvokeAction_AsyncAction_TaskOfValueReturnType() 904public async Task InvokeAction_AsyncAction_WithAsyncKeywordThrows() 927public async Task InvokeAction_AsyncAction_WithoutAsyncThrows() 950public async Task InvokeAction_AsyncAction_WithExceptionsAfterAwait() 975public async Task InvokeAction_SyncAction() 999public async Task InvokeAction_SyncAction_WithException() 1023public async Task InvokeAction_SyncMethod_WithArgumentDictionary_DefaultValueAttributeUsed() 1049public async Task InvokeAction_SyncMethod_WithArgumentArray_DefaultValueAttributeIgnored() 1076public async Task InvokeAction_SyncMethod_WithArgumentDictionary_DefaultParameterValueUsed() 1102public async Task InvokeAction_SyncMethod_WithArgumentDictionary_AnyValue_HasPrecedenceOverDefaults() 1129public async Task InvokeAction_AsyncAction_WithCustomTaskReturnType() 1157public async Task InvokeAction_AsyncAction_WithCustomTaskOfTReturnType() 1187public async Task InvokeAction_AsyncAction_ReturningUnwrappedTask() 1212public async Task InvokeAction_AsyncActionWithTaskOfObjectReturnType_AndReturningTaskOfActionResult() 1238public async Task InvokeAction_ActionWithObjectReturnType_AndReturningActionResult() 1264public async Task InvokeAction_AsyncMethod_ParametersInRandomOrder() 1297public async Task InvokeAction_ReturnTypeAsIActionResult_ReturnsExpected(string methodName) 1325public async Task InvokeAction_AsyncMethod_InvalidParameterValueThrows() 1356public async Task InvokeAction_WithNullActionResultThrows(string methodName, Type resultType) 1380public async Task Invoke_UsesDefaultValuesIfNotBound() 1427(_, __, ___) => Task.CompletedTask, 1449public async Task InvokeAction_ConvertibleToActionResult() 1474public async Task InvokeAction_AsyncAction_ConvertibleToActionResult() 1499public async Task InvokeAction_ConvertibleToActionResult_AsObject() 1522public async Task InvokeAction_ConvertibleToActionResult_ReturningNull_Throws() 1548public async Task InvokeAsync_Logs() 1757return Task.CompletedTask; 1804return await Task.FromResult<TestActionResult>(new TestActionResult { Value = value }); 1819return await Task.FromResult(new TestActionResult { Value = value }); 1829return await Task.FromResult<IActionResult>(null); 1834return await Task.FromResult<TestActionResult>(null); 1837public async Task TaskAction(int i, string s) 1876await Task.Delay(500); 1895/// Returns a <see cref="Task{TResult}"/> instead of a <see cref="Task"/>. 1897public Task UnwrappedTask(int i, string s) 1899return Task.Factory.StartNew(async () => await Task.Factory.StartNew(() => i)); 1926=> Task.FromResult(new ConvertibleToActionResult { Value = input }); 1959public Task ExecuteResultAsync(ActionContext context) 1962return Task.FromResult(0);
Infrastructure\DefaultApiProblemDetailsWriterTest.cs (7)
19public async Task WriteAsync_Works() 55public async Task WriteAsync_Works_WhenReplacingProblemDetailsUsingSetter() 94public async Task WriteAsync_AddExtensions() 152public async Task WriteAsync_Skip_WhenNotApiController() 168public async Task WriteAsync_Skip_WhenSuppressMapClientErrors() 184public async Task WriteAsync_Skip_WhenNoFormatter() 243public Task WriteAsync(OutputFormatterWriteContext context)
Infrastructure\DefaultOutputFormatterSelectorTest.cs (9)
386public virtual Task WriteAsync(OutputFormatterWriteContext context) 402public override Task WriteResponseBodyAsync(OutputFormatterWriteContext context, Encoding selectedEncoding) 404return Task.FromResult(0); 418public override Task WriteResponseBodyAsync(OutputFormatterWriteContext context, Encoding selectedEncoding) 420return Task.FromResult(0); 433public override Task WriteResponseBodyAsync(OutputFormatterWriteContext context, Encoding selectedEncoding) 435return Task.FromResult(0); 449public override Task WriteResponseBodyAsync(OutputFormatterWriteContext context) 451return Task.FromResult(0);
Infrastructure\JsonResultExecutorTestBase.cs (27)
23public async Task ExecuteAsync_UsesDefaultContentType_IfNoContentTypeSpecified() 43public async Task ExecuteAsync_NullEncoding_DoesNotSetCharsetOnContentType() 64public async Task ExecuteAsync_UsesEncodingSpecifiedInContentType() 88public async Task ExecuteAsync_UsesEncodingSpecifiedInResponseContentType() 108public async Task ExecuteAsync_SetsContentTypeAndEncoding() 132public async Task ExecuteAsync_NoResultContentTypeSet_UsesResponseContentType_AndSuppliedEncoding() 156public async Task ExecuteAsync_NoResultContentTypeSet_UsesDefaultEncoding_DoesNotSetCharset( 179public async Task ExecuteAsync_UsesPassedInSerializerSettings() 205public async Task ExecuteAsync_ErrorDuringSerialization_DoesNotWriteContent() 233public async Task ExecuteAsync_NonNullResult_LogsResultType() 251public async Task ExecuteAsync_NullResult_LogsNull() 269public async Task ExecuteAsync_LargePayload_DoesNotPerformSynchronousWrites() 276.Returns(Task.CompletedTask) 294public async Task ExecuteAsync_ThrowsIfSerializerSettingIsNotTheCorrectType() 310public async Task ExecuteAsync_WithNullValue() 328public async Task ExecuteAsync_SerializesAsyncEnumerables() 346public async Task ExecuteAsync_SerializesAsyncEnumerablesOfPrimtives() 364public async Task ExecuteAsync_AsyncEnumerableConnectionCloses() 384await Task.Yield(); 395public async Task ExecuteAsyncWithDifferentContentType_AsyncEnumerableConnectionCloses() 418await Task.Yield(); 429public async Task ExecuteAsync_AsyncEnumerableThrowsCustomOCE_SurfacesError() 442await Task.Yield(); 449public async Task ExecuteAsync_AsyncEnumerableThrowsConnectionAbortedOCE_DoesNotSurfaceError() 467await Task.Yield(); 521await Task.Yield(); 528await Task.Yield();
Infrastructure\NonDisposableStreamTest.cs (1)
71public async Task InnerStreamIsNotFlushedOnFlushAsync()
Infrastructure\ObjectResultExecutorTest.cs (26)
19public async Task ExecuteAsync_UsesSpecifiedContentType() 47public async Task ExecuteAsync_ContentTypeProvidedFromResponseAndObjectResult_UsesResponseContentType() 70public async Task ExecuteAsync_WithOneProvidedContentType_FromResponseContentType_IgnoresAcceptHeader() 92public async Task ExecuteAsync_WithOneProvidedContentType_FromResponseContentType_NoFallback() 113public async Task ExecuteAsync_WithResponseAndObjectResultContentType_ForProblemDetailsValue_UsesXMLContentType() 138public async Task ExecuteAsync_WithResponseContentType_ForProblemDetailsValue_UsesProblemDetailXMLContentType() 160public async Task ExecuteAsync_ForProblemDetailsValue_UsesProblemDetailsContentType() 182public async Task ExecuteAsync_ForProblemDetailsValue_UsesProblemDetailsJsonContentType_BasedOnAcceptHeader() 208public async Task ExecuteAsync_ForProblemDetailsValue_UsesProblemDetailsXMLContentType_BasedOnAcceptHeader() 233public async Task ExecuteAsync_NoContentTypeProvidedForProblemDetails_UsesDefaultContentTypes() 254public async Task ExecuteAsync_NoFormatterFound_Returns406() 280public async Task ExecuteAsync_FallsBackOnFormattersInOptions() 305public async Task ExecuteAsync_ThrowsWithNoFormatters() 332public async Task ExecuteAsync_MatchAllContentType_Throws(string[] contentTypes, string invalidContentType) 371public async Task ExecuteAsync_SelectDefaultFormatter_OnAllMediaRangeAcceptHeaderMediaType( 408public async Task ObjectResult_PerformsContentNegotiation_OnAllMediaRangeAcceptHeaderMediaType( 437public async Task ObjectResult_NullValue() 492public virtual Task WriteAsync(OutputFormatterWriteContext context) 511public override Task WriteResponseBodyAsync(OutputFormatterWriteContext context, Encoding selectedEncoding) 514return Task.FromResult(0); 529public override Task WriteResponseBodyAsync(OutputFormatterWriteContext context, Encoding selectedEncoding) 531return Task.FromResult(0); 544public override Task WriteResponseBodyAsync(OutputFormatterWriteContext context, Encoding selectedEncoding) 546return Task.FromResult(0); 560public override Task WriteResponseBodyAsync(OutputFormatterWriteContext context) 562return Task.FromResult(0);
Infrastructure\SystemTextJsonResultExecutorTest.cs (1)
21public async Task WriteResponseBodyAsync_WithNonUtf8Encoding_FormattingErrorsAreThrown()
LocalRedirectResultTest.cs (3)
63public async Task Execute_ReturnsExpectedValues() 89public async Task Execute_Throws_ForNonLocalUrl( 111public async Task Execute_Throws_ForNonLocalUrlTilde(
ModelBinding\Binders\ArrayModelBinderTest.cs (5)
13public async Task BindModelAsync_ValueProviderContainPrefix_Succeeds() 49public async Task ArrayModelBinder_CreatesEmptyCollection_IfIsTopLevelObject( 87public async Task ArrayModelBinder_CreatesEmptyCollectionAndAddsError_IfIsTopLevelObject() 133public async Task ArrayModelBinder_DoesNotCreateCollection_IfNotIsTopLevelObject( 181public async Task BindModelAsync_ModelMetadataNotReadOnly_ModelNonNull_FailsSilently(int[] model)
ModelBinding\Binders\BinderTypeModelBinderProviderTest.cs (2)
48public Task BindModelAsync(ModelBindingContext bindingContext) 50return Task.FromResult(0);
ModelBinding\Binders\BinderTypeModelBinderTest.cs (6)
14public async Task BindModel_ReturnsFailedResult_EvenIfSelectedBinderReturnsNull() 29public async Task BindModel_CallsBindAsync_OnProvidedModelBinder() 97public Task BindModelAsync(ModelBindingContext bindingContext) 99return Task.FromResult(0); 112public Task BindModelAsync(ModelBindingContext bindingContext) 115return Task.CompletedTask;
ModelBinding\Binders\BodyModelBinderTests.cs (21)
21public async Task BindModel_CallsSelectedInputFormatterOnce() 52public async Task BindModel_NoInputFormatterFound_SetsModelStateError() 76public async Task BindModel_NoInputFormatterFound_SetsModelStateError_RespectsBinderModelName() 101public async Task BindModel_IsGreedy() 119public async Task BindModel_NoValueResult_SetsModelStateError() 161public async Task BindModel_PassesAllowEmptyInputOptionViaContext(bool treatEmptyInputAsDefaultValueOption) 192public async Task BindModel_SetsModelIfAllowEmpty() 220public async Task BindModel_FailsIfNotAllowEmpty() 249public async Task BindModel_CustomFormatter_ThrowingInputFormatterException_AddsErrorToModelState() 296public async Task BindModel_BuiltInXmlInputFormatters_ThrowingInputFormatterException_AddsErrorToModelState( 326public async Task BindModel_BuiltInJsonInputFormatter_ThrowingInputFormatterException_AddsErrorToModelState() 368public async Task BindModel_DerivedXmlInputFormatters_AddsErrorToModelState(IInputFormatter formatter) 397public async Task BindModel_DerivedJsonInputFormatter_AddsErrorToModelState() 442public async Task BindModel_BuiltInInputFormatters_ThrowingNonInputFormatterException_Throws( 477public async Task BindModel_DerivedXmlInputFormatters_ThrowingNonInputFormattingException_AddsErrorToModelState( 508public async Task BindModel_CustomFormatter_ThrowingNonInputFormatterException_Throws() 532public async Task NullFormatterError_AddedToModelState() 563public async Task BindModelCoreAsync_UsesFirstFormatterWhichCanRead() 590public async Task BindModelAsync_LogsFormatterRejectionAndSelection() 619public async Task BindModelAsync_LogsNoFormatterSelectedAndRemoveFromBodyAttribute() 658public async Task BindModelAsync_DoesNotThrowNullReferenceException()
ModelBinding\Binders\ByteArrayModelBinderTests.cs (4)
13public async Task BindModelSetsModelToNullOnNullOrEmptyString(string value) 37public async Task BindModel() 58public async Task BindModelAddsModelErrorsOnInvalidCharacters() 82public async Task BindModel_ReturnsWithIsModelSetFalse_WhenValueNotFound()
ModelBinding\Binders\CancellationTokenModelBinderTests.cs (1)
12public async Task CancellationTokenModelBinder_ReturnsNonEmptyResult_ForCancellationTokenType()
ModelBinding\Binders\CollectionModelBinderTest.cs (15)
16public async Task BindComplexCollectionFromIndexes_FiniteIndexes() 41public async Task BindComplexCollectionFromIndexes_InfiniteIndexes() 66public async Task BindModel_ComplexCollection_Succeeds(bool isReadOnly) 95public async Task BindModel_ComplexCollection_BindingContextModelNonNull_Succeeds(bool isReadOnly) 126public async Task BindModel_SimpleCollection_Succeeds(bool isReadOnly) 150public async Task BindModel_SimpleCollection_BindingContextModelNonNull_Succeeds(bool isReadOnly) 174public async Task BindModelAsync_SimpleCollectionWithNullValue_Succeeds() 195public async Task BindSimpleCollection_RawValueIsEmptyCollection_ReturnsEmptyList() 210public async Task BindSimpleCollection_RawValueWithNull_ReturnsListWithoutNull() 236public async Task CollectionModelBinder_CreatesEmptyCollection_IfIsTopLevelObject( 273public async Task CollectionModelBinder_CreatesEmptyCollectionAndAddsError_IfIsTopLevelObject() 313public async Task CollectionModelBinder_DoesNotCreateEmptyCollection_IfModelHasDefaultValue() 350public async Task CollectionModelBinder_DoesNotCreateEmptyCollection_IfModelNonNull() 389public async Task CollectionModelBinder_DoesNotCreateCollection_IfNotIsTopLevelObject( 453public async Task BindSimpleCollection_SubBindingSucceeds()
ModelBinding\Binders\ComplexObjectModelBinderTest.cs (14)
275public async Task BindModelAsync_CreatesModelAndAddsError_IfIsTopLevelObject_WithNoData() 325public async Task BindModelAsync_CreatesModelAndAddsError_IfIsTopLevelObject_WithNoSettableProperties() 369public async Task BindModelAsync_CreatesModelAndAddsError_IfIsTopLevelObject_WithAllPropertiesExcluded() 435public async Task BindModelAsync_ModelIsNotNull_DoesNotCallCreateModel() 592public async Task BindModelAsync_BindRequiredFieldMissing_RaisesModelError() 638public Task BindModelAsync(ModelBindingContext bindingContext) 641return Task.CompletedTask; 657public async Task BindModelAsync_DataMemberIsRequiredFieldMissing_RaisesModelError() 694public async Task BindModelAsync_ValueTypePropertyWithBindRequired_SetToNull_CapturesException() 733public async Task BindModelAsync_ValueTypeProperty_WithBindingOptional_NoValueSet_NoError() 756public async Task BindModelAsync_NullableValueTypeProperty_NoValueSet_NoError() 779public async Task BindModelAsync_ValueTypeProperty_NoValue_NoError() 804public async Task BindModelAsync_ProvideRequiredField_Success() 829public async Task BindModelAsync_Success()
ModelBinding\Binders\ComplexTypeModelBinderTest.cs (18)
277public async Task BindModelAsync_CreatesModel_IfIsTopLevelObject( 335public async Task BindModelAsync_CreatesModelAndAddsError_IfIsTopLevelObject_WithNoData() 385public async Task BindModelAsync_CreatesModelAndAddsError_IfIsTopLevelObject_WithNoSettableProperties() 429public async Task BindModelAsync_CreatesModelAndAddsError_IfIsTopLevelObject_WithAllPropertiesExcluded() 592public async Task BindModelAsync_ModelIsNotNull_DoesNotCallCreateModel() 615public async Task BindModelAsync_ModelIsNull_CallsCreateModel() 773public async Task BindModelAsync_BindRequiredFieldMissing_RaisesModelError() 807public async Task BindModelAsync_DataMemberIsRequiredFieldMissing_RaisesModelError() 841public async Task BindModelAsync_ValueTypePropertyWithBindRequired_SetToNull_CapturesException() 877public async Task BindModelAsync_ValueTypeProperty_WithBindingOptional_NoValueSet_NoError() 897public async Task BindModelAsync_NullableValueTypeProperty_NoValueSet_NoError() 917public async Task BindModelAsync_ValueTypeProperty_NoValue_NoError() 939public async Task BindModelAsync_ProvideRequiredField_Success() 961public async Task BindModelAsync_Success() 999public async Task BindModelAsync_PropertyInitializedInNonParameterlessConstructorConstructor() 1626public virtual Task BindPropertyPublic(ModelBindingContext bindingContext) 1638return Task.CompletedTask; 1641protected override Task BindProperty(ModelBindingContext bindingContext)
ModelBinding\Binders\DateTimeModelBinderTest.cs (9)
12public async Task BindModel_ReturnsFailure_IfAttemptedValueCannotBeParsed() 30public async Task BindModel_CreatesError_IfAttemptedValueCannotBeParsed() 54public async Task BindModel_CreatesError_IfAttemptedValueCannotBeCompletelyParsed() 77public async Task BindModel_ReturnsFailed_IfValueProviderEmpty() 92public async Task BindModel_NullableDatetime_ReturnsFailed_IfValueProviderEmpty() 109public async Task BindModel_CreatesError_IfTrimmedAttemptedValueIsEmpty_NonNullableDestination(string value) 135public async Task BindModel_ReturnsNull_IfTrimmedAttemptedValueIsEmpty_NullableDestination(string value) 157public async Task BindModel_ReturnsModel_IfAttemptedValueIsValid(Type type) 180public async Task UsesSpecifiedStyleToParseModel()
ModelBinding\Binders\DictionaryModelBinderTest.cs (13)
18public async Task BindModel_Succeeds(bool isReadOnly) 58public async Task BindModel_WithExistingModel_Succeeds(bool isReadOnly) 126public async Task BindModel_FallsBackToBindingValues( 159public async Task BindModel_FallsBackToBindingValues_WhenParameterHasDefaultValue( 193public async Task BindModel_DoesNotFallBack_WithoutEnumerableValueProvider() 230public async Task BindModel_DoesNotFallBack_WithoutEnumerableValueProvider_WhenParameterHasDefaultValue() 285public async Task BindModel_FallsBackToBindingValues_WithValueTypes(IDictionary<long, int> dictionary) 316public async Task BindModel_FallsBackToBindingValues_WithComplexValues() 379public async Task BindModel_FallsBackToBindingValues_WithCustomDictionary( 419public async Task DictionaryModelBinder_CreatesEmptyCollection_IfIsTopLevelObject( 458public async Task DictionaryModelBinder_CreatesEmptyCollectionAndAddsError_IfIsTopLevelObject() 503public async Task DictionaryModelBinder_DoesNotCreateEmptyCollection_IfIsTopLevelObjectAndHasDefaultValue( 550public async Task DictionaryModelBinder_DoesNotCreateCollection_IfNotIsTopLevelObject(
ModelBinding\Binders\EnumTypeModelBinderTest.cs (9)
14public async Task BindModel_SetsModel_ForEmptyValue_AndNullableEnumTypes(Type modelType) 30public async Task BindModel_AddsErrorToModelState_ForEmptyValue_AndNonNullableEnumTypes(Type modelType) 50public async Task BindModel_BindsEnumModels_ForValuesInArray(string enumValue) 72public async Task BindModel_BindsTo_NonNullableFlagsEnumType(string flagsEnumValue) 96public async Task BindModel_BindsTo_NullableFlagsEnumType(string flagsEnumValue) 133public async Task BindModel_AddsErrorToModelState_ForInvalidEnumValues(Type modelType, string suppliedValue) 156public async Task BindModel_BindsTo_NonNullableFlagsEnumType_List( 181public async Task BindModel_BindsTo_NullableFlagsEnumType_List( 213public async Task BindModel_AddsErrorToModelState_ForInvalidEnumValues_List(
ModelBinding\Binders\FloatingPointTypeModelBinderTestOfT.cs (15)
33public async Task BindModel_ReturnsFailure_IfAttemptedValueCannotBeParsed(Type destinationType) 52public async Task BindModel_CreatesError_IfAttemptedValueCannotBeParsed(Type destinationType) 77public async Task BindModel_CreatesError_IfAttemptedValueCannotBeCompletelyParsed(Type destinationType) 101public async Task BindModel_CreatesError_IfAttemptedValueContainsDisallowedWhitespace(Type destinationType) 125public async Task BindModel_CreatesError_IfAttemptedValueContainsDisallowedDecimal(Type destinationType) 149public async Task BindModel_CreatesError_IfAttemptedValueContainsDisallowedThousandsSeparator(Type destinationType) 173public async Task BindModel_ReturnsFailed_IfValueProviderEmpty(Type destinationType) 190public async Task BindModel_CreatesError_IfTrimmedAttemptedValueIsEmpty_NonNullableDestination(string value) 216public async Task BindModel_ReturnsNull_IfTrimmedAttemptedValueIsEmpty_NullableDestination(string value) 237public async Task BindModel_ReturnsModel_IfAttemptedValueIsValid_Twelve(Type destinationType) 259public async Task BindModel_ReturnsModel_IfAttemptedValueIsValid_TwelvePointFive(Type destinationType) 280public async Task BindModel_ReturnsModel_IfAttemptedValueIsValid_FrenchTwelvePointFive(Type destinationType) 301public async Task BindModel_ReturnsModel_IfAttemptedValueIsValid_ThirtyTwoThousand(Type destinationType) 322public async Task BindModel_ReturnsModel_IfAttemptedValueIsValid_ThirtyTwoThousandPointOne(Type destinationType) 343public async Task BindModel_ReturnsModel_IfAttemptedValueIsValid_FrenchThirtyTwoThousandPointOne(Type destinationType)
ModelBinding\Binders\FormCollectionModelBinderTest.cs (3)
15public async Task FormCollectionModelBinder_ValidType_BindSuccessful() 41public async Task FormCollectionModelBinder_NoForm_BindSuccessful_ReturnsEmptyFormCollection() 61.Returns(Task.FromResult(formCollection));
ModelBinding\Binders\FormFileModelBinderTest.cs (17)
14public async Task FormFileModelBinder_SingleFile_BindSuccessful() 38public async Task FormFileModelBinder_SingleFileAtTopLevel_BindSuccessfully_WithEmptyModelName() 72public async Task FormFileModelBinder_SingleFileWithinTopLevelPoco_BindSuccessfully() 112public async Task FormFileModelBinder_SingleFileWithinTopLevelPoco_BindSuccessfully_WithShortenedModelName() 154public async Task FormFileModelBinder_SingleFileWithinTopLevelDictionary_BindSuccessfully() 188public async Task FormFileModelBinder_SingleFileWithinTopLevelDictionary_BindSuccessfully_WithShortenedModelName() 224public async Task FormFileModelBinder_ExpectMultipleFiles_BindSuccessful() 256public async Task FormFileModelBinder_BindsFiles_ForCollectionsItCanCreate(Type destinationType) 274public async Task FormFileModelBinder_ExpectSingleFile_BindFirstFile() 292public async Task FormFileModelBinder_ReturnsFailedResult_WhenNoFilePosted() 309public async Task FormFileModelBinder_ReturnsFailedResult_WhenNamesDoNotMatch() 331public async Task FormFileModelBinder_UsesFieldNameForTopLevelObject(bool isTopLevel, string expected) 359public async Task FormFileModelBinder_ReturnsFailedResult_WithEmptyContentDisposition() 379public async Task FormFileModelBinder_ReturnsFailedResult_WithNoFileNameAndZeroLength() 399public async Task FormFileModelBinder_ReturnsResult_ForReadOnlyDestination() 416public async Task FormFileModelBinder_ReturnsFailedResult_ForCollectionsItCannotCreate() 476.Returns(Task.FromResult(formCollection));
ModelBinding\Binders\HeaderModelBinderTests.cs (13)
17public async Task HeaderBinder_BindsHeaders_ToStringCollection_WithoutInnerModelBinder() 39public async Task HeaderBinder_BindsHeaders_ToStringType_WithoutInnerModelBinder() 67public async Task HeaderBinder_BindsHeaders_ForCollectionsItCanCreate_WithoutInnerModelBinder( 89public async Task HeaderBinder_BindsHeaders_ToStringCollection() 135public async Task HeaderBinder_BindsHeaders_ToSimpleTypes( 160public async Task HeaderBinder_DoesNotSetModel_ForHeaderNotPresentOnRequest(Type modelType) 177public async Task HeaderBinder_DoesNotCreateEmptyCollection_ForNonTopLevelObjects(Type modelType) 200public async Task HeaderBinder_BindsHeaders_ForCollectionsItCanCreate(Type destinationType) 218public async Task HeaderBinder_ReturnsResult_ForReadOnlyDestination() 234public async Task HeaderBinder_ResetsTheBindingScope_GivingOriginalValueProvider() 252public async Task HeaderBinder_UsesValues_OnlyFromHeaderValueProvider() 279public async Task HeaderBinder_BindModelAsync_AddsErrorToModelState_OnInvalidInput( 302public async Task HeaderBinder_BindModelAsync_AddsErrorToModelState_OnInvalid_CollectionInput(
ModelBinding\Binders\KeyValuePairModelBinderTest.cs (7)
12public async Task BindModel_MissingKey_ReturnsResult_AndAddsModelValidationError() 37public async Task BindModel_MissingValue_ReturnsResult_AndAddsModelValidationError() 63public async Task BindModel_MissingKeyAndMissingValue_DoNotAddModelStateError() 85public async Task BindModel_SubBindingSucceeds() 108public async Task TryBindStrongModel_InnerBinderReturnsAResult_ReturnsInnerBinderResult( 143public async Task KeyValuePairModelBinder_CreatesEmptyCollection_IfIsTopLevelObject() 174public async Task KeyValuePairModelBinder_DoesNotCreateCollection_IfNotIsTopLevelObject(string prefix)
ModelBinding\Binders\ServicesModelBinderTest.cs (1)
13public async Task ServiceModelBinder_BindsService()
ModelBinding\Binders\SimpleTypeModelBinderTest.cs (17)
18public async Task BindModelAsync_ReturnsProvidedString(string value) 40public async Task BindModel_ReturnsProvidedWhitespaceString_WhenNotConvertEmptyStringToNull(string value) 92public async Task BindModel_ReturnsFailure_IfTypeCanBeConverted_AndConversionFails(Type destinationType) 112public async Task BindModel_CreatesError_WhenTypeConversionIsNull(Type destinationType) 135public async Task BindModel_Error_FormatExceptionsTurnedIntoStringsInModelState() 177public async Task BindModel_EmptyValueProviderResult_ReturnsFailedAndLogsSuccessfully(ModelMetadata metadata) 199public async Task BindModel_ReturnsNull_IfTrimmedValueIsEmptyString(object value) 219public async Task BindModel_NullableIntegerValueProviderResult_ReturnsModel() 240public async Task BindModel_NullableDoubleValueProviderResult_ReturnsModel() 262public async Task BindModel_ValidValueProviderResult_ReturnsModelAndLogsSuccessfully(ModelMetadata metadata) 308public async Task BindModel_ThousandsSeparators_LeadToErrors(Type type) 336public async Task BindModel_ValidValueProviderResultWithProvidedCulture_ReturnsModel() 357public async Task BindModel_CreatesErrorForFormatException_ValueProviderResultWithInvalidCulture() 381public async Task BindModel_BindsEnumModels_IfArrayElementIsStringKey() 402public async Task BindModel_BindsEnumModels_IfArrayElementIsStringValue() 443public async Task BindModel_BindsIntEnumModels(string flagsEnumValue, int expected) 466public async Task BindModel_BindsFlagsEnumModels(string flagsEnumValue, int expected)
ModelBinding\Binders\TryParseTypeModelBinderTest.cs (17)
41public async Task BindModel_ReturnsFailure_IfTypeCanBeConverted_AndConversionFails(Type destinationType) 61public async Task BindModel_CreatesError_WhenTypeConversionIsNull(Type destinationType) 84public async Task BindModel_Error_FormatExceptionsTurnedIntoStringsInModelState() 126public async Task BindModel_EmptyValueProviderResult_ReturnsFailedAndLogsSuccessfully(ModelMetadata metadata) 146public async Task BindModel_NullableIntegerValueProviderResult_ReturnsModel() 167public async Task BindModel_NullableDoubleValueProviderResult_ReturnsModel() 189public async Task BindModel_ValidValueProviderResult_ReturnsModelAndLogsSuccessfully(ModelMetadata metadata) 234public async Task BindModel_ThousandsSeparators_LeadToErrors(Type type) 262public async Task BindModel_ValidValueProviderResultWithProvidedCulture_ReturnsModel() 283public async Task BindModel_CreatesErrorForFormatException_ValueProviderResultWithInvalidCulture() 307public async Task BindModel_BindsEnumModels_IfArrayElementIsStringKey() 328public async Task BindModel_BindsEnumModels_IfArrayElementIsStringValue() 365public async Task BindModel_BindsIntEnumModels(string flagsEnumValue, int expected) 388public async Task BindModel_CreatesErrorForFormatException_BindsIntEnumModels(string flagsEnumValue) 415public async Task BindModel_BindClassWithTryParseMethod(string value, int expected) 438public async Task BindModel_CreatesErrorForFormatException_BindClassWithTryParseMethod(string value) 464public async Task BindModel_BindsFlagsEnumModels(string flagsEnumValue, int expected)
ModelBinding\CompositeValueProviderTest.cs (1)
47public async Task TryCreateAsync_AddsModelStateError_WhenValueProviderFactoryThrowsValueProviderException()
ModelBinding\DefaultModelBindingContextTest.cs (1)
186public Task BindModelAsync(ModelBindingContext bindingContext)
ModelBinding\FormFileValueProviderFactoryTest.cs (6)
15public async Task CreateValueProviderAsync_DoesNotAddValueProvider_IfRequestDoesNotHaveFormContent() 29public async Task CreateValueProviderAsync_DoesNotAddValueProvider_IfFileCollectionIsEmpty() 43public async Task CreateValueProviderAsync_AddsValueProvider() 61public async Task GetValueProviderAsync_ThrowsValueProviderException_IfReadingFormThrowsInvalidDataException() 75public async Task GetValueProviderAsync_ThrowsValueProviderException_IfReadingFormThrowsInvalidOperationException() 89public async Task GetValueProviderAsync_ThrowsOriginalException_IfReadingFormThrows()
ModelBinding\FormValueProviderFactoryTest.cs (5)
16public async Task GetValueProviderAsync_ReturnsNull_WhenContentTypeIsNotFormUrlEncoded() 34public async Task GetValueProviderAsync_ReturnsValueProvider_WithCurrentCulture(string contentType) 49public async Task GetValueProviderAsync_ThrowsValueProviderException_IfReadingFormThrowsInvalidDataException() 63public async Task GetValueProviderAsync_ThrowsValueProviderException_IfReadingFormThrowsInvalidOperationException() 77public async Task GetValueProviderAsync_ThrowsOriginalException_IfReadingFormThrows()
ModelBinding\JQueryFormValueProviderFactoryTest.cs (7)
40public async Task GetValueProvider_ReturnsNull_WhenContentTypeIsNotFormUrlEncoded() 58public async Task CreateValueProviderAsync_ReturnsValueProvider_WithCurrentCulture(string contentType) 102public async Task GetValueProvider_ReturnsValueProvider_ContainingExpectedKeys(string key) 118public async Task CreatesValueProvider_WithCurrentCulture() 134public async Task GetValueProviderAsync_ThrowsValueProviderException_IfReadingFormThrowsInvalidDataException() 148public async Task GetValueProviderAsync_ThrowsValueProviderException_IfReadingFormThrowsInvalidOperationException() 162public async Task GetValueProviderAsync_ThrowsOriginalException_IfReadingFormThrows()
ModelBinding\JQueryQueryStringValueProviderFactoryTest.cs (3)
68public async Task GetValueProvider_ReturnsValueProvider_ContainingExpectedKeys(string key) 84public async Task DoesNotCreateValueProvider_WhenQueryIsEmpty() 98public async Task CreatesValueProvider_WithInvariantCulture()
ModelBinding\ModelBinderFactoryTest.cs (2)
653public Task BindModelAsync(ModelBindingContext bindingContext) 665public Task BindModelAsync(ModelBindingContext bindingContext)
ModelBinding\ModelBindingHelperTest.cs (13)
24public async Task TryUpdateModel_ReturnsFalse_IfBinderIsUnsuccessful() 47public async Task TryUpdateModel_ReturnsFalse_IfModelValidationFails() 89public async Task TryUpdateModel_ReturnsTrue_IfModelBindsAndValidatesSuccessfully() 128public async Task TryUpdateModel_UsingPropertyFilterOverload_ReturnsFalse_IfBinderIsUnsuccessful() 155public async Task TryUpdateModel_UsingPropertyFilterOverload_ReturnsTrue_ModelBindsAndValidatesSuccessfully() 209public async Task TryUpdateModel_UsingIncludeExpressionOverload_ReturnsFalse_IfBinderIsUnsuccessful() 235public async Task TryUpdateModel_UsingIncludeExpressionOverload_ReturnsTrue_ModelBindsAndValidatesSuccessfully() 286public async Task TryUpdateModel_UsingDefaultIncludeOverload_IncludesAllProperties() 457public async Task TryUpdateModelNonGeneric_PropertyFilterOverload_ReturnsFalse_IfBinderIsUnsuccessful() 485public async Task TryUpdateModelNonGeneric_PropertyFilterOverload_ReturnsTrue_ModelBindsAndValidatesSuccessfully() 540public async Task TryUpdateModelNonGeneric_ModelTypeOverload_ReturnsFalse_IfBinderIsUnsuccessful() 565public async Task TryUpdateModelNonGeneric_ModelTypeOverload_ReturnsTrue_IfModelBindsAndValidatesSuccessfully() 605public async Task TryUpdateModel_ModelTypeDifferentFromModel_Throws()
ModelBinding\ParameterBinderTest.cs (13)
56public async Task BindModelAsync_EnforcesTopLevelBindRequired() 86public async Task BindModelAsync_EnforcesTopLevelRequired() 186public async Task BindModelAsync_EnforcesTopLevelRequiredAndLogsSuccessfully_WithEmptyPrefix( 225public async Task BindModelAsync_EnforcesTopLevelDataAnnotationsAttribute() 262public async Task BindModelAsync_SupportsIObjectModelValidatorForBackCompat() 304public async Task BindModelAsync_ForParameter_UsesValidationFromActualModel_WhenDerivedModelIsSet() 359public async Task BindModelAsync_ForParameter_UsesValidationFromParameter_WhenDerivedModelIsSet() 415public async Task BindModelAsync_ForProperty_UsesValidationFromActualModel_WhenDerivedModelIsSet() 469public async Task BindModelAsync_ForProperty_UsesValidationOnProperty_WhenDerivedModelIsSet() 524public async Task BindModelAsync_ForOverlappingParametersWithSuppressions_InValid_WithValidSecondParameter() 583public async Task BindModelAsync_ForOverlappingParametersWithSuppressions_InValid_WithInValidSecondParameter() 651public async Task BindModelAsync_ForOverlappingParameters_InValid_WithInValidFirstParameterAndSecondNull() 735return Task.CompletedTask;
ModelBinding\QueryStringValueProviderFactoryTest.cs (2)
15public async Task DoesNotCreateValueProvider_WhenQueryStringIsEmpty() 30public async Task GetValueProvider_ReturnsQueryStringValueProviderInstanceWithInvariantCulture()
ModelBinding\StubModelBinder.cs (6)
10private readonly Func<ModelBindingContext, Task> _callback; 14_callback = context => Task.CompletedTask; 22return Task.CompletedTask; 31return Task.CompletedTask; 41return Task.CompletedTask; 58public virtual async Task BindModelAsync(ModelBindingContext bindingContext)
ModelBinding\ValueProviderFactoryExtensionsTest.cs (2)
48public Task CreateValueProviderAsync(ValueProviderFactoryContext context) 56public Task CreateValueProviderAsync(ValueProviderFactoryContext context)
ObjectResultTests.cs (6)
35public async Task ObjectResult_ExecuteResultAsync_SetsStatusCode() 63public async Task ObjectResult_ExecuteResultAsync_SetsProblemDetailsStatus() 95public async Task ObjectResult_ExecuteResultAsync_GetsStatusCodeFromProblemDetails() 126public async Task ObjectResult_ExecuteResultAsync_ResultAndProblemDetailsHaveStatusCodes() 177public Task WriteAsync(OutputFormatterWriteContext context) 179return Task.FromResult(0);
PhysicalFileResultTest.cs (1)
16protected override Task ExecuteAsync(
ProducesAttributeTests.cs (3)
25() => Task.FromResult(CreateResultExecutedContext(resultExecutingContext))); 52() => Task.FromResult(CreateResultExecutedContext(resultExecutingContext))); 77() => Task.FromResult(CreateResultExecutedContext(resultExecutingContext)));
RedirectResultTest.cs (1)
16protected override Task ExecuteAsync(HttpContext httpContext, string contentPath)
RedirectToActionResultTest.cs (4)
20public async Task RedirectToAction_Execute_PassesCorrectValuesToRedirect() 55public async Task RedirectToAction_Execute_ThrowsOnNullUrl() 84public async Task RedirectToAction_Execute_WithFragment_PassesCorrectValuesToRedirect() 112public async Task RedirectToAction_Execute_WithFragment_PassesCorrectValuesToRedirect_WithPreserveMethod()
RedirectToPageResultTest.cs (6)
20public async Task ExecuteResultAsync_ThrowsOnNullUrl() 45public async Task ExecuteResultAsync_PassesCorrectValuesToRedirect(bool permanentRedirect) 76public async Task ExecuteResultAsync_LocalRelativePaths() 133public async Task ExecuteResultAsync_WithAllParameters() 187public async Task RedirectToPage_WithNullPage_UsesAmbientValue() 237public async Task RedirectToPage_DoesNotUseAmbientHandler()
RedirectToRouteResultTest.cs (5)
22public async Task RedirectToRoute_Execute_PassesCorrectValuesToRedirect(object values) 55public async Task RedirectToRoute_Execute_ThrowsOnNullUrl() 84public async Task ExecuteResultAsync_UsesRouteName_ToGenerateLocationHeader() 116public async Task ExecuteResultAsync_WithFragment_PassesCorrectValuesToRedirect() 141public async Task ExecuteResultAsync_WithFragment_PassesCorrectValuesToRedirect_WithPreserveMethod()
Routing\ActionEndpointFactoryTest.cs (1)
265RequestDelegate del = context => Task.CompletedTask;
Routing\AttributeRouteTest.cs (5)
19private static readonly RequestDelegate NullHandler = (c) => Task.FromResult(0); 25public async Task AttributeRoute_UsesUpdatedActionDescriptors() 64routeContext.Handler = (c) => Task.CompletedTask; 66return Task.CompletedTask; 781.Returns(Task.CompletedTask)
Routing\AttributeRoutingTest.cs (4)
22public async Task AttributeRouting_SyntaxErrorInTemplate() 49public async Task AttributeRouting_DisallowedParameter() 76public async Task AttributeRouting_MultipleErrors() 110public async Task AttributeRouting_WithControllerActionDescriptor()
Routing\ControllerLinkGeneratorExtensionsTest.cs (1)
200(httpContext) => Task.CompletedTask,
Routing\DynamicControllerEndpointMatcherPolicyTest.cs (13)
48new Endpoint(_ => Task.CompletedTask, new EndpointMetadataCollection(actions[0]), "Test1"), 49new Endpoint(_ => Task.CompletedTask, new EndpointMetadataCollection(actions[1]), "Test2"), 50new Endpoint(_ => Task.CompletedTask, new EndpointMetadataCollection(actions[2]), "Test3"), 54_ => Task.CompletedTask, 99public async Task ApplyAsync_NoMatch() 129public async Task ApplyAsync_HasMatchNoEndpointFound() 160public async Task ApplyAsync_HasMatchFindsEndpoint_WithoutRouteValues() 206public async Task ApplyAsync_ThrowsForTransformerWithInvalidLifetime() 237public async Task ApplyAsync_HasMatchFindsEndpoint_WithRouteValues() 294public async Task ApplyAsync_CanDiscardFoundEndpoints() 333public async Task ApplyAsync_CanReplaceFoundEndpoints() 356new Endpoint((ctx) => Task.CompletedTask, new EndpointMetadataCollection(Array.Empty<object>()), "ReplacedEndpoint") 395public async Task ApplyAsync_CanExpandTheListOfFoundEndpoints()
Routing\EndpointRoutingUrlHelperTest.cs (2)
141httpContext.SetEndpoint(new Endpoint(context => Task.CompletedTask, EndpointMetadataCollection.Empty, null)); 270(httpContext) => Task.CompletedTask,
Routing\MvcRouteHandlerTests.cs (2)
19public async Task RouteAsync_FailOnNoAction_LogsCorrectValues() 90.Returns(Task.FromResult(true));
Routing\PageLinkGeneratorExtensionsTest.cs (1)
170(httpContext) => Task.CompletedTask,
Routing\UrlHelperTest.cs (3)
145public Task RouteAsync(RouteContext context) 147context.Handler = (c) => Task.FromResult(0); 148return Task.FromResult(false);
SignInResultTest.cs (6)
19public async Task ExecuteResultAsync_InvokesSignInAsyncOnAuthenticationManager() 27.Returns(Task.CompletedTask) 46public async Task ExecuteResultAsync_InvokesSignInAsyncOnAuthenticationManagerWithDefaultScheme() 54.Returns(Task.CompletedTask) 73public async Task ExecuteResultAsync_InvokesSignInAsyncOnConfiguredScheme() 82.Returns(Task.CompletedTask)
SignOutResultTest.cs (14)
18public async Task ExecuteResultAsync_NoArgsInvokesDefaultSignOut() 25.Returns(Task.CompletedTask) 44public async Task ExecuteResultAsync_InvokesSignOutAsyncOnAuthenticationManager() 51.Returns(Task.CompletedTask) 70public async Task ExecuteResultAsync_InvokesSignOutAsyncOnAllConfiguredSchemes() 78.Returns(Task.CompletedTask) 82.Returns(Task.CompletedTask) 101public async Task ExecuteAsync_NoArgsInvokesDefaultSignOut() 108.Returns(Task.CompletedTask) 121public async Task ExecuteAsync_InvokesSignOutAsyncOnAuthenticationManager() 128.Returns(Task.CompletedTask) 141public async Task ExecuteAsync_InvokesSignOutAsyncOnAllConfiguredSchemes() 149.Returns(Task.CompletedTask) 153.Returns(Task.CompletedTask)
src\Shared\ResultsTests\FileContentResultTestBase.cs (11)
19protected abstract Task ExecuteAsync( 28public async Task WriteFileAsync_CopiesBuffer_ToOutputStream() 49public async Task WriteFileAsync_PreconditionStateShouldProcess_WritesRangeRequested( 92public async Task WriteFileAsync_IfRangeHeaderValid_WritesRangeRequest() 131public async Task WriteFileAsync_RangeProcessingNotEnabled_RangeRequestIgnored() 165public async Task WriteFileAsync_IfRangeHeaderInvalid_RangeRequestIgnored() 202public async Task WriteFileAsync_PreconditionStateUnspecified_RangeRequestIgnored(string rangeString) 233public async Task WriteFileAsync_PreconditionStateUnspecified_RangeRequestedNotSatisfiable(string rangeString) 265public async Task WriteFileAsync_PreconditionFailed_RangeRequestedIgnored() 299public async Task WriteFileAsync_NotModified_RangeRequestedIgnored() 334public async Task ExecuteResultAsync_SetsSuppliedContentTypeAndEncoding()
src\Shared\ResultsTests\FileStreamResultTestBase.cs (13)
16protected abstract Task ExecuteAsync( 29public async Task WriteFileAsync_PreconditionStateShouldProcess_WritesRangeRequested(long? start, long? end, string expectedString, long contentLength) 71public async Task WriteFileAsync_IfRangeHeaderValid_WritesRequestedRange() 112public async Task WriteFileAsync_RangeProcessingNotEnabled_RangeRequestedIgnored() 149public async Task WriteFileAsync_IfRangeHeaderInvalid_RangeRequestedIgnored() 189public async Task WriteFileAsync_PreconditionStateUnspecified_RangeRequestIgnored(string rangeString) 222public async Task WriteFileAsync_PreconditionStateUnspecified_RangeRequestedNotSatisfiable(string rangeString) 256public async Task WriteFileAsync_RangeRequested_PreconditionFailed() 292public async Task WriteFileAsync_NotModified_RangeRequestedIgnored() 331public async Task WriteFileAsync_RangeRequested_FileLengthZeroOrNull(long? fileLength) 372public async Task WriteFileAsync_CopiesProvidedStream_ToOutputStream() 396public async Task SetsSuppliedContentTypeAndEncoding() 422public async Task HeadRequest_DoesNotWriteToBody_AndClosesReadStream()
src\Shared\ResultsTests\PhysicalFileResultTestBase.cs (19)
22protected abstract Task ExecuteAsync( 35public async Task WriteFileAsync_WritesRangeRequested(long? start, long? end, long contentLength) 66public async Task WriteFileAsync_IfRangeHeaderValid_WritesRequestedRange() 98public async Task WriteFileAsync_RangeProcessingNotEnabled_RangeRequestedIgnored() 125public async Task WriteFileAsync_IfRangeHeaderInvalid_RangeRequestedIgnored() 155public async Task WriteFileAsync_RangeHeaderMalformed_RangeRequestIgnored(string rangeString) 183public async Task WriteFileAsync_RangeRequestedNotSatisfiable(string rangeString) 212public async Task WriteFileAsync_RangeRequested_PreconditionFailed() 239public async Task WriteFileAsync_RangeRequested_NotModified() 267public async Task ExecuteResultAsync_CallsSendFileAsync_IfIHttpSendFilePresent() 274.Returns(Task.FromResult<int>(0)); 291public async Task ExecuteResultAsync_CallsSendFileAsyncWithRequestedRange_IfIHttpSendFilePresent(long? start, long? end, long contentLength) 323public async Task ExecuteResultAsync_SetsSuppliedContentTypeAndEncoding() 344public async Task ExecuteResultAsync_WorksWithAbsolutePaths() 376public async Task ExecuteAsync_ThrowsNotSupported_ForNonRootedPaths(string path) 433public Task CompleteAsync() 443public Task SendFileAsync(string path, long offset, long? length, CancellationToken cancellation) 449return Task.CompletedTask; 452public Task StartAsync(CancellationToken cancellation = default)
src\Shared\ResultsTests\RedirectResultTestBase.cs (3)
16protected abstract Task ExecuteAsync(HttpContext httpContext, string contentPath); 21public async Task Execute_ReturnsContentPath_WhenItDoesNotStartWithTilde( 44public async Task Execute_ReturnsAppRelativePath_WhenItStartsWithTilde(
src\Shared\ResultsTests\VirtualFileResultTestBase.cs (20)
25protected abstract Task ExecuteAsync( 38public async Task WriteFileAsync_WritesRangeRequested( 78public async Task WriteFileAsync_IfRangeHeaderValid_WritesRequestedRange() 115public async Task WriteFileAsync_RangeProcessingNotEnabled_RangeRequestedIgnored() 148public async Task WriteFileAsync_IfRangeHeaderInvalid_RangeRequestedIgnored() 184public async Task WriteFileAsync_RangeHeaderMalformed_RangeRequestIgnored(string rangeString) 218public async Task WriteFileAsync_RangeRequestedNotSatisfiable(string rangeString) 254public async Task WriteFileAsync_RangeRequested_PreconditionFailed() 285public async Task WriteFileAsync_RangeRequested_NotModified() 321public async Task ExecuteResultAsync_CallsSendFileAsyncWithRequestedRange_IfIHttpSendFilePresent(long? start, long? end, long contentLength) 358public async Task ExecuteResultAsync_SetsSuppliedContentTypeAndEncoding() 376public async Task ExecuteResultAsync_ReturnsFileContentsForRelativePaths() 399public async Task ExecuteResultAsync_ReturnsFiles_ForDifferentPaths(string path) 421public async Task ExecuteResultAsync_TrimsTilde_BeforeInvokingFileProvider(string path) 439public async Task ExecuteResultAsync_WorksWithNonDiskBasedFiles() 465public async Task ExecuteResultAsync_ThrowsFileNotFound_IfFileProviderCanNotFindTheFile() 536public Task CompleteAsync() 546public Task SendFileAsync(string path, long offset, long? length, CancellationToken cancellation) 553return Task.FromResult(0); 556public Task StartAsync(CancellationToken cancellation = default)
VirtualFileResultTest.cs (1)
81protected override Task ExecuteAsync(HttpContext httpContext, string path, string contentType, DateTimeOffset? lastModified = null, EntityTagHeaderValue entityTag = null, bool enableRangeProcessing = false)
Microsoft.AspNetCore.Mvc.Core.TestCommon (108)
CommonFilterTest.cs (10)
15public static async Task ActionFilter_Calls_OnActionExecuted(Mock mock) 33var next = new ActionExecutionDelegate(() => Task.FromResult(CreateActionExecutedContext(context))); 49public static async Task ActionFilter_SettingResult_ShortCircuits(Mock mock) 84public static async Task ResultFilter_Calls_OnResultExecuted(Mock mock) 102var next = new ResultExecutionDelegate(() => Task.FromResult(CreateResultExecutedContext(context))); 118public static async Task ResultFilter_SettingResult_DoesNotShortCircuit(Mock mock) 140var next = new ResultExecutionDelegate(() => Task.FromResult(CreateResultExecutedContext(context))); 156public static async Task ResultFilter_SettingCancel_ShortCircuits(Mock mock) 231public Task ExecuteResultAsync(ActionContext context) 233return Task.FromResult(true);
CommonResourceInvokerTest.cs (96)
36public async Task InvokeAction_DoesNotInvokeExceptionFilter_WhenActionDoesNotThrow() 54public async Task InvokeAction_DoesNotAsyncInvokeExceptionFilter_WhenActionDoesNotThrow() 60.Returns<ExceptionContext>((context) => Task.FromResult(true)) 75public async Task InvokeAction_InvokesExceptionFilter_WhenActionThrows() 83.Returns(Task.FromResult(true)) 117public async Task InvokeAction_InvokesAsyncExceptionFilter_WhenActionThrows() 125.Returns(Task.FromResult(true)) 131.Returns<ExceptionContext>((context) => Task.FromResult(true)) 144.Returns<ExceptionContext>((context) => Task.FromResult(true)) 163public async Task InvokeAction_InvokesExceptionFilter_ShortCircuit_ExceptionNull_WithoutResult() 190public async Task InvokeAction_InvokesExceptionFilter_ShortCircuit_ExceptionNull_WithResult() 196.Returns(Task.FromResult(true)) 230public async Task InvokeAction_InvokesExceptionFilter_ShortCircuit_ExceptionHandled_WithoutResult() 256public async Task InvokeAction_InvokesExceptionFilter_ShortCircuit_ExceptionHandled_WithResult() 262.Returns(Task.FromResult(true)) 296public async Task InvokeAction_InvokesAsyncExceptionFilter_ShortCircuit_ExceptionNull_WithoutResult() 308.Returns<ExceptionContext>((context) => Task.FromResult(true)) 324public async Task InvokeAction_InvokesAsyncExceptionFilter_ShortCircuit_ExceptionNull_WithResult() 330.Returns(Task.FromResult(true)) 343.Returns<ExceptionContext>((context) => Task.FromResult(true)) 365public async Task InvokeAction_InvokesAsyncExceptionFilter_ShortCircuit_ExceptionHandled_WithoutResult() 377.Returns<ExceptionContext>((context) => Task.FromResult(true)) 392public async Task InvokeAction_InvokesAsyncExceptionFilter_ShortCircuit_ExceptionHandled_WithResult() 398.Returns(Task.FromResult(true)) 411.Returns<ExceptionContext>((context) => Task.FromResult(true)) 433public async Task InvokeAction_InvokesAsyncExceptionFilter_SettingResultDoesNotShortCircuit() 439.Returns<ActionContext>((context) => Task.FromResult(true)) 449.Returns<ExceptionContext>((context) => Task.FromResult(true)) 474public async Task InvokeAction_InvokesExceptionFilter_UnhandledExceptionIsThrown() 492public async Task InvokeAction_InvokesExceptionFilter_ResultIsExecuted_WithoutResultFilters() 498.Returns<ActionContext>((context) => Task.FromResult(true)) 520public async Task InvokeAction_InvokesExceptionFilter_SettingResultDoesNotShortCircuit() 526.Returns<ActionContext>((context) => Task.FromResult(true)) 557public async Task InvokeAction_WithExceptionFilterInTheStack_InvokesResultFilter() 575public async Task InvokeAction_InvokesAuthorizationFilter() 591public async Task InvokeAction_InvokesAsyncAuthorizationFilter() 597.Returns<AuthorizationFilterContext>(context => Task.FromResult(true)) 612public async Task InvokeAction_InvokesAuthorizationFilter_ShortCircuit() 618.Returns(Task.FromResult(true)) 624.Callback<AuthorizationFilterContext>(c => Task.FromResult(true)) 646public async Task InvokeAction_InvokesAsyncAuthorizationFilter_ShortCircuit() 652.Returns(Task.FromResult(true)) 660return Task.FromResult(true); 670return Task.FromResult(true); 688public async Task InvokeAction_ExceptionInAuthorizationFilter_CannotBeHandledByOtherFilters() 733public async Task InvokeAction_InvokesAuthorizationFilter_ChallengeNotSeenByResultFilters() 739.Returns<ActionContext>((context) => Task.FromResult(true)) 761public async Task InvokeAction_InvokesResultFilter() 779public async Task InvokeAction_InvokesAsyncResultFilter() 800public async Task InvokeAction_InvokesResultFilter_ShortCircuit_WithCancel() 840public async Task InvokeAction_InvokesAsyncResultFilter_ShortCircuit_WithCancel() 859return Task.FromResult(true); 883public async Task InvokeAction_InvokesAsyncResultFilter_ShortCircuit_WithoutCancel() 901return Task.FromResult(true); 925public async Task InvokeAction_InvokesAsyncResultFilter_ShortCircuit_WithoutCancel_CallNext() 953public async Task InvokeAction_InvokesResultFilter_ExceptionGoesUnhandled() 985public async Task InvokeAction_InvokesResultFilter_WithExceptionThrownByResult() 1030public async Task InvokeAction_InvokesAsyncResultFilter_WithExceptionThrownByResult() 1073public async Task InvokeAction_InvokesResultFilter_WithExceptionThrownByResultFilter() 1116public async Task InvokeAction_InvokesAsyncResultFilter_WithExceptionThrownByResultFilter() 1159public async Task InvokeAction_InvokesAsyncResourceFilter() 1183public async Task InvokeAction_InvokesResourceFilter() 1210public async Task InvokeAction_InvokesAsyncResourceFilter_WithActionResult_FromAction() 1237public async Task InvokeAction_InvokesAsyncResourceFilter_WithActionResult_FromExceptionFilter() 1276public async Task InvokeAction_InvokesAsyncResourceFilter_WithActionResult_FromResultFilter() 1313public async Task InvokeAction_InvokesAsyncResourceFilter_HandleException_FromAction() 1342public async Task InvokeAction_InvokesAsyncResourceFilter_HandlesException_FromResultFilter() 1381public async Task InvokeAction_InvokesAsyncResourceFilter_HandleException_BySettingNull() 1411public async Task InvokeAction_InvokesAsyncResourceFilter_ThrowsUnhandledException() 1447public async Task InvokeAction_InvokesResourceFilter_OnResourceExecuting_ThrowsUnhandledException() 1483public async Task InvokeAction_InvokesResourceFilter_OnResourceExecuted_ThrowsUnhandledException() 1519public async Task InvokeAction_InvokesAsyncResourceFilter_ShortCircuit() 1525.Returns(Task.FromResult(true)) 1544return Task.FromResult(true); 1574public async Task InvokeAction_InvokesAsyncResourceFilter_ShortCircuit_WithoutResult() 1592return Task.FromResult(true); 1621public async Task InvokeAction_InvokesResourceFilter_ShortCircuit() 1627.Returns(Task.FromResult(true)) 1671public async Task InvokeAction_InvokesAsyncResourceFilter_InvalidShortCircuit() 1700public async Task InvokeAction_AuthorizationFilter_ChallengePreventsResourceFiltersFromRunning() 1732public async Task InvokeAction_AuthorizationFilterShortCircuit_InvokesAlwaysRunResultFilter() 1749return Task.CompletedTask; 1762public async Task InvokeAction_AuthorizationFilterShortCircuit_InvokesAsyncAlwaysRunResultFilter() 1792public async Task InvokeAction_AuthorizationFilterShortCircuit_DoesNotRunResultFilters() 1804.Returns(Task.CompletedTask); 1835public async Task InvokeAction_ResourceFilterShortCircuit_InvokesAlwaysRunResultFilter() 1852return Task.CompletedTask; 1865public async Task InvokeAction_ResourceFilterShortCircuit_InvokesAsyncAlwaysRunResultFilter() 1892public async Task InvokeAction_ResourceFilterShortCircuit_DoesNotRunResultFilters() 1904.Returns(Task.CompletedTask); 1932public async Task InvokeAction_ExceptionFilterShortCircuit_InvokesAlwaysRunResultFilter() 1949return Task.CompletedTask; 1962public async Task InvokeAction_ExceptionFilterShortCircuit_InvokesAsyncAlwaysRunResultFilter() 1989public async Task InvokeAction_ExceptionFilterShortCircuit_DoesNotRunResultFilters() 2001.Returns(Task.CompletedTask); 2031public async Task InvokeAction_AlwaysRunResultFiltersAndRunWithResultFilters()
SimpleValueProviderFactory.cs (2)
22public Task CreateValueProviderAsync(ValueProviderFactoryContext context) 25return Task.CompletedTask;
Microsoft.AspNetCore.Mvc.Cors (3)
CorsAuthorizationFilter.cs (1)
63public async Task OnAuthorizationAsync(AuthorizationFilterContext context)
DisableCorsAuthorizationFilter.cs (2)
22public Task OnAuthorizationAsync(AuthorizationFilterContext context) 39return Task.CompletedTask;
Microsoft.AspNetCore.Mvc.Cors.Test (10)
CorsApplicationModelProviderTest.cs (2)
294public Task OnAuthorizationAsync(AuthorizationFilterContext context) 296return Task.FromResult(0);
CorsAuthorizationFilterTest.cs (5)
23public async Task CaseInsensitive_PreFlightRequest_SuccessfulMatch_WritesHeaders(string preflightRequestMethod) 53public async Task PreFlight_FailedMatch_RespondsWith204NoContent() 74public async Task CorsRequest_SuccessfulMatch_WritesHeaders() 97public async Task CorsRequest_FailedMatch_Writes200() 121.Returns(Task.FromResult(new CorsPolicy()));
DisableCorsAuthorizationFilterTest.cs (3)
15public async Task DisableCors_DoesNotShortCircuitsRequest_IfNotAPreflightRequest() 35public async Task DisableCors_DoesNotShortCircuitsRequest_IfNoAccessControlRequestMethodFound() 56public async Task DisableCors_CaseInsensitivePreflightMethod_ShortCircuitsRequest(string preflightMethod)
Microsoft.AspNetCore.Mvc.Formatters.Xml (2)
XmlDataContractSerializerOutputFormatter.cs (1)
213public override async Task WriteResponseBodyAsync(OutputFormatterWriteContext context, Encoding selectedEncoding)
XmlSerializerOutputFormatter.cs (1)
192public override async Task WriteResponseBodyAsync(OutputFormatterWriteContext context, Encoding selectedEncoding)
Microsoft.AspNetCore.Mvc.Formatters.Xml.Test (73)
FlushReportingStream.cs (1)
20public override Task FlushAsync(CancellationToken cancellationToken)
XmlDataContractSerializerInputFormatterTest.cs (21)
134public async Task BuffersRequestBody_ByDefault() 166public async Task ReadAsync_DoesNotDisposeBufferedStreamIfItDidNotCreateIt() 198public async Task SuppressInputFormatterBufferingSetToTrue_DoesNotBufferRequestBody() 233public async Task BuffersRequestBody_ByDefaultUsingMvcOptions() 265public async Task SuppressInputFormatterBufferingSetToTrue_DoesNotBufferRequestBody_UsingMvcOptions() 297public async Task ReadAsync_ReadsSimpleTypes() 324public async Task SuppressInputFormatterBufferingSetToTrue_UsingMutatedOptions() 361public async Task ReadAsync_ReadsComplexTypes() 391public async Task ReadAsync_ReadsWhenMaxDepthIsModified() 414public async Task ReadAsync_ThrowsOnExceededMaxDepth() 430public async Task ReadAsync_ThrowsWhenReaderQuotasAreChanged() 456public async Task ReadAsync_VerifyStreamIsOpenAfterRead() 476public async Task ReadAsync_FallsbackToUTF8_WhenCharSet_NotInContentType() 500public async Task ReadAsync_UsesContentTypeCharSet_ToReadStream() 529public async Task ReadAsync_IgnoresBOMCharacters() 561public async Task ReadAsync_AcceptsUTF16Characters() 599public async Task ReadAsync_ThrowsWhenNotConfiguredWithRootName() 619public async Task ReadAsync_ReadsWhenConfiguredWithRootName() 657public async Task ReadAsync_ThrowsWhenNotConfiguredWithKnownTypes() 678public async Task ReadAsync_ReadsWhenConfiguredWithKnownTypes() 771public override void OnCompleted(Func<object, Task> callback, object state)
XmlDataContractSerializerOutputFormatterTest.cs (19)
98public async Task WriteAsync_CanWriteBasicTypes(object input, string expectedOutput) 154public async Task SuppliedWriterSettings_TakeAffect() 182public async Task WriteAsync_WritesSimpleTypes() 207public async Task WriteAsync_WritesComplexTypes() 242public async Task WriteAsync_WritesOnModifiedWriterSettings() 273public async Task WriteAsync_WritesUTF16Output() 303public async Task WriteAsync_WritesIndentedOutput() 329public async Task WriteAsync_VerifyBodyIsNotClosedAfterOutputIsWritten() 347public async Task WriteAsync_DoesntFlushOutputStream() 465public async Task WriteAsync_ThrowsWhenNotConfiguredWithKnownTypes() 479public async Task WriteAsync_ThrowsWhenNotConfiguredWithPreserveReferences() 496public async Task WriteAsync_WritesWhenConfiguredWithRootName() 540public async Task WriteAsync_WritesWhenConfiguredWithKnownTypes() 587public async Task WriteAsync_WritesWhenConfiguredWithPreserveReferences() 703public async Task CanIndentOutputConditionally(bool indent, object input, string expectedOutput) 722public async Task WriteResponseBodyAsync_AsyncEnumerableConnectionCloses() 746await Task.Yield(); 762public async Task WriteResponseBodyAsync_AsyncEnumerable() 782await Task.Yield();
XmlSerializerInputFormatterTest.cs (17)
37public async Task BuffersRequestBody_ByDefault() 74public async Task SuppressInputFormatterBufferingSetToTrue_DoesNotBufferRequestBody_ObsoleteParameter() 111public async Task BuffersRequestBody_ByDefaultUsingMvcOptions() 147public async Task SuppressInputFormatterBufferingSetToTrue_DoesNotBufferRequestBody() 186public async Task SuppressInputFormatterBufferingSetToTrue_UsingMutatedOptions() 331public async Task ReadAsync_ReadsSimpleTypes() 363public async Task ReadAsync_ReadsComplexTypes() 398public async Task ReadAsync_ReadsWhenMaxDepthIsModified() 423public async Task ReadAsync_ThrowsOnExceededMaxDepth() 444public async Task ReadAsync_ThrowsWhenReaderQuotasAreChanged() 473public async Task ReadAsync_VerifyStreamIsOpenAfterRead() 494public async Task ReadAsync_FallsbackToUTF8_WhenCharSet_NotInContentType() 520public async Task ReadAsync_UsesContentTypeCharSet_ToReadStream() 549public async Task ReadAsync_IgnoresBOMCharacters() 581public async Task ReadAsync_AcceptsUTF16Characters() 621public async Task ReadAsync_DoesNotDisposeBufferedStreamIfItDidNotCreateIt() 706public override void OnCompleted(Func<object, Task> callback, object state)
XmlSerializerOutputFormatterTest.cs (15)
52public async Task XmlSerializerOutputFormatterCanWriteBasicTypes(object input, string expectedOutput) 87public async Task XmlSerializer_CanIndentOutputConditionally(bool indent, object input, string expectedOutput) 106public async Task XmlSerializer_CanModifyNamespacesInGeneratedXml() 158public async Task SuppliedWriterSettings_TakeAffect() 182public async Task XmlSerializerOutputFormatterWritesSimpleTypes() 205public async Task XmlSerializerOutputFormatterWritesComplexTypes() 238public async Task XmlSerializerOutputFormatterWritesOnModifiedWriterSettings() 267public async Task XmlSerializerOutputFormatterWritesUTF16Output() 294public async Task XmlSerializerOutputFormatterWritesIndentedOutput() 318public async Task VerifyBodyIsNotClosedAfterOutputIsWritten() 401public async Task XmlSerializerOutputFormatterWritesContentLengthResponse() 504public async Task WriteResponseBodyAsync_AsyncEnumerableConnectionCloses() 528await Task.Yield(); 544public async Task WriteResponseBodyAsync_AsyncEnumerable() 564await Task.Yield();
Microsoft.AspNetCore.Mvc.FunctionalTests (1020)
AntiforgeryAuthTests.cs (4)
20public async Task AutomaticAuthenticationBeforeAntiforgery() 31public async Task AuthBeforeAntiforgery() 43public async Task IgnoreAntiforgeryOverridesAutoAntiforgery() 53public async Task AntiforgeryOverridesIgnoreAntiforgery()
AntiforgeryMiddlewareTest.cs (6)
23public async Task Works_WithAntiforgeryMetadata_ValidToken() 55public async Task Works_WithAntiforgeryMetadata_AndFilterAttribute_ValidToken() 69public async Task Works_WithAntiforgeryMetadata_InvalidToken() 96public async Task Works_WithAntiforgeryMetadata_ValidToken_RequestSizeLimit() 139public async Task Throws_WithAntiforgeryMetadata_ValidToken_RequestFormLimits() 171public async Task Works_WithAntiforgeryMetadata_ValidToken_DisableRequestSizeLimits()
AntiforgeryTests.cs (8)
19public async Task MultipleAFTokensWithinTheSamePage_GeneratesASingleCookieToken() 41public async Task MultipleFormPostWithingASingleView_AreAllowed() 75public async Task SetCookieAndHeaderBeforeFlushAsync_GeneratesCookieTokenAndHeader() 93public async Task SetCookieAndHeaderBeforeFlushAsync_PostToForm() 125public async Task Antiforgery_HeaderNotSet_SendsBadRequest() 153public async Task AntiforgeryTokenGeneration_SetsDoNotCacheHeaders_OverridesExistingCachingHeaders() 175public async Task RequestWithoutAntiforgeryToken_SendsBadRequest() 188public async Task RequestWithoutAntiforgeryToken_ExecutesResultFilter()
ApiBehaviorTest.cs (23)
31public virtual async Task ActionsReturnBadRequest_WhenModelStateIsInvalid() 88public async Task ActionsReturnUnsupportedMediaType_WhenMediaTypeIsNotSupported() 104public async Task ActionsReturnUnsupportedMediaType_WhenEncodingIsUnsupported() 124public Task ActionsWithApiBehavior_InferFromBodyParameters() 128public Task ActionsWithApiBehavior_InferFromBodyParameters_DoNotConsiderCancellationTokenSourceParameter() 131private async Task ActionsWithApiBehaviorInferFromBodyParameters(string action) 151public async Task ActionsWithApiBehavior_DoesNotInferFromBodyForCompositeComplexTypesParameters() 173public async Task ActionsWithApiBehavior_InferFromServicesParameters() 188public async Task ActionsWithApiBehavior_InferQueryAndRouteParameters() 206public async Task ActionsWithApiBehavior_InferEmptyPrefixForComplexValueProviderModel_Success() 227public async Task ActionsWithApiBehavior_InferEmptyPrefixForComplexValueProviderModel_Ignored() 248public async Task ActionsWithApiBehavior_InferModelBinderType() 263public async Task ActionsWithApiBehavior_InferModelBinderTypeWithExplicitModelName() 278public virtual async Task ClientErrorResultFilterExecutesForStatusCodeResults() 306public virtual async Task SerializingProblemDetails_IgnoresNullValuedProperties() 324public virtual async Task SerializingProblemDetails_WithAllValuesSpecified() 340public virtual async Task SerializingValidationProblemDetails_WithExtensionData() 383public override Task ActionsReturnBadRequest_WhenModelStateIsInvalid() 389public override Task ClientErrorResultFilterExecutesForStatusCodeResults() 395public override Task SerializingProblemDetails_IgnoresNullValuedProperties() 401public override Task SerializingProblemDetails_WithAllValuesSpecified() 407public override Task SerializingValidationProblemDetails_WithExtensionData() 428public async Task ActionsReturnBadRequest_UsesProblemDescriptionProviderAndApiConventionsToConfigureErrorResponse()
ApiExplorerTest.cs (63)
24public async Task ApiExplorer_IsVisible_EnabledWithConvention() 37public async Task ApiExplorer_IsVisible_DisabledWithConvention() 50public async Task ApiExplorer_IsVisible_DisabledWithAttribute() 63public async Task ApiExplorer_IsVisible_EnabledWithAttribute() 76public async Task ApiExplorer_GroupName_SetByConvention() 90public async Task ApiExplorer_GroupName_SetByAttributeOnController() 104public async Task ApiExplorer_GroupName_SetByAttributeOnAction() 118public async Task ApiExplorer_GroupName_SetByEndpointMetadataOnController() 132public async Task ApiExplorer_GroupName_SetByEndpointMetadataOnAction() 146public async Task ApiExplorer_RouteTemplate_DisplaysFixedRoute() 160public async Task ApiExplorer_RouteTemplate_DisplaysRouteWithParameters() 180public async Task ApiExplorer_RouteTemplate_StripsInlineConstraintsFromThePath() 203public async Task ApiExplorer_RouteTemplate_StripsCatchAllsFromThePath() 225public async Task ApiExplorer_RouteTemplate_StripsCatchAllsWithConstraintsFromThePath() 250public async Task ApiExplorer_RouteTemplateStripsMultipleConstraints_OnTheSamePathSegment() 286public async Task ApiExplorer_RouteTemplateStripsMultipleConstraints_InMultipleSegments() 322public async Task ApiExplorer_DescribeParameters_FromAllSources() 351public async Task ApiExplorer_RouteTemplate_MakesParametersOptional() 370public async Task ApiExplorer_HttpMethod_All() 384public async Task ApiExplorer_HttpMethod_Single_GET() 400public async Task ApiExplorer_HttpMethod_Single_PUT() 423public async Task ApiExplorer_HttpMethod_Single_POST() 446public async Task ApiExplorer_ResponseType_VoidWithResponseTypeAttributeStatusCode(string action) 466public async Task ApiExplorer_ResponseType_VoidWithoutAttributeDefaultStatusCode(string action) 490public async Task ApiExplorer_ResponseType_UnknownWithoutAttribute(string action) 510public async Task ApiExplorer_ResponseType_KnownWithoutAttribute(string action, string type) 529public async Task ApiExplorer_ResponseType_KnownWithoutAttribute_ReturnVoid() 551public async Task ApiExplorer_ResponseType_DifferentOnAttributeThanReturnType() 576public async Task ApiExplorer_ResponseType_KnownWithAttribute(string action, string type) 595public async Task ExplicitResponseTypeDecoration_SuppressesDefaultStatus() 627public async Task ExplicitResponseTypeDecoration_SuppressesDefaultStatus_AlsoHonorsProducesContentTypes() 659public async Task ExplicitResponseTypeDecoration_WithExplicitDefaultStatus() 691public async Task ExplicitResponseTypeDecoration_WithExplicitDefaultStatus_SpecifiedViaProducesAttribute() 722public async Task ApiExplorer_ResponseType_InheritingFromController() 757public async Task ApiExplorer_ResponseType_OverrideOnAction() 792public async Task ApiExplorer_ResponseTypeWithContentType_OverrideOnAction() 829public async Task ApiExplorer_ResponseContentType_Unset() 855public async Task ApiExplorer_ResponseContentType_Specific() 879public async Task ApiExplorer_ResponseContentType_WildcardMatch() 905public async Task ApiExplorer_ResponseContentType_NoMatch() 930public async Task ApiExplorer_ResponseContentType_OverrideOnAction( 952public async Task ApiExplorer_Parameters_SimpleTypes_Default() 976public async Task ApiExplorer_Parameters_SimpleTypes_BinderMetadataOnParameters() 1001public async Task ApiExplorer_ParametersSimpleModel() 1025public async Task ApiExplorer_Parameters_SimpleTypes_SimpleModel_FromBody() 1049public async Task ApiExplorer_Parameters_SimpleTypes_ComplexModel() 1093public async Task ApiExplorer_Parameters_DefaultValue() 1125public async Task ApiExplorer_Parameters_IsRequired() 1162public async Task ApiExplorer_Updates_WhenActionDescriptorCollectionIsUpdated() 1196public async Task ApiExplorer_DoesNotListActionsSuppressedForPathMatching() 1209public async Task ApiBehavior_AddsMultipartFormDataConsumesConstraint_ForActionsWithFormFileParameters() 1222public async Task ApiBehavior_UsesContentTypeFromProducesAttribute_WhenNoFormatterSupportsIt() 1244public Task ApiConvention_ForGetMethod_ReturningModel() => ApiConvention_ForGetMethod("GetProduct"); 1247public Task ApiConvention_ForGetMethod_ReturningTaskOfActionResultOfModel() => ApiConvention_ForGetMethod("GetTaskOfActionResultOfProduct"); 1249private async Task ApiConvention_ForGetMethod(string action) 1283public async Task ApiConvention_ForGetMethodThatDoesNotMatchConvention() 1308public async Task ApiConvention_ForMethodWithResponseTypeAttributes() 1339public async Task ApiConvention_ForPostMethodThatMatchesConvention() 1374public async Task ApiConvention_ForPostActionWithProducesAttribute() 1409public async Task ApiConvention_ForPutActionThatMatchesConvention() 1450public async Task ApiConvention_ForDeleteActionThatMatchesConvention() 1490public async Task ApiConvention_ForActionWithApiConventionMethod() 1523public async Task ApiAction_ForActionWithVoidResponseType(string path, Type type)
ApplicationModelTest.cs (14)
19public async Task ControllerModel_CustomizedWithAttribute() 32public async Task ActionModel_CustomizedWithAttribute() 45public async Task ParameterModel_CustomizedWithAttribute() 58public async Task ApplicationModel_AddPropertyToActionDescriptor_FromApplicationModel() 71public async Task ApplicationModel_AddPropertyToActionDescriptor_ControllerModelOverwritesCommonApplicationProperty() 84public async Task ApplicationModel_ProvidesMetadataToActionDescriptor_ActionModelOverwritesControllerModelProperty() 97public async Task ApplicationModelExtensions_AddsConventionToAllControllers() 111public async Task ApplicationModelExtensions_AddsConventionToAllActions() 128public async Task ActionModelSuppressedForPathMatching_CannotBeRouted() 138public async Task ActionModelNotSuppressedForPathMatching_CanBeRouted() 148public async Task ActionModelSuppressedForLinkGeneration_CannotBeLinked() 157public async Task ActionModelSuppressedForPathMatching_CanBeLinked() 170public async Task ApplicationModel_CanDuplicateController_InMultipleAreas(string areaName, string expectedContent) 184public async Task ControllerModel_CanDuplicateActions_RoutesToDifferentNames(string actionName, string expectedContent)
AsyncActionsTests.cs (26)
19public async Task AsyncVoidAction_ReturnsOK() 31public async Task TaskAction_ReturnsOK() 43public async Task TaskExceptionAction_ReturnsCorrectError() 54public async Task TaskOfObjectAction_ReturnsJsonFormattedObject() 66public async Task TaskOfObjectExceptionAction_ReturnsCorrectError() 77public async Task TaskOfIActionResultAction_ReturnsString() 89public async Task TaskOfIActionResultExceptionAction_ReturnsCorrectError() 100public async Task TaskOfContentResultAction_ReturnsString() 112public async Task TaskOfContentResultExceptionAction_ReturnsCorrectError() 123public async Task PreCompletedValueTaskOfObjectAction_ReturnsJsonFormattedObject() 135public async Task PreCompletedValueTaskOfObjectExceptionAction_ReturnsCorrectError() 146public async Task PreCompletedValueTaskOfIActionResultAction_ReturnsString() 158public async Task PreCompletedValueTaskOfIActionResultExceptionAction_ReturnsCorrectError() 169public async Task PreCompletedValueTaskOfContentResultAction_ReturnsString() 181public async Task PreCompletedValueTaskOfContentResultExceptionAction_ReturnsCorrectError() 192public async Task CustomAwaitableVoidAction_ReturnsOK() 204public async Task CustomAwaitableVoidExceptionAction_ReturnsCorrectError() 215public async Task CustomAwaitableOfObjectAction_ReturnsJsonFormattedObject() 227public async Task CustomAwaitableOfObjectExceptionAction_ReturnsCorrectError() 238public async Task CustomAwaitableOfIActionResultAction_ReturnsString() 250public async Task CustomAwaitableOfIActionResultExceptionAction_ReturnsCorrectError() 261public async Task CustomAwaitableOfContentResultAction_ReturnsString() 273public async Task CustomAwaitableOfContentResultExceptionAction_ReturnsCorrectError() 284public async Task AsyncSuffixIsIgnored() 294public async Task ActionIsNotRoutedWithAsyncSuffix() 304public async Task ViewLookupWithAsyncSuffix()
AsyncDisposalTest.cs (3)
30public async Task CanDisposeAsyncController() 42public async Task HandlesAsyncExceptionsDuringAsyncDisposal() 54public async Task HandlesSyncExceptionsDuringAsyncDisposal()
AsyncEnumerableTestBase.cs (5)
22public Task AsyncEnumerableReturnedWorks() => AsyncEnumerableWorks("getallprojects"); 25public Task AsyncEnumerableWrappedInTask() => AsyncEnumerableWorks("getallprojectsastask"); 27private async Task AsyncEnumerableWorks(string action) 45public async Task AsyncEnumerableExceptionsAreThrown() 60public async Task AsyncEnumerableWithXmlFormatterWorks()
AuthMiddlewareAndFilterTestBase.cs (16)
24public async Task AllowAnonymousOnActionsWork() 34public async Task GlobalAuthFilter_AppliesToActionsWithoutAnyAuthAttributes() 52public async Task GlobalAuthFilter_CombinesWithAuthAttributeSpecifiedOnAction() 77public async Task AllowAnonymousOnPageConfiguredViaConventionWorks() 87public async Task AllowAnonymousOnPageConfiguredViaModelWorks() 97public async Task GlobalAuthFilterAppliedToPageWorks() 116public async Task CanLoginWithBearer() 131public async Task CanLoginWithBearerAfterAnonymous() 150public async Task CanLoginWithCookie() 165public async Task CanLoginWithCookieAfterAnonymous() 184public async Task CanLoginWithBearerAfterCookie() 212public Task GlobalAuthFilter_CombinesWithAuthAttributeOnPageModel() 221public Task GlobalAuthFilter_CombinesWithAuthAttributeSpecifiedViaConvention() 229private async Task LoginAB(string url) 253private async Task AssertAuthorizeResponse(HttpResponseMessage response) 259private async Task AssertForbiddenResponse(HttpResponseMessage response)
AuthMiddlewareUsingRequireAuthTest.cs (3)
24public async Task RequireAuthConfiguredGlobally_AppliesToControllers() 43public async Task RequireAuthConfiguredGlobally_AppliesToRazorPages() 61private async Task AssertAuthorizeResponse(HttpResponseMessage response)
BasicTests.cs (34)
31public async Task CanRender_CSharp7Views() 51public async Task CanRender_ViewComponentWithArgumentsFromController() 74public async Task CanRender_ViewsWithLayout(string url) 95public async Task CanRender_SimpleViews() 115public async Task ViewWithAttributePrefix_RendersWithoutIgnoringPrefix() 133public async Task CanReturn_ResultsWithoutContent() 147public async Task ReturningTaskFromAction_ProducesEmptyResult() 159public async Task ActionDescriptors_CreatedOncePerRequest() 176public async Task ActionWithRequireHttps_RedirectsToSecureUrl_ForNonHttpsGetRequests() 192public async Task ActionWithRequireHttps_ReturnsBadRequestResponse_ForNonHttpsNonGetRequests() 210public async Task ActionWithRequireHttps_AllowsHttpsRequests(string method) 222public async Task JsonHelper_RendersJson_WithCamelCaseNames() 242public async Task JsonHelperWithSettings_RendersJson_WithNamesUnchanged() 265public async Task JsonHelperWithSettings_RendersJson_WithSnakeCaseNames() 324public async Task HtmlHelperLinkGeneration(string viewName, string expectedLink) 336public async Task ConfigureMvc_AddsOptionsProperly() 348public async Task TypesMarkedAsNonAction_AreInaccessible() 358public async Task UsingPageRouteParameterInConventionalRouteWorks() 371public async Task UsingPageRouteParameterInAttributeRouteWorks() 384public async Task RedirectToAction_WithEmptyActionName_UsesAmbientValue() 404public async Task ActionMethod_ReturningActionMethodOfT_WithBadRequest() 417public async Task ActionMethod_ReturningActionMethodOfT() 431public async Task ActionMethod_ReturningSequenceOfObjectsWrappedInActionResultOfT() 445public async Task TestingInfrastructure_InvokesCreateDefaultBuilder() 455public async Task ApplicationAssemblyPartIsListedAsFirstAssembly() 484public async Task ViewDataProperties_AreTransferredToViews() 501public async Task ViewDataProperties_AreTransferredToViewComponents() 515public async Task BindPropertiesAttribute_CanBeAppliedToControllers() 537public async Task BindPropertiesAttribute_DoesNotApplyToPropertiesWithBindingInfo() 561public async Task BindPropertiesAttribute_DoesNotCausePropertiesWithBindNeverAttributeToBeModelBound() 581public async Task BindPropertiesAttributeWithSupportsGet_BindsOnNonGet() 599public async Task BindPropertiesAttributeWithSupportsGet_BindsOnGet() 611public async Task BindPropertiesAppliesValidation() 635public async Task InvalidForm_ResultsInModelError()
ClientValidationOptionsTests.cs (1)
16public async Task DisablingClientValidation_DisablesItForPagesAndViews()
CompilationOptionsTests.cs (1)
20public async Task CompilationOptions_AreUsedByViewsAndPartials()
ComponentRenderingFunctionalTests.cs (6)
24public async Task Renders_BasicComponent() 39public async Task Renders_RoutingComponent() 55public async Task Redirects_Navigation_Component() 70public async Task Renders_RoutingComponent_UsingRazorComponents_Prerenderer() 86public async Task Renders_ThrowingComponent_UsingRazorComponents_Prerenderer() 102public async Task Renders_AsyncComponent()
ConsumesAttributeEndpointRoutingTests.cs (1)
17public override async Task HasEndpointMatch()
ConsumesAttributeTests.cs (1)
17public override async Task HasEndpointMatch()
ConsumesAttributeTestsBase.cs (9)
28public abstract Task HasEndpointMatch(); 31public async Task NoRequestContentType_SelectsActionWithoutConstraint() 48public async Task NoRequestContentType_Selects_IfASingleActionWithConstraintIsPresent() 65public async Task NoRequestContentType_MultipleMatches_IfAMultipleActionWithConstraintIsPresent() 82public async Task Selects_Action_BasedOnRequestContentType(string requestContentType) 103public async Task ActionLevelAttribute_OverridesClassLevel(string requestContentType) 125public async Task DerivedClassLevelAttribute_OverridesBaseClassLevel() 148public async Task JsonSyntaxSuffix_SelectsActionConsumingJson() 169public async Task XmlSyntaxSuffix_SelectsActionConsumingXml()
ContentNegotiationTest.cs (28)
26public async Task ProducesAttribute_SingleContentType_PicksTheFirstSupportedFormatter() 43public async Task ProducesAttribute_MultipleContentTypes_RunsConnegToSelectFormatter() 60public async Task NoProducesAttribute_ActionReturningString_RunsUsingTextFormatter() 76public async Task NoProducesAttribute_ActionReturningAnyObject_RunsUsingDefaultFormatters() 93public async Task ContentNegotiationWithPartiallyValidAcceptHeader_SkipsInvalidEntries(string acceptHeader) 109public async Task ProducesAttributeWithTypeOnly_RunsRegularContentNegotiation() 132public async Task ProducesAttribute_WithTypeAndContentType_UsesContentType() 157public async Task NoAcceptAndRequestContentTypeHeaders_UsesFirstFormatterWhichCanWriteType(string url) 173public async Task NoMatchingFormatter_ForTheGivenContentType_Returns406() 198public async Task ProducesAttribute_WithMediaTypeHavingParameters_IsCaseInsensitiveMatch( 218public async Task ProducesAttribute_OnAction_OverridesTheValueOnClass() 236public async Task ProducesAttribute_OnDerivedClass_OverridesTheValueOnBaseClass() 254public async Task ProducesAttribute_OnDerivedAction_OverridesTheValueOnBaseClass() 271public async Task ProducesAttribute_OnDerivedAction_OverridesTheValueOnBaseAction() 288public async Task ProducesAttribute_OnDerivedClassAndAction_OverridesTheValueOnBaseClass() 306public async Task ProducesAttribute_IsNotHonored_ForJsonResult() 324public async Task XmlFormatter_SupportedMediaType_DoesNotChangeAcrossRequests() 352public async Task ObjectResult_WithStringReturnType_DefaultToTextPlain(string acceptMediaType) 369public async Task ObjectResult_WithStringReturnType_AndNonTextPlainMediaType_DoesNotReturnTextPlain() 387public async Task NoMatchOn_RequestContentType_FallsBackOnTypeBasedMatch_NoMatchFound_Returns406() 404public async Task InvalidResponseContentType_WithNotMatchingAcceptHeader_Returns406() 419public async Task InvalidResponseContentType_WithMatchingAcceptHeader_Returns406() 434public async Task InvalidResponseContentType_WithoutAcceptHeader_Returns406() 448public async Task ProducesAttribute_And_FormatFilterAttribute_Conflicting() 460public async Task ProducesAttribute_And_FormatFilterAttribute_Collaborating() 473public async Task ProducesAttribute_CustomMediaTypeWithJsonSuffix_RunsConnegAndSelectsJsonFormatter() 491public async Task ProducesAttribute_CustomMediaTypeWithXmlSuffix_RunsConnegAndSelectsXmlFormatter() 510public async Task FormatFilter_XmlAsFormat_ReturnsXml()
ControllerEndpointFiltersTest.cs (4)
27public async Task CanApplyEndpointFilterToController() 40public async Task CanCaptureMethodInfoFromControllerAction() 53public async Task CanInterceptActionResultViaFilter() 65public async Task CanAccessArgumentsFromAction()
ControllerFromServicesTests.cs (7)
19public async Task ControllersWithConstructorInjectionAreCreatedAndActivated() 35public async Task TypesDerivingFromControllerAreRegistered() 48public async Task TypesDerivingFromTypesWithControllerAttributeAreRegistered() 61public async Task TypesWithControllerSuffixAreRegistered() 77public async Task TypesWithControllerSuffixAreConventionalRouted() 97public async Task AddControllersFromServices_UsesControllerDiscoveryContentions(string action) 107public async Task AddControllersAsServices_MultipleCalls_DoesNotReplacePreviousProvider()
CorsTests.cs (1)
18public override async Task PreflightRequestOnNonCorsEnabledController_DoesNotMatchTheAction()
CorsTestsBase.cs (15)
28public async Task ResourceWithSimpleRequestPolicy_Allows_SimpleRequests(string method) 49public async Task OptionsRequest_NonPreflight_ExecutesOptionsAction() 65public async Task PreflightRequestOnNonCorsEnabledController_ExecutesOptionsAction() 83public virtual async Task PreflightRequestOnNonCorsEnabledController_DoesNotMatchTheAction() 102public async Task OriginMatched_ReturnsHeaders(string method) 139public async Task SuccessfulCorsRequest_AllowsCredentials_IfThePolicyAllowsCredentials() 171public async Task SuccessfulPreflightRequest_AllowsCredentials_IfThePolicyAllowsCredentials() 207public async Task PolicyFailed_Allows_ActualRequest_WithMissingResponseHeaders() 232public async Task DisableCors_ActionsCanOverride_ControllerLevel(string method) 256public async Task DisableCors_PreFlight_ActionsCanOverride_ControllerLevel(string method) 282public async Task Cors_RunsBeforeOtherAuthorizationFilters_UsesPolicySpecifiedOnController() 314public async Task Cors_RunsBeforeOtherAuthorizationFilters_UsesPolicySpecifiedOnAction() 349public async Task DisableCors_RunsBeforeOtherAuthorizationFilters() 377public async Task Cors_OnAction_PreferredOverController_AndAuthorizationFiltersRunAfterCors() 400public async Task Cors_WithoutOriginHeader_Works()
CustomValueProviderTest.cs (4)
27public async Task CustomValueProvider_DisplayName() 44public async Task CustomValueProvider_IntValues() 61public async Task CustomValueProvider_NullableIntValues() 78public async Task CustomValueProvider_StringValues()
DataAnnotationTests.cs (1)
27public async Task DataAnnotationLocalizationOfEnums_FromDataAnnotationLocalizerProvider()
DefaultValuesTest.cs (7)
18public async Task Controller_WithDefaultValueAttribute_ReturnsDefault() 32public async Task Controller_WithDefaultValueAttribute_ReturnsModelBoundValues() 46public async Task Controller_WithDefaultParameterValue_ReturnsDefault() 60public async Task Controller_WithDefaultParameterValue_ReturnsModelBoundValues() 74public async Task Controller_WithDefaultParameterValues_ForStructs_ReturnsDefaults() 88public async Task Controller_WithDefaultParameterValues_ForStructs_ReturnsBoundValues() 104public async Task EchoValue_DefaultParameterValue_ForGlobbedPath()
DirectivesTest.cs (3)
18public async Task ViewsInheritsUsingsAndInjectDirectivesFromViewStarts() 32public async Task ViewInheritsBasePageFromViewStarts() 45public async Task ViewAndViewComponentsReplaceTModelTokenFromInheritedBasePages()
DoNotRespectBrowserAcceptHeaderTests.cs (4)
27public async Task AllMediaRangeAcceptHeader_FirstFormatterInListWritesResponse(string acceptHeader) 49public async Task AllMediaRangeAcceptHeader_ProducesAttributeIsHonored(string acceptHeader) 77public async Task AllMediaRangeAcceptHeader_WithContentTypeHeader_ContentTypeIsIgnored(string acceptHeader) 109public async Task AllMediaRangeAcceptHeader_WithExactMatch_ReturnsExpectedContent(string acceptHeader)
ErrorPageTests.cs (6)
51public async Task CompilationFailuresAreListedByErrorPageMiddleware() 89public async Task ParseFailuresAreListedByErrorPageMiddleware() 111public async Task CompilationFailuresFromViewImportsAreListed() 134public async Task RuntimeErrorAreListedByErrorPageMiddleware() 152public async Task LoaderExceptionsFromReflectionTypeLoadExceptionsAreListed() 170public async Task AggregateException_FlattensInnerExceptions()
FileResultTests.cs (39)
23public async Task FileFromDisk_CanBeEnabled_WithMiddleware() 43public async Task FileFromDisk_CanBeEnabled_WithMiddleware_RangeRequest(long start, long end, string expectedBody) 65public async Task FileFromDisk_CanBeEnabled_WithMiddleware_RangeRequestIgnored(string rangeString) 85public async Task FileFromDisk_CanBeEnabled_WithMiddleware_RangeRequestNotSatisfiable(string rangeString) 107public async Task FileFromDisk_CanBeEnabled_WithMiddleware_RangeRequest_WithLastModifiedAndEtag(long start, long end, string expectedBody) 129public async Task FileFromDisk_CanBeEnabled_WithMiddleware_RangeRequestIgnored_WithLastModifiedAndEtag(string rangeString) 149public async Task FileFromDisk_CanBeEnabled_WithMiddleware_RangeRequestNotSatisfiable_WithLastModifiedAndEtag(string rangeString) 170public async Task FileFromDisk_ReturnsFileWithFileName() 193public async Task FileFromDisk_ReturnsFileWithFileName_RangeProcessingNotEnabled_RangeRequestedIgnored(string httpMethod, string expectedBody) 211public async Task FileFromDisk_ReturnsFileWithFileName_IfRangeHeaderValid_RangeRequest_WithLastModifiedAndEtag() 231public async Task FileFromDisk_ReturnsFileWithFileName_IfRangeHeaderInvalid_RangeRequestIgnored_WithLastModifiedAndEtag() 260public async Task FileFromDisk_ReturnsFileWithFileName_DoesNotServeBody_ForHeadRequest_WithLastModifiedAndEtag( 293public async Task FileFromDisk_ReturnsFileFromSymlink() 310public async Task FileFromStream_ReturnsFile() 330public async Task FileFromStream_ReturnsFile_RangeRequest(long start, long end, string expectedBody) 352public async Task FileFromStream_ReturnsFile_RangeRequestIgnored(string rangeString) 372public async Task FileFromStream_ReturnsFile_RangeRequestNotSatisfiable(string rangeString) 391public async Task FileFromStream_ReturnsFileWithFileName() 414public async Task FileFromStream_ReturnsFileWithFileName_RangeProcessingNotEnabled_RangeRequestedIgnored(string httpMethod, string expectedBody) 432public async Task FileFromStream_ReturnsFileWithFileName_IfRangeHeaderValid_RangeRequest() 452public async Task FileFromStream_ReturnsFileWithFileName_IfRangeHeaderInvalid_RangeRequestNotSatisfiable() 479public async Task FileFromStream_ReturnsFileWithFileName_DoesNotServeBody_ForHeadRequest( 511public async Task FileFromBinaryData_ReturnsFile() 531public async Task FileFromBinaryData_ReturnsFile_RangeRequest(long start, long end, string expectedBody) 553public async Task FileFromBinaryData_ReturnsFile_RangeRequestIgnored(string rangeString) 573public async Task FileFromBinaryData_ReturnsFile_RangeRequestNotSatisfiable(string rangeString) 595public async Task FileFromBinaryData_ReturnsFileWithFileName() 618public async Task FileFromBinaryData_ReturnsFileWithFileName_RangeProcessingNotEnabled_RangeRequestedIgnored(string httpMethod, string expectedBody) 636public async Task FileFromBinaryData_ReturnsFileWithFileName_IfRangeHeaderValid() 656public async Task FileFromBinaryData_ReturnsFileWithFileName_IfRangeHeaderInvalid_RangeRequestIgnored() 685public async Task FileFromBinaryData_ReturnsFileWithFileName_DoesNotServeBody_ForHeadRequest( 717public async Task FileFromEmbeddedResources_ReturnsFileWithFileName() 744public async Task FileFromEmbeddedResources_ReturnsFileWithFileName_RangeRequest(long start, long end, string expectedBody) 768public async Task FileFromEmbeddedResources_ReturnsFileWithFileName_RangeProcessingNotEnabled_RangeRequestedIgnored(string httpMethod, string expectedBody) 786public async Task FileFromEmbeddedResources_ReturnsFileWithFileName_IfRangeHeaderValid_RangeRequest() 809public async Task FileFromEmbeddedResources_ReturnsFileWithFileName_IfRangeHeaderInvalid_RangeRequestIgnored() 834public async Task FileFromEmbeddedResources_ReturnsFileWithFileName_RangeRequestIgnored(string rangeString) 857public async Task FileFromEmbeddedResources_ReturnsFileWithFileName_RangeRequestNotSatisfiable(string rangeString) 889public async Task FileFromEmbeddedResources_ReturnsFileWithFileName_DoesNotServeBody_ForHeadRequest(
FiltersTest.cs (7)
21public async Task CanAuthorize_UsersByRole() 32public async Task CanAuthorize_UsersByPolicyRequirements() 43public async Task ImpossiblePolicyFailsAuthorize() 56public async Task MiddlewareFilter_LocalizationMiddlewareRegistration_UsesRouteDataToFindCulture( 71public async Task AlwaysRunResultFilters_CanRunWhenResourceFiltersShortCircuit() 89public async Task FiltersCanBeDeclaredGlobally() 102public async Task ServiceFiltersWork()
FlushPointTest.cs (6)
18public async Task FlushPointsAreExecutedForPagesWithLayouts() 37public async Task FlushFollowedByLargeContent() 51public async Task FlushInvokedInComponent() 64public async Task FlushPointsAreExecutedForPagesWithoutLayouts() 86public async Task FlushPointsAreExecutedForPagesWithComponentsPartialsAndSections(string action, string title) 110public async Task FlushPointsNestedLayout()
FormFileUploadTest.cs (2)
19public async Task CanUploadFileInFrom() 43public async Task UploadMultipleFiles()
GlobalAuthorizationFilterTestBase.cs (3)
14public virtual async Task DeniesAnonymousUsers_ByDefault() 28public async Task AllowAnonymousUsers_ForActionsWithAllowAnonymousAttribute() 40public async Task AuthorizationPoliciesCombine()
HtmlGenerationTest.cs (27)
83public async Task EnumValues_SerializeCorrectly() 94public async Task HtmlGenerationWebSite_GeneratesExpectedResults(string action, string antiforgeryPath) 124public async Task HtmlGenerationWebSite_GeneratesExpectedResults_WithImageData() 208public async Task HtmlGenerationWebSite_LinkGeneration_With21CompatibilityBehavior() 251public async Task HtmlGenerationWebSite_GenerateEncodedResults(string action, string antiforgeryPath) 283public Task HtmlGenerationWebSite_GenerateEncodedResultsNotReadyForHelix(string action, string antiforgeryPath) 291public async Task CheckViewData_GeneratesExpectedResults(string action) 312public async Task ValidationTagHelpers_GeneratesExpectedSpansAndDivs() 342public async Task ClientValidators_AreGeneratedDuringInitialRender() 368public async Task ValidationTagHelpers_UsingRecords() 406public async Task CacheTagHelper_CanCachePortionsOfViewsPartialViewsAndViewComponents() 470public async Task CacheTagHelper_ExpiresContent_BasedOnExpiresParameter() 480await Task.Delay(TimeSpan.FromSeconds(2)); 489public async Task CacheTagHelper_UsesVaryByCookie_ToVaryContent() 516public async Task CacheTagHelper_VariesByRoute() 567public async Task CacheTagHelper_VariesByUserId() 589public async Task CacheTagHelper_BubblesExpirationOfNestedTagHelpers() 626public async Task CacheTagHelper_DoesNotCacheIfDisabled() 640public async Task EditorTemplateWithNoModel_RendersWithCorrectMetadata() 658public async Task EditorTemplateWithSpecificModel_RendersWithCorrectMetadata() 683public async Task WeirdModelExpressions_CanAccessModelValues(string action) 698public async Task PartialTagHelper_AllowsPassingModelValue() 712public async Task PartialTagHelper_AllowsPassingNullModelValue() 727public async Task PartialTagHelper_AllowsUsingFallback() 741public async Task PartialTagHelper_AllowsUsingOptional() 755public async Task ValidationProviderAttribute_ValidationTagHelpers_GeneratesExpectedDataAttributes() 778public async Task ValidationProviderAttribute_ValidationTagHelpers_GeneratesExpectedSpansAndDivsOnValidationError()
HtmlGenerationWithCultureTest.cs (3)
35public async Task CacheTagHelper_AllowsVaryingByCulture() 79public async Task CacheTagHelper_AllowsVaryingByUICulture() 129public async Task CacheTagHelper_VaryByCultureComposesWithOtherVaryByOptions()
HtmlHelperOptionsTest.cs (2)
19public async Task AppWideDefaultsInViewAndPartialView() 50public async Task OverrideAppWideDefaultsInViewAndPartialView()
HttpActionResultTests.cs (2)
21public async Task ActionCanReturnIResultWithContent() 36public async Task ActionCanReturnIResultWithStatusCodeOnly()
Infrastructure\CultureReplacerMiddleware.cs (1)
30public async Task Invoke(HttpContext context)
InputFormatterTests.cs (18)
26public async Task CheckIfXmlInputFormatterIsBeingCalled() 46public async Task CustomFormatter_IsSelected_ForSupportedContentTypeAndEncoding(string encoding) 63public async Task CustomFormatter_NotSelected_ForUnsupportedContentType(string contentType) 76public async Task BindingWorksForPolymorphicTypes() 88public async Task ValidationUsesModelMetadataFromActualModelType_ForModelBoundParameters() 107public async Task InputFormatterWorksForPolymorphicTypes() 120public async Task ValidationUsesModelMetadataFromActualModelType_ForInputFormattedParameters() 139public async Task InputFormatterWorksForPolymorphicProperties() 152public async Task ValidationUsesModelMetadataFromActualModelType_ForInputFormattedProperties() 171public async Task BodyIsRequiredByDefault() 189public async Task BodyIsRequiredByDefault_WhenNullableContextEnabled() 212public async Task BodyIsRequiredByDefaultFailsWithContentLengthZero() 226public async Task OptionalFromBodyWorks() 236public async Task OptionalFromBodyWorks_WithDefaultValue() 246public async Task OptionalFromBodyWorks_WithNullable() 256public async Task OptionalFromBodyWorksWithEmptyRequest() 271public async Task OptionalFromBodyWorksWithEmptyRequest_WithDefaultValue() 286public async Task OptionalFromBodyWorksWithEmptyRequest_WithNullable()
InputObjectValidationTests.cs (13)
48public async Task CheckIfObjectIsDeserializedWithoutErrors() 73public async Task CheckIfObjectIsDeserialized_WithErrors() 101public async Task CheckIfExcludedFieldsAreNotValidated() 116public async Task ShallowValidation_HappensOnExcluded_ComplexTypeProperties() 144public async Task ShallowValidation_HappensOnExcluded_SimpleTypeProperties( 168public async Task CheckIfExcludedField_IsNotValidatedForNonBodyBoundModels() 186public async Task ValidationProviderAttribute_WillValidateObject() 207public async Task ValidationProviderAttribute_DoesNotInterfere_WithOtherValidationAttributes() 227public async Task ValidationProviderAttribute_RequiredAttributeErrorMessage_WillComeFirst() 249public async Task ValidationThrowsError_WhenValidationExceedsMaxValidationDepth() 269public async Task ErrorsDeserializingMalformedJson_AreReportedForModelsWithoutAnyValidationAttributes() 298public async Task JsonValidationErrors_AreReportedForModelsWithoutAnyValidationAttributes() 327public async Task ErrorsDeserializingMalformedXml_AreReportedForModelsWithoutAnyValidationAttributes()
InputParentValidationTests.cs (2)
34public async Task ParentObjectValidation_RespectsMvcOptions_WhenChildIsInvalid() 53public async Task ParentObjectIsValidated_WhenChildIsValid()
InputValidationTests.cs (2)
21public async Task ValidRequest_IsAccepted() 61public async Task InvalidRequest_IsRejected()
JsonInputFormatterTestBase.cs (10)
30public async Task JsonInputFormatter_IsSelectedForJsonRequest(string requestContentType) 48public async Task JsonInputFormatter_IsModelStateValid_ForValidContentType( 69public virtual async Task JsonInputFormatter_ReturnsDefaultValue_ForValueTypes(string input) 84public async Task JsonInputFormatter_ReadsPrimitiveTypes() 100public async Task JsonInputFormatter_RoundtripsPocoModel() 122public virtual async Task JsonInputFormatter_RoundtripsRecordType() 139public virtual async Task JsonInputFormatter_ValidationWithRecordTypes_ValidationErrors() 170public virtual async Task JsonInputFormatter_ValidationWithRecordTypes_NoValidationErrors() 187public async Task JsonInputFormatter_Returns415UnsupportedMediaType_ForEmptyContentType() 204public async Task JsonInputFormatter_IsModelStateValid_ForTransferEncodingChunk(
JsonOutputFormatterTestBase.cs (11)
31public virtual async Task SerializableErrorIsReturnedInExpectedFormat() 68public virtual async Task Formatting_IntValue() 79public virtual async Task Formatting_StringValue() 90public virtual async Task Formatting_StringValueWithUnicodeContent() 101public virtual async Task Formatting_StringValueWithNonAsciiCharacters() 112public virtual async Task Formatting_SimpleModel() 126public virtual async Task Formatting_CollectionType() 140public virtual async Task Formatting_DictionaryType() 154public virtual async Task Formatting_LargeObject() 169public virtual async Task Formatting_ProblemDetails() 187public virtual async Task Formatting_PolymorphicModel()
JsonPatchInputFormatterTest.cs (7)
22public async Task AddOperation_Works() 42public async Task ReplaceOperation_Works() 62public async Task CopyOperation_Works() 83public async Task MoveOperation_Works() 104public async Task RemoveOperation_Works() 124public async Task AddOperation_InvalidValueForProperty_AddsErrorToModelState() 138public async Task InvalidOperation_AddsErrorToModelState()
JsonResultWithNewtonsoftJsonTest.cs (6)
27public async Task JsonResult_UsesDefaultContentType() 48public async Task JsonResult_Conneg_Fails(string mediaType) 67public async Task JsonResult_Null() 85public async Task JsonResult_String() 102public async Task JsonResult_Uses_CustomSerializerSettings() 118public async Task JsonResult_CustomContentType()
JsonResultWithSystemTextJsonTest.cs (6)
27public async Task JsonResult_UsesDefaultContentType() 48public async Task JsonResult_Conneg_Fails(string mediaType) 67public async Task JsonResult_Null() 85public async Task JsonResult_String() 102public async Task JsonResult_Uses_CustomSerializerSettings() 118public async Task JsonResult_CustomContentType()
KeyedServicesTests.cs (5)
18public async Task ExplicitSingleFromKeyedServiceAttribute() 36public async Task ExplicitMultipleFromKeyedServiceAttribute() 50public async Task ExplicitSingleFromKeyedServiceAttributeWithNullKey() 64public async Task ExplicitSingleFromKeyedServiceAttributeOptionalNotRegistered() 78public async Task ExplicitSingleFromKeyedServiceAttributeRequiredNotRegistered()
LinkGenerationTests.cs (2)
43public async Task GeneratedLinksWithActionResults_AreRelativeLinks_WhenSetOnLocationHeader( 60public async Task GeneratedLinks_AreNotPunyEncoded_WhenGeneratedOnViews()
LinkGeneratorTest.cs (18)
25public async Task GetPathByAction_CanGeneratePathToSelf() 37public async Task GetPathByAction_CanGeneratePathToSelf_PreserveAmbientValues() 49public async Task GetPathByAction_CanGeneratePathToAnotherAction_RemovesAmbientValues() 61public async Task GetPathByAction_CanGeneratePathToAnotherController_RemovesAmbientValues() 73public async Task GetPathByAction_CanGeneratePathToAnotherControllerInArea_RemovesAmbientValues() 85public async Task GetPathByAction_CanGeneratePathWithinArea() 99public async Task GetPathByAction_FailsToGenerateLinkInsideArea() 111public async Task GetPathByAction_CanGeneratePathOutsideOfArea() 123public async Task GetPathByAction_CanGeneratePathFromPath() 135public async Task GetPathByPage_FromPage_CanGeneratePathWithRelativePageName() 147public async Task GetPathByPage_CanGeneratePathToPage() 159public async Task GetPathByPage_CanGeneratePathToPage_PathTransformed() 171public async Task GetPathByPage_CanGeneratePathToPageInArea() 183public async Task GetUriByAction_CanGenerateFullUri() 195public async Task GetUriByAction_CanGenerateFullUri_WithoutHttpContext() 207public async Task GetUriByPage_CanGenerateFullUri() 219public async Task GetUriByPage_CanGenerateFullUri_WithoutHttpContext() 231public async Task GetUriByRouteValues_CanGenerateUriToRouteWithoutMvcParameters()
LinkParserTest.cs (2)
26public async Task ParsePathByEndpoint_CanParsedWithDefaultRoute() 54public async Task ParsePathByEndpoint_CanParsedWithNamedAttributeRoute()
MvcSandboxTest.cs (2)
19public async Task Home_Pages_ReturnSuccess() 29public async Task RazorPages_ReturnSuccess()
NewtonsoftJsonInputFormatterTest.cs (3)
18public virtual async Task JsonInputFormatter_SuppliedJsonDeserializationErrorMessage() 35public async Task JsonInputFormatter_ReturnsBadRequest_ForEmptyRequestBody( 52public async Task JsonInputFormatter_ReturnsBadRequest_ForEmptyRequestBody_WhenNullableIsNotSet(
NewtonsoftJsonOutputFormatterTest.cs (2)
19public async Task JsonOutputFormatter_ReturnsIndentedJson() 45public async Task JsonOutputFormatter_SetsContentLength()
NonNullableReferenceTypesTest.cs (3)
20public async Task CanUseNonNullableReferenceType_WithController_OmitData_ValidationErrors() 62public async Task CanUseNonNullableReferenceType_WithController_SubmitData_NoError() 101public async Task CanUseNonNullableReferenceType_WithController_DefaultValueParameter_NoError()
OutputFormatterTest.cs (5)
24public async Task StringOutputFormatter_ForStringValues_GetsSelectedReturnsTextPlainContentType(string actionName) 42public async Task JsonOutputFormatter_ForNonStringValue_GetsSelected(string actionName) 57public async Task NoContentFormatter_ForVoidAndTaskReturnType_DoesNotRun(string actionName) 75public async Task NoContentFormatter_ForNullValue_ByDefault_GetsSelectedAndWritesResponse(string actionName) 93public async Task
PageAsyncDisposalTest.cs (1)
30public async Task CanDisposeAsyncPage()
RazorBuildTest.cs (8)
36public async Task Rzc_LocalPageWithDifferentContent_IsUsed() 48public async Task RuntimeCompilation_WithFallbackPage_Works() 61public async Task Rzc_LocalViewWithDifferentContent_IsUsed() 73public async Task RzcViewsArePreferredToRuntimeViews() 86public async Task RazorViews_AreUpdatedOnChange() 123public async Task RazorPages_AreUpdatedOnChange() 151private async Task UpdateFile(string path, string content) 163private async Task UpdateRazorPages()
RazorPageModelTest.cs (7)
24public async Task Page_TryUpdateModelAsync_Success() 49public async Task Page_TryValidateModel_Success() 74public async Task Page_TryValidateModel_TooLong() 100public async Task PageModel_TryUpdateModelAsync_Success() 125public async Task PageModel_TryValidateModel_Success() 150public async Task PageModel_TryValidateModel_TooLong() 175private async Task AddAntiforgeryHeaders(HttpRequestMessage request)
RazorPagesNamespaceTest.cs (3)
23public async Task Page_DefaultNamespace_IfUnset() 33public async Task Page_ImportedNamespace_UsedFromViewImports() 43public async Task Page_OverrideNamespace_SetByPage()
RazorPagesTest.cs (92)
32public async Task Page_SimpleForms_RenderAntiforgery() 52public async Task Page_Handler_HandlerFromQueryString() 62public async Task Page_Handler_HandlerRouteDataChosenOverQueryString() 72public async Task Page_Handler_Handler() 82public async Task Page_Handler_Async() 104public async Task Page_Handler_AsyncHandler() 114public async Task Page_Handler_ReturnTypeImplementsIActionResult() 135public async Task PageWithoutModel_ReturnPartial() 145public async Task PageWithModel_Works() 155public async Task PageWithModel_PartialUsingPageModelWorks() 165public async Task PageWithModel_PartialWithNoModel() 175public async Task Page_Handler_AsyncReturnTypeImplementsIActionResult() 185public async Task PageModel_Handler_Handler() 195public async Task PageModel_Handler_Async() 217public async Task PageModel_Handler_AsyncHandler() 227public async Task PageModel_Handler_ReturnTypeImplementsIActionResult() 248public async Task PageModel_Handler_AsyncReturnTypeImplementsIActionResult() 258public async Task RouteData_StringValueOnIntProp_ExpectsNotFound() 271public async Task RouteData_IntProperty_IsCoerced() 287public async Task Page_SetsPath() 303public async Task TagHelper_InvalidIndexerDoesNotFail() 319public async Task NoPage_NotFound() 332public async Task PageHandlerCanReturnBadRequest() 346public async Task HelloWorld_CanGetContent() 364public async Task HelloWorldWithRoute_CanGetContent() 380public async Task HelloWorldWithHandler_CanGetContent() 396public async Task HelloWorldWithPageModelHandler_CanPostContent() 422public async Task HelloWorldWithPageModelHandler_CanGetContent(string httpMethod) 439public async Task HelloWorldWithPageModelAttributeHandler() 452public async Task PageWithoutContent() 468public async Task ViewReturnsPage() 484public async Task TempData_SetTempDataInPage_CanReadValue() 509public async Task TempData_SetTempDataInPageModel_CanReadValue() 534public async Task TempData_TempDataPropertyOnPageModel_IsPopulatedFromTempData() 559public async Task TempData_TempDataPropertyOnPageModel_PopulatesTempData() 597public async Task AuthorizePage_AddsAuthorizationForSpecificPages() 611public async Task AuthorizePage_AllowAnonymousForSpecificPages() 627public async Task ViewStart_IsDiscoveredWhenRootDirectoryIsNotSpecified() 642public async Task ViewImport_IsDiscoveredWhenRootDirectoryIsNotSpecified() 656public async Task PropertiesOnPageAreBound() 680public async Task PropertiesOnPageAreValidated() 711public async Task PropertiesOnPageModelAreBound() 735public async Task PropertiesOnPageModelAreValidated() 769public async Task PolymorphicPropertiesOnPageModelsAreBound() 795public async Task PolymorphicPropertiesOnPageModelsAreValidated() 827public async Task HandlerMethodArgumentsAndPropertiesAreModelBound() 851public async Task PagePropertiesAreNotBoundInGetRequests() 876public async Task PageProperty_WithSupportsGetTrue_OnPageWithHandler_FuzzyMatchesHeadRequest() 892public async Task PageProperty_WithSupportsGetTrue_OnPageWithNoHandler_FuzzyMatchesHeadRequest() 908public async Task PageProperty_WithSupportsGet_BoundInGet() 924public async Task PagePropertiesAreInjected() 940public async Task RedirectFromPageWorks() 954public async Task RedirectFromPageModelWorks() 968public async Task RedirectToSelfWorks() 990public async Task RedirectDoesNotIncludeHandlerByDefault() 1004public async Task RedirectToOtherHandlersWorks() 1018public async Task Controller_RedirectToPage() 1032public async Task Page_RedirectToController() 1046public async Task RedirectToSibling_Works() 1058public async Task RedirectToSibling_RedirectsToIndexPage_WithoutIndexSegment() 1070public async Task RedirectToSibling_RedirectsToSubDirectory() 1082public async Task RedirectToSibling_RedirectsToDotSlash() 1096public async Task RedirectToSibling_RedirectsToParentDirectory() 1108public async Task TagHelpers_SupportSiblingRoutes() 1124public async Task TagHelpers_SupportSubDirectoryRoutes() 1140public async Task TagHelpers_SupportsPathNavigation() 1157public async Task Page_WithSection_CanAccessModel() 1170public async Task PagesCanByRoutedViaRoute_AddedViaAddPageRoute() 1183public async Task PagesCanByRoutedToApplicationRoot_ViaAddPageRoute() 1196public async Task AuthFiltersAppliedToPageModel_AreExecuted() 1207public async Task AuthorizeAttributeIsExecutedPriorToAutoAntiforgeryFilter() 1218public async Task PageFiltersAppliedToPageModel_AreExecuted() 1231public async Task ResponseCacheAttributes_AreApplied() 1248public async Task ViewLocalizer_WorksForPagesWithoutModel() 1260public async Task ViewLocalizer_WorksForPagesWithModel() 1273public async Task BindPropertiesAttribute_CanBeAppliedToModelType() 1296public async Task BindPropertiesAttribute_CanBeAppliedToModelType_AllowsBindingOnGet() 1311public async Task BindingInfoOnPropertiesIsPreferredToBindingInfoOnType() 1337public Task InheritsOnViewImportsWorksForPagesWithoutModel() 1341public Task InheritsOnViewImportsWorksForPagesWithModel() 1344private async Task InheritsOnViewImportsWorks(string path) 1357public async Task PageHandlerFilterOnPageModelIsExecuted() 1370public async Task ResultFilterOnPageModelIsExecuted() 1380public async Task Page_CanOverrideRouteTemplate() 1390public async Task Page_Handler_BindsToDefaultValues() 1409public async Task PageResultSetAt_AuthorizationFilter_Works(string targetName) 1421public async Task PageResultSetAt_PageFilter_Works(string targetName) 1431public async Task ViewDataAwaitableInPageFilter_AfterHandlerMethod_ReturnsPageResult() 1441public async Task OptionsRequest_WithoutHandler_Returns200_WithoutExecutingPage() 1457public async Task PageWithOptionsHandler_ExecutesGetRequest() 1473public async Task PageWithOptionsHandler_ExecutesOptionsRequest() 1488private async Task AddAntiforgeryHeaders(HttpRequestMessage request)
RazorPagesViewSearchTest.cs (4)
23public async Task Page_CanFindPartial_InCurrentDirectory() 33public async Task Page_CanFindPartial_InParentDirectory() 43public async Task Page_CanFindPartial_InRootDirectory() 53public async Task Page_CanFindPartial_InViewsSharedDirectory()
RazorPagesWithBasePathTest.cs (49)
20public async Task PageOutsideBasePath_IsNotRouteable() 30public async Task IndexAtBasePath_IsRouteableAtRoot() 43public async Task IndexAtBasePath_IsRouteableViaIndex() 56public async Task IndexInSubdirectory_IsRouteableViaDirectoryName() 69public async Task PageWithRouteTemplateInSubdirectory_IsRouteable() 82public async Task PageWithRouteTemplateInSubdirectory_IsRouteable_WithOptionalParameters() 95public async Task AuthConvention_IsAppliedOnBasePathRelativePaths_ForFiles() 106public async Task AuthConvention_IsAppliedOnBasePathRelativePaths_For_Folders() 117public async Task AuthConvention_AppliedToFolders_CanByOverridenByFiltersOnModel() 127public async Task ViewStart_IsDiscoveredWhenRootDirectoryIsSpecified() 142public async Task ViewStart_IsDiscoveredForFilesOutsidePageRoot() 157public async Task ViewImport_IsDiscoveredWhenRootDirectoryIsSpecified() 171public async Task FormTagHelper_WithPage_GeneratesLinksToSelf() 184public async Task FormTagHelper_WithPageHandler_AllowsPostingToSelf() 204public async Task FormTagHelper_WithPage_AllowsPostingToAnotherPage() 219public async Task FormActionTagHelper_WithPage_AllowsPostingToAnotherPage() 238public async Task RedirectFromPage_RedirectsToPathWithoutIndexSegment() 252public async Task RedirectFromPage_ToIndex_RedirectsToPathWithoutIndexSegment() 266public async Task PageRoute_UsingDefaultPageNameToRoute() 279public async Task Pages_ReturnsFromPagesSharedDirectory() 292public async Task PagesInAreas_Work() 305public async Task PagesInAreas_CanHaveRouteTemplates() 318public async Task PagesInAreas_CanGenerateLinksToControllersAndPages() 335public async Task PagesInAreas_CanGenerateRelativeLinks() 351public async Task PagesInAreas_CanDiscoverViewsFromAreaAndSharedDirectories() 374public async Task AuthorizeFolderConvention_CanBeAppliedToAreaPages() 385public async Task AllowAnonymousToPageConvention_CanBeAppliedToAreaPages() 401public async Task PageConventions_CanBeUsedToCustomizeTheModelType() 413public async Task PageConventions_CustomizedModelCanPostToHandlers() 442public async Task PageConventions_CustomizedModelCanWorkWithModelState() 470public async Task PageConventions_CustomizedModelCanWorkWithModelState_EnforcesBindRequired() 501public async Task ValidationAttributes_OnTopLevelProperties() 512public async Task CompareValidationAttributes_OnTopLevelProperties() 523public async Task ValidationAttributes_OnHandlerParameters() 533public async Task PagesFromClassLibraries_CanBeServed() 543public async Task PagesFromClassLibraries_CanBeOverriden() 553public async Task ViewDataAttributes_SetInPageModel_AreTransferredToLayout() 573public async Task ViewDataAttributes_SetInPageWithoutModel_AreTransferredToLayout() 587public async Task ViewDataProperties_SetInPageModel_AreTransferredToViewComponents() 601public async Task Antiforgery_RequestWithoutAntiforgeryToken_Returns200ForHeadRequests() 614public async Task Antiforgery_RequestWithoutAntiforgeryToken_Returns400BadRequest() 627public async Task Antiforgery_RequestWithAntiforgeryToken_Succeeds() 641public async Task Antiforgery_IgnoreAntiforgeryTokenAppliedToModelWorks() 655public async Task ViewDataSetInViewStart_IsAvailableToPage() 671public async Task RoundTrippingFormFileInputWorks() 708public async Task AuthAttribute_AppliedOnPageWorks() 719public async Task AuthAttribute_AppliedOnPageWithModelWorks() 730public async Task FiltersAppliedToPageAndPageModelAreExecuted() 741private async Task AddAntiforgeryHeadersAsync(HttpRequestMessage request)
RazorPagesWithEndpointRoutingTest.cs (4)
19public async Task Authorize_AppliedUsingConvention_Works() 30public async Task Authorize_AppliedUsingConvention_CanByOverridenByAllowAnonymousAppliedToModel() 43public async Task Authorize_AppliedUsingAttributeOnModel_Works() 54public async Task Authorize_WithEndpointRouting_WorksForControllers()
RazorRuntimeCompilationHostingStartupTest.cs (4)
35public async Task RazorViews_CanBeServedAndUpdatedViaRuntimeCompilation() 72public async Task RazorPages_CanBeServedAndUpdatedViaRuntimeCompilation() 100private async Task UpdateFile(string path, string content) 112private async Task UpdateRazorPages()
RazorViewLocationSpecificationTest.cs (5)
25public async Task PartialLayoutPaths_SpecifiedInViewStarts_GetResolvedByViewEngine(string action) 45public async Task PartialLayoutPaths_SpecifiedInPage_GetResolvedByViewEngine(string actionName) 62public async Task NonPartialLayoutPaths_GetResolvedByViewEngine(string actionName) 80public async Task PartialsCanBeSpecifiedWithPartialPath(string actionName) 97public async Task PartialLayout_ThrowsIfRequiredSectionMissing()
ReadFromDisconnectedClientTest.cs (2)
27public async Task ActionWithAntiforgery_Returns400_WhenReadingBodyThrows() 40public async Task ActionReadingForm_ReturnsInvalidModelState_WhenReadingBodyThrows()
RemoteAttributeValidationTest.cs (3)
25public async Task RemoteAttribute_LeadsToExpectedValidationAttributes(string areaName, string pathSegment) 50public async Task RemoteAttribute_VerificationAction_GetReturnsExpectedJson( 72public async Task RemoteAttribute_VerificationAction_PostReturnsExpectedJson(
RequestFormLimitsTest.cs (6)
24public async Task RequestFormLimitCheckHappens_WithAntiforgeryValidation() 45public async Task OverridesControllerLevelLimits() 68public async Task OverrideControllerLevelLimits_UsingDefaultLimits() 94public async Task RequestSizeLimitCheckHappens_BeforeRequestFormLimits() 119public async Task RequestFormLimitsCheckHappens_AfterRequestSizeLimit() 141public async Task AntiforgeryValidationHappens_AfterRequestFormAndSizeLimitCheck()
RequestServicesEndpointRoutingTest.cs (1)
17public override async Task HasEndpointMatch()
RequestServicesTest.cs (1)
17public override async Task HasEndpointMatch()
RequestServicesTestBase.cs (4)
27public abstract Task HasEndpointMatch(); 35public async Task RequestServices(string url) 55public async Task RequestServices_TagHelper() 77public async Task RequestServices_Constraint()
RequestSizeLimitTest.cs (3)
25public async Task RequestSizeLimitCheckHappens_BeforeAntiforgeryTokenValidation() 47public async Task AntiforgeryTokenValidationHappens_AfterRequestSizeLimitCheck() 65public async Task DisableRequestSizeLimitOnAction_OverridesControllerLevelSettings()
RespectBrowserAcceptHeaderTests.cs (2)
27public async Task ReturnStringFromAction_StringOutputFormatterDoesNotWriteTheResponse() 46public async Task ReturnStringFromAction_AcceptHeaderWithTextPlain_WritesTextPlainResponse()
RoutingAcrossPipelineBranchesTest.cs (5)
25public async Task MatchesConventionalRoutesInTheirBranches() 59public async Task LinkGenerationWorksOnEachBranch() 93public async Task LinkGenerationStillWorksAcrossBranches() 123public async Task DoesNotMatchConventionalRoutesDefinedInOtherBranches() 146public async Task ConventionalAndDynamicRouteOrdersAreScopedPerBranch()
RoutingDynamicOrderTest.cs (6)
25public async Task PrefersAttributeRoutesOverDynamicControllerRoutes() 46public async Task DynamicRoutesAreMatchedInDefinitionOrderOverPrecedence() 69public async Task ConventionalRoutesDefinedEarlierWinOverDynamicControllerRoutes() 91public async Task ConventionalRoutesDefinedLaterLooseToDynamicControllerRoutes() 114public async Task DynamicPagesDefinedEarlierWinOverDynamicControllers() 135public async Task DynamicPagesDefinedLaterLooseOverDynamicControllers()
RoutingDynamicTest.cs (9)
26public async Task DynamicController_CanGet404ForMissingAction() 41public async Task DynamicPage_CanGet404ForMissingAction() 56public async Task DynamicController_CanSelectControllerInArea() 72public async Task DynamicController_CanFilterResultsBasedOnState() 86public async Task DynamicController_CanSelectControllerInArea_WithActionConstraints() 102public async Task DynamicPage_CanSelectPage() 118public async Task DynamicPage_CanFilterBasedOnState() 133public async Task AppWithDynamicRouteAndMapRazorPages_CanRouteToRazorPage() 150public async Task AppWithDynamicRouteAndMapRazorPages_CanRouteToDynamicController()
RoutingEndpointRoutingTest.cs (26)
18public async Task AttributeRoutedAction_ContainsPage_RouteMatched() 39public async Task ParameterTransformer_TokenReplacement_Found() 55public async Task ParameterTransformer_TokenReplacement_NotFound() 65public async Task AttributeRoutedAction_Parameters_Found() 81public async Task AttributeRoutedAction_Parameters_DefaultValue_Found() 97public async Task AttributeRoutedAction_ParameterTransformer_Found() 113public async Task AttributeRoutedAction_ParameterTransformer_NotFound() 123public async Task AttributeRoutedAction_ParameterTransformer_LinkToSelf() 143public async Task AttributeRoutedAction_ParameterTransformer_LinkWithAmbientController() 163public async Task AttributeRoutedAction_ParameterTransformer_LinkToAttributeRoutedController() 183public async Task AttributeRoutedAction_ParameterTransformer_LinkToConventionalController() 203public override async Task HasEndpointMatch() 218public override async Task RouteData_Routers_ConventionalRoute() 235public override async Task RouteData_Routers_AttributeRoute() 253public override async Task ConventionalRoutedController_InArea_ActionBlockedByHttpMethod() 263public async Task ConventionalRoutedAction_ParameterTransformer() 278public async Task ConventionalRoutedAction_ParameterTransformer_NotFound() 288public async Task ConventionalRoutedAction_ParameterTransformer_DefaultValue() 303public async Task ConventionalRoutedAction_ParameterTransformer_WithParam() 320public async Task ConventionalRoutedAction_ParameterTransformer_LinkToConventionalController() 339public async Task ConventionalRoutedAction_ParameterTransformer_LinkToConventionalControllerWithParam() 358public async Task ConventionalRoutedAction_ParameterTransformer_LinkToSelf() 377public async Task LinkGenerator_EndpointName_LinkToConventionalRoutedAction() 392public async Task LinkGenerator_EndpointName_LinkToConventionalRoutedAction_WithAmbientValueIgnored() 407public async Task LinkGenerator_EndpointName_LinkToAttributeRoutedAction() 422public async Task LinkGenerator_EndpointName_LinkToAttributeRoutedAction_WithAmbientValueIgnored()
RoutingFallbackTest.cs (7)
26public async Task Fallback_CanGet404ForMissingFile() 41public async Task Fallback_CanAccessKnownEndpoint() 57public async Task Fallback_CanFallbackToControllerInArea() 73public async Task Fallback_CanFallbackToControllerInArea_WithActionConstraints() 89public async Task Fallback_CanFallbackToControllerInAreaPost() 105public async Task Fallback_CanFallbackToPage() 121public async Task Fallback_DoesNotFallbackToFile_WhenContentTypeDoesNotMatchConsumesAttribute()
RoutingGroupsTest.cs (2)
27public async Task MatchesControllerGroup() 40public async Task MatchesPagesGroupAndGeneratesValidLink()
RoutingGroupsWithMetadataTest.cs (1)
25public async Task OrderedGroupMetadataForControllers()
RoutingTests.cs (4)
19public override async Task HasEndpointMatch() 35public override async Task AttributeRoutedAction_MultipleRouteAttributes_RouteAttributeTemplatesIgnoredForOverrideActions() 48public override async Task RouteData_Routers_ConventionalRoute() 70public override async Task RouteData_Routers_AttributeRoute()
RoutingTestsBase.cs (79)
29public async Task ConventionalRoutedAction_RouteUrl_AmbientValues(string requestUrl, string controller, string action, string expectedUrl) 47public async Task ConventionalRoutedAction_RouteHasNonParameterConstraint_RouteConstraintRun_Allowed() 63public async Task ConventionalRoutedAction_RouteHasNonParameterConstraint_RouteConstraintRun_Denied() 73public async Task ConventionalRoutedAction_RouteContainsPage_RouteNotMatched() 92public async Task AttributeRoutedAction_InArea_StaysInArea_ActionDoesntExist() 113public async Task ConventionalRoutedAction_InArea_StaysInArea() 133public abstract Task HasEndpointMatch(); 136public abstract Task RouteData_Routers_ConventionalRoute(); 139public abstract Task RouteData_Routers_AttributeRoute(); 146public async Task RouteData_DataTokens_FilterCanSetDataTokens() 178public async Task DataTokens_ReturnsDataTokensForRoute() 190public async Task DataTokens_ReturnsNoDataTokensForRoute() 202public async Task Page_PageRouteTransformer() 212public async Task Page_PageRouteTransformer_WithoutIndex() 222public async Task Page_PageRouteTransformer_RouteParameter() 234public async Task Page_PageRouteTransformer_PageWithConfiguredRoute() 246public virtual async Task ConventionalRoutedController_ActionIsReachable() 270public virtual async Task ConventionalRoutedController_ActionIsReachable_WithDefaults() 294public virtual async Task ConventionalRoutedController_NonActionIsNotReachable() 304public virtual async Task ConventionalRoutedController_InArea_ActionIsReachable() 329public virtual async Task ConventionalRoutedController_InArea_ActionBlockedByHttpMethod() 341public virtual async Task ConventionalRoutedController_WithOptionalSegment(string optionalSegment, string expected) 356public async Task AttributeRoutedAction_IsReachable() 384public async Task AttributeRoutedAction_AcceptRequestsWithValidMethods_InRoutesWithoutExtraTemplateSegmentsOnTheAction( 437public virtual async Task AttributeRoutedAction_RejectsRequestsWithWrongMethods_InRoutesWithoutExtraTemplateSegmentsOnTheAction( 454public virtual async Task AttributeRoutedAction_MultipleRouteAttributes_WorksWithNameAndOrder(string url) 478public virtual async Task AttributeRoutedAction_MultipleRouteAttributes_WorksWithOverrideRoutes() 504public virtual async Task AttributeRoutedAction_MultipleRouteAttributes_RouteAttributeTemplatesIgnoredForOverrideActions() 521public virtual async Task AttributeRoutedAction_MultipleRouteAttributes_CombinesWithMultipleHttpAttributes( 548public virtual async Task AttributeRoutedAction_MultipleHttpAttributesAndTokenReplacement(string url) 589public virtual async Task AttributeRoutedAction_MultipleRouteAttributes_WithMultipleHttpAttributes_RespectsConstraints( 605public async Task AttributeRoutedAction_IsNotReachableWithTraditionalRoute() 617public async Task AttributeRoutedAction_TriedBeforeConventionalRouting() 634public async Task AttributeRoutedAction_ControllerLevelRoute_WithActionParameter_IsReachable() 664public async Task AttributeRoutedAction_ControllerLevelRoute_IsReachable() 688public async Task AttributeRoutedAction_RouteAttributeOnAction_IsReachable(string method) 713public async Task AttributeRoutedAction_RouteAttributeOnActionAndController_IsReachable(string method) 733public async Task AttributeRoutedAction_RouteAttributeOnActionAndHttpGetOnDifferentAction_ReachesHttpGetAction() 756public async Task AttributeRoutedAction_ControllerLevelRoute_WithAcceptVerbs_IsReachable(string verb) 778public async Task AttributeRoutedAction_ControllerLevelRoute_WithAcceptVerbsAndRouteTemplate_IsReachable(string verb) 802public virtual async Task AttributeRoutedAction_AcceptVerbsAndRouteTemplate_IsReachable(string verb, string path) 823public async Task AttributeRoutedAction_WithCustomHttpAttributes_IsReachable() 846public async Task AttributeRoutedAction_ControllerLevelRoute_CombinedWithActionRoute_IsReachable(string verb, string action) 870public async Task AttributeRoutedAction_ActionLevelRouteWithTildeSlash_OverridesControllerLevelRoute() 891public async Task AttributeRoutedAction_OverrideActionOverridesOrderOnController() 912public async Task AttributeRoutedAction_OrderOnActionOverridesOrderOnController() 929public virtual async Task AttributeRoutedAction_LinkGeneration_OverrideActionOverridesOrderOnController() 940public virtual async Task AttributeRoutedAction_LinkGeneration_OrderOnActionOverridesOrderOnController() 953public virtual async Task AttributeRoutedAction_PreservesDefaultValue_IfRouteValueIsNull(string teamName, string expected) 965public virtual async Task AttributeRoutedAction_LinkToSelf() 985public virtual async Task AttributeRoutedAction_LinkWithAmbientController() 1005public virtual async Task AttributeRoutedAction_LinkToAttributeRoutedController() 1025public virtual async Task AttributeRoutedAction_LinkToConventionalController() 1047public virtual async Task AttributeRoutedAction_LinkWithName_WithNameInheritedFromControllerRoute( 1070public virtual async Task AttributeRoutedAction_LinkWithName_WithNameOverridenFromController() 1088public virtual async Task AttributeRoutedAction_Link_WithNonEmptyActionRouteTemplateAndNoActionRouteName() 1110public virtual async Task AttributeRoutedAction_LinkWithName_WithNonEmptyActionRouteTemplateAndActionRouteName() 1128public async Task ConventionalRoutedAction_DefaultValues_OptionalParameter_LinkToDefaultValuePath() 1149public async Task ConventionalRoutedAction_DefaultValues_OptionalParameter_LinkToFullPath() 1170public async Task ConventionalRoutedAction_DefaultValues_DefaultParameter_LinkToDefaultValuePath() 1192public async Task ConventionalRoutedAction_DefaultValues_DefaultParameterWithCatchAll_LinkToDefaultValuePath() 1214public async Task ConventionalRoutedAction_DefaultValues_DefaultParameter_LinkToFullPath() 1236public async Task ConventionalRoutedAction_DefaultValues_DefaultParameterMatches_LinkToShortenedPath() 1258public virtual async Task ConventionalRoutedAction_LinkToArea() 1279public virtual async Task ConventionalRoutedAction_InArea_ImplicitLinkToArea() 1299public virtual async Task ConventionalRoutedAction_InArea_ExplicitLeaveArea() 1320public virtual async Task AttributeRoutedAction_LinkToArea() 1341public virtual async Task AttributeRoutedAction_InArea_ImplicitLinkToArea() 1361public virtual async Task AttributeRoutedAction_InArea_ExplicitLeaveArea() 1382public virtual async Task AttributeRoutedAction_InArea_LinkToConventionalRoutedActionInArea() 1403public virtual async Task ConventionalRoutedAction_InArea_LinkToAttributeRoutedActionInArea() 1424public virtual async Task ConventionalRoutedAction_InArea_LinkToAnotherArea() 1445public virtual async Task AttributeRoutedAction_InArea_LinkToAnotherArea() 1471public async Task AttributeRouting_MixedAcceptVerbsAndRoute_Reachable(string path, string verb, string actionName) 1506public virtual async Task AttributeRouting_MixedAcceptVerbsAndRoute_Unreachable(string path, string verb) 1523public async Task AttributeRouting_RouteNameTokenReplace_Reachable(string path, string verb, string actionName) 1543public async Task RazorPage_WithLinks_GeneratesLinksCorrectly() 1561public async Task CanRunMiddlewareAfterRouting() 1573public async Task CanUseLinkGeneration_To_ConventionalActionWithPageParameter()
RoutingWithoutRazorPagesTestsBase.cs (2)
25public async Task AttributeRoutedAction_ContainsPage_RouteMatched() 46public async Task ConventionalRoutedAction_RouteContainsPage_RouteNotMatched()
SerializableErrorTests.cs (4)
35public async Task ModelStateErrors_AreSerialized(string acceptHeader) 56public async Task PostedSerializableError_IsBound(string acceptHeader) 102public async Task IsReturnedInExpectedFormat(string acceptHeader, string inputXml) 145public async Task IncorrectTopLevelElement_ReturnsExpectedError(string acceptHeader, string inputXml)
SimpleTests.cs (1)
18public async Task JsonSerializeFormatted()
SimpleWithWebApplicationBuilderTests.cs (16)
31public async Task HelloWorld() 45public async Task JsonResult_Works() 61public async Task OkObjectResult_Works() 77public async Task AcceptedObjectResult_Works() 94public async Task ActionReturningMoreThanOneResult_NotFound() 107public async Task ActionReturningMoreThanOneResult_Found() 121public async Task MvcControllerActionWorks() 136public async Task DefaultEnvironment_Is_Development() 150public async Task Configuration_Can_Be_Overridden() 177public async Task Environment_Can_Be_Overridden() 196public async Task WebRoot_Can_Be_Overriden() 217public async Task Accepts_Json_WhenBindingAComplexType() 227public async Task Rejects_NonJson_WhenBindingAComplexType() 242public async Task Accepts_NonJsonMediaType() 257public async Task FileUpload_Works_WithAntiforgeryToken() 281public async Task FileUpload_Fails_WithoutAntiforgeryToken()
StreamOutputFormatterTest.cs (1)
23public async Task StreamOutputFormatter_ReturnsAppropriateContentAndContentType(string actionName, string contentType)
SystemTextJsonInputFormatterTest.cs (3)
14public override Task JsonInputFormatter_RoundtripsRecordType() 18public override Task JsonInputFormatter_ValidationWithRecordTypes_NoValidationErrors() 22public override Task JsonInputFormatter_ValidationWithRecordTypes_ValidationErrors()
SystemTextJsonOutputFormatterTest.cs (7)
19public override Task SerializableErrorIsReturnedInExpectedFormat() => base.SerializableErrorIsReturnedInExpectedFormat(); 22public override async Task Formatting_StringValueWithUnicodeContent() 33public async Task Formatting_WithCustomEncoder() 52public override Task Formatting_DictionaryType() => base.Formatting_DictionaryType(); 55public override Task Formatting_ProblemDetails() => base.Formatting_ProblemDetails(); 58public override Task Formatting_PolymorphicModel() => base.Formatting_PolymorphicModel(); 61public async Task Formatting_PolymorphicModel_WithJsonPolymorphism()
TagHelperComponentTagHelperTest.cs (3)
22public async Task InjectsTestHeadTagHelperComponent() 42public async Task InjectsTestBodyTagHelperComponent() 62public async Task AddTestTagHelperComponent_FromController()
TagHelpersFromServicesTest.cs (1)
18public async Task TagHelpersWithConstructorInjectionAreCreatedAndActivated()
TagHelpersTest.cs (11)
39public async Task CanRenderViewsWithTagHelpers(string action) 62public Task CanRenderViewsWithTagHelpersNotReadyForHelix(string action) => CanRenderViewsWithTagHelpers(action); 65public async Task GivesCorrectCallstackForSyncronousCalls() 76public async Task CanRenderViewsWithTagHelpersAndUnboundDynamicAttributes_Encoded() 97public async Task ReRegisteringAntiforgeryTokenInsideFormTagHelper_DoesNotAddDuplicateAntiforgeryTokenFields() 173public async Task TagHelpersAreInheritedFromViewImportsPages(string action, string expected) 183public async Task DefaultInheritedTagsCanBeRemoved() 196public async Task ViewsWithModelMetadataAttributes_CanRenderForm() 214public async Task ViewsWithModelMetadataAttributes_CanRenderPostedValue() 242public async Task ViewsWithModelMetadataAttributes_CanHandleInvalidData() 275public async Task EncodersPages_ReturnExpectedContent(string actionName)
TempDataInCookiesTest.cs (3)
62public async Task RoundTripLargeData_WorksWithChunkingCookies(int size) 118public async Task Redirect_RetainsTempData_EvenIfAccessed_AndSetsAppropriateCookieValues() 170public async Task CookieTempDataProviderCookie_DoesNotSetsSecureAttributeOnCookie(bool secureRequest)
TempDataInCookiesUsingCookieConsentTest.cs (2)
27public async Task CookieTempDataProviderCookie_SetInResponse_OnGrantingConsent() 60public async Task CookieTempDataProviderCookie_NotSetInResponse_OnNoConsent()
TempDataPropertyTest.cs (4)
20public async Task TempDataPropertyAttribute_RetainsTempDataWithView() 48public async Task TempDataPropertyAttribute_RetainsTempDataWithoutView() 76public async Task TempDataPropertyAttribute_TempDataKept() 113public async Task TempDataPropertyAttribute_TempDataNotKept()
TempDataTestBase.cs (9)
15public async Task PersistsJustForNextRequest() 46public async Task ViewRendersTempData() 65public async Task Redirect_RetainsTempData_EvenIfAccessed() 96public async Task Peek_RetainsTempData() 129public async Task ValidTypes_RoundTripProperly() 161public async Task ResponseWrite_DoesNotCrashSaveTempDataFilter() 175public async Task SetInActionResultExecution_AvailableForNextRequest() 206public async Task SaveTempDataFilter_DoesNotSaveTempData_OnUnhandledException() 224public async Task SaveTempDataFilter_DoesNotSaveTempData_OnHandledExceptions()
TestingInfrastructureInheritanceTests.cs (1)
82public async Task TestingInfrastructure_GenericHost_HostDisposeAsync()
TestingInfrastructureTests.cs (11)
34public async Task TestingInfrastructure_CanOverrideServiceFromWithinTheTest() 53public async Task TestingInfrastructure_RedirectHandlerWorksWithPreserveMethod() 74public async Task TestingInfrastructure_RedirectHandlerWorksWithInvalidRequestAndContentHeaders() 97public async Task TestingInfrastructure_RedirectHandlerUsesOriginalRequestHeaders() 113public async Task TestingInfrastructure_RedirectHandler_SupportsZeroMaxRedirects() 127public async Task TestingInfrastructure_RedirectHandlerHandlesRelativeLocation() 140public async Task TestingInfrastructure_RedirectHandlerFollowsStatusCode303() 154public async Task TestingInfrastructure_PostRedirectGetWorksWithCookies() 172public async Task TestingInfrastructure_PutWithoutBodyFollowsRedirects() 183public async Task TestingInfrastructure_WorksWithGenericHost() 231public async Task TestingInfrastructure_RedirectHandlerDoesNotCopyAuthorizationHeaders()
UrlResolutionTest.cs (2)
28public async Task AppRelativeUrlsAreResolvedCorrectly() 45public async Task AppRelativeUrlsAreResolvedAndEncodedCorrectly()
VersioningEndpointRoutingTests.cs (3)
18public override async Task HasEndpointMatch() 36public override async Task VersionedApi_CanUseConstraintOrder_ToChangeSelectedAction() 55public override async Task VersionedApi_ConstraintOrder_IsRespected()
VersioningTests.cs (1)
17public override async Task HasEndpointMatch()
VersioningTestsBase.cs (25)
25public abstract Task HasEndpointMatch(); 30public async Task AttributeRoutedAction_WithVersionedRoutes_IsNotAmbiguous(string version) 52public async Task AttributeRoutedAction_WithAmbiguousVersionedRoutes_CanBeDisambiguatedUsingOrder(string version) 74public async Task VersionedApi_CanReachV1Operations_OnTheSameController_WithNoVersionSpecified() 95public async Task VersionedApi_CanReachV1Operations_OnTheSameController_WithVersionSpecified() 114public async Task VersionedApi_CanReachV1OperationsWithParameters_OnTheSameController() 133public async Task VersionedApi_CanReachV1OperationsWithParameters_OnTheSameController_WithVersionSpecified() 160public async Task VersionedApi_CanReachOtherVersionOperations_OnTheSameController(string version) 184public async Task VersionedApi_CanNotReachOtherVersionOperations_OnTheSameController_WithNoVersionSpecified() 206public async Task VersionedApi_CanReachOtherVersionOperationsWithParameters_OnTheSameController( 235public async Task VersionedApi_CanNotReachOtherVersionOperationsWithParameters_OnTheSameController_WithNoVersionSpecified(string method) 254public async Task VersionedApi_CanUseOrderToDisambiguate_OverlappingVersionRanges(string version) 276public async Task VersionedApi_OverlappingVersionRanges_FallsBackToLowerOrderAction(string version) 297public async Task VersionedApi_CanReachV1Operations_OnTheOriginalController_WithNoVersionSpecified(string method, string action) 318public async Task VersionedApi_CanReachV1Operations_OnTheOriginalController_WithVersionSpecified(string method, string action) 340public async Task VersionedApi_CanReachV1OperationsWithParameters_OnTheOriginalController(string method, string action) 361public async Task VersionedApi_CanReachV1OperationsWithParameters_OnTheOriginalController_WithVersionSpecified(string method, string action) 380public async Task VersionedApi_CanReachOtherVersionOperationsWithParameters_OnTheV2Controller() 402public async Task VersionedApi_CanHaveTwoRoutesWithVersionOnTheUrl_OnTheSameAction(string url) 423public async Task VersionedApi_CanHaveTwoRoutesWithVersionOnTheUrl_OnDifferentActions(string url, string version) 444public async Task VersionedApi_CanHaveTwoRoutesWithVersionOnTheUrl_OnDifferentActions_WithInlineConstraint(string url, string version) 468public async Task VersionedApi_CanProvideVersioningInformation_UsingPlainActionConstraint(string url, string query, string actionName) 487public virtual async Task VersionedApi_ConstraintOrder_IsRespected() 506public virtual async Task VersionedApi_CanUseConstraintOrder_ToChangeSelectedAction() 527public async Task VersionedApi_MultipleVersionsUsingAttributeRouting_OnTheSameMethod(string version)
ViewComponentFromServicesTests.cs (1)
18public async Task ViewComponentsWithConstructorInjectionAreCreatedAndActivated()
ViewEngineTests.cs (19)
64public async Task RazorView_ExecutesPageAndLayout(string actionName, string expected) 77public async Task RazorView_ExecutesPartialPagesWithCorrectContext() 96public async Task RazorView_DoesNotThrow_PartialViewWithEnumerableModel() 110public async Task RazorView_PassesViewContextBetweenViewAndLayout() 148public async Task RazorViewEngine_UsesViewExpandersForViewsAndPartials(string value, string expected) 184public async Task ViewLocationExpanders_GetIsMainPageFromContext(string action, string expected) 241public async Task RazorViewEngine_RendersPartialViews(string actionName, string expected) 253public async Task LayoutValueIsPassedBetweenNestedViewStarts() 292public async Task RazorViewEngine_UsesExpandersForLayouts(string value, string expected) 309public async Task ViewStartsCanUseDirectivesInjectedFromParentGlobals() 325public async Task ViewComponentsExecuteLayout() 342public async Task RelativePathsWorkAsExpected() 366public async Task ViewComponentsDoNotExecuteViewStarts() 379public async Task PartialDoNotExecuteViewStarts() 392public async Task PartialsRenderedViaRenderPartialAsync_CanRenderLayouts() 407public async Task PartialsRenderedViaPartialAsync_CanRenderLayouts() 427public async Task RazorView_SetsViewPathAndExecutingPagePath() 442public async Task ViewEngine_NormalizesPathsReturnedByViewLocationExpanders() 458public async Task ViewEngine_DiscoversViewsFromPagesSharedDirectory()
XmlDataContractSerializerFormattersWrappingTest.cs (12)
32public async Task CanWrite_ValueTypes(string url) 56public async Task CanWrite_NonWrappedTypes(string url) 80public async Task CanWrite_NonWrappedTypes_Empty(string url) 103public async Task CanWrite_NonWrappedTypes_NullInstance(string url) 126public async Task CanWrite_WrappedTypes(string url) 151public async Task CanWrite_WrappedTypes_Empty(string url) 174public async Task CanWrite_WrappedTypes_NullInstance(string url) 195public async Task CanWrite_IEnumerableOf_SerializableErrors() 217public async Task ProblemDetails_IsSerialized() 238public async Task ProblemDetails_WithExtensionMembers_IsSerialized() 259public async Task ValidationProblemDetails_IsSerialized() 283public async Task ValidationProblemDetails_WithExtensionMembers_IsSerialized()
XmlDataContractSerializerInputFormatterTest.cs (3)
23public async Task ThrowsOnInvalidInput_AndAddsToModelState() 39public async Task RequiredDataIsProvided_AndModelIsBound_NoValidationErrors() 67public async Task DataMissingForReferenceTypeProperties_AndModelIsBound_AndHasMixedValidationErrors()
XmlOutputFormatterTests.cs (10)
24public async Task XmlDataContractSerializerOutputFormatterIsCalled() 46public async Task XmlSerializerOutputFormatterIsCalled() 69public async Task XmlSerializerFailsAndDataContractSerializerIsCalled() 90public async Task XmlSerializerOutputFormatter_WhenDerivedClassIsReturned() 113public async Task XmlDataContractSerializerOutputFormatter_WhenDerivedClassIsReturned() 134public async Task XmlSerializerFormatter_DoesNotWriteDictionaryObjects() 152public async Task XmlSerializerFormatter_WorksForActionsReturningTaskOfDummyClass() 172public async Task XmlSerializerFormatter_WorksForActionsReturningDummyClassAsTaskOfObject() 192public async Task XmlSerializerOutputFormatter_WorksForActionsReturningTaskOfPerson() 213public async Task XmlSerializerOutputFormatter_WorksForActionsReturningPersonAsTaskOfObject()
XmlSerializerFormattersWrappingTest.cs (12)
30public async Task CanWrite_ValueTypes(string url) 51public async Task CanWrite_NonWrappedTypes(string url) 72public async Task CanWrite_NonWrappedTypes_NullInstance(string url) 92public async Task CanWrite_NonWrappedTypes_Empty(string url) 112public async Task CanWrite_WrappedTypes(string url) 134public async Task CanWrite_WrappedTypes_Empty(string url) 154public async Task CanWrite_WrappedTypes_NullInstance(string url) 172public async Task CanWrite_IEnumerableOf_SerializableErrors() 192public async Task ProblemDetails_IsSerialized() 220public async Task ProblemDetails_WithExtensionMembers_IsSerialized() 241public async Task ValidationProblemDetails_IsSerialized() 264public async Task ValidationProblemDetails_WithExtensionMembers_IsSerialized()
XmlSerializerInputFormatterTests.cs (2)
22public async Task CheckIfXmlSerializerInputFormatterIsCalled() 42public async Task ThrowsOnInvalidInput_AndAddsToModelState()
Microsoft.AspNetCore.Mvc.IntegrationTests (525)
ActionParametersIntegrationTest.cs (22)
34public async Task ActionParameter_NonSettableCollectionModel_EmptyPrefix_GetsBound() 81public async Task ActionParameter_ReadOnlyCollectionModel_EmptyPrefix_DoesNotGetBound() 127public async Task ActionParameter_SettableArrayModel_EmptyPrefix_GetsBound() 175public async Task ActionParameter_NonSettableArrayModel_EmptyPrefix_DoesNotGetBound() 211public async Task ActionParameter_NonSettableCollectionModel_WithPrefix_GetsBound() 256public async Task ActionParameter_ReadOnlyCollectionModel_WithPrefix_DoesNotGetBound() 302public async Task ActionParameter_SettableArrayModel_WithPrefix_GetsBound() 347public async Task ActionParameter_NonSettableArrayModel_WithPrefix_DoesNotGetBound() 387public async Task ActionParameter_ModelPropertyTypeWithNoParameterlessConstructor_ThrowsException() 420public async Task ActionParameter_UsesDefaultConstructorParameters() 448public async Task ActionParameter_UsingComplexTypeModelBinder_ModelPropertyTypeWithNoParameterlessConstructor_ThrowsException() 482public async Task ActionParameter_BindingToStructModel_ThrowsException() 506public async Task ActionParameter_BindingToAbstractionType_ThrowsException() 540public async Task ActionParameter_MultipleConstructorsWithDefaultValues_NoParameterlessConstructor_Throws() 573public async Task ActionParameter_RecordTypeWithMultipleConstructors_Throws() 601public async Task ActionParameter_CustomModelBinder_CanCreateModels_ForParameterlessConstructorTypes() 632public async Task ActionParameter_WithBindNever_DoesNotGetBound() 665public async Task ActionParameter_WithValidateNever_DoesNotGetValidated() 707public async Task ActionParameter_EnforcesBindRequired(int? input, bool isValid) 755public async Task ActionParameter_EnforcesDataAnnotationsAttributes( 804public async Task ActionParameter_CanRunIValidatableObject_EmptyPrefix() 848public async Task ActionParameter_CanRunIValidatableObject_WithPrefix()
ArrayModelBinderIntegrationTest.cs (10)
14public async Task ArrayModelBinder_BindsArrayOfSimpleType_WithPrefix_Success() 54public async Task ArrayModelBinder_BindsArrayOfSimpleType_WithExplicitPrefix_Success() 98public async Task ArrayModelBinder_BindsArrayOfSimpleType_EmptyPrefix_Success() 138public async Task ArrayModelBinder_BindsArrayOfSimpleType_NoData() 173public async Task ArrayModelBinder_BindsArrayOfComplexType_WithPrefix_Success() 214public async Task ArrayModelBinder_BindsArrayOfComplexType_WithExplicitPrefix_Success() 259public async Task ArrayModelBinder_BindsArrayOfComplexType_EmptyPrefix_Success() 300public async Task ArrayModelBinder_BindsArrayOfComplexType_NoData() 337public async Task ArrayModelBinder_BindsArrayOfComplexTypeHavingInitializedData_WithPrefix_Success_ReadOnly() 372public async Task ArrayModelBinder_ThrowsOn1025Items_AtTopLevel()
AuthorizeFilterIntegrationTest.cs (6)
28public async Task AuthorizeFilter_CalledTwiceWithNonDefaultProvider() 53public async Task AuthorizeFilter_CalledTwiceWithDefaultProvider() 84public async Task CombinedAuthorizeFilter_AlwaysCalledWithDefaultProvider() 123public async Task CombinedAuthorizeFilter_AlwaysCalledWithNonDefaultProvider() 204return Task.FromResult(new AuthorizationPolicy(requirements, new string[] { })); 209return Task.FromResult<AuthorizationPolicy>(null);
BinderTypeBasedModelBinderIntegrationTest.cs (19)
15public async Task BindParameter_WithModelBinderType_NullData_ReturnsNull() 49public async Task BindParameter_WithModelBinderType_NoData() 86public async Task BindParameter_WithData_WithPrefix_GetsBound() 152public async Task BinderTypeOnParameterType_WithData_EmptyPrefix_GetsBound(BindingInfo bindingInfo) 205public async Task BinderTypeOnProperty_WithData_EmptyPrefix_GetsBound(BindingInfo bindingInfo) 242public async Task BindProperty_WithData_EmptyPrefix_GetsBound() 278public async Task BindProperty_WithData_WithPrefix_GetsBound() 318public Task BindModelAsync(ModelBindingContext bindingContext) 326return Task.CompletedTask; 337return Task.CompletedTask; 343public Task BindModelAsync(ModelBindingContext bindingContext) 351return Task.CompletedTask; 362return Task.CompletedTask; 368public Task BindModelAsync(ModelBindingContext bindingContext) 380return Task.CompletedTask; 386public Task BindModelAsync(ModelBindingContext bindingContext) 392return Task.CompletedTask; 398public Task BindModelAsync(ModelBindingContext bindingContext) 404return Task.CompletedTask;
BindingSourceMetadataProviderIntegrationTest.cs (2)
16public async Task BindParameter_WithCancellationToken_BindingSourceSpecial() 70public async Task BindParameter_WithFormFile_BindingSourceFormFile()
BindPropertyIntegrationTest.cs (7)
24public async Task BindModelAsync_WithBindProperty_BindsModel_WhenRequestIsNotGet() 51public async Task BindModelAsync_WithBindProperty_SupportsGet_BindsModel_WhenRequestIsGet() 78public async Task BindModelAsync_WithBindProperty_DoesNotBindModel_WhenRequestIsGet() 103public async Task BindModelAsync_WithBindProperty_BindNever_DoesNotBindModel() 139public async Task BindModelAsync_WithBindProperty_EnforcesBindRequired(int? input, bool isValid) 183public async Task BindModelAsync_WithBindPageProperty_EnforcesBindRequired(int? input, bool isValid) 257public async Task BindModelAsync_WithBindProperty_EnforcesDataAnnotationsAttributes(
BodyValidationIntegrationTests.cs (19)
16public async Task ModelMetadataTypeAttribute_ValidBaseClass_NoModelStateErrors() 53public async Task ModelMetadataType_ValidArray_NoModelStateErrors() 93public async Task ModelMetadataTypeAttribute_InvalidPropertiesAndSubPropertiesOnBaseClass_HasModelStateErrors() 142public async Task ModelMetadataTypeAttribute_InvalidComplexTypePropertyOnBaseClass_HasModelStateErrors() 182public async Task ModelMetadataTypeAttribute_InvalidClassAttributeOnBaseClass_HasModelStateErrors() 222public async Task ModelMetadataTypeAttribute_ValidDerivedClass_NoModelStateErrors() 259public async Task ModelMetadataTypeAttribute_InvalidPropertiesOnDerivedClass_HasModelStateErrors() 303public async Task ModelMetadataTypeAttribute_InvalidClassAttributeOnBaseClassProduct_HasModelStateErrors() 355public async Task FromBodyAllowingEmptyInputAndRequiredOnProperty_EmptyBody_AddsModelStateError() 396public async Task FromBodyAllowingEmptyInputOnActionParameter_EmptyBody_BindsToNullValue() 441public async Task FromBodyAndRequiredOnValueTypeProperty_EmptyBody_AddsModelStateError() 510public async Task FromBodyAndRequiredOnInnerValueTypeProperty_NotBound_JsonFormatterSuccessful() 548public async Task FromBodyWithInvalidPropertyData_JsonFormatterAddsModelError() 602public async Task FromBodyWithEmptyBody_ModelStateIsInvalid_HasModelErrors( 649public async Task FromBodyWithEmptyBody_ModelStateIsValid_WhenAllowEmptyInput() 700public async Task FromBodyOnTopLevelProperty_RequiredOnSubProperty_AddsModelStateError(string inputText) 759public async Task FromBodyOnProperty_Succeeds_IgnoresRequiredOnValueTypeSubProperty(string inputText) 809public async Task FromBodyOnPropertyType_WithData_Succeeds(BindingInfo bindingInfo) 855public async Task FromBodyOnParameterType_WithData_Succeeds(BindingInfo bindingInfo)
ByteArrayModelBinderIntegrationTest.cs (3)
20public async Task BindProperty_WithData_GetsBound(bool fallBackScenario) 70public async Task BindParameter_NoData_DoesNotGetBound() 103public async Task BindParameter_WithData_GetsBound()
CancellationTokenModelBinderIntegrationTest.cs (3)
17public async Task BindProperty_WithData_WithPrefix_GetsBound() 57public async Task BindProperty_WithData_WithEmptyPrefix_GetsBound() 92public async Task BindParameter_WithData_GetsBound()
CollectionModelBinderIntegrationTest.cs (23)
20public async Task CollectionModelBinder_BindsListOfSimpleType_WithPrefix_Success() 64public async Task CollectionModelBinder_BindsListOfSimpleType_WithExplicitPrefix_Success(string queryString) 104public async Task CollectionModelBinder_BindsCollectionOfSimpleType_EmptyPrefix_Success(string queryString) 136public async Task CollectionModelBinder_BindsListOfSimpleType_NoData() 176public async Task CollectionModelBinder_BindsListOfComplexType_ImpliedPrefix_Success(string queryString) 212public async Task CollectionModelBinder_BindsListOfComplexType_ExplicitPrefix_Success(string queryString) 249public async Task CollectionModelBinder_BindsListOfComplexType_NoData() 287public async Task CollectionModelBinder_BindsListOfComplexType_WithRequiredProperty_WithPrefix_PartialData() 342public async Task CollectionModelBinder_BindsListOfComplexType_WithRequiredProperty_WithExplicitPrefix_PartialData() 397public async Task CollectionModelBinder_BindsCollectionOfComplexType_WithRequiredProperty_EmptyPrefix_PartialData() 448public async Task CollectionModelBinder_BindsListOfSimpleType_WithIndex_Success() 492public async Task CollectionModelBinder_BindsCollectionOfComplexType_WithRequiredProperty_WithIndex_PartialData() 543public async Task CollectionModelBinder_BindsListOfComplexType_WithRequiredProperty_NoData() 585public async Task CollectionModelBinder_UsesCustomIndexes() 643public async Task CollectionModelBinder_UsesCustomIndexes_AddsErrorsWithCorrectKeys() 689public async Task CollectionModelBinder_BindsCollectionOfComplexType_ImpliedPrefix_FindsValidationErrors( 930public async Task CollectionModelBinder_BindsParameterToExpectedType( 969public async Task CollectionModelBinder_ThrowsOn1025Items_AtTopLevel() 1003public async Task CollectionModelBinder_Binds3Items_WithIndices() 1054public async Task CollectionModelBinder_ThrowsOn4Items_WithIndices() 1093public async Task CollectionModelBinder_ThrowsOn1025Items() 1126public async Task CollectionModelBinder_CollectionOfSimpleTypes_DoesNotResultInValidationError() 1176public async Task CollectionModelBinder_CollectionOfNonNullableTypes_AppliesImplicitRequired()
ComplexRecordIntegrationTest.cs (79)
32public async Task BindsNestedPOCO_WithBodyModelBinder_WithPrefix_Success() 82public async Task BindsNestedPOCO_WithBodyModelBinder_WithEmptyPrefix_Success() 132public async Task BindsNestedPOCO_WithBodyModelBinder_WithPrefix_NoBodyData() 183public async Task BindsNestedPOCO_WithBodyModelBinder_WithPrefix_NoBodyData_ValueInQuery() 237public async Task BindsNestedPOCO_WithBodyModelBinder_WithPrefix_PartialData() 286public async Task BindsNestedPOCO_WithBodyModelBinder_WithPrefix_NoData() 334public async Task BindsNestedPOCO_WithByteArrayModelBinder_WithPrefix_Success() 387public async Task BindsNestedPOCO_WithByteArrayModelBinder_WithEmptyPrefix_Success() 439public async Task BindsNestedPOCO_WithByteArrayModelBinder_WithPrefix_NoData() 491public async Task BindsNestedPOCO_WithFormFileModelBinder_WithPrefix_Success() 544public async Task BindsNestedPOCO_WithFormFileModelBinder_WithEmptyPrefix_Success() 597public async Task BindsNestedPOCO_WithFormFileModelBinder_WithPrefix_NoBodyData() 648public async Task BindsNestedPOCO_WithFormFileModelBinder_WithPrefix_PartialData() 705public async Task BindsNestedPOCO_WithFormFileModelBinder_WithPrefix_NoData() 759public async Task BindsArrayProperty_WithPrefix_Success() 815public async Task BindsArrayProperty_EmptyPrefix_Success() 870public async Task BindsArrayProperty_NoCollectionData() 917public async Task BindsArrayProperty_NoData() 962public async Task BindsListProperty_WithPrefix_Success() 1018public async Task BindsListProperty_EmptyPrefix_Success() 1073public async Task BindsListProperty_NoCollectionData() 1120public async Task BindsListProperty_NoData() 1165public async Task BindsDictionaryProperty_WithPrefix_Success() 1221public async Task BindsDictionaryProperty_EmptyPrefix_Success() 1276public async Task BindsDictionaryProperty_NoCollectionData() 1323public async Task BindsDictionaryProperty_NoData() 1376public async Task BindsDictionaryProperty_WithIEnumerableComplexTypeValue_Success() 1483public async Task BindsDictionaryProperty_WithArrayOfComplexTypeValue_Success() 1590public async Task BindsDictionaryProperty_WithIEnumerableOfKeyValuePair_Success() 1699public async Task BindsKeyValuePairProperty_WithPrefix_Success() 1755public async Task BindsKeyValuePairProperty_EmptyPrefix_Success() 1812public async Task Foo_BindsKeyValuePairProperty_WithPrefix_Success() 1904public async Task BindsNestedPOCO_WithAllGreedyBoundProperties() 1954public async Task WithRequiredComplexProperty_NoData_GetsErrors() 1999public async Task WithBindRequired_NoData_AndCustomizedMessage_AddsGivenMessage() 2059public async Task WithNestedRequiredProperty_WithPartialData_GetsErrors() 2113public async Task WithNestedRequiredProperty_WithData_EmptyPrefix_GetsErrors() 2167public async Task WithNestedRequiredProperty_WithData_CustomPrefix_GetsErrors() 2227public async Task WithRequiredProperty_NoData_GetsErrors() 2275public async Task WithRequiredProperty_NoData_CustomPrefix_GetsErrors() 2327public async Task WithRequiredProperty_WithData_EmptyPrefix_GetsBound() 2375public async Task WithRequiredCollectionProperty_NoData_GetsErrors() 2423public async Task WithRequiredCollectionProperty_NoData_CustomPrefix_GetsErrors() 2475public async Task WithRequiredCollectionProperty_WithData_EmptyPrefix_GetsBound() 2524public async Task BindsPOCO_TypeConvertedPropertyNonConvertibleValue_GetsError() 2578public async Task BindsPOCO_TypeConvertedPropertyWithEmptyValue_Error() 2639public async Task ModelNameOnPropertyType_WithData_Succeeds(BindingInfo bindingInfo) 2688public async Task ModelNameOnParameterType_WithData_Succeeds(BindingInfo bindingInfo) 2743public async Task BindAttributeOnPropertyType_WithData_Succeeds(BindingInfo bindingInfo) 2798public async Task BindAttributeOnParameterType_WithData_Succeeds(BindingInfo bindingInfo) 2854public async Task BindsSettableProperties(string queryString) 2899public async Task BindsKeyValuePairProperty_HavingFromHeaderProperty_Success() 2967public async Task ReportsFailureToCollectionModelBinder() 3033public Task BindModelAsync(ModelBindingContext bindingContext) 3041public async Task ReportsFailureToCollectionModelBinder_CustomBinder() 3106public async Task ReportsFailureToNearTopLevel() 3157public async Task ReportsFailureToComplexTypeModelBinder() 3229public async Task ReportsFailureToViaCollection() 3302public async Task ModelBindingSystem_ThrowsOn33Binders() 3335public async Task ModelBindingSystem_BindsWith3Binders() 3370public async Task ModelBindingSystem_ThrowsOn4Binders() 3406public async Task ModelBindingSystem_ThrowsOn33Binders_WithIndirectModelTypeLoop() 3439public async Task RecordTypeWithBoundParametersAndProperties_NoData() 3482public async Task RecordTypeWithBoundParametersAndProperties_ValueForParameter() 3525public async Task RecordTypeWithBoundParametersAndProperties_ValueForProperty() 3568public async Task RecordTypeWithBoundParametersAndProperties_ValueForParameterAndProperty() 3617public async Task RecordTypeWithBoundParameters_ParameterCannotBeBound() 3665public async Task RecordTypeWithBoundParameters_ParameterAreFiltered() 3716public async Task RecordTypesWithDifferentMetadataOnParameterAndProperty_MetadataOnParameterIsUsed() 3759public async Task RecordTypesWithDifferentMetadataOnParameterAndProperty_NoDataForParameter() 3805public async Task RecordTypeWithCollectionParameter_WithData_Succeeds() 3848public async Task RecordTypeCollectionParameter_NoData() 3892public async Task RecordTypesWithReadOnlyCollectionParameter_Data_GetsBound() 3937public async Task RecordTypesWithDefaultParameterValue_Data() 3981public async Task RecordTypesWithDefaultParameterValue_NoData() 4022public async Task RecordTypesWithDefaultParameterValue_PartialData() 4065public async Task RecordTypesWithDefaultParameterValue_PartialDataWithPrefix() 4110public async Task RecordTypeWithBindRequiredParameters_Data_Success() 4155public async Task RecordTypeWithBindRequiredParameters_PartialData_BindRequiredError()
ComplexTypeIntegrationTestBase.cs (63)
69public async Task ComplexBinder_BindsNestedPOCO_WithBodyModelBinder_WithPrefix_Success() 119public async Task ComplexBinder_BindsNestedPOCO_WithBodyModelBinder_WithEmptyPrefix_Success() 169public async Task ComplexBinder_BindsNestedPOCO_WithBodyModelBinder_WithPrefix_NoBodyData() 220public async Task ComplexTypeModelBinder_BindsNestedPOCO_WithBodyModelBinder_WithPrefix_PartialData() 269public async Task ComplexTypeModelBinder_BindsNestedPOCO_WithBodyModelBinder_WithPrefix_NoData() 327public async Task ComplexBinder_BindsNestedPOCO_WithByteArrayModelBinder_WithPrefix_Success() 380public async Task ComplexBinder_BindsNestedPOCO_WithByteArrayModelBinder_WithEmptyPrefix_Success() 432public async Task ComplexBinder_BindsNestedPOCO_WithByteArrayModelBinder_WithPrefix_NoData() 494public async Task ComplexBinder_BindsNestedPOCO_WithFormFileModelBinder_WithPrefix_Success() 547public async Task ComplexBinder_BindsNestedPOCO_WithFormFileModelBinder_WithEmptyPrefix_Success() 600public async Task ComplexBinder_BindsNestedPOCO_WithFormFileModelBinder_WithPrefix_NoBodyData() 651public async Task ComplexTypeModelBinder_BindsNestedPOCO_WithFormFileModelBinder_WithPrefix_PartialData() 708public async Task ComplexTypeModelBinder_BindsNestedPOCO_WithFormFileModelBinder_WithPrefix_NoData() 767public async Task ComplexBinder_BindsArrayProperty_WithPrefix_Success() 823public async Task ComplexBinder_BindsArrayProperty_EmptyPrefix_Success() 878public async Task ComplexBinder_BindsArrayProperty_NoCollectionData() 925public async Task ComplexBinder_BindsArrayProperty_NoData() 975public async Task ComplexBinder_BindsListProperty_WithPrefix_Success() 1031public async Task ComplexBinder_BindsListProperty_EmptyPrefix_Success() 1086public async Task ComplexBinder_BindsListProperty_NoCollectionData() 1133public async Task ComplexBinder_BindsListProperty_NoData() 1183public async Task ComplexBinder_BindsDictionaryProperty_WithPrefix_Success() 1239public async Task ComplexBinder_BindsDictionaryProperty_EmptyPrefix_Success() 1294public async Task ComplexBinder_BindsDictionaryProperty_NoCollectionData() 1341public async Task ComplexBinder_BindsDictionaryProperty_NoData() 1412public async Task ComplexBinder_BindsDictionaryProperty_WithIEnumerableComplexTypeValue_Success() 1519public async Task ComplexBinder_BindsDictionaryProperty_WithArrayOfComplexTypeValue_Success() 1626public async Task ComplexBinder_BindsDictionaryProperty_WithIEnumerableOfKeyValuePair_Success() 1740public async Task ComplexBinder_BindsKeyValuePairProperty_WithPrefix_Success() 1796public async Task ComplexBinder_BindsKeyValuePairProperty_EmptyPrefix_Success() 1851public async Task ComplexBinder_BindsKeyValuePairProperty_NoCollectionData() 1900public async Task ComplexBinder_BindsKeyValuePairProperty_NoData() 1952public async Task Foo_ComplexBinder_BindsKeyValuePairProperty_WithPrefix_Success() 2051public async Task ComplexBinder_BindsNestedPOCO_WithAllGreedyBoundProperties() 2108public async Task ComplexBinder_WithRequiredComplexProperty_NoData_GetsErrors() 2153public async Task ComplexBinder_WithBindRequired_NoData_AndCustomizedMessage_AddsGivenMessage() 2221public async Task ComplexBinder_WithNestedRequiredProperty_WithPartialData_GetsErrors() 2275public async Task ComplexBinder_WithNestedRequiredProperty_WithData_EmptyPrefix_GetsErrors() 2329public async Task ComplexBinder_WithNestedRequiredProperty_WithData_CustomPrefix_GetsErrors() 2393public async Task ComplexBinder_WithRequiredProperty_NoData_GetsErrors() 2441public async Task ComplexBinder_WithRequiredProperty_NoData_CustomPrefix_GetsErrors() 2493public async Task ComplexBinder_WithRequiredProperty_WithData_EmptyPrefix_GetsBound() 2545public async Task ComplexBinder_WithRequiredCollectionProperty_NoData_GetsErrors() 2593public async Task ComplexBinder_WithRequiredCollectionProperty_NoData_CustomPrefix_GetsErrors() 2645public async Task ComplexBinder_WithRequiredCollectionProperty_WithData_EmptyPrefix_GetsBound() 2697public async Task ComplexBinder_BindsPOCO_TypeConvertedPropertyNonConvertibleValue_GetsError() 2751public async Task ComplexBinder_BindsPOCO_TypeConvertedPropertyWithEmptyValue_Error() 2818public async Task ModelNameOnPropertyType_WithData_Succeeds(BindingInfo bindingInfo) 2867public async Task ModelNameOnParameterType_WithData_Succeeds(BindingInfo bindingInfo) 2934public async Task BindAttributeOnPropertyType_WithData_Succeeds(BindingInfo bindingInfo) 2989public async Task BindAttributeOnParameterType_WithData_Succeeds(BindingInfo bindingInfo) 3047public async Task ComplexTypeModelBinder_BindsSettableProperties(string queryString) 3103public async Task ComplexBinder_BindsKeyValuePairProperty_HavingFromHeaderProperty_Success() 3175public async Task ComplexTypeModelBinder_ReportsFailureToCollectionModelBinder() 3248public Task BindModelAsync(ModelBindingContext bindingContext) 3256public async Task ComplexTypeModelBinder_ReportsFailureToCollectionModelBinder_CustomBinder() 3328public async Task ComplexTypeModelBinder_ReportsFailureToComplexTypeModelBinder_NearTopLevel() 3379public async Task ComplexTypeModelBinder_ReportsFailureToComplexTypeModelBinder() 3458public async Task ComplexTypeModelBinder_ReportsFailureToComplexTypeModelBinder_ViaCollection() 3537public async Task ModelBindingSystem_ThrowsOn33Binders() 3580public async Task ModelBindingSystem_BindsWith3Binders() 3621public async Task ModelBindingSystem_ThrowsOn4Binders() 3675public async Task ModelBindingSystem_ThrowsOn33Binders_WithIndirectModelTypeLoop()
DictionaryModelBinderIntegrationTest.cs (31)
18public async Task DictionaryModelBinder_BindsDictionaryOfSimpleType_WithPrefixAndKVP_Success() 58public async Task DictionaryModelBinder_BindsDictionaryOfSimpleType_WithPrefixAndItem_Success() 95public async Task DictionaryModelBinder_BindsDictionaryOfSimpleType_WithIndex_Success() 144public async Task DictionaryModelBinder_BindsDictionaryOfSimpleType_WithExplicitPrefix_Success( 186public async Task DictionaryModelBinder_BindsDictionaryOfSimpleType_EmptyPrefix_Success(string queryString) 328public async Task DictionaryModelBinder_Binds3EntriesOfSimpleType(Action<HttpRequest> updateRequest) 362public async Task DictionaryModelBinder_Binds3EntriesOfSimpleType_WithJQueryQueryString( 398public async Task DictionaryModelBinder_BindsDictionaryOfSimpleType_NoData() 430public async Task DictionaryModelBinder_BindsDictionaryOfSimpleType_NoData_WithDefaultValue() 503public async Task DictionaryModelBinder_BindsDictionaryOfComplexType_WithImpliedPrefix(string queryString) 540public async Task DictionaryModelBinder_BindsDictionaryOfComplexType_WithImpliedPrefixAndJQuery( 578public async Task DictionaryModelBinder_BindsDictionaryOfComplexType_WithImpliedPrefixAndJQueryFirst( 613public async Task DictionaryModelBinder_BindsDictionaryOfComplexType_WithImpliedPrefixIntegralKeysAndJQuery( 648public async Task DictionaryModelBinder_BindsDictionaryOfComplexType_WithImpliedPrefixIntegralKeysAndJQueryFirst( 696public async Task DictionaryModelBinder_BindsDictionaryOfComplexType_WithExplicitPrefix( 735public async Task DictionaryModelBinder_BindsDictionaryOfComplexType_WithExplicitPrefixAndJQuery( 779public async Task DictionaryModelBinder_BindsDictionaryOfComplexType_ImpliedPrefix_FindsValidationErrors( 820public async Task DictionaryModelBinder_BindsDictionaryOfComplexType_NoData() 852public async Task DictionaryModelBinder_BindsDictionaryOfComplexType_NoData_WithDefaultValue() 906public async Task DictionaryModelBinder_BindsDictionaryOfCollectionType_WithImpliedPrefix(string queryString) 937public async Task DictionaryModelBinder_BindsDictionaryOfCollectionType_WithImpliedPrefixAndJQuery( 971public async Task DictionaryModelBinder_BindsDictionaryOfCollectionType_WithImpliedPrefixAndJQueryFirst( 1010public async Task DictionaryModelBinder_BindsDictionaryOfCollectionType_WithImpliedPrefixIntegralKeysAndJQuery( 1049public async Task DictionaryModelBinder_BindsDictionaryOfCollectionType_WithImpliedPrefixIntegralKeysAndJQueryFirst( 1154public async Task DictionaryModelBinder_BindsParameterToExpectedType( 1197public async Task DictionaryModelBinder_ThrowsOn1025Items_AtTopLevel() 1231public async Task DictionaryModelBinder_DictionaryOfSimpleType_NullValue_DoesNotResultInRequiredValidation() 1286public async Task DictionaryModelBinder_ValuesIsNonNullableType_AppliesImplicitRequired() 1356public async Task DictionaryModelBinder_BindsDictionaryOfSimpleValueAndEnumKey_WithError() 1391public async Task DictionaryModelBinder_BindsDictionaryOfSimpleValueAndEnumValue_WithError() 1439public async Task DictionaryModelBinder_ValuesNullableTypeWithRequiredAttributes_AppliesValidation()
ExcludeBindingMetadataProviderIntegrationTest.cs (2)
15public async Task BindParameter_WithTypeProperty_IsNotBound() 61public async Task BindParameter_WithTypeProperty_IsBound()
FormCollectionModelBindingIntegrationTest.cs (3)
27public async Task BindProperty_WithData_WithEmptyPrefix_GetsBound() 74public async Task BindParameter_WithData_GetsBound() 119public async Task BindParameter_NoData_BindsWithEmptyCollection()
FormFileModelBindingIntegrationTest.cs (22)
27public async Task BindProperty_WithData_WithEmptyPrefix_GetsBound() 75public async Task BindProperty_WithOnlyFormFile_WithEmptyPrefix() 126public async Task BindProperty_WithOnlyFormFile_WithPrefix() 184public async Task BindProperty_OnFormFileInNestedSubClass_AtSecondLevel_WhenSiblingPropertyIsSpecified() 271public async Task BindProperty_OnFormFileInNestedSubClass_AtSecondLevel_RecursiveModel() 336public async Task BindProperty_OnFormFileInNestedSubClass_AtThirdLevel_RecursiveModel() 402public async Task BindProperty_OnFormFileInNestedSubClass_AtSecondLevel_WhenSiblingPropertiesAreNotSpecified() 472public async Task BindCollectionProperty_WithData_IsBound() 518public async Task BindCollectionProperty_NoData_IsNotBound() 561public async Task BindReadOnlyCollectionProperty_WithData_IsBound() 607public async Task BindParameter_WithData_GetsBound() 656public async Task BindParameter_NoData_DoesNotGetBound() 696public async Task BindProperty_WithData_WithPrefix_GetsBound() 755public async Task BindProperty_FormFileCollectionInCollection_WithPrefix() 821public async Task BindProperty_FormFileCollectionInCollection_OnlyFiles() 882public async Task BindProperty_FormFileCollectionInCollection_OutOfOrderFile() 921public async Task BindProperty_FormFileCollectionInCollection_MultipleFiles() 983public async Task BindProperty_FormFile_AsAPropertyOnNestedColection() 1037public async Task BindModelAsync_MultiDimensionalFormFile_Works() 1088public async Task BindModelAsync_MultiDimensionalFormFile_WithArrayNotation() 1133public async Task BindModelAsync_DeeplyNestedMultiDimensionalFormFile_Works() 1192public async Task BindModelAsync_DictionaryOfFormFiles()
GenericModelBinderIntegrationTest.cs (17)
21public async Task GenericModelBinder_BindsCollection_ElementTypeFromGreedyModelBinder_WithPrefix_Success() 60public async Task GenericModelBinder_BindsCollection_ElementTypeFromGreedyModelBinder_EmptyPrefix_Success() 98public async Task GenericModelBinder_BindsCollection_ElementTypeFromGreedyModelBinder_NoData() 166public Task BindModelAsync(ModelBindingContext bindingContext) 178return Task.CompletedTask; 182return Task.CompletedTask; 189public async Task GenericModelBinder_BindsCollection_ElementTypeUsesGreedyModelBinder_WithPrefix_Success() 225public async Task GenericModelBinder_BindsCollection_ElementTypeUsesGreedyBindingSource_WithPrefix_NullElement() 259public async Task GenericModelBinder_BindsArrayOfDictionary_WithPrefix_Success() 304public async Task GenericModelBinder_BindsArrayOfDictionary_EmptyPrefix_Success() 349public async Task GenericModelBinder_BindsArrayOfDictionary_NoData() 384public async Task GenericModelBinder_BindsCollectionOfKeyValuePair_WithPrefix_Success() 428public async Task GenericModelBinder_BindsCollectionOfKeyValuePair_EmptyPrefix_Success() 472public async Task GenericModelBinder_BindsCollectionOfKeyValuePair_NoData() 507public async Task GenericModelBinder_BindsDictionaryOfList_WithPrefix_Success() 556public async Task GenericModelBinder_BindsDictionaryOfList_EmptyPrefix_Success() 604public async Task GenericModelBinder_BindsDictionaryOfList_NoData()
HeaderModelBinderIntegrationTest.cs (7)
27public async Task BindPropertyFromHeader_NoData_UsesFullPathAsKeyForModelStateErrors() 67public async Task BindPropertyFromHeader_WithPrefix_GetsBound() 112public async Task BindPropertyFromHeader_WithData_WithEmptyPrefix_GetsBound() 158public async Task BindCollectionPropertyFromHeader_WithData_IsBound() 205public async Task BindReadOnlyCollectionPropertyFromHeader_WithData_IsBound() 248public async Task BindParameterFromHeader_WithData_WithPrefix_ModelGetsBound(Type modelType, string value) 306public async Task BindPropertyFromHeader_WithPrefix_GetsBound_ForSimpleTypes()
JQueryFormatModelBindingIntegrationTest.cs (2)
14public async Task BindsJQueryFormatData_FromQuery() 55public async Task BindsJQueryFormatData_FromRequestBody()
KeyValuePairModelBinderIntegrationTest.cs (13)
14public async Task KeyValuePairModelBinder_BindsKeyValuePairOfSimpleType_WithPrefix_Success() 54public async Task KeyValuePairModelBinder_SimpleTypes_WithNoKey_AddsError() 91public async Task KeyValuePairModelBinder_SimpleTypes_WithNoKey_AndCustomizedMessage_AddsGivenMessage() 141public async Task KeyValuePairModelBinder_SimpleTypes_WithNoValue_AddsError() 178public async Task KeyValuePairModelBinder_SimpleTypes_WithNoValue_AndCustomizedMessage_AddsGivenMessage() 228public async Task KeyValuePairModelBinder_BindsKeyValuePairOfSimpleType_WithExplicitPrefix_Success() 272public async Task KeyValuePairModelBinder_BindsKeyValuePairOfSimpleType_EmptyPrefix_Success() 312public async Task KeyValuePairModelBinder_BindsKeyValuePairOfSimpleType_NoData() 350public async Task KeyValuePairModelBinder_BindsKeyValuePairOfComplexType_WithPrefix_Success() 391public async Task KeyValuePairModelBinder_BindsKeyValuePairOfComplexType_WithExplicitPrefix_Success() 436public async Task KeyValuePairModelBinder_BindsKeyValuePairOfComplexType_EmptyPrefix_Success() 477public async Task KeyValuePairModelBinder_BindsKeyValuePairOfComplexType_NoData() 513public async Task KeyValuePairModelBinder_BindsKeyValuePairOfArray_Success()
ModelPrefixSelectionIntegrationTest.cs (5)
22public async Task ComplexModel_PrefixSelected_ByValueProvider() 67public async Task ComplexModel_PrefixSelected_ByValueProviderValue_WithFilteredValueProviders() 116public async Task ComplexModel_EmptyPrefixSelected_NoMatchingValueProviderValue() 155public async Task ComplexModel_EmptyPrefixSelected_NoMatchingValueProviderValue_WithFilteredValueProviders() 204public async Task ComplexModel_EmptyPrefixSelected_NoMatchingValueProviderValue_WithFilteredValueProviders_NoValues()
NullableReferenceTypeIntegrationTest.cs (4)
21public async Task BindProperty_WithNonNullableReferenceType_NoData_ValidationError() 69public async Task BindProperty_WithNullableReferenceType_NoData_NoValidationError() 108public async Task BindProperty_WithNonNullableReferenceType_NoData_ValidationError_CustomMessage() 155public async Task BindParameter_WithNonNullableReferenceType_NoData_ValidationError()
ServicesModelBinderIntegrationTest.cs (11)
14public async Task BindParameterFromService_WithData_GetsBound() 52public async Task BindParameterFromService_NoPrefix_GetsBound() 88public async Task BindEnumerableParameterFromService_NoPrefix_GetsBound() 124public async Task BindEnumerableParameterFromService_NoService_GetsBound() 160public async Task BindParameterFromService_NoService_Throws() 196public async Task BindNullableParameterFromService_WithData_GetBounds() 229public async Task BindNullableParameterFromService_NoService_BindsToNull() 265public async Task BindParameterWithDefaultValueFromService_WithData_GetBounds() 298public async Task BindParameterWithDefaultValueFromService_NoService_BindsToDefaultValue() 346public async Task FromServicesOnPropertyType_WithData_Succeeds(BindingInfo bindingInfo) 383public async Task FromServicesOnParameterType_WithData_Succeeds(BindingInfo bindingInfo)
SimpleTypeModelBinderIntegrationTest.cs (17)
19public async Task BindProperty_WithData_WithPrefix_GetsBound() 67public async Task BindProperty_WithData_WithEmptyPrefix_GetsBound() 111public async Task BindParameter_WithData_GetsBound() 155public async Task BindParameter_WithEmptyQueryStringKey_DoesNotGetBound() 189public async Task BindDecimalParameter_WithData_GetsBound() 233public async Task BindDateTimeParameter_WithData_GetsBound() 277public async Task BindDateTimeParameter_WithDataFromBody_GetsBound() 317public async Task BindParameter_WithMultipleValues_GetsBoundToFirstValue() 361public async Task BindParameter_NonConvertibleValue_GetsError() 410public async Task BindParameter_NonConvertibleValue_GetsCustomErrorMessage() 472public async Task BindParameter_WithEmptyData_DoesNotBind(Type parameterType) 514public async Task BindParameter_WithEmptyData_AndPerTypeMessage_AddsGivenMessage(Type parameterType) 569public async Task BindParameter_WithEmptyData_BindsReferenceAndNullableObjects(Type parameterType) 607public async Task BindParameter_NoData_Fails() 661public async Task BindParameter_FromFormData_BindsCorrectly(Dictionary<string, StringValues> personStore) 706public async Task BindParameter_PrefersTypeConverter_OverTryParse() 750public async Task BindParameter_BindsUsingTryParse()
SuccessfulModelBinder.cs (2)
13public Task BindModelAsync(ModelBindingContext bindingContext) 18return Task.CompletedTask;
TryUpdateModelIntegrationTest.cs (29)
21public async Task TryUpdateModel_ExistingModel_EmptyPrefix_OverwritesBoundValues() 61public async Task TryUpdateModel_ExistingModel_EmptyPrefix_GetsBound() 102public async Task TryUpdateModel_TopLevelCollection_EmptyPrefix_BindsAfterClearing() 160public async Task TryUpdateModel_NestedPoco_EmptyPrefix_DoesNotTrounceUnboundValues() 210public async Task TryUpdateModel_SettableCollectionModel_EmptyPrefix_CreatesCollection() 246public async Task TryUpdateModel_SettableCollectionModel_EmptyPrefix_MaintainsCollectionIfNonNull() 297public async Task TryUpdateModel_NonSettableCollectionModel_EmptyPrefix_GetsBound() 353public async Task TryUpdateModel_ReadOnlyCollectionModel_EmptyPrefix_DoesNotGetBound() 382public async Task TryUpdateModel_ReadOnlyCollectionModel_WithPrefix_DoesNotGetBound() 416public async Task TryUpdateModel_SettableArrayModel_EmptyPrefix_CreatesArray() 452public async Task TryUpdateModel_SettableArrayModel_EmptyPrefix_OverwritesArray() 505public async Task TryUpdateModel_NonSettableArrayModel_EmptyPrefix_IsNotBound() 546public async Task TryUpdateModel_NonSettableIEnumerableModel_EmptyPrefix_IsNotBound() 593public async Task TryUpdateModel_NonSettableICollectionModel_EmptyPrefix_IsNotBound() 628public async Task TryUpdateModel_ExistingModel_WithPrefix_ValuesGetOverwritten() 668public async Task TryUpdateModel_ExistingModel_WithPrefix_GetsBound() 702public async Task TryUpdateModel_TopLevelCollection_WithPrefix_BindsAfterClearing() 760public async Task TryUpdateModel_NestedPoco_WithPrefix_DoesNotTrounceUnboundValues() 805public async Task TryUpdateModel_SettableCollectionModel_WithPrefix_CreatesCollection() 841public async Task TryUpdateModel_SettableCollectionModel_WithPrefix_MaintainsCollectionIfNonNull() 882public async Task TryUpdateModel_NonSettableCollectionModel_WithPrefix_GetsBound() 933public async Task TryUpdateModel_SettableArrayModel_WithPrefix_CreatesArray() 969public async Task TryUpdateModel_SettableArrayModel_WithPrefix_OverwritesArray() 1017public async Task TryUpdateModel_NonSettableArrayModel_WithPrefix_GetsBound() 1046public async Task TryUpdateModelAsync_TopLevelFormFileCollection_IsBound() 1098public async Task TryUpdateModel_ExistingModelWithNoParameterlessConstructor_OverwritesBoundValues() 1143public async Task TryUpdateModel_RecordTypeModel_Throws() 1170public async Task TryUpdateModel_RecordTypeProperty() 1216public async Task TryUpdateModel_RecordTypePropertyIsOverwritten()
ValidationIntegrationTests.cs (52)
84public async Task ValidationIsTriggered_OnFromBodyModels(List<ParameterDescriptor> parameters) 123public async Task MultipleActionParameter_ValidModelState(List<ParameterDescriptor> parameters) 164public async Task Validation_RequiredAttribute_OnSimpleTypeProperty_WithData() 201public async Task Validation_RequiredAttribute_OnSimpleTypeProperty_NoData() 252public async Task Validation_RequiredAttribute_OnPOCOProperty_WithData() 290public async Task Validation_RequiredAttribute_OnPOCOProperty_NoData() 343public async Task Validation_RequiredAttribute_OnNestedSimpleTypeProperty_WithData() 381public async Task Validation_RequiredAttribute_OnNestedSimpleTypeProperty_NoDataForRequiredProperty() 435public async Task Validation_RequiredAttribute_OnCollectionProperty_WithData() 473public async Task Validation_RequiredAttribute_OnCollectionProperty_NoData() 522public async Task Validation_RequiredAttribute_OnPOCOPropertyOfBoundElement_WithData() 559public async Task Validation_RequiredAttribute_OnPOCOPropertyOfBoundElement_NoDataForRequiredProperty() 623public async Task Validation_RequiredAttribute_OnActionParameter_WithDefaultValue() 647public async Task Validation_RequiredAttribute_OnActionParameter_Invalid() 680public async Task Validation_StringLengthAttribute_OnPropertyOfPOCO_Valid() 717public async Task Validation_StringLengthAttribute_OnPropertyOfPOCO_Invalid() 768public async Task Validation_StringLengthAttribute_OnPropertyOfNestedPOCO_Valid() 805public async Task Validation_StringLengthAttribute_OnPropertyOfNestedPOCO_Invalid() 845public async Task Validation_StringLengthAttribute_OnPropertyOfNestedPOCO_NoData() 903public async Task Validation_CustomAttribute_OnPOCOProperty_Valid() 940public async Task Validation_CustomAttribute_OnPOCOProperty_Invalid() 1010public async Task Validation_CustomAttribute_OnCollectionElement_Valid() 1047public async Task Validation_CustomAttribute_OnCollectionElement_Invalid() 1098public async Task Validation_StringLengthAttribute_OnPropertyOfCollectionElement_Valid() 1135public async Task Validation_StringLengthAttribute_OnPropertyOfCollectionElement_Invalid() 1175public async Task Validation_StringLengthAttribute_OnPropertyOfCollectionElement_NoData() 1215public async Task Validation_FormatException_ShowsInvalidValueMessage_OnSimpleTypeProperty() 1255public async Task Validation_OverflowException_ShowsInvalidValueMessage_OnSimpleTypeProperty() 1347public async Task IValidatableObject_IsValidated() 1396public async Task CustomValidationAttribute_IsValidated() 1435public async Task ValidateNeverProperty_IsSkipped() 1468public async Task ValidateNeverProperty_IsSkippedWithoutAccessingModel() 1499public async Task PropertyWithinValidateNeverType_IsSkipped(string propertyName) 1568public async Task PropertyToSometimesSkip_IsSkipped_IfControlIsNull() 1605public async Task PropertyToSometimesSkip_IsValidated_IfControlIsNotNull() 1658public async Task PropertyToSometimesSkip_IsNotValidated_IfNoValidationAttributesExistButPropertyValidationFilterExists() 1722public async Task TypeBasedExclusion_ForBodyAndNonBodyBoundModels() 1772public async Task FromBody_JToken_ExcludedFromValidation() 1828public async Task CancellationToken_WithEmptyPrefix_DoesNotSuppressUnrelatedErrors() 1864public async Task FromBody_WithEmptyPrefix_DoesNotSuppressUnrelatedErrors_Valid() 1910public async Task FromBody_WithEmptyPrefix_DoesNotSuppressUnrelatedErrors_Invalid() 1964public async Task Validation_NoAttributeInGraphOfObjects_WithDefaultValidatorProviders() 2017public async Task Validation_ListOfType_NoValidatorOnParameter() 2069public async Task Validation_ListOfType_ValidatorOnParameter() 2139public async Task Validation_CollectionOfType_ValidatorOnElement() 2208public async Task Validation_DictionaryType_NoValidators() 2255public async Task Validation_DictionaryType_ValueHasValidators() 2306public async Task Validation_TopLevelProperty_NoValidation() 2360public async Task Validation_TopLevelProperty_ValidationOnProperty() 2418public async Task Validation_InfinitelyRecursiveType_NoValidators() 2463public async Task Validation_InifnitelyRecursiveModel_ValidationOnTopLevelParameter() 2508public async Task Validation_ModelWithNonNullableReferenceTypes_DoesNotValidateNonNullablePropertiesOnFrameworkTypes()
ValidationWithRecordIntegrationTests.cs (52)
76public async Task ValidationIsTriggered_OnFromBodyModels(List<ParameterDescriptor> parameters) 115public async Task MultipleActionParameter_ValidModelState(List<ParameterDescriptor> parameters) 152public async Task Validation_RequiredAttribute_OnSimpleTypeProperty_WithData() 189public async Task Validation_RequiredAttribute_OnSimpleTypeProperty_NoData() 233public async Task Validation_RequiredAttribute_OnPOCOProperty_WithData() 271public async Task Validation_RequiredAttribute_OnPOCOProperty_NoData() 315public async Task Validation_RequiredAttribute_OnNestedSimpleTypeProperty_WithData() 353public async Task Validation_RequiredAttribute_OnNestedSimpleTypeProperty_NoDataForRequiredProperty() 400public async Task Validation_RequiredAttribute_OnCollectionProperty_WithData() 438public async Task Validation_RequiredAttribute_OnCollectionProperty_NoData() 481public async Task Validation_RequiredAttribute_OnPOCOPropertyOfBoundElement_WithData() 518public async Task Validation_RequiredAttribute_OnPOCOPropertyOfBoundElement_NoDataForRequiredProperty() 563public async Task Validation_StringLengthAttribute_OnPropertyOfPOCO_Valid() 600public async Task Validation_StringLengthAttribute_OnPropertyOfPOCO_Invalid() 644public async Task Validation_StringLengthAttribute_OnPropertyOfNestedPOCO_Valid() 681public async Task Validation_StringLengthAttribute_OnPropertyOfNestedPOCO_Invalid() 721public async Task Validation_StringLengthAttribute_OnPropertyOfNestedPOCO_NoData() 772public async Task Validation_CustomAttribute_OnPOCOProperty_Valid() 809public async Task Validation_CustomAttribute_OnPOCOProperty_Invalid() 872public async Task Validation_CustomAttribute_OnCollectionElement_Valid() 909public async Task Validation_CustomAttribute_OnCollectionElement_Invalid() 956public async Task Validation_StringLengthAttribute_OnPropertyOfCollectionElement_Valid() 993public async Task Validation_StringLengthAttribute_OnPropertyOfCollectionElement_Invalid() 1033public async Task Validation_StringLengthAttribute_OnPropertyOfCollectionElement_NoData() 1067public async Task Validation_FormatException_ShowsInvalidValueMessage_OnSimpleTypeProperty() 1107public async Task Validation_OverflowException_ShowsInvalidValueMessage_OnSimpleTypeProperty() 1191public async Task IValidatableObject_IsValidated() 1240public async Task CustomValidationAttribute_IsValidated() 1279public async Task ValidateNeverProperty_IsSkipped() 1312public async Task ValidateNeverProperty_IsSkippedWithoutAccessingModel() 1376public async Task PropertyToSometimesSkip_IsSkipped_IfControlIsNull() 1413public async Task PropertyToSometimesSkip_IsValidated_IfControlIsNotNull() 1464public async Task PropertyToSometimesSkip_IsNotValidated_IfNoValidationAttributesExistButPropertyValidationFilterExists() 1525public async Task TypeBasedExclusion_ForBodyAndNonBodyBoundModels() 1575public async Task FromBody_JToken_ExcludedFromValidation() 1631public async Task CancellationToken_WithEmptyPrefix_DoesNotSuppressUnrelatedErrors() 1667public async Task FromBody_WithEmptyPrefix_DoesNotSuppressUnrelatedErrors_Valid() 1713public async Task FromBody_WithEmptyPrefix_DoesNotSuppressUnrelatedErrors_Invalid() 1763public async Task Validation_NoAttributeInGraphOfObjects_WithDefaultValidatorProviders() 1808public async Task Validation_ListOfType_NoValidatorOnParameter() 1860public async Task Validation_ListOfType_ValidatorOnParameter() 1930public async Task Validation_CollectionOfType_ValidatorOnElement() 1999public async Task Validation_DictionaryType_NoValidators() 2046public async Task Validation_DictionaryType_ValueHasValidators() 2097public async Task Validation_TopLevelProperty_NoValidation() 2148public async Task Validation_TopLevelProperty_ValidationOnProperty() 2206public async Task Validation_InfinitelyRecursiveType_NoValidators() 2249public async Task Validation_InifnitelyRecursiveModel_ValidationOnTopLevelParameter() 2302public async Task Validation_ValidatorsDefinedOnRecordTypeProperties() 2341public async Task Validation_ValidatorsDefinedOnRecordTypePropertiesAndParameters() 2380public async Task Validation_ValidatorsDefinedOnMixOfRecordTypePropertiesAndParameters() 2419public async Task Validation_ValidatorsOnParametersAndProperties()
Microsoft.AspNetCore.Mvc.NewtonsoftJson (3)
NewtonsoftJsonOutputFormatter.cs (1)
134public override async Task WriteResponseBodyAsync(OutputFormatterWriteContext context, Encoding selectedEncoding)
NewtonsoftJsonResultExecutor.cs (2)
67/// <returns>A <see cref="Task"/> which will complete when writing has completed.</returns> 68public async Task ExecuteAsync(ActionContext context, JsonResult result)
Microsoft.AspNetCore.Mvc.NewtonsoftJson.Test (116)
JsonResultTest.cs (1)
20public async Task ExecuteAsync_WritesJsonContent()
NewtonsoftJsonInputFormatterTest.cs (19)
26public async Task Constructor_BuffersRequestBody_UsingDefaultOptions() 58public async Task Constructor_SuppressInputFormatterBuffering_UsingMvcOptions_DoesNotBufferRequestBody() 94public async Task Version_2_1_Constructor_SuppressInputFormatterBufferingSetToTrue_UsingMutatedOptions() 152public async Task CustomSerializerSettingsObject_TakesEffect() 198public override Task JsonFormatter_EscapedKeys() 204public override Task JsonFormatter_EscapedKeys_Bracket() 210public override Task JsonFormatter_EscapedKeys_SingleQuote() 218public Task ReadAsync_WithInputThatDeserializesToNull_SetsModelOnlyIfAllowingEmptyInput_WhenValueIsWhitespaceString(string content, bool treatEmptyInputAsDefaultValue, bool expectedIsModelSet) 229public async Task ReadAsync_WithAllowInputFormatterExceptionMessages_RegistersJsonInputExceptionsAsInputFormatterException( 255public async Task ReadAsync_AllowMultipleErrors() 288public async Task ReadAsync_DoNotAllowInputFormatterExceptionMessages_DoesNotWrapJsonInputExceptions() 311public async Task ReadAsync_AllowInputFormatterExceptionMessages_DoesNotWrapJsonInputExceptions() 344public async Task ReadAsync_DoesNotRethrowFormatExceptions() 375public async Task ReadAsync_DoesNotRethrowOverflowExceptions() 406public async Task ReadAsync_HasCorrectModelErrorWithNestedType() 437public async Task ReadAsync_RegistersFileStreamForDisposal() 483public async Task ReadAsync_WithReadJsonWithRequestCulture_DeserializesUsingRequestCulture( 526public async Task ReadAsync_AllowUserCodeToHandleDeserializationErrors() 624public override void OnCompleted(Func<object, Task> callback, object state)
NewtonsoftJsonOutputFormatterTest.cs (19)
48public async Task MvcJsonOptionsAreUsedToSetBufferThresholdFromServices() 89public async Task MvcJsonOptionsAreUsedToSetBufferThreshold() 121public async Task ChangesTo_SerializerSettings_AffectSerialization() 149public async Task ChangesTo_SerializerSettings_AfterSerialization_DoNotAffectSerialization() 195public async Task NamingStrategy_AffectsSerialization(NamingStrategy strategy, string expected) 238public async Task NamingStrategy_DoesNotAffectDictionarySerialization(NamingStrategy strategy) 277public async Task NamingStrategy_DoesNotAffectSerialization_WithJsonProperty(NamingStrategy strategy) 313public async Task NamingStrategy_DoesNotAffectSerialization_WithJsonObject(NamingStrategy strategy) 347public async Task WriteToStreamAsync_RoundTripsJToken() 371public async Task WriteToStreamAsync_LargePayload_DoesNotPerformSynchronousWrites() 378.Returns(Task.CompletedTask); 379stream.Setup(v => v.FlushAsync(It.IsAny<CancellationToken>())).Returns(Task.CompletedTask); 401public async Task SerializingWithPreserveReferenceHandling() 435public async Task WriteResponseBodyAsync_AsyncEnumerableConnectionCloses() 467await Task.Yield(); 480public async Task WriteResponseBodyAsync_AsyncEnumerableThrowsCustomOCE() 507await Task.Yield(); 514public async Task WriteResponseBodyAsync_AsyncEnumerableThrowsConnectionAbortedOCE() 545await Task.Yield();
NewtonsoftJsonPatchInputFormatterTest.cs (6)
24public async Task Constructor_BuffersRequestBody_ByDefault() 57public async Task Constructor_SuppressInputFormatterBuffering_DoesNotBufferRequestBody() 104public async Task JsonPatchInputFormatter_ReadsOneOperation_Successfully() 127public async Task JsonPatchInputFormatter_ReadsMultipleOperations_Successfully() 199public async Task JsonPatchInputFormatter_ReturnsModelStateErrors_InvalidModelType() 279public override void OnCompleted(Func<object, Task> callback, object state)
NewtonsoftJsonResultExecutorTest.cs (2)
32public async Task ExecuteAsync_AsyncEnumerableReceivesCancellationToken() 56await Task.Yield();
src\Mvc\Mvc.Core\test\Formatters\JsonInputFormatterTestBase.cs (26)
64public async Task JsonFormatterReadsIntValue() 85public async Task JsonFormatterReadsStringValue() 106public async Task JsonFormatterReadsNonUtf8Content() 128public virtual async Task JsonFormatter_EscapedKeys() 156public virtual async Task JsonFormatter_EscapedKeys_Bracket() 183public virtual async Task JsonFormatter_EscapedKeys_SingleQuote() 211public virtual async Task JsonFormatterReadsDateTimeValue() 233public async Task JsonFormatterReadsComplexTypes() 255public async Task ReadAsync_ReadsValidArray() 276public virtual Task ReadAsync_ReadsValidArray_AsListOfT() => ReadAsync_ReadsValidArray_AsList(typeof(List<int>)); 279public virtual Task ReadAsync_ReadsValidArray_AsIListOfT() => ReadAsync_ReadsValidArray_AsList(typeof(IList<int>)); 282public virtual Task ReadAsync_ReadsValidArray_AsCollectionOfT() => ReadAsync_ReadsValidArray_AsList(typeof(ICollection<int>)); 285public virtual Task ReadAsync_ReadsValidArray_AsEnumerableOfT() => ReadAsync_ReadsValidArray_AsList(typeof(IEnumerable<int>)); 287protected async Task ReadAsync_ReadsValidArray_AsList(Type requestedType) 308public virtual async Task ReadAsync_ArrayOfObjects_HasCorrectKey() 335public virtual async Task ReadAsync_AddsModelValidationErrorsToModelState() 361public virtual async Task ReadAsync_InvalidArray_AddsOverflowErrorsToModelState() 387public virtual async Task ReadAsync_InvalidComplexArray_AddsOverflowErrorsToModelState() 414public virtual async Task ReadAsync_UsesTryAddModelValidationErrorsToModelState() 442public async Task ReadAsync_WithInputThatDeserializesToNull_SetsModelOnlyIfAllowingEmptyInput( 468public async Task ReadAsync_ComplexPoco() 495public virtual async Task ReadAsync_NestedParseError() 519public virtual async Task ReadAsync_RequiredAttribute() 538public async Task ReadAsync_DoesNotDisposeBufferedReadStream() 561public async Task ReadAsync_WithEnableBufferingWorks() 585public async Task ReadAsync_WithEnableBufferingWorks_WithInputStreamAtOffset()
src\Mvc\Mvc.Core\test\Formatters\JsonOutputFormatterTestBase.cs (3)
77public async Task WriteToStreamAsync_UsesCorrectCharacterEncoding( 110public async Task WriteResponseBodyAsync_Encodes() 141public async Task ErrorDuringSerialization_DoesNotCloseTheBrackets()
src\Mvc\Mvc.Core\test\Infrastructure\AsyncEnumerableReaderTest.cs (13)
30public async Task TryGetReader_ReturnsReaderForIAsyncEnumerable() 48public async Task TryGetReader_ReturnsReaderForIAsyncEnumerableOfValueType() 100public async Task CachedDelegate_CanReadEnumerableInstanceMultipleTimes() 118public async Task CachedDelegate_CanReadEnumerableInstanceMultipleTimes_ThatProduceDifferentResults() 152public async Task Reader_ReadsIAsyncEnumerable_ImplementingMultipleAsyncEnumerableInterfaces() 171public async Task Reader_ThrowsIfBufferLimitIsReached() 190public async Task Reader_ThrowsIfIAsyncEnumerableThrows() 203public async Task Reader_PassesCancellationTokenToIAsyncEnumerable() 222await Task.Yield(); 229await Task.Yield(); 238await Task.Yield(); 245await Task.Yield(); 265await Task.Yield();
src\Mvc\Mvc.Core\test\Infrastructure\JsonResultExecutorTestBase.cs (27)
23public async Task ExecuteAsync_UsesDefaultContentType_IfNoContentTypeSpecified() 43public async Task ExecuteAsync_NullEncoding_DoesNotSetCharsetOnContentType() 64public async Task ExecuteAsync_UsesEncodingSpecifiedInContentType() 88public async Task ExecuteAsync_UsesEncodingSpecifiedInResponseContentType() 108public async Task ExecuteAsync_SetsContentTypeAndEncoding() 132public async Task ExecuteAsync_NoResultContentTypeSet_UsesResponseContentType_AndSuppliedEncoding() 156public async Task ExecuteAsync_NoResultContentTypeSet_UsesDefaultEncoding_DoesNotSetCharset( 179public async Task ExecuteAsync_UsesPassedInSerializerSettings() 205public async Task ExecuteAsync_ErrorDuringSerialization_DoesNotWriteContent() 233public async Task ExecuteAsync_NonNullResult_LogsResultType() 251public async Task ExecuteAsync_NullResult_LogsNull() 269public async Task ExecuteAsync_LargePayload_DoesNotPerformSynchronousWrites() 276.Returns(Task.CompletedTask) 294public async Task ExecuteAsync_ThrowsIfSerializerSettingIsNotTheCorrectType() 310public async Task ExecuteAsync_WithNullValue() 328public async Task ExecuteAsync_SerializesAsyncEnumerables() 346public async Task ExecuteAsync_SerializesAsyncEnumerablesOfPrimtives() 364public async Task ExecuteAsync_AsyncEnumerableConnectionCloses() 384await Task.Yield(); 395public async Task ExecuteAsyncWithDifferentContentType_AsyncEnumerableConnectionCloses() 418await Task.Yield(); 429public async Task ExecuteAsync_AsyncEnumerableThrowsCustomOCE_SurfacesError() 442await Task.Yield(); 449public async Task ExecuteAsync_AsyncEnumerableThrowsConnectionAbortedOCE_DoesNotSurfaceError() 467await Task.Yield(); 521await Task.Yield(); 528await Task.Yield();
Microsoft.AspNetCore.Mvc.Razor (14)
Compilation\DefaultViewCompiler.cs (2)
64compiledViews.TryAdd(compiledView.RelativePath, Task.FromResult(compiledView)); 111return Task.FromResult(new CompiledViewDescriptor
HelperResult.cs (3)
14private readonly Func<TextWriter, Task> _asyncAction; 23public HelperResult(Func<TextWriter, Task> asyncAction) 33public Func<TextWriter, Task> WriteAction => _asyncAction;
IRazorPage.cs (1)
58Task ExecuteAsync();
RazorPageBase.cs (2)
173public abstract Task ExecuteAsync(); 371protected void DefineSection(string name, Func<object?, Task> section)
RazorView.cs (4)
76public virtual async Task RenderAsync(ViewContext context) 138private async Task RenderPageCoreAsync(IRazorPage page, ViewContext context) 157private async Task RenderViewStartsAsync(ViewContext context) 194private async Task RenderLayoutAsync(
RenderAsyncDelegate.cs (1)
10public delegate Task RenderAsyncDelegate();
TagHelpers\TagHelperComponentTagHelper.cs (1)
78public override async Task ProcessAsync(TagHelperContext context, TagHelperOutput output)
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (3)
PageLoaderMatcherPolicy.cs (3)
55public Task ApplyAsync(HttpContext httpContext, CandidateSet candidates) 92return Task.CompletedTask; 95private static async Task ApplyAsyncAwaited(PageLoader pageLoader, CandidateSet candidates, Task<CompiledPageActionDescriptor> actionDescriptorTask, int index)
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.Test (36)
PageLoaderMatcherPolicyTest.cs (8)
16public async Task ApplyAsync_UpdatesCandidateSet() 24var loader = Mock.Of<PageLoader>(p => p.LoadAsync(It.IsAny<PageActionDescriptor>(), It.IsAny<EndpointMetadataCollection>()) == Task.FromResult(compiled)); 35public async Task ApplyAsync_ReadsLoaderFromRequestServices() 44.Returns(Task.FromResult(compiled)) 61public async Task ApplyAsync_UpdatesCandidateSet_IfLoaderReturnsAsynchronously() 70var loadTask = Task.Run(async () => 79var applyTask = policy.ApplyAsync(new DefaultHttpContext(), candidateSet); 91(context) => Task.CompletedTask,
RuntimeViewCompilerTest.cs (28)
22public async Task CompileAsync_ReturnsResultWithNullAttribute_IfFileIsNotFoundInFileSystem() 41public async Task CompileAsync_ReturnsResultWithExpirationToken() 61public async Task CompileAsync_AddsChangeTokensForViewStartsIfFileExists() 87public async Task CompileAsync_NormalizesPathSeparatorForPaths(string relativePath) 107public async Task CompileAsync_InvalidatesCache_IfChangeTokenExpires() 135public async Task CompileAsync_ReturnsNewResultIfFileWasModified() 161public async Task CompileAsync_ReturnsNewResult_IfAncestorViewImportsWereModified() 187public async Task CompileAsync_ReturnsPrecompiledViews() 213public async Task CompileAsync_PerformsCaseInsensitiveLookupsForPrecompiledViews(string lookupPath) 233public async Task CompileAsync_PerformsCaseInsensitiveLookupsForPrecompiledViews_WithNonNormalizedPaths() 253public async Task CompileAsync_PrecompiledViewWithoutChecksumForMainSource_DoesNotSupportRecompilation() 291public async Task CompileAsync_PrecompiledViewWithoutAnyChecksum_DoesNotSupportRecompilation() 326public async Task CompileAsync_PrecompiledViewWithChecksum_UsesPrecompiledViewWhenChecksumIsMatch() 358public async Task CompileAsync_PrecompiledViewWithChecksum_CanRejectWhenChecksumFails() 388public async Task CompileAsync_PrecompiledViewWithChecksum_AddsExpirationTokensForFilesInChecksumAttributes() 417public async Task CompileAsync_PrecompiledViewWithChecksum_CanRecompile() 455public async Task CompileAsync_PrecompiledViewWithChecksum_DoesNotRecompiledWithoutContentChange() 489public async Task CompileAsync_PrecompiledViewWithChecksum_CanReusePrecompiledViewIfContentChangesToMatch() 527public async Task CompileAsync_PrecompiledViewWithChecksum_CanRecompileWhenViewImportChanges() 568public async Task GetOrAdd_AllowsConcurrentCompilationOfMultipleRazorPages() 630var task1 = Task.Run(() => compiler.CompileAsync(path1)); 631var task2 = Task.Run(() => compiler.CompileAsync(path2)); 636await Task.WhenAll(task1, task2); 646public async Task CompileAsync_DoesNotCreateMultipleCompilationResults_ForConcurrentInvocations() 668var task1 = Task.Run(() => compiler.CompileAsync(path)); 669var task2 = Task.Run(() => 678await Task.WhenAll(task1, task2); 687public async Task GetOrAdd_CachesCompilationExceptions()
Microsoft.AspNetCore.Mvc.Razor.Test (128)
Compilation\DefaultRazorPageFactoryProviderTest.cs (1)
112public override Task ExecuteAsync()
Compilation\DefaultViewCompilerTest.cs (5)
12public async Task CompileAsync_ReturnsResultWithNullAttribute_IfFileIsNotFoundInFileSystem() 27public async Task CompileAsync_ReturnsCompiledViews() 51public async Task CompileAsync_PerformsCaseInsensitiveLookupsForCompiledViews(string lookupPath) 69public async Task CompileAsync_PerformsCaseInsensitiveLookupsForCompiledViews_WithNonNormalizedPaths() 87public async Task CompileAsync_DiscoversHotReloadedTypes()
RazorPageActivatorTest.cs (4)
291public override Task ExecuteAsync() 304public override Task ExecuteAsync() 320public override Task ExecuteAsync() 331public override Task ExecuteAsync()
RazorPageCreateModelExpressionTest.cs (4)
345public override Task ExecuteAsync() 368public override Task ExecuteAsync() 376public override Task ExecuteAsync() 386public override Task ExecuteAsync()
RazorPageCreateTagHelperTest.cs (1)
111public override Task ExecuteAsync()
RazorPageTest.cs (48)
27private readonly RenderAsyncDelegate _nullRenderAsyncDelegate = () => Task.FromResult(0); 28private readonly Func<TextWriter, Task> NullAsyncWrite = writer => writer.WriteAsync(string.Empty); 31public async Task WritingScopesRedirectContentWrittenToViewContextWriter() 59public async Task WritingScopesRedirectsContentWrittenToOutput() 83public async Task WritingScopesCanNest() 118public async Task StartTagHelperWritingScope_CannotFlushInWritingScope() 138public async Task StartTagHelperWritingScope_SetsHtmlEncoder() 155public async Task StartTagHelperWritingScope_DoesNotSetHtmlEncoderToNull() 173public async Task EndTagHelperWritingScope_CannotEndWritingScopeWhenNoWritingScope() 188public async Task EndTagHelperWritingScope_ReturnsAppropriateContent() 209public async Task EndWriteTagHelperAttribute_RestoresPageWriter() 229public async Task EndWriteTagHelperAttribute_ReturnsAppropriateContent() 250public async Task BeginWriteTagHelperAttribute_NestingWritingScopesThrows() 269public async Task TagHelperScopes_ViewBuffersCanCombine() 294return Task.FromResult(innerContentLevel1); 326return Task.FromResult(innerContentLevel1); 342return Task.FromResult(innerContentLevel2); 399public async Task DefineSection_ThrowsIfSectionIsAlreadyDefined() 415public async Task RenderSection_RendersSectionFromPreviousPage() 437public async Task RenderSection_ThrowsIfPreviousSectionWritersIsNotSet() 455public async Task RenderSection_ThrowsIfRequiredSectionIsNotFound() 477public async Task IgnoreSection_DoesNotThrowIfSectionIsNotFound() 514public async Task IsSectionDefined_ReturnsFalseIfSectionNotDefined() 538public async Task IsSectionDefined_ReturnsTrueIfSectionDefined() 562public async Task RenderSection_ThrowsIfSectionIsRenderedMoreThanOnce() 586public async Task RenderSectionAsync_ThrowsIfSectionIsRenderedMoreThanOnce() 610public async Task RenderSectionAsync_ThrowsIfSectionIsRenderedMoreThanOnce_WithSyncMethod() 634public async Task RenderSectionAsync_ThrowsIfNotInvokedFromLayoutPage() 653public async Task EnsureRenderedBodyOrSections_ThrowsIfRenderBodyIsNotCalledFromPage_AndNoSectionsAreDefined() 670public async Task EnsureRenderedBodyOrSections_SucceedsIfRenderBodyIsNotCalledFromPage_AndNoSectionsAreDefined_AndBodyIgnored() 687public async Task EnsureRenderedBodyOrSections_ThrowsIfDefinedSectionsAreNotRendered() 712public async Task EnsureRenderedBodyOrSections_SucceedsIfDefinedSectionsAreNotRendered_AndIgnored() 734public async Task ExecuteAsync_RendersSectionsThatAreNotIgnored() 759public async Task EnsureRenderedBodyOrSections_SucceedsIfRenderBodyIsNotCalled_ButAllDefinedSectionsAreRendered() 782public async Task ExecuteAsync_RendersSectionsAndBody() 829public async Task Href_ReadsUrlHelperFromServiceCollection() 863public async Task FlushAsync_InvokesFlushOnWriter() 881public async Task FlushAsync_ThrowsIfTheLayoutHasBeenSet() 901public async Task FlushAsync_DoesNotThrowWhenIsRenderingLayoutIsSet() 925public async Task FlushAsync_ReturnsEmptyHtmlString() 985executeChildContentAsync: () => Task.FromResult(result: true), 1027executeChildContentAsync: () => Task.FromResult(result: true), 1073executeChildContentAsync: () => Task.FromResult(result: true), 1116executeChildContentAsync: () => Task.FromResult(result: true), 1146executeChildContentAsync: () => Task.FromResult(result: true), 1356public async Task Write_WithHtmlString_WritesValueWithoutEncoding() 1382return Task.FromResult(0); 1387Func<TestableRazorPage, Task> executeAction,
RazorViewTest.cs (40)
28public async Task RenderAsync_AsPartial_BuffersOutput() 58public async Task RenderAsync_AsPartial_ActivatesViews_WithThePassedInViewContext() 96public async Task RenderAsync_AsPartial_ActivatesViews_WritesBeforeAndAfterRazorViewEventDiagnostics() 145public async Task ViewContext_ExecutingPagePath_ReturnsPathOfRazorPageBeingExecuted() 206public async Task RenderAsync_AsPartial_ActivatesViews() 231public async Task RenderAsync_AsPartial_ExecutesLayout_ButNotViewStartPages() 280public async Task RenderAsync_CreatesOutputBuffer() 307public async Task RenderAsync_CopiesBufferedContentToOutput() 332public async Task RenderAsync_ActivatesPages() 360public async Task RenderAsync_ExecutesViewStart() 416public async Task RenderAsync_ExecutesDefaultLayout() 460public async Task RenderAsync_ExecutesDefaultLayout_WithViewStart() 514public async Task RenderAsync_ThrowsIfLayoutPageCannotBeFound_MessageUsesGetPageLocations() 557public async Task RenderAsync_ThrowsIfLayoutPageCannotBeFound_MessageUsesFindPageLocations() 600public async Task RenderAsync_ThrowsIfLayoutPageCannotBeFound_MessageUsesAllLocations() 645public async Task RenderAsync_ExecutesLayoutPages() 715public async Task RenderAsync_ThrowsIfSectionsWereDefinedButNotRendered() 753public async Task RenderAsync_SucceedsIfNestedSectionsAreRendered() 820public async Task RenderAsync_SucceedsIfRenderBodyIsNotInvoked_ButAllSectionsAreRendered() 889public async Task RenderAsync_WithNestedSections_ThrowsIfSectionsWereDefinedButNotRendered() 952public async Task RenderAsync_WithNestedSectionsOfTheSameName_ThrowsIfSectionsWereDefinedButNotRendered() 1021public async Task RenderAsync_ThrowsIfBodyWasNotRendered() 1055public async Task RenderAsync_ExecutesNestedLayoutPages() 1124public async Task RenderAsync_ExecutesNestedLayoutPages_WithRelativePaths() 1198public async Task RenderAsync_Throws_IfLayoutPageReferencesSelf() 1239public async Task RenderAsync_Throws_IfNestedLayoutPagesResultInCyclicReferences() 1293public async Task RenderAsync_ExecutesNestedLayoutsWithNestedSections() 1363public async Task RenderAsync_DoesNotCopyContentOnceRazorTextWriterIsNoLongerBuffering() 1421public async Task FlushAsync_DoesNotThrowWhenInvokedInsideOfASection() 1476public async Task RenderAsync_ThrowsIfLayoutIsSpecifiedWhenNotBuffered() 1505public async Task RenderAsync_ThrowsIfFlushWasInvokedInsideRenderedSectionAndLayoutWasSet() 1552public async Task RenderAsync_CopiesLayoutPropertyFromViewStart() 1600public async Task RenderAsync_CopiesLayoutPropertyFromViewStart_WithRelativePaths() 1658public async Task ResettingLayout_InViewStartCausesItToBeResetInPage() 1702public async Task RenderAsync_RendersViewStartsInOrderInWhichTheyAreSpecified() 1744public async Task RenderAsync_InvokesOnAfterPageActivated() 1818public override Task ExecuteAsync() 1821return Task.FromResult(0); 1840public override Task ExecuteAsync() 1843return Task.FromResult(0);
TagHelpers\TagHelperComponentPropertyActivatorTest.cs (2)
42public Task ProcessAsync(TagHelperContext context, TagHelperOutput output) 44return Task.CompletedTask;
TagHelpers\TagHelperComponentTagHelperTest.cs (16)
67public async Task ProcessAsync_InvokesComponentsProcessAsyncInCorrectOrder() 80getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>( 136getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>( 154public async Task ProcessAsync_InvokesTagHelperComponentProcessAsync() 167getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>( 185public async Task ProcessAsync_InvokesTagHelperComponentProcessAsync_WithAddedTagHelperComponents() 198getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>( 233getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>( 251public async Task ProcessAsync_LogsTagHelperComponentProcessed() 266getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>( 341public Task ProcessAsync(TagHelperContext context, TagHelperOutput output) 344return Task.CompletedTask; 357public Task ProcessAsync(TagHelperContext context, TagHelperOutput output) 360return Task.CompletedTask; 379public Task ProcessAsync(TagHelperContext context, TagHelperOutput output) 382return Task.CompletedTask;
TagHelpers\UrlResolutionTagHelperTest.cs (7)
49getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>(null)); 79getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>(null)); 136getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>(null)); 194getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>(null)); 250getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>(null)); 289getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>(null)); 327getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>(null));
Microsoft.AspNetCore.Mvc.RazorPages (74)
Builder\RazorPagesEndpointRouteBuilderExtensions.cs (4)
74var builder = endpoints.MapFallback(context => Task.CompletedTask); 132var builder = endpoints.MapFallback(pattern, context => Task.CompletedTask); 186var builder = endpoints.MapFallback(context => Task.CompletedTask); 246var builder = endpoints.MapFallback(pattern, context => Task.CompletedTask);
Filters\IAsyncPageFilter.cs (4)
16/// <returns>A <see cref="Task"/> that on completion indicates the filter has executed.</returns> 17Task OnPageHandlerSelectionAsync(PageHandlerSelectedContext context); 26/// <returns>A <see cref="Task"/> that on completion indicates the filter has executed.</returns> 27Task OnPageHandlerExecutionAsync(PageHandlerExecutingContext context, PageHandlerExecutionDelegate next);
Filters\PageHandlerExecutionDelegate.cs (1)
11/// A <see cref="Task"/> that on completion returns an <see cref="PageHandlerExecutedContext"/>.
Filters\PageHandlerPageFilter.cs (4)
15public Task OnPageHandlerExecutionAsync(PageHandlerExecutingContext context, PageHandlerExecutionDelegate next) 42public Task OnPageHandlerSelectionAsync(PageHandlerSelectedContext context) 55return Task.CompletedTask; 58private static async Task ExecuteSyncFilter(
Filters\PageHandlerResultFIlter.cs (2)
15public Task OnResultExecutionAsync(ResultExecutingContext context, ResultExecutionDelegate next) 42private static async Task ExecuteSyncFilter(
Infrastructure\DefaultPageLoader.cs (1)
46compiledPageActionDescriptor.CompiledPageActionDescriptorTask ??= Task.FromResult(compiledPageActionDescriptor);
Infrastructure\DynamicPageEndpointMatcherPolicy.cs (1)
61public async Task ApplyAsync(HttpContext httpContext, CandidateSet candidates)
Infrastructure\ExecutorFactory.cs (5)
36else if (returnType == typeof(Task)) 79private readonly Func<object, object?[]?, Task> _thunk; 87_thunk = Expression.Lambda<Func<object, object?[]?, Task>>( 165return Task.FromResult<IActionResult?>(null); 192return Task.FromResult(_thunk(receiver, arguments));
Infrastructure\PageActionInvoker.cs (15)
74protected override async Task InvokeInnerFilterAsync() 102protected override Task InvokeResultAsync(IActionResult result) 178private Task BindArgumentsAsync() 184return Task.CompletedTask; 190private async Task BindArgumentsCoreAsync() 248private async Task InvokeHandlerMethodAsync() 299private Task Next(ref State next, ref Scope scope, ref object? state, ref bool isCompleted) 369var task = filter.OnPageHandlerSelectionAsync(handlerSelectedContext); 427var task = BindArgumentsAsync(); 483var task = filter.OnPageHandlerExecutionAsync(handlerExecutingContext, InvokeNextPageFilterAwaitedAsync); 568var task = InvokeNextPageFilterAsync(); 606var task = InvokeHandlerMethodAsync(); 629return Task.CompletedTask; 641return Task.CompletedTask; 649private async Task InvokeNextPageFilterAsync()
Infrastructure\PageActionInvokerCacheEntry.cs (2)
21Func<PageContext, object, Task> propertyBinder, 60public Func<PageContext, object, Task> PropertyBinder { get; }
Infrastructure\PageBinderFactory.cs (6)
10internal static readonly Func<PageContext, object, Task> NullPropertyBinder = (context, arguments) => Task.CompletedTask; 11internal static readonly PageHandlerBinderDelegate NullHandlerBinder = (context, arguments) => Task.CompletedTask; 13public static Func<PageContext, object, Task> CreatePropertyBinder( 46async Task Bind(PageContext pageContext, object instance) 127async Task Bind(PageContext pageContext, IDictionary<string, object?> arguments)
Infrastructure\PageHandlerBinderDelegate.cs (1)
6internal delegate Task PageHandlerBinderDelegate(PageContext pageContext, IDictionary<string, object?> arguments);
Infrastructure\PageLoader.cs (2)
19/// <returns>A <see cref="Task"/> that on completion returns a <see cref="CompiledPageActionDescriptor"/>.</returns> 28/// <returns>A <see cref="Task"/> that on completion returns a <see cref="CompiledPageActionDescriptor"/>.</returns>
Infrastructure\PageResultExecutor.cs (1)
51public virtual Task ExecuteAsync(PageContext pageContext, PageResult result)
Infrastructure\RazorPageAdapter.cs (1)
83public Task ExecuteAsync()
PageBase.cs (9)
1275/// <returns>A <see cref="Task"/> that on completion returns <c>true</c> if the update is successful.</returns> 1293/// <returns>A <see cref="Task"/> that on completion returns <c>true</c> if the update is successful.</returns> 1320/// <returns>A <see cref="Task"/> that on completion returns <c>true</c> if the update is successful.</returns> 1351/// <returns>A <see cref="Task"/> that on completion returns <c>true</c> if the update is successful.</returns> 1387/// <returns>A <see cref="Task"/> that on completion returns <c>true</c> if the update is successful.</returns> 1425/// <returns>A <see cref="Task"/> that on completion returns <c>true</c> if the update is successful.</returns> 1458/// <returns>A <see cref="Task"/> that on completion returns <c>true</c> if the update is successful.</returns> 1489/// <returns>A <see cref="Task"/> that on completion returns <c>true</c> if the update is successful.</returns> 1525/// <returns>A <see cref="Task"/> that on completion returns <c>true</c> if the update is successful.</returns>
PageModel.cs (14)
184/// <returns>A <see cref="Task"/> that on completion returns <c>true</c> if the update is successful.</returns> 200/// <returns>A <see cref="Task"/> that on completion returns <c>true</c> if the update is successful.</returns> 225/// <returns>A <see cref="Task"/> that on completion returns <c>true</c> if the update is successful.</returns> 256/// <returns>A <see cref="Task"/> that on completion returns <c>true</c> if the update is successful.</returns> 292/// <returns>A <see cref="Task"/> that on completion returns <c>true</c> if the update is successful.</returns> 330/// <returns>A <see cref="Task"/> that on completion returns <c>true</c> if the update is successful.</returns> 363/// <returns>A <see cref="Task"/> that on completion returns <c>true</c> if the update is successful.</returns> 394/// <returns>A <see cref="Task"/> that on completion returns <c>true</c> if the update is successful.</returns> 430/// <returns>A <see cref="Task"/> that on completion returns <c>true</c> if the update is successful.</returns> 1690/// <returns>A <see cref="Task"/> that on completion indicates the filter has executed.</returns> 1691public virtual Task OnPageHandlerSelectionAsync(PageHandlerSelectedContext context) 1696return Task.CompletedTask; 1706/// <returns>A <see cref="Task"/> that on completion indicates the filter has executed.</returns> 1707public virtual async Task OnPageHandlerExecutionAsync(PageHandlerExecutingContext context, PageHandlerExecutionDelegate next)
PageResult.cs (1)
50public override Task ExecuteResultAsync(ActionContext context)
Microsoft.AspNetCore.Mvc.RazorPages.Test (180)
ApplicationModels\AuthorizationPageApplicationModelProviderTest.cs (4)
42public override Task ExecuteAsync() => throw new NotImplementedException(); 95public override Task ExecuteAsync() => throw new NotImplementedException(); 138public override Task ExecuteAsync() => throw new NotImplementedException(); 177public override Task ExecuteAsync() => throw new NotImplementedException();
ApplicationModels\DefaultPageApplicationModelProviderTest.cs (17)
52public override Task ExecuteAsync() 78public override Task ExecuteAsync() => throw new NotImplementedException(); 103public override Task ExecuteAsync() => throw new NotImplementedException(); 128public override Task ExecuteAsync() => throw new NotImplementedException(); 178public override Task ExecuteAsync() => throw new NotImplementedException(); 219public override Task ExecuteAsync() => throw new NotImplementedException(); 264public override Task ExecuteAsync() => throw new NotImplementedException(); 401public override Task ExecuteAsync() => null; 500public override Task ExecuteAsync() 522public override Task ExecuteAsync() 558public override Task ExecuteAsync() => throw new NotImplementedException(); 613public override Task ExecuteAsync() => throw new NotImplementedException(); 654public override Task ExecuteAsync() => throw new NotImplementedException(); 1049public override Task ExecuteAsync() => throw new NotImplementedException(); 1066public override Task ExecuteAsync() => throw new NotImplementedException(); 1148public Task OnPageHandlerExecutionAsync(PageHandlerExecutingContext context, PageHandlerExecutionDelegate next) 1153public Task OnPageHandlerSelectionAsync(PageHandlerSelectedContext context)
ApplicationModels\ResponseCacheFilterApplicationModelProviderTest.cs (3)
41public override Task ExecuteAsync() => throw new NotImplementedException(); 83public override Task ExecuteAsync() => throw new NotImplementedException(); 129public override Task ExecuteAsync() => throw new NotImplementedException();
ApplicationModels\TempDataFilterPageApplicationModelProviderTest.cs (1)
141public override Task ExecuteAsync() => null;
ApplicationModels\ViewDataAttributePageApplicationModelProviderTest.cs (1)
61public override Task ExecuteAsync() => null;
Filters\PageHandlerResultFilterTest.cs (9)
15public async Task OnResultExecutionAsync_ExecutesAsyncFilters() 28.Returns(Task.CompletedTask) 41ResultExecutionDelegate next = () => Task.FromResult(resultExecutedContext); 53public async Task OnResultExecutionAsync_ExecutesSyncFilters() 82ResultExecutionDelegate next = () => Task.FromResult(resultExecutedContext); 94public async Task OnPageHandlerExecutionAsync_DoesNotInvokeResultExecuted_IfCancelled() 124ResultExecutionDelegate next = () => Task.FromResult(resultExecutedContext); 136public async Task OnPageHandlerExecutionAsync_InvokesNextDelegateIfHandlerDoesNotImplementFilter() 160return Task.FromResult(resultExecutedContext);
Infrastructure\DefaultPageActivatorProviderTest.cs (5)
149public async Task CreateAsyncReleaser_CreatesDelegateThatDisposesAsyncDisposableTypes() 170public async Task CreateAsyncReleaser_CreatesDelegateThatPrefersAsyncDisposeAsyncOverDispose() 193public override Task ExecuteAsync() 211public override Task ExecuteAsync() 223public override Task ExecuteAsync()
Infrastructure\DefaultPageFactoryProviderTest.cs (6)
328public async Task PageFactoryCreateAsyncPageDisposerCreatesDisposerForPage() 432public override Task ExecuteAsync() 443public override Task ExecuteAsync() 454public override Task ExecuteAsync() 477public override Task ExecuteAsync() 500public override Task ExecuteAsync()
Infrastructure\DefaultPageLoaderTest.cs (6)
30public async Task LoadAsync_InvokesApplicationModelProviders() 102public async Task LoadAsync_CreatesEndpoint_WithRoute() 155public async Task LoadAsync_InvokesApplicationModelProviders_WithTheRightOrder() 219public async Task LoadAsync_CachesResults() 273public async Task LoadAsync_IsUniquePerPageDescriptor() 333public async Task LoadAsync_CompiledPageActionDescriptor_ReturnsSelf()
Infrastructure\DefaultPageModelActivatorProviderTest.cs (2)
174public async Task CreateAsyncReleaser_CreatesDelegateThatDisposesAsyncDisposableTypes() 195public async Task CreateAsyncReleaser_CreatesDelegateThatPrefersAsyncDisposeAsyncOverDispose()
Infrastructure\DynamicPageEndpointMatcherPolicyTest.cs (16)
40new Endpoint(_ => Task.CompletedTask, new EndpointMetadataCollection(actions[0]), "Test1"), 41new Endpoint(_ => Task.CompletedTask, new EndpointMetadataCollection(actions[1]), "Test2"), 45_ => Task.CompletedTask, 72new Endpoint(_ => Task.CompletedTask, EndpointMetadataCollection.Empty, "Test1"), 73new Endpoint(_ => Task.CompletedTask, EndpointMetadataCollection.Empty, "Test2"), 74new Endpoint(_ => Task.CompletedTask, EndpointMetadataCollection.Empty, "ReplacedLoaded") 80.Returns((PageActionDescriptor descriptor, EndpointMetadataCollection endpoint) => Task.FromResult(new CompiledPageActionDescriptor 116public async Task ApplyAsync_NoMatch() 146public async Task ApplyAsync_HasMatchNoEndpointFound() 177public async Task ApplyAsync_HasMatchFindsEndpoint_WithoutRouteValues() 217public async Task ApplyAsync_HasMatchFindsEndpoint_WithRouteValues() 268public async Task ApplyAsync_Throws_ForTransformersWithInvalidLifetime() 298public async Task ApplyAsync_CanDiscardFoundEndpoints() 336public async Task ApplyAsync_CanReplaceFoundEndpoints() 358new Endpoint((ctx) => Task.CompletedTask, new EndpointMetadataCollection(new PageActionDescriptor() 396public async Task ApplyAsync_CanExpandTheListOfFoundEndpoints()
Infrastructure\ExecutorFactoryTest.cs (18)
13public async Task CreateExecutor_ForActionResultMethod() 33public async Task CreateExecutor_ForMethodReturningConcreteSubtypeOfIActionResult() 53public async Task CreateExecutor_ForActionResultReturningMethod_WithParameters() 75public async Task CreateExecutor_ForVoidReturningMethod() 98public async Task CreateExecutor_ForVoidTaskReturningMethod() 121public async Task CreateExecutor_ForTaskOfIActionResultReturningMethod() 142public async Task CreateExecutor_ForTaskOfConcreteActionResultReturningMethod() 242public async Task VoidTaskReturningHandler() 244await Task.Run(() => 250public Task<IActionResult> GenericTaskHandler() => Task.FromResult<IActionResult>(new EmptyResult()); 254return Task.FromResult(new ContentResult 260public override Task ExecuteAsync() 287public async Task VoidTaskReturningHandler() 289await Task.Run(() => 295public Task<IActionResult> GenericTaskHandler() => Task.FromResult<IActionResult>(new EmptyResult()); 299return Task.FromResult(new ContentResult 307public Task<object> TaskOfObject() => Task.FromResult(new object()); 318public override Task ExecuteAsync()
Infrastructure\PageActionInvokerTest.cs (53)
31public async Task Invoke_WritesDiagnostic_ActionSelected() 59public async Task Invoke_WritesDiagnostic_ActionInvoked() 85public async Task AddingValueProviderFactory_AtResourceFilter_IsAvailableInPageContext() 117public async Task DeletingValueProviderFactory_AtResourceFilter_IsNotAvailableInPageContext() 154public async Task InvokeAction_WithSimplePage_FlowsRightValues() 210public async Task InvokeAction_WithSimplePageWithPocoModel_FlowsRightValues() 267public async Task InvokeAction_WithPageModel_FlowsRightValues() 326public async Task InvokeAction_WithPage_SetsExecutingFilePath() 356public async Task InvokeAction_InvokesPageFilter_CanModifySelectedHandler() 410public async Task InvokeAction_InvokesAsyncPageFilter_CanModifySelectedHandler() 422.Returns(Task.CompletedTask) 437.Returns(Task.CompletedTask) 468public async Task ViewDataIsSet_AfterHandlerMethodIsExecuted() 495public async Task InvokeAction_InvokesPageFilter() 521public async Task InvokeAction_InvokesAsyncPageFilter() 551public async Task InvokeAction_PageResultSetAt_AsyncAuthorizeFilter_PopulatesProperties() 564return Task.CompletedTask; 586public async Task InvokeAction_PageResultSetAt_SyncAuthorizeFilter_PopulatesProperties() 620public async Task InvokeAction_PageResultSetAt_AsyncResourceFilter_PopulatesProperties() 633return Task.CompletedTask; 655public async Task InvokeAction_PageResultSetAt_SyncResourceFilter_PopulatesProperties() 689public async Task InvokeAction_PageResultSetAt_AsyncResultFilter_PopulatesProperties() 724public async Task InvokeAction_PageResultSetAt_SyncResultFilter_PopulatesProperties() 758public async Task InvokeAction_PageResultSetAt_AsyncPageFilter_PopulatesProperties() 772return Task.CompletedTask; 794public async Task InvokeAction_PageResultSetAt_SyncPageFilter_PopulatesProperties() 829public async Task InvokeAction_InvokesPageFilter_ShortCircuit() 835.Returns(Task.FromResult(true)) 889public async Task InvokeAction_InvokesAsyncPageFilter_ShortCircuit_WithResult() 895.Returns(Task.FromResult(true)) 916return Task.FromResult(true); 961public async Task InvokeAction_InvokesAsyncPageFilter_ShortCircuit_WithoutResult() 981return Task.FromResult(true); 1019public async Task InvokeAction_InvokesAsyncPageFilter_ShortCircuit_WithResult_CallNext() 1047public async Task InvokeAction_InvokesPageFilter_WithExceptionThrownByAction() 1082public async Task InvokeAction_InvokesPageFilter_WithExceptionThrownByPageFilter() 1127public async Task InvokeAction_InvokesAsyncPageFilter_WithExceptionThrownByPageFilter() 1172public async Task InvokeAction_InvokesPageFilter_HandleException() 1178.Returns<ActionContext>((context) => Task.FromResult(true)) 1218public async Task InvokeAction_InvokesAsyncResourceFilter_WithActionResult_FromPageFilter() 1256public async Task InvokeAction_InvokesAsyncResourceFilter_HandleException_FromPageFilter() 1296public async Task InvokeAction_InvokesAsyncResourceFilter_HandlesException_FromExceptionFilter() 1335public async Task InvokeAction_ExceptionBubbling_AsyncPageFilter_To_ResourceFilter() 1390public async Task InvokeAction_ForPage_Logs(bool hasPageModel) 1457handlers.Add((obj, args) => Task.FromResult(result)); 1466handlers.Add((obj, args) => Task.FromException<IActionResult>(exception)); 1534handlers[i] = (obj, args) => Task.FromResult<IActionResult>(new PageResult()); 1669filter.Setup(f => f.OnPageHandlerSelectionAsync(It.IsAny<PageHandlerSelectedContext>())).Returns(Task.CompletedTask); 1674private readonly Func<PageContext, Task> _executeAction; 1681public TestPageResultExecutor(Func<PageContext, Task> executeAction) 1693public override Task ExecuteAsync(PageContext pageContext, PageResult result) 1695return _executeAction?.Invoke(pageContext) ?? Task.CompletedTask; 1713public override Task ExecuteAsync()
Infrastructure\PageBinderFactoryTest.cs (19)
177public async Task ModelBinderFactory_BindsPropertiesOnPage() 235public async Task ModelBinderFactory_BindsPropertiesOnPageModel() 301public async Task ModelBinderFactory_PreservesExistingValueIfModelBindingFailed() 349public async Task ModelBinderFactory_BindsPropertyWithoutSupportsGet_WhenRequestIsGet(string method) 409public async Task ModelBinderFactory_BindsPropertyWithoutSupportsGet_WhenRequestIsNotGet() 470public async Task CreatePropertyBinder_SkipsBindingPropertiesWithBindNever() 517public async Task CreatePropertyBinder_ValidatesTopLevelProperties() 576public async Task CreateHandlerBinder_BindsHandlerParameters() 619public async Task CreateHandlerBinder_SkipBindingParametersThatDisallowBinding() 656public async Task CreateHandlerBinder_ValidatesTopLevelParameters() 706public async Task FactoryRecordsErrorWhenValueProviderThrowsValueProviderException() 850public override Task ExecuteAsync() => Task.FromResult(0); 867public override Task ExecuteAsync() => Task.FromResult(0); 890public override Task ExecuteAsync() => Task.FromResult(0); 913public override Task ExecuteAsync() => Task.FromResult(0);
Infrastructure\PageHandlerPageFilterTest.cs (9)
15public async Task OnPageHandlerExecutionAsync_ExecutesAsyncFilters() 36PageHandlerExecutionDelegate next = () => Task.FromResult(pageHandlerExecutedContext); 41.Returns(Task.CompletedTask) 54public async Task OnPageHandlerExecutionAsync_ExecutesSyncFilters() 84PageHandlerExecutionDelegate next = () => Task.FromResult(pageHandlerExecutedContext); 96public async Task OnPageHandlerExecutionAsync_DoesNotInvokeHandlerExecuted_IfResultIsSet() 127PageHandlerExecutionDelegate next = () => Task.FromResult(pageHandlerExecutedContext); 139public async Task OnPageHandlerExecutionAsync_InvokesNextDelegateIfHandlerDoesNotImplementFilter() 164return Task.FromResult(pageHandlerExecutedContext);
PageModelTest.cs (7)
1752public async Task TryUpdateModel_ReturnsFalse_IfValueProviderFactoryThrows() 1843public async Task AsyncPageHandlerExecutingMethod_InvokeSyncMethods() 1871() => Task.FromResult(pageHandlerExecutedContext)); 1877public async Task AsyncPageHandlerExecutingMethod__DoesNotInvokeExecutedMethod_IfResultIsSet() 1906() => Task.FromResult(pageHandlerExecutedContext)); 1912public async Task AsyncPageHandlerSelectingMethod_InvokeSyncMethods() 2087public override Task ExecuteAsync()
PageTest.cs (4)
1830public async Task TryUpdateModel_ReturnsFalse_IfValueProviderFactoryThrows() 1910public override Task ExecuteAsync() 1918public override Task ExecuteAsync() 1936public override Task ExecuteAsync()
Microsoft.AspNetCore.Mvc.TagHelpers (14)
Cache\DistributedCacheTagHelperFormatter.cs (2)
29return Task.FromResult(serialized); 38return Task.FromResult(new HtmlString(content));
Cache\DistributedCacheTagHelperStorage.cs (1)
34public Task SetAsync(string key, byte[] value, DistributedCacheEntryOptions options)
Cache\IDistributedCacheTagHelperStorage.cs (1)
28Task SetAsync(string key, byte[] value, DistributedCacheEntryOptions options);
CacheTagHelper.cs (1)
61public override async Task ProcessAsync(TagHelperContext context, TagHelperOutput output)
ComponentTagHelper.cs (1)
86public override async Task ProcessAsync(TagHelperContext context, TagHelperOutput output)
DistributedCacheTagHelper.cs (1)
53public override async Task ProcessAsync(TagHelperContext context, TagHelperOutput output)
LabelTagHelper.cs (1)
50public override async Task ProcessAsync(TagHelperContext context, TagHelperOutput output)
OptionTagHelper.cs (1)
59public override async Task ProcessAsync(TagHelperContext context, TagHelperOutput output)
PartialTagHelper.cs (2)
104public override async Task ProcessAsync(TagHelperContext context, TagHelperOutput output) 198private async Task RenderPartialViewAsync(TextWriter writer, object model, IView view)
PersistComponentStateTagHelper.cs (1)
41public override async Task ProcessAsync(TagHelperContext context, TagHelperOutput output)
RenderAtEndOfFormTagHelper.cs (1)
44public override async Task ProcessAsync(TagHelperContext context, TagHelperOutput output)
ValidationMessageTagHelper.cs (1)
52public override async Task ProcessAsync(TagHelperContext context, TagHelperOutput output)
Microsoft.AspNetCore.Mvc.TagHelpers.Test (355)
AnchorTagHelperTest.cs (24)
17public async Task ProcessAsync_GeneratesExpectedOutput() 47return Task.FromResult<TagHelperContent>(tagHelperContent); 88public async Task ProcessAsync_CallsIntoRouteLinkWithExpectedParameters() 104return Task.FromResult<TagHelperContent>(tagHelperContent); 138public async Task ProcessAsync_CallsIntoActionLinkWithExpectedParameters() 154return Task.FromResult<TagHelperContent>(tagHelperContent); 190public async Task ProcessAsync_AddsAreaToRouteValuesAndCallsIntoActionLinkWithExpectedParameters() 206return Task.FromResult<TagHelperContent>(tagHelperContent); 248public async Task ProcessAsync_AspAreaOverridesAspRouteArea() 264return Task.FromResult<TagHelperContent>(tagHelperContent); 307public async Task ProcessAsync_EmptyStringOnAspAreaIsPassedThroughToRouteValues() 323return Task.FromResult<TagHelperContent>(tagHelperContent); 365public async Task ProcessAsync_AddsPageToRouteValuesAndCallsPageLinkWithExpectedParameters() 381return Task.FromResult<TagHelperContent>(tagHelperContent); 416public async Task ProcessAsync_AddsAreaToRouteValuesAndCallsPageLinkWithExpectedParameters() 432return Task.FromResult<TagHelperContent>(tagHelperContent); 487public async Task ProcessAsync_ThrowsIfHrefConflictsWithBoundAttributes(string propertyName) 501getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>(null)); 533public async Task ProcessAsync_ThrowsIfRouteAndActionOrControllerProvided(string propertyName) 548getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>(null)); 571public async Task ProcessAsync_ThrowsIfRouteAndPageProvided() 586getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>(null)); 609public async Task ProcessAsync_ThrowsIfActionAndPageProvided() 624getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>(null));
CacheTagHelperTest.cs (40)
27public async Task ProcessAsync_DoesNotCache_IfDisabled() 63public async Task ProcessAsync_ReturnsCachedValue_IfEnabled() 90public async Task ProcessAsync_ReturnsCachedValue_IfVaryByParamIsUnchanged() 141public async Task ProcessAsync_RecalculatesValueIfCacheKeyChanges() 209public async Task ProcessAsync_SetsEntrySize_ForPlaceholderAndFinalCacheEntries() 323public async Task ProcessAsync_UsesExpiresAfter_ToExpireCacheEntry() 376public async Task ProcessAsync_UsesExpiresOn_ToExpireCacheEntry() 429public async Task ProcessAsync_UsesExpiresSliding_ToExpireCacheEntryWithSlidingExpiration() 482public async Task ProcessAsync_FlowsEntryLinkThatAllowsAddingTriggersToAddedEntry() 508return Task.FromResult(tagHelperContent); 538public async Task ProcessAsync_ComputesValueOnce_WithConcurrentRequests() 562return Task.FromResult<TagHelperContent>(tagHelperContent); 592var task1 = Task.Run(async () => 599var task2 = Task.Run(async () => 606await Task.WhenAll(task1, task2); 623public async Task ProcessAsync_ExceptionInProcessing_DoesntBlockConcurrentRequests() 675var task1 = Task.Run(async () => 682var task2 = Task.Run(async () => 689await Task.WhenAll(task1, task2); 706public async Task ProcessAsync_ExceptionInProcessing_DoNotThrowInSubsequentRequests() 728return Task.FromResult<TagHelperContent>(tagHelperContent); 799public async Task ProcessAsync_WorksForNestedCacheTagHelpers() 824return Task.FromResult<TagHelperContent>(content); 846public async Task ProcessAsync_ThrowsExceptionForAwaiters_IfExecutorEncountersAnException() 874var task1 = Task.Run(() => cacheTagHelper1.ProcessAsync(GetTagHelperContext(cache.Key1), tagHelperOutput)); 875var task2 = Task.Run(() => cacheTagHelper2.ProcessAsync(GetTagHelperContext(cache.Key2), tagHelperOutput)); 884public async Task ProcessAsync_AwaitersUseTheResultOfExecutor() 911return Task.FromResult<TagHelperContent>(content); 918var task1 = Task.Run(() => cacheTagHelper1.ProcessAsync(GetTagHelperContext(cache.Key1), tagHelperOutput1)); 919var task2 = Task.Run(() => cacheTagHelper2.ProcessAsync(GetTagHelperContext(cache.Key2), tagHelperOutput2)); 922await Task.WhenAll(task1, task2); 963return Task.FromResult<TagHelperContent>(tagHelperContent);
ComponentTagHelperTest.cs (3)
22public async Task ProcessAsync_RendersComponent() 46public async Task ProcessAsync_WithoutSpecifyingRenderMode_ThrowsError() 75(_, __) => Task.FromResult<TagHelperContent>(new DefaultTagHelperContent()));
DistributedCacheTagHelperTest.cs (24)
30public async Task ProcessAsync_DoesNotCache_IfDisabled() 41.Returns(Task.FromResult(value)); 72public async Task ProcessAsync_ReturnsCachedValue_IfEnabled() 83.Returns(Task.FromResult<byte[]>(null)); 125public async Task ProcessAsync_ReturnsCachedValue_IfVaryByParamIsUnchanged() 187public async Task ProcessAsync_RecalculatesValueIfCacheKeyChanges() 346public async Task ProcessAsync_UsesExpiresAfter_ToExpireCacheEntry() 408public async Task ProcessAsync_UsesExpiresOn_ToExpireCacheEntry() 470public async Task ProcessAsync_UsesExpiresSliding_ToExpireCacheEntryWithSlidingExpiration() 532public async Task ProcessAsync_ComputesValueOnce_WithConcurrentRequests() 561return Task.FromResult<TagHelperContent>(tagHelperContent); 595var task1 = Task.Run(async () => 602var task2 = Task.Run(async () => 609await Task.WhenAll(task1, task2); 626public async Task ProcessAsync_ExceptionInProcessing_DoesntBlockConcurrentRequests() 687var task1 = Task.Run(async () => 694var task2 = Task.Run(async () => 701await Task.WhenAll(task1, task2); 718public async Task Deserialize_DoesntAlterValue_WhenSerialized() 770return Task.FromResult<TagHelperContent>(tagHelperContent);
EnvironmentTagHelperTest.cs (1)
233return Task.FromResult<TagHelperContent>(tagHelperContent);
FormActionTagHelperTest.cs (24)
16public async Task ProcessAsync_GeneratesExpectedOutput() 40return Task.FromResult<TagHelperContent>(tagHelperContent); 91public async Task ProcessAsync_GeneratesExpectedOutput_WithRoute() 115return Task.FromResult<TagHelperContent>(tagHelperContent); 196public async Task ProcessAsync_CallsActionWithExpectedParameters( 211return Task.FromResult<TagHelperContent>(new DefaultTagHelperContent()); 256public async Task ProcessAsync_CallsRouteUrlWithExpectedParameters( 271return Task.FromResult<TagHelperContent>(new DefaultTagHelperContent()); 333public async Task ProcessAsync_CallsActionWithExpectedRouteValues( 349return Task.FromResult<TagHelperContent>(new DefaultTagHelperContent()); 387public async Task ProcessAsync_CallsRouteUrlWithExpectedRouteValues( 403return Task.FromResult<TagHelperContent>(new DefaultTagHelperContent()); 439public async Task ProcessAsync_WithPageAndArea_CallsUrlHelperWithExpectedValues() 452return Task.FromResult<TagHelperContent>(new DefaultTagHelperContent()); 512public async Task ProcessAsync_ThrowsIfFormActionConflictsWithBoundAttributes(string tagName, string propertyName) 525getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>(null)); 557public async Task ProcessAsync_ThrowsIfRouteAndActionOrControllerProvided(string tagName, string propertyName) 571getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>(null)); 595public async Task ProcessAsync_ThrowsIfRouteAndPageProvided(string tagName) 609getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>(null)); 633public async Task ProcessAsync_ThrowsIfRouteAndPageHandlerProvided(string tagName) 647getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>(null)); 671public async Task ProcessAsync_ThrowsIfActionAndPageProvided(string tagName) 685getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>(null));
FormTagHelperTest.cs (42)
22public async Task ProcessAsync_InvokesGeneratePageForm_WithOnlyPageHandler() 42return Task.FromResult<TagHelperContent>(tagHelperContent); 69public async Task ProcessAsync_ActionAndControllerGenerateAntiforgery() 90return Task.FromResult<TagHelperContent>(tagHelperContent); 126public async Task ProcessAsync_AspAntiforgeryAloneGeneratesProperFormTag() 146return Task.FromResult<TagHelperContent>(tagHelperContent); 180public async Task ProcessAsync_EmptyHtmlStringActionGeneratesAntiforgery() 203return Task.FromResult<TagHelperContent>(tagHelperContent); 238public async Task ProcessAsync_EmptyStringActionGeneratesAntiforgery() 261return Task.FromResult<TagHelperContent>(tagHelperContent); 296public async Task ProcessAsync_GeneratesExpectedOutput() 324return Task.FromResult<TagHelperContent>(tagHelperContent); 376public async Task ProcessAsync_GeneratesAntiforgeryCorrectly( 396return Task.FromResult<TagHelperContent>(tagHelperContent); 433public async Task ProcessAsync_BindsRouteValues() 451return Task.FromResult<TagHelperContent>(tagHelperContent); 505public async Task ProcessAsync_CallsIntoGenerateFormWithExpectedParameters() 522return Task.FromResult<TagHelperContent>(tagHelperContent); 557public async Task ProcessAsync_AspFragmentAddsFragmentToAction() 586return Task.FromResult<TagHelperContent>(tagHelperContent); 624public async Task ProcessAsync_AspAreaAddsAreaToRouteValues() 641return Task.FromResult<TagHelperContent>(tagHelperContent); 681public async Task ProcessAsync_EmptyStringOnAspAreaIsPassedThroughToRouteValues() 698return Task.FromResult<TagHelperContent>(tagHelperContent); 738public async Task ProcessAsync_AspAreaOverridesAspRouteArea() 755return Task.FromResult<TagHelperContent>(tagHelperContent); 796public async Task ProcessAsync_CallsIntoGenerateRouteFormWithExpectedParameters() 813return Task.FromResult<TagHelperContent>(tagHelperContent); 851public async Task ProcessAsync_InvokesGeneratePageForm() 868return Task.FromResult<TagHelperContent>(tagHelperContent); 897public async Task ProcessAsync_WithPageAndArea_InvokesGeneratePageForm() 914return Task.FromResult<TagHelperContent>(tagHelperContent); 958public async Task ProcessAsync_SupportsAntiforgeryIfActionIsSpecified( 984return Task.FromResult<TagHelperContent>(tagHelperContent); 1012public async Task ProcessAsync_ThrowsIfActionConflictsWithBoundAttributes(string propertyName) 1022getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>(null)); 1053public async Task ProcessAsync_ThrowsIfRouteAndActionOrControllerProvided(string propertyName) 1064getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>(null)); 1087public async Task ProcessAsync_ThrowsIfRouteAndPageProvided() 1098getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>(null)); 1121public async Task ProcessAsync_ThrowsIfActionAndPageProvided() 1132getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>(null));
ImageTagHelperTest.cs (2)
52getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>( 290return Task.FromResult<TagHelperContent>(tagHelperContent);
InputTagHelperTest.cs (52)
73public async Task CheckBoxHandlesMultipleAttributesSameNameArePreserved( 92getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>(result: null)) 140getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>(result: null)) 187getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>(result: null)) 231getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>(result: null)) 283getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>(result: null)) 328getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>(result: null)) 382getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>(result: null)) 438getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>(result: null)) 489getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>(result: null)) 545getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>(result: null)) 617public async Task ProcessAsync_GeneratesExpectedOutput( 656return Task.FromResult<TagHelperContent>(tagHelperContent); 891getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>(result: null)) 906public async Task ProcessAsync_GenerateCheckBox_WithHiddenInputRenderModeNone() 945getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>(result: null)) 963public async Task ProcessAsync_GenerateCheckBox_WithHiddenInputRenderModeInline() 1005getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>(result: null)) 1023public async Task ProcessAsync_GenerateCheckBox_WithHiddenInputRenderModeEndOfForm() 1065getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>(result: null)) 1083public async Task ProcessAsync_GenerateCheckBox_WithHiddenInputRenderModeEndOfForm_AndCanRenderAtEndOfFormNotSet() 1125getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>(result: null)) 1143public async Task ProcessAsync_CallsGenerateCheckBox_WithExpectedParameters() 1169return Task.FromResult<TagHelperContent>(tagHelperContent); 1227public async Task ProcessAsync_CallsGenerateTextBox_WithExpectedParametersForHidden( 1269return Task.FromResult<TagHelperContent>(tagHelperContent); 1323public async Task ProcessAsync_GenerateCheckBox_WithHiddenInputExpectedFormAttribute() 1368getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>(result: null)) 1394public async Task ProcessAsync_CallsGeneratePassword_WithExpectedParameters( 1435return Task.FromResult<TagHelperContent>(tagHelperContent); 1492public async Task ProcessAsync_CallsGenerateRadioButton_WithExpectedParameters( 1535return Task.FromResult<TagHelperContent>(tagHelperContent); 1605public async Task ProcessAsync_CallsGenerateTextBox_WithExpectedParameters( 1647return Task.FromResult<TagHelperContent>(tagHelperContent); 1743public async Task ProcessAsync_CallsGenerateTextBox_AddsExpectedAttributes( 1765getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>( 1817public async Task ProcessAsync_CallsGenerateTextBox_InputTypeDateTime_RendersAsDateTime() 1838getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>( 1886public async Task ProcessAsync_CallsGenerateTextBox_InputTypeDateOnly_RendersAsDate() 1907getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>( 1978public async Task ProcessAsync_CallsGenerateTextBox_AddsExpectedAttributesForRfc3339( 2001getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>( 2057public async Task ProcessAsync_CallsGenerateTextBox_ProducesExpectedValue_ForDateTime( 2081getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>( 2119public async Task ProcessAsync_CallsGenerateTextBox_ProducesExpectedValue_ForDateOnly( 2143getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>( 2186public async Task ProcessAsync_CallsGenerateTextBox_ProducesExpectedValue_ForDateTimeNotRfc3339( 2211getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>( 2252public async Task ProcessAsync_CallsGenerateTextBox_ProducesExpectedValue_ForDateOnlyNotRfc3339( 2277getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>( 2312public async Task ProcessAsync_CallsGenerateTextBox_ProducesExpectedValue_OverridesDefaultFormat( 2335getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>(
LabelTagHelperTest.cs (4)
152public async Task ProcessAsync_GeneratesExpectedOutput( 199return Task.FromResult<TagHelperContent>(tagHelperContent); 270public async Task ProcessAsync_GeneratesExpectedOutput_WithDisplayName( 320return Task.FromResult<TagHelperContent>(tagHelperContent);
LinkTagHelperTest.cs (1)
988getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>(
OptionTagHelperTest.cs (7)
375public async Task ProcessAsync_GeneratesExpectedOutput( 411return Task.FromResult<TagHelperContent>(null); 447public async Task ProcessAsync_DoesNotUseGenerator_IfSelectedNullOrNoSelectedValues( 482return Task.FromResult<TagHelperContent>(tagHelperContent); 511public async Task ProcessAsync_DoesNotUseViewContext_IfSelectedNotNull( 547return Task.FromResult<TagHelperContent>(tagHelperContent); 575getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>(
PartialTagHelperTest.cs (32)
149public async Task ProcessAsync_RendersPartialView_IfGetViewReturnsView() 164.Returns(Task.CompletedTask); 187public async Task ProcessAsync_RendersPartialView_IfFindViewReturnsView() 202.Returns(Task.CompletedTask); 228public async Task ProcessAsync_UsesViewDataFromContext() 243.Returns(Task.CompletedTask); 269public async Task ProcessAsync_UsesPassedInViewData_WhenNotNull() 287.Returns(Task.CompletedTask); 311public async Task ProcessAsync_UsesModelExpression_ToDetermineModel() 335.Returns(Task.CompletedTask) 359public async Task ProcessAsync_DoesNotUseModelFromViewdata_IfModelExpressionEvaluatesToNull() 381.Returns(Task.CompletedTask) 405public async Task ProcessAsync_SetsHtmlFieldPrefix_UsingModelExpression() 428.Returns(Task.CompletedTask) 453public async Task ProcessAsync_UsesModelOnViewContextViewData_WhenModelExpressionIsNull() 468.Returns(Task.CompletedTask) 491public async Task ProcessAsync_DoesNotModifyHtmlFieldPrefix_WhenModelExpressionIsNull() 508.Returns(Task.CompletedTask) 531public async Task ProcessAsync_DisposesViewInstance() 543.Returns(Task.CompletedTask) 567public async Task ProcessAsync_Throws_If_NotOptional_And_GetViewAndFindReturnNotFoundResults() 606public async Task ProcessAsync_IfOptional_And_ViewIsNotFound_WillNotRenderAnything() 621.Returns(Task.CompletedTask); 647public async Task ProcessAsync_RendersMainPartial_If_FallbackIsSet_AndMainPartialIsFound() 663.Returns(Task.CompletedTask); 671.Returns(Task.CompletedTask); 697public async Task ProcessAsync_IfHasFallback_Throws_When_MainPartialAndFallback_AreNotFound() 749public async Task ProcessAsync_RendersFallbackView_If_MainIsNotFound_AndGetViewReturnsView() 765.Returns(Task.CompletedTask); 793public async Task ProcessAsync_RendersFallbackView_If_MainIsNotFound_AndFindViewReturnsView() 809.Returns(Task.CompletedTask); 863(_, __) => Task.FromResult<TagHelperContent>(new DefaultTagHelperContent()));
PersistComponentStateTagHelperTest.cs (13)
34public async Task ExecuteAsync_DoesNotPersistDataWhenNoPrerenderHappened() 55public async Task ExecuteAsync_DoesNotRenderWebAssemblyStateWhenStateWasNotPersisted() 77public async Task ExecuteAsync_RendersWebAssemblyStateExplicitly() 94return Task.CompletedTask; 106public async Task ExecuteAsync_RendersWebAssemblyStateImplicitlyWhenAWebAssemblyComponentWasPrerendered() 124return Task.CompletedTask; 136public async Task ExecuteAsync_RendersServerStateExplicitly() 153return Task.CompletedTask; 167public async Task ExecuteAsync_DoesNotRenderServerStateWhenStateWasNotPersisted() 188public async Task ExecuteAsync_RendersServerStateImplicitlyWhenAServerComponentWasPrerendered() 206return Task.CompletedTask; 220public async Task ExecuteAsync_ThrowsIfItCantInferThePersistMode() 252(_, __) => Task.FromResult<TagHelperContent>(new DefaultTagHelperContent()));
PrerenderComponentApplicationStoreTest.cs (2)
12public async Task PersistStateAsync_PersistsGivenState() 30public async Task GetPersistedStateAsync_RestoresPreexistingStateAsync()
ProtectedPrerenderComponentApplicationStateTest.cs (2)
18public async Task PersistStateAsync_ProtectsPersistedState() 37public async Task GetPersistStateAsync_CanUnprotectPersistedState()
RenderAtEndOfFormTagHelperTest.cs (5)
41public async Task Process_AddsHiddenInputTag_FromEndOfFormContent( 58return Task.FromResult<TagHelperContent>(new DefaultTagHelperContent()); 82public async Task Process_AddsHiddenInputTag_FromEndOfFormContent_WithCachedBody( 101return Task.FromResult(true); 141public override async Task ProcessAsync(TagHelperContext context, TagHelperOutput output)
ScriptTagHelperTest.cs (1)
852getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>(
SelectTagHelperTest.cs (15)
164public async Task ProcessAsync_GeneratesExpectedOutput( 211return Task.FromResult<TagHelperContent>(tagHelperContent); 253public async Task ProcessAsync_WithItems_GeneratesExpectedOutput_DoesNotChangeSelectList( 301return Task.FromResult<TagHelperContent>(tagHelperContent); 357public async Task ProcessAsync_WithItems_AndNoModelExpression_GeneratesExpectedOutput() 392return Task.FromResult<TagHelperContent>(tagHelperContent); 433public async Task ProcessAsyncInTemplate_WithItems_GeneratesExpectedOutput_DoesNotChangeSelectList( 481return Task.FromResult<TagHelperContent>(tagHelperContent); 538public async Task ProcessAsync_CallsGeneratorWithExpectedValues_ItemsAndAttribute( 570return Task.FromResult<TagHelperContent>(tagHelperContent); 628public async Task TagHelper_CallsGeneratorWithExpectedValues_RealModelType( 652return Task.FromResult<TagHelperContent>(tagHelperContent); 727(_, __) => Task.FromResult<TagHelperContent>(new DefaultTagHelperContent())); 765(_, __) => Task.FromResult<TagHelperContent>(new DefaultTagHelperContent())); 815(_, __) => Task.FromResult<TagHelperContent>(new DefaultTagHelperContent()));
TagHelperOutputExtensionsTest.cs (24)
337getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>( 439getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>( 467return Task.FromResult<TagHelperContent>(tagHelperContent); 502return Task.FromResult<TagHelperContent>(tagHelperContent); 534return Task.FromResult<TagHelperContent>(tagHelperContent); 563getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>( 591getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>( 617getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>( 776getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>( 802getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>( 825getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>( 853getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>( 878getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>( 900getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>( 927getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>( 949getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>( 979getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>( 1000getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>( 1022getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>( 1049getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>( 1068getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>( 1091getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>( 1112getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>( 1135getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>(
TextAreaTagHelperTest.cs (4)
80public async Task Process_GeneratesExpectedOutput( 137return Task.FromResult<TagHelperContent>(tagHelperContent); 182(_, __) => Task.FromResult<TagHelperContent>(new DefaultTagHelperContent())); 221(_, __) => Task.FromResult<TagHelperContent>(new DefaultTagHelperContent()));
ValidationMessageTagHelperTest.cs (16)
21public async Task ProcessAsync_GeneratesExpectedOutput() 57return Task.FromResult<TagHelperContent>(tagHelperContent); 89public async Task ProcessAsync_WithEmptyNameFor_Throws() 123(_, __) => Task.FromResult<TagHelperContent>(new DefaultTagHelperContent())); 133public async Task ProcessAsync_GeneratesExpectedOutput_WithEmptyNameFor_WithValidationFor() 168(_, __) => Task.FromResult<TagHelperContent>(new DefaultTagHelperContent())); 196public async Task ProcessAsync_PassesValidationForThrough_EvenIfNullFor() 221(_, __) => Task.FromResult<TagHelperContent>(new DefaultTagHelperContent())); 234public async Task ProcessAsync_CallsIntoGenerateValidationMessageWithExpectedParameters() 271return Task.FromResult<TagHelperContent>(tagHelperContent); 294public async Task ProcessAsync_DoesNotOverrideOutputContent( 327return Task.FromResult<TagHelperContent>(tagHelperContent); 357public async Task ProcessAsync_MergesTagBuilderFromGenerateValidationMessage( 390return Task.FromResult<TagHelperContent>(tagHelperContent); 417public async Task ProcessAsync_DoesNothingIfNullFor() 428getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>(
ValidationSummaryTagHelperTest.cs (17)
41public async Task ProcessAsync_GeneratesExpectedOutput_WithNoErrors(ModelStateDictionary modelState) 97public async Task ProcessAsync_SuppressesOutput_IfClientSideValidationDisabled_WithNoErrorsData( 164public async Task ProcessAsync_SuppressesOutput_IfModelOnly_WithNoModelError( 206public async Task ProcessAsync_GeneratesExpectedOutput_WithModelError(ValidationSummary validationSummary) 236return Task.FromResult<TagHelperContent>(tagHelperContent); 270public async Task ProcessAsync_GeneratesExpectedOutput_WithPropertyErrors() 306return Task.FromResult<TagHelperContent>(tagHelperContent); 338public async Task ProcessAsync_CallsIntoGenerateValidationSummaryWithExpectedParameters( 367getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>( 393public async Task ProcessAsync_MergesTagBuilderFromGenerateValidationSummary() 422getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>( 465public async Task ProcessAsync_DoesNothingIfValidationSummaryNone() 481getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>( 510public async Task ProcessAsync_GeneratesValidationSummaryWhenNotNone(ValidationSummary validationSummary) 537getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>( 587public async Task ProcessAsync_GeneratesExpectedOutput_WithModelErrorForIEnumerable() 622return Task.FromResult<TagHelperContent>(tagHelperContent);
Microsoft.AspNetCore.Mvc.Test (11)
Routing\ActionConstraintMatcherPolicyTest.cs (11)
19public async Task Apply_CanBeAmbiguous() 41public async Task Apply_PrefersActionWithConstraints() 74public async Task Apply_ConstraintsRejectAll() 109public async Task Apply_ConstraintsRejectAll_DifferentStages() 146public async Task Apply_ConstraintsInOrder() 180public async Task Apply_SkipsOverInvalidEndpoints() 219public async Task Apply_IncludesNonMvcEndpoints() 255public async Task Apply_ConstraintsInOrder_MultipleStages() 294public async Task Apply_Fallback_ToActionWithoutConstraints() 336public async Task DataTokens_RoundTrip() 480(context) => Task.CompletedTask,
Microsoft.AspNetCore.Mvc.Testing (2)
DeferredHostBuilder.cs (2)
143public async Task StartAsync(CancellationToken cancellationToken = default) 157public Task StopAsync(CancellationToken cancellationToken = default) => _host.StopAsync(cancellationToken);
Microsoft.AspNetCore.Mvc.ViewFeatures (103)
Buffers\PagedBufferedTextWriter.cs (16)
29public override Task FlushAsync() => FlushAsyncCore(); 34private Task FlushAsyncCore() 41return Task.CompletedTask; 47private async Task FlushAsyncAwaited() 102public override Task WriteAsync(char value) 104var flushTask = FlushAsyncCore(); 111private async Task WriteAsyncAwaited(Task flushTask, char value) 117public override Task WriteAsync(char[] buffer, int index, int count) 119var flushTask = FlushAsyncCore(); 126private async Task WriteAsyncAwaited(Task flushTask, char[] buffer, int index, int count) 132public override Task WriteAsync(string value) 134var flushTask = FlushAsyncCore(); 141private async Task WriteAsyncAwaited(Task flushTask, string value)
Buffers\ViewBuffer.cs (2)
210/// <returns>A <see cref="Task"/> which will complete once content has been written.</returns> 211public async Task WriteToAsync(TextWriter writer, HtmlEncoder encoder)
Buffers\ViewBufferTextWriter.cs (16)
178public override Task WriteAsync(char value) 181return Task.CompletedTask; 185public override Task WriteAsync(char[] buffer, int index, int count) 195return Task.CompletedTask; 199public override Task WriteAsync(string value) 202return Task.CompletedTask; 219public override Task WriteLineAsync(char value) 223return Task.CompletedTask; 227public override Task WriteLineAsync(char[] value, int start, int offset) 231return Task.CompletedTask; 235public override Task WriteLineAsync(string value) 239return Task.CompletedTask; 243public override Task WriteLineAsync() 246return Task.CompletedTask; 270/// <returns>A <see cref="Task"/> that represents the asynchronous copy and flush operations.</returns> 271public override async Task FlushAsync()
Controller.cs (4)
341/// <returns>A <see cref="Task"/> instance.</returns> 343public virtual Task OnActionExecutionAsync( 362return Task.CompletedTask; 364static async Task Awaited(Controller controller, Task<ActionExecutedContext> task)
Filters\AntiforgeryMiddlewareAuthorizationFilter.cs (2)
15public Task OnAuthorizationAsync(AuthorizationFilterContext context) 29return Task.CompletedTask;
Filters\SaveTempDataFilter.cs (5)
14private static readonly Func<object, Task> OnStartingCallback = (state) => OnStarting((HttpContext)state); 50private static Task OnStarting(HttpContext httpContext) 55return Task.CompletedTask; 65return Task.CompletedTask; 74return Task.CompletedTask;
Filters\ValidateAntiforgeryTokenAuthorizationFilter.cs (1)
23public async Task OnAuthorizationAsync(AuthorizationFilterContext context)
HtmlHelper.cs (3)
461public Task RenderPartialAsync(string partialViewName, object model, ViewDataDictionary viewData) 503/// <returns>The <see cref="Task"/>.</returns> 504protected virtual async Task RenderPartialCoreAsync(
IViewComponentHelper.cs (2)
24/// <returns>A <see cref="Task"/> that on completion returns the rendered <see cref="IHtmlContent" />. 37/// <returns>A <see cref="Task"/> that on completion returns the rendered <see cref="IHtmlContent" />.
IViewComponentResult.cs (2)
24/// <returns>A <see cref="Task"/> that represents the asynchronous execution.</returns> 25Task ExecuteAsync(ViewComponentContext context);
NullView.cs (2)
15public Task RenderAsync(ViewContext context) 19return Task.CompletedTask;
PartialViewResult.cs (1)
60public override Task ExecuteResultAsync(ActionContext context)
PartialViewResultExecutor.cs (3)
128/// <returns>A <see cref="Task"/> which will complete when view execution is completed.</returns> 129public virtual Task ExecuteAsync(ActionContext actionContext, IView view, PartialViewResult viewResult) 145public virtual async Task ExecuteAsync(ActionContext context, PartialViewResult result)
Rendering\HtmlHelperPartialExtensions.cs (10)
22/// A <see cref="Task"/> that on completion returns a new <see cref="IHtmlContent"/> instance containing 44/// A <see cref="Task"/> that on completion returns a new <see cref="IHtmlContent"/> instance containing 67/// A <see cref="Task"/> that on completion returns a new <see cref="IHtmlContent"/> instance containing 243var result = htmlHelper.RenderPartialAsync(partialViewName, model, viewData); 254/// <returns>A <see cref="Task"/> that renders the created HTML when it executes.</returns> 258public static Task RenderPartialAsync( 276/// <returns>A <see cref="Task"/> that renders the created HTML when it executes.</returns> 280public static Task RenderPartialAsync( 299/// <returns>A <see cref="Task"/> that renders the created HTML when it executes.</returns> 303public static Task RenderPartialAsync(
Rendering\IHtmlHelper.cs (3)
488/// A <see cref="Task"/> that on completion returns a new <see cref="IHtmlContent"/> instance containing 576/// <returns>A <see cref="Task"/> that renders the created HTML when it executes.</returns> 580Task RenderPartialAsync(string partialViewName, object model, ViewDataDictionary viewData);
Rendering\ViewComponentHelperExtensions.cs (4)
20/// <returns>A <see cref="Task"/> that on completion returns the rendered <see cref="IHtmlContent" />. 34/// <returns>A <see cref="Task"/> that on completion returns the rendered <see cref="IHtmlContent" />. 49/// <returns>A <see cref="Task"/> that on completion returns the rendered <see cref="IHtmlContent" />. 63/// <returns>A <see cref="Task"/> that on completion returns the rendered <see cref="IHtmlContent" />.
TemplateRenderer.cs (1)
123var renderTask = viewEngineResult.View.RenderAsync(viewContext);
ViewComponentResult.cs (1)
59public override Task ExecuteResultAsync(ActionContext context)
ViewComponentResultExecutor.cs (1)
67public virtual async Task ExecuteAsync(ActionContext context, ViewComponentResult result)
ViewComponents\ContentViewComponentResult.cs (3)
48/// <returns>A completed <see cref="Task"/>.</returns> 49public Task ExecuteAsync(ViewComponentContext context) 53return Task.CompletedTask;
ViewComponents\DefaultViewComponentDescriptorProvider.cs (3)
92nameof(Task))); 104else if (typeof(Task).IsAssignableFrom(selectedMethod.ReturnType)) 109nameof(Task)));
ViewComponents\DefaultViewComponentInvoker.cs (2)
51public async Task InvokeAsync(ViewComponentContext context) 59if (returnType == typeof(void) || returnType == typeof(Task))
ViewComponents\HtmlContentViewComponentResult.cs (3)
49/// <returns>A completed <see cref="Task"/>.</returns> 50public Task ExecuteAsync(ViewComponentContext context) 54return Task.CompletedTask;
ViewComponents\IViewComponentInvoker.cs (2)
16/// <returns>A <see cref="Task"/> that represents the asynchronous operation of execution.</returns> 17Task InvokeAsync(ViewComponentContext context);
ViewComponents\ViewViewComponentResult.cs (3)
58var task = ExecuteAsync(context); 67/// <returns>A <see cref="Task"/> which will complete when view rendering is completed.</returns> 68public async Task ExecuteAsync(ViewComponentContext context)
ViewEngines\IView.cs (2)
24/// <returns>A <see cref="Task"/> that on completion renders the view.</returns> 25Task RenderAsync(ViewContext context);
ViewExecutor.cs (4)
120/// <returns>A <see cref="Task"/> which will complete when view execution is completed.</returns> 121public virtual async Task ExecuteAsync( 179/// <returns>A <see cref="Task"/> which will complete when view execution is completed.</returns> 180protected async Task ExecuteAsync(
ViewResult.cs (1)
60public override async Task ExecuteResultAsync(ActionContext context)
ViewResultExecutor.cs (1)
139public async Task ExecuteAsync(ActionContext context, ViewResult result)
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (159)
Buffers\PagedBufferedTextWriterTest.cs (13)
22public async Task Write_Char() 43public async Task Write_CharArray_Null() 61public async Task Write_CharArray() 113public async Task Write_CharArray_Bounded() 140public async Task Write_String_Null() 158public async Task Write_String() 186public async Task SynchronousWrites_FollowedByAsyncWriteString_WritesAllContent() 205public async Task SynchronousWrites_FollowedByAsyncWriteChar_WritesAllContent() 224public async Task SynchronousWrites_FollowedByAsyncWriteCharArray_WritesAllContent() 243public async Task FlushAsync_ReturnsPages() 264public async Task FlushAsync_FlushesContent() 284public async Task FlushAsync_WritesContentToInner() 304public async Task FlushAsync_WritesContentToInner_WithLargeArrays()
Buffers\ViewBufferTest.cs (2)
205public async Task WriteToAsync_WritesRazorValues_ToTextWriter() 227public async Task WriteToAsync_WritesRazorValuesFromAllBuffers(int valuesToWrite)
Buffers\ViewBufferTextWriterTest.cs (3)
37public async Task Write_WritesDataTypes_AfterFlush() 105public async Task WriteLines_WritesCharBuffer() 138public async Task Write_WritesStringBuffer()
ControllerTest.cs (2)
343public async Task Controller_ActionFilter_SettingResult_ShortCircuits() 351public async Task Controller_ActionFilter_Calls_OnActionExecuted()
DefaultDisplayTemplatesTest.cs (1)
351.Returns(Task.Run(() =>
DefaultEditorTemplatesTest.cs (2)
1299.Returns(Task.Run(() => 1578public Task RenderPartialAsync(string partialViewName, object model, ViewDataDictionary viewData)
DependencyInjection\MvcViewFeaturesMvcBuilderExtensionsTest.cs (1)
174public Task<string> InvokeAsync() => Task.FromResult("Hello world");
Filters\AntiforgeryMiddlewareAuthorizationFilterTest.cs (4)
15public async Task FiltersWorks_MiddlewareInvoked_InvalidFeature() 33public async Task FiltersWorks_MiddlewareInvoked_ValidFeature() 51public async Task FiltersWorks_MiddlewareNotInvoked_InvalidFeature() 68public async Task FiltersWorks_MiddlewareNotInvoked_ValidFeature()
Filters\AutoValidateAntiforgeryTokenAuthorizationFilterTest.cs (6)
20public async Task Filter_ValidatesAntiforgery_ForUnsafeMethod(string httpMethod) 26.Returns(Task.FromResult(0)) 48public async Task Filter_SkipsAntiforgeryVerification_ForSafeMethod(string httpMethod) 54.Returns(Task.FromResult(0)) 72public async Task Filter_SkipsAntiforgeryVerification_WhenOverridden() 78.Returns(Task.FromResult(0))
Filters\SaveTempDataFilterTest.cs (13)
29public async Task OnResultExecuting_DoesntThrowIfResponseStarted() 53.Setup(rf => rf.OnStarting(It.IsAny<Func<object, Task>>(), It.IsAny<object>())) 97public async Task OnResourceExecuting_DoesNotSaveTempData_WhenTempDataAlreadySaved() 119public async Task OnResourceExecuting_DoesNotSaveTempData_WhenUnhandledExceptionOccurs() 142public async Task OnResultExecuting_SavesTempData_WhenTempData_NotSavedAlready(IActionResult result) 162public async Task OnResourceExecuting_KeepsTempData_ForIKeepTempDataResult() 183public async Task OnResultExecuting_DoesNotKeepTempData_ForNonIKeepTempDataResult() 383public Task ExecuteResultAsync(ActionContext context) 391public Task ExecuteResultAsync(ActionContext context) 400private Func<Task> _responseStartingAsync = () => Task.FromResult(true); 415public override void OnStarting(Func<object, Task> callback, object state) 430public async Task FireOnSendingHeadersAsync()
Filters\ValidateAntiforgeryTokenAuthorizationFilterTest.cs (5)
24public async Task Filter_ValidatesAntiforgery_ForAllMethods(string httpMethod) 30.Returns(Task.FromResult(0)) 48public async Task Filter_SkipsAntiforgeryVerification_WhenOverridden() 54.Returns(Task.FromResult(0)) 76public async Task Filter_SetsFailureResult()
PartialViewResultExecutorTest.cs (2)
281public async Task ExecuteAsync_UsesContentType_FromPartialViewResult() 310public async Task ExecuteAsync_UsesStatusCode_FromPartialViewResult()
PartialViewResultTest.cs (6)
42public async Task ExecuteResultAsync_Throws_IfServicesNotRegistered() 61public async Task ExecuteResultAsync_Throws_IfViewCouldNotBeFound_MessageUsesGetViewLocations() 99public async Task ExecuteResultAsync_Throws_IfViewCouldNotBeFound_MessageUsesFindViewLocations() 137public async Task ExecuteResultAsync_Throws_IfViewCouldNotBeFound_MessageUsesAllLocations() 177public async Task ExecuteResultAsync_FindsAndExecutesView() 186.Returns(Task.FromResult(0))
Rendering\DefaultTemplatesUtilities.cs (1)
313.Returns(Task.FromResult(0));
Rendering\HtmlHelperDisplayExtensionsTest.cs (13)
53.Returns(Task.FromResult(0)); 136.Returns(Task.FromResult(0)); 162.Returns(Task.FromResult(0)); 188.Returns(Task.FromResult(0)); 216.Returns(Task.FromResult(0)); 244.Returns(Task.FromResult(0)); 291.Returns(Task.FromResult(0)); 322.Returns(Task.FromResult(0)); 363.Returns(Task.FromResult(0)); 388.Returns(Task.FromResult(0)); 416.Returns(Task.FromResult(0)); 463.Returns(Task.FromResult(0)); 490.Returns(Task.FromResult(0));
Rendering\HtmlHelperEditorExtensionsTest.cs (2)
20.Returns(Task.FromResult(0)); 46.Returns(Task.FromResult(0));
Rendering\HtmlHelperPartialExtensionsTest.cs (21)
53.Returns(Task.FromResult(htmlContent)) 107public async Task PartialAsyncMethods_CallHtmlHelperWithExpectedArguments( 127.Returns(Task.FromResult(htmlContent)) 182public async Task RenderPartialMethods_CallHtmlHelperWithExpectedArguments( 183Func<IHtmlHelper, Task> renderPartialAsyncMethod, 202.Returns(Task.FromResult(true)) 213public static TheoryData<Func<IHtmlHelper, Task>, object, ViewDataDictionary> RenderPartialAsyncExtensionMethods 219return new TheoryData<Func<IHtmlHelper, Task>, object, ViewDataDictionary> 230public async Task RenderPartialAsyncMethods_CallHtmlHelperWithExpectedArguments( 231Func<IHtmlHelper, Task> renderPartialAsyncMethod, 250.Returns(Task.FromResult(true)) 272.Returns(Task.FromResult((IHtmlContent)expected)) 293.Returns(Task.FromResult((IHtmlContent)expected)) 317.Returns(Task.FromResult((IHtmlContent)expected)) 339.Returns(Task.FromResult((IHtmlContent)expected)) 397public async Task PartialAsync_Throws_IfViewNotFound_MessageUsesGetViewLocations() 426public async Task PartialAsync_Throws_IfViewNotFound_MessageUsesFindViewLocations() 455public async Task PartialAsync_Throws_IfViewNotFound_MessageUsesAllLocations() 486public async Task RenderPartialAsync_Throws_IfViewNotFound_MessageUsesGetViewLocations() 515public async Task RenderPartialAsync_Throws_IfViewNotFound_MessageUsesFindViewLocations() 544public async Task RenderPartialAsync_Throws_IfViewNotFound_MessageUsesAllLocations()
SessionStateTempDataProviderTest.cs (4)
109public Task LoadAsync(CancellationToken cancellationToken = default(CancellationToken)) 111return Task.FromResult(0); 114public Task CommitAsync(CancellationToken cancellationToken = default(CancellationToken)) 116return Task.FromResult(0);
ViewComponentResultTest.cs (21)
51public async Task ExecuteResultAsync_Throws_IfServicesNotRegistered() 70public async Task ExecuteAsync_ViewComponentResult_AllowsNullViewDataAndTempData() 99public async Task ExecuteResultAsync_Throws_IfNameOrTypeIsNotSet() 120public async Task ExecuteResultAsync_Throws_IfViewComponentCouldNotBeFound_ByName() 143public async Task ExecuteResultAsync_Throws_IfViewComponentCouldNotBeFound_ByType() 168public async Task ExecuteResultAsync_ExecutesSyncViewComponent() 199public async Task ExecuteResultAsync_UsesDictionaryArguments() 230public async Task ExecuteResultAsync_ExecutesAsyncViewComponent() 261public async Task ExecuteResultAsync_ExecutesViewComponent_AndWritesDiagnosticListener() 302public async Task ExecuteResultAsync_ExecutesViewComponent_ByShortName() 333public async Task ExecuteResultAsync_ExecutesViewComponent_ByFullName() 364public async Task ExecuteResultAsync_ExecutesViewComponent_ByType() 395public async Task ExecuteResultAsync_WithCustomViewComponentHelper() 408var result = Task.FromResult<IHtmlContent>(new HtmlContentBuilder().AppendHtml(expected)); 437public async Task ExecuteResultAsync_WithCustomViewComponentHelper_ForLargeText() 450var result = Task.FromResult<IHtmlContent>(new HtmlContentBuilder().AppendHtml(expected)); 479public async Task ExecuteResultAsync_SetsStatusCode() 537public async Task ViewComponentResult_SetsContentTypeHeader( 579public async Task ViewComponentResult_SetsContentTypeHeader_OverrideResponseContentType() 616public async Task ViewComponentResult_NoContentTypeSet_PreservesResponseContentType( 744return Task.FromResult(new HtmlString("Hello-Async, " + name));
ViewComponents\DefaultViewComponentActivatorTests.cs (2)
64public async Task DefaultViewComponentActivator_ReleaseAsync_PrefersAsyncDisposableOverDisposable() 101public Task ExecuteAsync()
ViewComponents\DefaultViewComponentDescriptorProviderTest.cs (5)
123public Task InvokeAsync() => Task.FromResult(0); 140public Task Invoke() => Task.FromResult(0); 145public Task<int> Invoke() => Task.FromResult(0);
ViewComponents\DefaultViewComponentFactoryTest.cs (2)
59public async Task ReleaseViewComponentAsync_CallsDispose_OnTheInstance() 83public async Task ReleaseViewComponentAsync_CallsDisposeAsync_OnAsyncDisposableComponents()
ViewComponents\ViewComponentFeatureProviderTest.cs (1)
72public Task<string> InvokeAsync() => Task.FromResult("Hello world");
ViewComponents\ViewViewComponentResultTest.cs (7)
31.Returns(Task.FromResult(result: true)) 70.Returns(Task.FromResult(result: true)) 104.Returns(Task.FromResult(result: true)) 299public async Task ExecuteAsync_RendersPartialViews() 334public async Task ExecuteAsync_ResolvesViewEngineFromServiceProvider_IfNoViewEngineIsExplicitlyProvided() 376public async Task ExecuteAsync_ThrowsIfPartialViewCannotBeFound() 419public async Task ExecuteAsync_Throws_IfNoViewEngineCanBeResolved()
ViewComponentTests.cs (4)
276public Task LoadAsync(CancellationToken cancellationToken = default(CancellationToken)) 278return Task.FromResult(0); 281public Task CommitAsync(CancellationToken cancellationToken = default(CancellationToken)) 283return Task.FromResult(0);
ViewExecutorTest.cs (8)
82public async Task ExecuteAsync_ExceptionInSyncContext() 121public async Task ExecuteAsync_SetsContentTypeAndEncoding( 171public async Task ExecuteAsync_ViewResultAllowNull() 216public async Task ExecuteAsync_SetsStatusCode() 251public async Task ExecuteAsync_WritesDiagnostic() 295public async Task ExecuteAsync_DoesNotWriteToResponse_OnceExceptionIsThrown() 336public async Task ExecuteAsync_AsynchronouslyFlushesToTheResponseStream_PriorToDispose(int writeLength) 380private IView CreateView(Func<ViewContext, Task> action)
ViewResultExecutorTest.cs (2)
276public async Task ExecuteAsync_UsesContentType_FromViewResult() 300public async Task ExecuteAsync_UsesStatusCode_FromViewResult()
ViewResultTest.cs (6)
52public async Task ExecuteResultAsync_Throws_IfServicesNotRegistered() 71public async Task ExecuteResultAsync_Throws_IfViewCouldNotBeFound_MessageUsesGetViewLocations() 109public async Task ExecuteResultAsync_Throws_IfViewCouldNotBeFound_MessageUsesFindViewLocations() 149public async Task ExecuteResultAsync_Throws_IfViewCouldNotBeFound_MessageUsesAllLocations() 189public async Task ExecuteResultAsync_FindsAndExecutesView() 198.Returns(Task.FromResult(0))
Microsoft.AspNetCore.OpenApi (22)
Services\IDocumentProvider.cs (1)
22Task GenerateAsync(string documentName, TextWriter writer);
Services\OpenApiDocumentProvider.cs (1)
21public async Task GenerateAsync(string documentName, TextWriter writer)
Services\OpenApiDocumentService.cs (1)
63private async Task ApplyTransformersAsync(OpenApiDocument document, CancellationToken cancellationToken)
Services\OpenApiOptions.cs (2)
72public OpenApiOptions UseTransformer(Func<OpenApiDocument, OpenApiDocumentTransformerContext, CancellationToken, Task> transformer) 85public OpenApiOptions UseOperationTransformer(Func<OpenApiOperation, OpenApiOperationTransformerContext, CancellationToken, Task> transformer)
src\Shared\ObjectMethodExecutor\ObjectMethodExecutorFSharpSupport.cs (6)
39/// or to a <see cref="Task"/>, if <c>TResult</c> is <see href="https://fsharp.github.io/fsharp-core-docs/reference/fsharp-core-unit-0.html">FSharp.Core.Unit</see>. 49/// to a <see cref="Task{TResult}"/>, or to a <see cref="Task"/>, if <c>TResult</c> is <see href="https://fsharp.github.io/fsharp-core-docs/reference/fsharp-core-unit-0.html">FSharp.Core.Unit</see>; 53/// When this method returns, contains the type of the closed generic instantiation of <see cref="Task{TResult}"/> or of <see cref="Task"/> that will be returned 114/// to a void-returning <see cref="Task"/> or <see cref="ValueTask"/>. 145var typeDef when typeDef == typeof(Task<>) && IsFSharpUnit(genericAwaitableType.GetGenericArguments()[0]) => (typeof(Task), MakeTaskOfUnitToTaskExpression(genericAwaitableType)), 155return Expression.Lambda(Expression.Convert(closedGenericTaskParam, typeof(Task)), closedGenericTaskParam);
src\SignalR\common\Shared\MemoryBufferWriter.cs (4)
138public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) 191private async Task CopyToSlowAsync(Stream destination, CancellationToken cancellationToken) 277public override Task FlushAsync(CancellationToken cancellationToken) => Task.CompletedTask;
Transformers\DelegateOpenApiDocumentTransformer.cs (5)
26private readonly Func<OpenApiDocument, OpenApiDocumentTransformerContext, CancellationToken, Task>? _documentTransformer; 27private readonly Func<OpenApiOperation, OpenApiOperationTransformerContext, CancellationToken, Task>? _operationTransformer; 29public DelegateOpenApiDocumentTransformer(Func<OpenApiDocument, OpenApiDocumentTransformerContext, CancellationToken, Task> transformer) 34public DelegateOpenApiDocumentTransformer(Func<OpenApiOperation, OpenApiOperationTransformerContext, CancellationToken, Task> transformer) 39public async Task TransformAsync(OpenApiDocument document, OpenApiDocumentTransformerContext context, CancellationToken cancellationToken)
Transformers\IOpenApiDocumentTransformer.cs (1)
20public Task TransformAsync(OpenApiDocument document, OpenApiDocumentTransformerContext context, CancellationToken cancellationToken);
Transformers\TypeBasedOpenApiDocumentTransformer.cs (1)
23public async Task TransformAsync(OpenApiDocument document, OpenApiDocumentTransformerContext context, CancellationToken cancellationToken)
Microsoft.AspNetCore.OpenApi.Microbenchmarks (8)
GenerationBenchmarks.cs (1)
40public async Task GenerateDocument()
TransformersBenchmark.cs (7)
35return Task.CompletedTask; 61return Task.CompletedTask; 68public async Task OperationTransformerAsDelegate() 74public async Task ActivatedDocumentTransformer() 80public async Task DocumentTransformerAsDelegate() 87public Task TransformAsync(OpenApiDocument document, OpenApiDocumentTransformerContext context, CancellationToken cancellationToken) 90return Task.CompletedTask;
Microsoft.AspNetCore.OpenApi.Tests (127)
Extensions\OpenApiEndpointRouteBuilderExtensionsTests.cs (4)
49public async Task MapOpenApi_ReturnsRenderedDocument() 76public async Task MapOpenApi_ReturnsDefaultDocumentIfNoNameProvided() 102public async Task MapOpenApi_Returns404ForUnresolvedDocument() 125public async Task MapOpenApi_ReturnsDocumentIfNameProvidedInQuery()
Integration\OpenApiDocumentIntegrationTests.cs (1)
19public async Task VerifyOpenApiDocument(string documentName)
Services\OpenApiComponentService\OpenApiComponentService.ParameterSchemas.cs (11)
53public async Task GetOpenApiParameters_HandlesRouteParameterWithPrimitiveType(Delegate requestHandler, string schemaType, string schemaFormat, bool isNullable) 82public async Task GetOpenApiParameters_HandlesRouteParameterWithParsableType(Delegate requestHandler, string schemaType, string schemaFormat) 124public async Task GetOpenApiParameters_HandlesRouteParameterWithRouteConstraint(string routeTemplate, string type, string format, int? minimum, int? maximum, int? minLength, int? maxLength, string pattern) 161public async Task GetOpenApiParameters_HandlesRouteParametersWithDefaultValue(Delegate requestHandler, Action<IOpenApiAny> assert) 180public async Task GetOpenApiParameters_HandlesEnumParameterWithoutConverter() 200public async Task GetOpenApiParameters_HandlesEnumParameterWithConverter() 235public async Task GetOpenApiParameters_HandlesRouteParameterFromAsParameters() 263public async Task GetOpenApiParameters_HandlesRouteParametersWithMvcModelBinding() 288public async Task GetOpenApiParameters_HandlesRouteParametersWithValidationsInMvcModelBinding() 330public async Task GetOpenApiParameters_HandlesRouteParameterWithValidationAttributes(Delegate requestHandler, Action<OpenApiSchema> verifySchema) 362public async Task GetOpenApiParameters_HandlesArrayBasedTypes(Delegate requestHandler, string innerSchemaType, bool isNullable)
Services\OpenApiComponentService\OpenApiComponentService.RequestBodySchemas.cs (5)
12public async Task GetOpenApiRequestBody_GeneratesSchemaForPoco() 58public async Task GetOpenApiRequestBody_GeneratesSchemaForFileTypes() 83public async Task GetOpenApiRequestBody_GeneratesSchemaForFilesInRecursiveType() 111public async Task GetOpenApiRequestBody_GeneratesSchemaForListOf() 170public async Task GetOpenApiRequestBody_HandlesPolymorphicRequestWithoutDiscriminator()
Services\OpenApiComponentService\OpenApiComponentService.ResponseSchemas.cs (8)
30public async Task GetOpenApiResponse_HandlesResponsesWithPrimitiveTypes(Delegate requestHandler, string contentType, string schemaType, string schemaFormat) 51public async Task GetOpenApiResponse_HandlesPocoResponse() 94public async Task GetOpenApiResponse_HandlesNullablePocoResponse() 140public async Task GetOpenApiResponse_HandlesInheritedTypeResponse() 189public async Task GetOpenApiResponse_HandlesGenericResponse() 254public async Task GetOpenApiResponse_HandlesPolymorphicResponseWithoutDiscriminator() 293public async Task GetOpenApiResponse_HandlesResultOfAnonymousType() 353public async Task GetOpenApiResponse_HandlesListOf()
Services\OpenApiDocumentProviderTests.cs (1)
14public async Task GenerateAsync_ReturnsDocument()
Services\OpenApiDocumentService\OpenApiDocumentServiceTests.Operations.cs (8)
11public async Task GetOpenApiOperation_CapturesSummary() 29public async Task GetOpenApiOperation_CapturesLastSummary() 47public async Task GetOpenApiOperation_CapturesDescription() 65public async Task GetOpenApiOperation_CapturesDescriptionLastDescription() 83public async Task GetOpenApiOperation_CapturesTags() 107public async Task GetOpenApiOperation_CapturesTagsLastTags() 131public async Task GetOpenApiOperation_SetsDefaultValueForTags() 155public async Task GetOpenApiOperation_CapturesTagsInDocument()
Services\OpenApiDocumentService\OpenApiDocumentServiceTests.Parameters.cs (6)
12public async Task GetOpenApiParameters_GeneratesParameterLocationCorrectly() 41public async Task GetOpenApiParameters_RouteParametersAreAlwaysRequired() 67public async Task GetOpenApiParameters_SetsRequirednessForQueryParameters() 93public async Task GetOpenApiParameters_SetsRequirednessForHeaderParameters() 122public async Task GetOpenApiParameters_RouteParametersAreAlwaysRequired_NullabilityDisabled() 149public async Task GetOpenApiRequestBody_SkipsRequestBodyParameters()
Services\OpenApiDocumentService\OpenApiDocumentServiceTests.Paths.cs (5)
11public async Task GetOpenApiPaths_ReturnsPaths() 46public async Task GetOpenApiPaths_RespectsShouldInclude() 71public async Task GetOpenApiPaths_RespectsSamePaths() 102public async Task GetOpenApiPaths_HandlesRouteParameters() 142public async Task GetOpenApiPaths_HandlesRouteConstraints()
Services\OpenApiDocumentService\OpenApiDocumentServiceTests.RequestBody.cs (27)
14public async Task GetRequestBody_VerifyDefaultFormEncoding() 41public async Task GetRequestBody_HandlesIFormFile(bool withAttribute) 79public async Task GetRequestBody_HandlesIFormFileOptionality(bool isOptional) 108public async Task GetRequestBody_HandlesIFormFileCollection(bool withAttribute) 147public async Task GetRequestBody_HandlesIFormFileCollectionOptionality(bool isOptional) 174public async Task GetRequestBody_MultipleFormFileParameters() 214public async Task GetRequestBody_IFormFileHandlesAcceptsMetadata() 241public async Task GetRequestBody_IFormFileHandlesConsumesAttribute() 268public async Task GetRequestBody_HandlesJsonBody() 293public async Task GetRequestBody_HandlesJsonBodyOptionality(bool isOptional) 321public async Task GetRequestBody_HandlesJsonBodyWithAttribute() 343public async Task GetRequestBody_HandlesJsonBodyWithAcceptsMetadata() 364public async Task GetRequestBody_HandlesJsonBodyWithConsumesAttribute() 385public async Task GetOpenApiRequestBody_SetsNullRequestBodyWithNoParameters() 404public async Task GetOpenApiRequestBody_HandlesFromFormWithPoco() 456public async Task GetOpenApiRequestBody_HandlesFromFormWithPoco_MvcAction() 508public async Task GetOpenApiRequestBody_HandlesMultipleFormWithPoco() 577public async Task GetOpenApiRequestBody_HandlesMultipleFormWithPoco_MvcAction() 645public async Task GetOpenApiRequestBody_HandlesFromFormWithPocoSingleProp_MvcAction() 685public async Task GetOpenApiRequestBody_HandlesFormModelWithFile_MvcAction() 724public async Task GetOpenApiRequestBody_HandlesFormModelWithFile() 768public async Task GetOpenApiRequestBody_HandlesFormWithPrimitives_MvcAction(string actionMethodName, string type, string format) 824public async Task GetOpenApiRequestBody_HandlesFormWithPrimitives(Delegate requestHandler, string schemaType, string schemaFormat) 855public async Task GetOpenApiRequestBody_HandlesFormWithMultipleMixedTypes() 922public async Task GetOpenApiRequestBody_HandlesFormWithMultipleMixedTypes_MvcAction() 989public async Task GetOpenApiRequestBody_HandlesStreamAndPipeReader() 1015public async Task GetOpenApiRequestBody_HandlesStreamAndPipeReader_MvcAction()
Services\OpenApiDocumentService\OpenApiDocumentServiceTests.Responses.cs (10)
12public async Task GetOpenApiResponse_SupportsMultipleResponseViaAttributes() 43public async Task GetOpenApiResponse_SupportsProblemDetailsResponse() 64public async Task GetOpenApiResponse_SupportsMultipleResponsesForStatusCode() 89public async Task GetOpenApiResponse_SupportsMultipleResponseTypesWithTypeForStatusCode() 115public async Task GetOpenApiResponse_SupportsMultipleResponseTypesWitDifferentContentTypes() 144public async Task GetOpenApiResponse_SupportsDifferentResponseTypesWitDifferentContentTypes() 170public async Task GetOpenApiResponse_ProducesDefaultResponse() 189public async Task GetOpenApiResponse_SupportsMvcProducesAttribute() 217public async Task GetOpenApiResponse_SupportsGeneratingDefaultResponseField() 249public async Task GetOpenApiResponse_SupportsGeneratingDefaultResponseWithSuccessResponse()
Services\OpenApiDocumentServiceTestsBase.cs (3)
28public static async Task VerifyOpenApiDocument(IEndpointRouteBuilder builder, Action<OpenApiDocument> verifyOpenApiDocument) 31public static async Task VerifyOpenApiDocument(IEndpointRouteBuilder builder, OpenApiOptions openApiOptions, Action<OpenApiDocument> verifyOpenApiDocument) 38public static async Task VerifyOpenApiDocument(ActionDescriptor action, Action<OpenApiDocument> verifyOpenApiDocument)
Services\OpenApiGeneratorTests.cs (4)
159AssertJsonResponse(GetOpenApiOperation(() => Task.FromResult(new InferredJsonClass())), "object"); 160AssertJsonResponse(GetOpenApiOperation(() => Task.FromResult((IInferredJsonInterface)null)), "object"); 189AssertVoid(GetOpenApiOperation(() => Task.CompletedTask)); 190AssertVoid(GetOpenApiOperation(() => Task.FromResult(default(FSharp.Core.Unit))));
Transformers\DocumentTransformerTests.cs (17)
13public async Task DocumentTransformer_RunsInRegisteredOrder() 24return Task.CompletedTask; 30return Task.CompletedTask; 40public async Task DocumentTransformer_SupportsActivatedTransformers() 57public async Task DocumentTransformer_SupportsInstanceTransformers() 74public async Task DocumentTransformer_SupportsActivatedTransformerWithSingletonDependency() 100public async Task DocumentTransformer_SupportsActivatedTransformerWithTransientDependency() 126public async Task DocumentTransformer_SupportsDisposableActivatedTransformer() 145public async Task DocumentTransformer_SupportsAsyncDisposableActivatedTransformer() 165public Task TransformAsync(OpenApiDocument document, OpenApiDocumentTransformerContext context, CancellationToken cancellationToken) 168return Task.CompletedTask; 183public Task TransformAsync(OpenApiDocument document, OpenApiDocumentTransformerContext context, CancellationToken cancellationToken) 186return Task.CompletedTask; 202public Task TransformAsync(OpenApiDocument document, OpenApiDocumentTransformerContext context, CancellationToken cancellationToken) 205return Task.CompletedTask; 211public Task TransformAsync(OpenApiDocument document, OpenApiDocumentTransformerContext context, CancellationToken cancellationToken) 215return Task.CompletedTask;
Transformers\OpenApiOptionsTests.cs (6)
14var transformer = new Func<OpenApiDocument, OpenApiDocumentTransformerContext, CancellationToken, Task>((document, context, cancellationToken) => 17return Task.CompletedTask; 65var transformer = new Func<OpenApiOperation, OpenApiOperationTransformerContext, CancellationToken, Task>((operation, context, cancellationToken) => 68return Task.CompletedTask; 82public Task TransformAsync(OpenApiDocument document, OpenApiDocumentTransformerContext context, CancellationToken cancellationToken) 84return Task.CompletedTask;
Transformers\OperationTransformerTests.cs (11)
10public async Task OperationTransformer_CanAccessApiDescription() 22return Task.CompletedTask; 44public async Task OperationTransformer_RunsInRegisteredOrder() 55return Task.CompletedTask; 61return Task.CompletedTask; 67return Task.CompletedTask; 89public async Task OperationTransformer_CanMutateOperationViaDocumentTransformer() 106return Task.CompletedTask; 128public async Task OperationTransformer_ThrowsExceptionIfDescriptionIdNotFound() 138return Task.CompletedTask; 142return Task.CompletedTask;
Microsoft.AspNetCore.OutputCaching (8)
OutputCacheMiddleware.cs (3)
80/// <returns>A <see cref="Task"/> that completes when the middleware has completed processing.</returns> 81public Task Invoke(HttpContext httpContext) 92private async Task InvokeAwaited(HttpContext httpContext, IReadOnlyList<IOutputCachePolicy> policies)
src\Shared\TaskToApm.cs (3)
32public static IAsyncResult Begin(Task task, AsyncCallback? callback, object? state) => 69internal readonly Task _task; 77internal TaskAsyncResult(Task task, object? state, AsyncCallback? callback)
Streams\OutputCacheStream.cs (2)
86public override async Task FlushAsync(CancellationToken cancellationToken) 156public override async Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) =>
Microsoft.AspNetCore.OutputCaching.Microbenchmarks (8)
EndToEndBenchmarks.cs (8)
48public async Task InitAsync() 90static Task WriteInRandomChunks(ReadOnlyMemory<byte> source, PipeWriter destination, CancellationToken cancellationToken) 106static async Task WriteInRandomChunksAsync(ReadOnlyMemory<byte> value, Stream destination, CancellationToken cancellationToken) 119public async Task StreamSync() 135public async Task StreamAsync() 151public async Task WriterAsync() 168public Task ReadAsync() => ReadAsync(false); 170private async Task ReadAsync(bool validate)
Microsoft.AspNetCore.OutputCaching.StackExchangeRedis (3)
RedisOutputCacheStore.cs (3)
88_ = Task.Factory.StartNew(RunGarbageCollectionLoopAsync, default, TaskCreationOptions.LongRunning, TaskScheduler.Current); 91private async Task RunGarbageCollectionLoopAsync() 100await Task.Delay(TimeSpan.FromSeconds(secondsWithJitter)).ConfigureAwait(false);
Microsoft.AspNetCore.OutputCaching.Tests (181)
CachedResponseBodyTests.cs (13)
25public async Task Copy_DoNothingWhenNoSegments() 34var receiverTask = ReceiveDataAsync(pipe.Reader, receivedSegments, cts.Token); 37await Task.WhenAll(receiverTask, copyTask); 44public async Task Copy_SingleSegment() 57var receiverTask = ReceiveDataAsync(pipe.Reader, receivedSegments, cts.Token); 58var copyTask = CopyDataAsync(body, pipe.Writer, cts.Token); 60await Task.WhenAll(receiverTask, copyTask); 67public async Task Copy_MultipleSegments() 81var receiverTask = ReceiveDataAsync(pipe.Reader, receivedSegments, cts.Token); 82var copyTask = CopyDataAsync(body, pipe.Writer, cts.Token); 84await Task.WhenAll(receiverTask, copyTask); 90static async Task CopyDataAsync(ReadOnlySequence<byte> body, PipeWriter writer, CancellationToken cancellationToken) 96static async Task ReceiveDataAsync(PipeReader reader, List<byte[]> receivedSegments, CancellationToken cancellationToken)
MemoryOutputCacheStoreTests.cs (13)
12public async Task StoreAndGetValue_Succeeds() 26public async Task StoreAndGetValue_TimesOut() 42public async Task StoreNullKey_ThrowsException() 52public async Task StoreNullValue_ThrowsException() 62public async Task EvictByTag_SingleTag_SingleEntry() 82await Task.Yield(); 90public async Task EvictByTag_SingleTag_MultipleEntries() 110public async Task EvictByTag_MultipleTags_SingleEntry() 126public async Task EvictByTag_MultipleTags_MultipleEntries() 156public async Task ExpiredEntries_AreRemovedFromTags() 188await Task.Yield(); 193await Task.Yield(); 202public async Task Store_Throws_OnInvalidTag(string tag)
OutputCacheAttributeTests.cs (8)
23public async Task Attribute_CreatesExpirePolicy() 35public async Task Attribute_CreatesNoStorePolicy() 46public async Task Attribute_CreatesNamedPolicy() 61public async Task Attribute_NamedPolicyDoesNotInjectDefaultPolicy() 75public async Task Attribute_CreatesVaryByHeaderPolicy() 91public async Task Attribute_CreatesVaryByQueryPolicy() 106public async Task Attribute_CreatesVaryByRoutePolicy() 125public async Task Attribute_CreatesTagsPolicy()
OutputCacheEntryFormatterTests.cs (3)
29public async Task StoreAndGet_StoresEmptyValues() 43public async Task StoreAndGet_StoresAllValues() 63public async Task StoreAndGet_StoresNullHeaders()
OutputCacheMiddlewareTests.cs (29)
33public async Task TryServeFromCacheAsync_OnlyIfCached_Serves504() 53public async Task TryServeFromCacheAsync_CachedResponseNotFound_Fails() 69public async Task TryServeFromCacheAsync_CachedResponseFound_Succeeds() 97public async Task TryServeFromCacheAsync_CachedResponseFound_OverwritesExistingHeaders() 127public async Task TryServeFromCacheAsync_CachedResponseFound_Serves304IfPossible() 603public async Task FinalizeCacheBody_Cache_IfContentLengthMatches() 631public async Task FinalizeCacheBody_DoNotCache_IfContentLengthMismatches(string method) 660public async Task FinalizeCacheBody_RequestHead_Cache_IfContentLengthPresent_AndBodyAbsentOrOfSameLength(bool includeBody) 691public async Task FinalizeCacheBody_Cache_IfContentLengthAbsent() 716public async Task FinalizeCacheBody_DoNotCache_IfIsResponseCacheableFalse() 737public async Task FinalizeCacheBody_DoNotCache_IfBufferingDisabled() 758public async Task FinalizeCacheBody_DoNotCache_IfSizeTooBig() 805public override void OnStarting(Func<object, Task> callback, object state) { } 809public async Task Locking_PreventsConcurrentRequests() 828await Task.Delay(500); 839var task1 = Task.Run(() => middleware.Invoke(context1.HttpContext)); 844var task2 = Task.Run(() => middleware.Invoke(context2.HttpContext)); 848await Task.WhenAll(task1, task2); 854public async Task Locking_IgnoresNonCacheableResponses() 892var task1 = Task.Run(() => middleware.Invoke(context1.HttpContext)); 898var task2 = Task.Run(() => middleware.Invoke(context2.HttpContext)); 901await Task.Delay(500); 906await Task.WhenAll(task1, task2); 916public async Task Locking_ExecuteAllRequestsWhenDisabled() 953var task1 = Task.Run(() => middleware.Invoke(context1.HttpContext)); 955var task2 = Task.Run(() => middleware.Invoke(context2.HttpContext)); 957await Task.WhenAll(task1, task2); 963public async Task EmptyCacheKey_IsNotCached() 1011public async Task Can_Implement_Policy_That_Enables_Storage_Without_Serving()
OutputCachePoliciesTests.cs (23)
11public async Task DefaultCachePolicy_EnablesCache() 22public async Task DefaultCachePolicy_VariesByHost() 33public async Task DefaultCachePolicy_AllowsLocking() 44public async Task DefaultCachePolicy_VariesByStar() 55public async Task EnableCachePolicy_DisablesCache() 67public async Task VaryByHostPolicy_Disabled_UpdatesCacheVaryByRule() 78public async Task ExpirationPolicy_SetsResponseExpirationTimeSpan() 90public async Task LockingPolicy_EnablesLocking() 101public async Task LockingPolicy_DisablesLocking() 112public async Task NoLookupPolicy_DisablesLookup() 123public async Task NoStorePolicy_DisablesStore() 138public async Task PredicatePolicy_Filters(bool filter, bool enabled, bool expected) 149public async Task ProfilePolicy_UsesNamedProfile() 170public async Task TagsPolicy_Tags() 183public async Task VaryByHeadersPolicy_IsEmpty() 195public async Task VaryByHeadersPolicy_AddsSingleHeader() 208public async Task VaryByHeadersPolicy_AddsMultipleHeaders() 221public async Task VaryByQueryPolicy_IsEmpty() 233public async Task VaryByQueryPolicy_AddsSingleHeader() 246public async Task VaryByQueryPolicy_AddsMultipleHeaders() 259public async Task VaryByQueryPolicy_AddsMultipleHeadersArray() 272public async Task VaryByKeyPrefixPolicy_AddsKeyPrefix() 285public async Task VaryByValuePolicy_KeyValuePair()
OutputCachePolicyBuilderTests.cs (22)
30public async Task BuildPolicy_CreatesExpirePolicy() 44public async Task BuildPolicy_CreatesNoStorePolicy() 56public async Task BuildPolicy_AddsCustomPolicy() 74public async Task BuildPolicy_AddsCustomPolicyWithoutDefaultPolicy() 92public async Task BuildPolicy_NoVaryByHost() 104public async Task BuildPolicy_CreatesVaryByHeaderPolicy() 121public async Task BuildPolicy_CreatesVaryByQueryPolicy() 137public async Task BuildPolicy_CreatesVaryByRoutePolicy() 157public async Task BuildPolicy_CreatesVaryByRoutePolicyArray() 177public async Task BuildPolicy_CreatesVaryByRoutePolicyReplacesValue() 197public async Task BuildPolicy_CreatesVaryByKeyPrefixPolicy() 217public async Task BuildPolicy_CreatesVaryByValuePolicy() 237public async Task BuildPolicy_CreatesTagPolicy() 251public async Task BuildPolicy_AllowsLocking() 263public async Task BuildPolicy_EnablesLocking() 275public async Task BuildPolicy_DisablesLocking() 287public async Task BuildPolicy_ClearsDefaultPolicy() 302public async Task BuildPolicy_DisablesCache() 314public async Task BuildPolicy_EnablesCache() 329public async Task BuildPolicy_ChecksWithPredicate(int source, int expected) 349public async Task BuildPolicy_NoDefaultWithFalsePredicate() 367public async Task BuildPolicy_CacheReturnsDefault()
OutputCachePolicyProviderTests.cs (17)
44public async Task AttemptOutputCaching_CacheableMethods_IsAllowed(string method) 63public async Task AttemptOutputCaching_UncacheableMethods_NotAllowed(string method) 77public async Task AttemptResponseCaching_AuthorizationHeaders_NotAllowed() 93public async Task AllowCacheStorage_NoStore_IsAllowed() 111public async Task AllowCacheLookup_LegacyDirectives_OverridenByCacheControl() 127public async Task IsResponseCacheable_NoPublic_IsAllowed() 141public async Task IsResponseCacheable_Public_IsAllowed() 159public async Task IsResponseCacheable_NoCache_IsAllowed() 177public async Task IsResponseCacheable_ResponseNoStore_IsAllowed() 195public async Task IsResponseCacheable_SetCookieHeader_NotAllowed() 209public async Task IsResponseCacheable_VaryHeaderByStar_IsAllowed() 223public async Task IsResponseCacheable_Private_IsAllowed() 242public async Task IsResponseCacheable_SuccessStatusCodes_IsAllowed(int statusCode) 318public async Task IsResponseCacheable_NonSuccessStatusCodes_NotAllowed(int statusCode) 332public async Task IsResponseCacheable_NoExpiryRequirements_IsAllowed() 351public async Task IsResponseCacheable_MaxAgeOverridesExpiry_IsAllowed() 374public async Task IsResponseCacheable_SharedMaxAgeOverridesMaxAge_IsAllowed()
OutputCacheTests.cs (47)
17public async Task ServesCachedContent_IfAvailable(string method) 39public async Task ServesFreshContent_IfNotAvailable(string method) 59public async Task ServesFreshContent_Post() 79public async Task ServesFreshContent_Head_Get() 99public async Task ServesFreshContent_Get_Head() 121public async Task ServesCachedContent_If_CacheControlNoCache(string method) 152public async Task ServesCachedContent_If_PragmaNoCache(string method) 183public async Task ServesCachedContent_If_PathCasingDiffers(string method) 205public async Task ServesFreshContent_If_PathCasingDiffers(string method) 228public async Task ServesFreshContent_If_ResponseExpired(string method) 246await Task.Delay(1); 256public async Task ServesFreshContent_If_Authorization_HeaderExists(string method) 279public async Task ServesCachedContent_If_Authorization_HeaderExists(string method) 305public async Task ServesCachedContent_IfVaryHeader_Matches() 326public async Task ServesFreshContent_IfVaryHeader_Mismatches() 351public async Task ServesCachedContent_IfVaryQueryKeys_Matches() 374public async Task ServesCachedContent_IfVaryQueryKeysExplicit_Matches_QueryKeyCaseInsensitive() 397public async Task ServesCachedContent_IfVaryQueryKeyStar_Matches_QueryKeyCaseInsensitive() 420public async Task ServesCachedContent_IfVaryQueryKeyExplicit_Matches_OrderInsensitive() 443public async Task ServesCachedContent_IfVaryQueryKeyStar_Matches_OrderInsensitive() 466public async Task ServesFreshContent_IfVaryQueryKey_Mismatches() 488public async Task ServesCachedContent_IfOtherVaryQueryKey_Mismatches() 511public async Task ServesFreshContent_IfVaryQueryKeyExplicit_Mismatch_QueryKeyCaseSensitive() 533public async Task ServesFreshContent_IfVaryQueryKeyStar_Mismatch_QueryKeyValueCaseSensitive() 555public async Task ServesCachedContent_IfRequestRequirements_NotMet() 579public async Task Serves504_IfOnlyIfCachedHeader_IsSpecified() 604public async Task ServesFreshContent_IfSetCookie_IsSpecified() 624public async Task ServesCachedContent_IfSubsequentRequestContainsNoStore() 648public async Task ServesCachedContent_IfInitialRequestContainsNoStore() 672public async Task ServesCachedContent_IfInitialResponseContainsNoStore() 692public async Task Serves304_IfIfModifiedSince_Satisfied() 721public async Task ServesCachedContent_IfIfModifiedSince_NotSatisfied() 742public async Task Serves304_IfIfNoneMatch_Satisfied() 770public async Task ServesCachedContent_IfIfNoneMatch_NotSatisfied() 791public async Task ServesCachedContent_IfBodySize_IsCacheable() 817public async Task ServesFreshContent_IfBodySize_IsNotCacheable() 840public async Task ServesFreshContent_CaseSensitivePaths_IsNotCacheable() 863public async Task ServesCachedContent_WithoutReplacingCachedVaryBy_OnCacheMiss() 887public async Task ServesCachedContent_IfCachedVaryByNotUpdated_OnCacheMiss() 920public async Task ServesCachedContent_IfAvailable_UsingHead_WithContentLength() 940public async Task MiddlewareFaultsAreObserved() 958static async Task RunClient(TestServer server) 969public async Task ServesCorrectlyUnderConcurrentLoad() 986clients[i] = Task.Run(() => RunClient(server, i)); 988await Task.WhenAll(clients); 1049private static async Task AssertCachedResponseAsync(HttpResponseMessage initialResponse, HttpResponseMessage subsequentResponse) 1062private static async Task AssertFreshResponseAsync(HttpResponseMessage initialResponse, HttpResponseMessage subsequentResponse)
TestUtils.cs (6)
46internal static async Task TestRequestDelegateWriteAsync(HttpContext context) 55internal static async Task TestRequestDelegateSendFileAsync(HttpContext context) 66internal static Task TestRequestDelegateWrite(HttpContext context) 78return Task.CompletedTask; 81internal static async Task TestRequestDelegatePipeWriteAsync(HttpContext context) 198next = httpContext => Task.CompletedTask;
Microsoft.AspNetCore.Owin (36)
OwinEnvironment.cs (3)
18using SendFileFunc = Func<string, long, long?, CancellationToken, Task>; 72return Task.CompletedTask; 124feature => new Func<Task>(() => feature.GetClientCertificateAsync(CancellationToken.None))));
OwinExtensions.cs (5)
11Func<IDictionary<string, object>, Task>, 12Func<IDictionary<string, object>, Task> 14using AppFunc = Func<IDictionary<string, object>, Task>; 16Func<IDictionary<string, object>, Task>, 17Func<IDictionary<string, object>, Task>
OwinFeatureCollection.cs (8)
18using SendFileFunc = Func<string, long, long?, CancellationToken, Task>; 182void IHttpResponseFeature.OnStarting(Func<object, Task> callback, object state) 194void IHttpResponseFeature.OnCompleted(Func<object, Task> callback, object state) 229Task IHttpResponseBodyFeature.SendFileAsync(string path, long offset, long? length, CancellationToken cancellation) 264var loadAsync = Prop<Func<Task>>(OwinConstants.CommonKeys.LoadClientCertAsync); 424async Task IHttpResponseBodyFeature.StartAsync(CancellationToken cancellationToken) 435Task IHttpResponseBodyFeature.CompleteAsync() 442return Task.CompletedTask;
WebSockets\OwinWebSocketAcceptAdapter.cs (6)
9using AppFunc = Func<IDictionary<string, object>, Task>; 17Task // Complete 44private Task RequestTask { get { return _requestTcs.Task; } } 45private Task UpstreamTask { get; set; } 75private Task OwinAcceptCallback(IDictionary<string, object> webSocketContext) 82private void EnsureCompleted(Task task)
WebSockets\OwinWebSocketAdapter.cs (5)
13Task>; 25Task>; 125public override Task SendAsync(ArraySegment<byte> buffer, WebSocketMessageType messageType, bool endOfMessage, CancellationToken cancellationToken) 131public override async Task CloseAsync(WebSocketCloseStatus closeStatus, string statusDescription, CancellationToken cancellationToken) 154public override Task CloseOutputAsync(WebSocketCloseStatus closeStatus, string statusDescription, CancellationToken cancellationToken)
WebSockets\WebSocketAcceptAdapter.cs (2)
9using AppFunc = Func<IDictionary<string, object>, Task>; 17Task // Complete
WebSockets\WebSocketAdapter.cs (7)
13Task>; 29Task>; 60internal Task SendAsync(ArraySegment<byte> buffer, int messageType, bool endOfMessage, CancellationToken cancel) 70return Task.CompletedTask; 92internal Task CloseAsync(int status, string description, CancellationToken cancel) 97private Task RedirectSendToCloseAsync(ArraySegment<byte> buffer, CancellationToken cancel) 119internal async Task CleanupAsync()
Microsoft.AspNetCore.Owin.Tests (12)
OwinExtensionTests.cs (12)
11Func<IDictionary<string, object>, Task>, 12Func<IDictionary<string, object>, Task> 14using AppFunc = Func<IDictionary<string, object>, Task>; 16Func<IDictionary<string, object>, Task>, 17Func<IDictionary<string, object>, Task> 25public async Task OwinConfigureServiceProviderAddsServices() 38return Task.FromResult(0); 54public async Task OwinDefaultNoServices() 72return Task.FromResult(0); 89public async Task OwinDefaultNullServiceProvider() 106return Task.FromResult(0); 122public async Task UseOwin()
Microsoft.AspNetCore.RateLimiting (3)
RateLimitingMiddleware.cs (3)
64/// <returns>A <see cref="Task"/> that completes when the request leaves.</returns> 65public Task Invoke(HttpContext context) 83private async Task InvokeInternal(HttpContext context, EnableRateLimitingAttribute? enableRateLimitingAttribute)
Microsoft.AspNetCore.RateLimiting.Tests (46)
RateLimitingApplicationBuilderExtensionsTests.cs (1)
66public async Task UseRateLimiter_DoNotThrowWithoutOptions()
RateLimitingMetricsTests.cs (14)
25public async Task Metrics_Rejected() 63public async Task Metrics_Success() 92var middlewareTask = middleware.Invoke(context); 122public async Task Metrics_ListenInMiddleOfRequest_CurrentLeasesNotDecreased() 145var middlewareTask = middleware.Invoke(context); 168public async Task Metrics_Queued() 196var routeEndpointBuilder = new RouteEndpointBuilder(c => Task.CompletedTask, RoutePatternFactory.Parse("/"), 0); 210var middlewareTask1 = middleware.Invoke(context1); 218var middlewareTask2 = middleware.Invoke(context1); 243public async Task Metrics_ListenInMiddleOfQueued_CurrentQueueNotDecreased() 271var routeEndpointBuilder = new RouteEndpointBuilder(c => Task.CompletedTask, RoutePatternFactory.Parse("/"), 0); 279var middlewareTask1 = middleware.Invoke(context1); 287var middlewareTask2 = middleware.Invoke(context1); 337next ??= c => Task.CompletedTask;
RateLimitingMiddlewareTests.cs (26)
33return Task.CompletedTask; 42return Task.CompletedTask; 51return Task.CompletedTask; 60public async Task RequestsCallNextIfAccepted() 70return Task.CompletedTask; 85public async Task RequestRejected_CallsOnRejectedAndGives503() 110public async Task RequestRejected_WinsOverDefaultStatusCode() 135public async Task RequestAborted_DoesNotThrowTaskCanceledException() 166public async Task EndpointLimiterRequested_NoPolicy_Throws() 182public async Task EndpointLimiter_Rejects() 217public async Task EndpointLimiterConvenienceMethod_Rejects() 253public async Task EndpointLimiterRejects_EndpointOnRejectedFires() 284public async Task GlobalAndEndpoint_GlobalRejects_GlobalWins() 316public async Task GlobalAndEndpoint_EndpointRejects_EndpointWins() 348public async Task GlobalAndEndpoint_BothReject_GlobalWins() 380public async Task EndpointLimiterRejects_EndpointOnRejectedFires_WithIRateLimiterPolicy() 423public async Task EndpointLimiter_DuplicatePartitionKey_NoCollision() 464public async Task EndpointLimiter_DuplicatePartitionKey_Lambda_NoCollision() 497var endpoint1 = new Endpoint(c => Task.CompletedTask, new EndpointMetadataCollection(new EnableRateLimitingAttribute(endpointName1)), "Test endpoint 1"); 498var endpoint2 = new Endpoint(c => Task.CompletedTask, new EndpointMetadataCollection(new EnableRateLimitingAttribute(endpointName2)), "Test endpoint 2"); 515public async Task DisableRateLimitingAttribute_SkipsGlobalAndEndpoint() 537context.SetEndpoint(new Endpoint(c => Task.CompletedTask, new EndpointMetadataCollection(new EnableRateLimitingAttribute(name), new DisableRateLimitingAttribute()), "Test endpoint")); 545context.SetEndpoint(new Endpoint(c => Task.CompletedTask, new EndpointMetadataCollection(new DisableRateLimitingAttribute(), new EnableRateLimitingAttribute(name)), "Test endpoint")); 553public async Task PolicyDirectlyOnEndpoint_GetsUsed() 583public async Task MultipleEndpointPolicies_LastOneWins() 649return Task.CompletedTask;
src\Shared\SyncPoint\SyncPoint.cs (5)
18public Task WaitForSyncPoint() => _atSyncPoint.Task; 32public Task WaitToContinue() 38public static Func<Task> Create(out SyncPoint syncPoint) 51public static Func<Task> Create(int count, out SyncPoint[] syncPoints) 67return Task.CompletedTask;
Microsoft.AspNetCore.Razor (12)
TagHelpers\ITagHelperComponent.cs (2)
36/// <returns>A <see cref="Task"/> that on completion updates the <paramref name="output"/>.</returns> 37Task ProcessAsync(TagHelperContext context, TagHelperOutput output);
TagHelpers\TagHelper.cs (3)
49/// <returns>A <see cref="Task"/> that on completion updates the <paramref name="output"/>.</returns> 51public virtual Task ProcessAsync(TagHelperContext context, TagHelperOutput output) 54return Task.CompletedTask;
TagHelpers\TagHelperComponent.cs (2)
31public virtual Task ProcessAsync(TagHelperContext context, TagHelperOutput output) 34return Task.CompletedTask;
TagHelpers\TagHelperOutput.cs (5)
27(useCachedResult, encoder) => Task.FromResult<TagHelperContent>(new DefaultTagHelperContent())) 220/// <returns>A <see cref="Task"/> that on completion returns content rendered by children.</returns> 237/// <returns>A <see cref="Task"/> that on completion returns content rendered by children.</returns> 251/// <returns>A <see cref="Task"/> that on completion returns content rendered by children.</returns> 273/// <returns>A <see cref="Task"/> that on completion returns content rendered by children.</returns>
Microsoft.AspNetCore.Razor.Runtime (13)
Runtime\TagHelpers\TagHelperExecutionContext.cs (6)
19private Func<Task> _executeChildContentAsync; 31executeChildContentAsync: () => Task.CompletedTask, 56Func<Task> executeChildContentAsync, 181Func<Task> executeChildContentAsync) 202/// <returns>A <see cref="Task"/> that on completion sets <see cref="Output"/>'s 204public async Task SetOutputContentAsync()
Runtime\TagHelpers\TagHelperRunner.cs (5)
21public Task RunAsync(TagHelperExecutionContext executionContext) 39var task = tagHelpers[i].ProcessAsync(tagHelperContext, tagHelperOutput); 46return Task.CompletedTask; 48static async Task Awaited(Task task, TagHelperExecutionContext executionContext, int i, int count)
Runtime\TagHelpers\TagHelperScopeManager.cs (2)
47Func<Task> executeChildContentAsync) 124Func<Task> executeChildContentAsync)
Microsoft.AspNetCore.Razor.Runtime.Test (35)
Runtime\TagHelpers\TagHelperExecutionContextTest.cs (26)
14public async Task SetOutputContentAsync_CanHandleExceptionThrowingChildContent() 37public async Task GetChildContentAsync_CanHandleExceptionThrowingChildContent() 61public async Task SetOutputContentAsync_SetsOutputsContent() 75return Task.FromResult(result: true); 88public async Task ExecutionContext_Reinitialize_UpdatesTagHelperOutputAsExpected() 94Func<Task> executeChildContentAsync = () => 97return Task.FromResult(true); 112Func<Task> updatedExecuteChildContentAsync = () => 115return Task.FromResult(true); 152Func<Task> executeChildContentAsync = () => 155return Task.FromResult(true); 220executeChildContentAsync: async () => await Task.FromResult(result: true), 263public async Task GetChildContentAsync_ReturnsExpectedContent(HtmlEncoder encoder) 280return Task.FromResult(result: true); 294public async Task GetChildContentAsync_StartsWritingScopeWithGivenEncoder(HtmlEncoder encoder) 303executeChildContentAsync: () => Task.FromResult(result: true), 316public async Task GetChildContentAsync_CachesValue(HtmlEncoder encoder) 328return Task.FromResult(result: true); 343public async Task GetChildContentAsync_CachesValuePerEncoder(HtmlEncoder encoder) 355return Task.FromResult(result: true); 370public async Task GetChildContentAsync_CachesValuePerEncoderInstance(HtmlEncoder encoder) 382return Task.FromResult(result: true); 400public async Task GetChildContentAsync_CanExecuteChildrenMoreThanOnce(HtmlEncoder encoder) 412return Task.FromResult(result: true); 428public async Task GetChildContentAsync_ReturnsNewObjectEveryTimeItIsCalled(bool useCachedResult) 436executeChildContentAsync: () => Task.FromResult(result: true),
Runtime\TagHelpers\TagHelperRunnerTest.cs (8)
12public async Task RunAsync_CallsInitPriorToProcessAsync() 86public async Task RunAsync_OrdersTagHelpers( 115public async Task RunAsync_SetsTagHelperOutputTagMode(TagMode tagMode) 133public async Task RunAsync_ProcessesAllTagHelpers() 152public async Task RunAsync_AllowsModificationOfTagHelperOutput() 173public async Task RunAsync_AllowsDataRetrievalFromTagHelperContext() 190public async Task RunAsync_ConfiguresTagHelperContextWithExecutionContextsItems() 281public override Task ProcessAsync(TagHelperContext context, TagHelperOutput output)
Runtime\TagHelpers\TagHelperScopeManagerTest.cs (1)
239executeChildContentAsync: async () => await Task.FromResult(result: true));
Microsoft.AspNetCore.Razor.Test (13)
TagHelpers\TagHelperOutputTest.cs (13)
14public async Task Reinitialize_AllowsOutputToBeReused() 23(useCachedResult, encoder) => Task.FromResult<TagHelperContent>(initialGetChildContent); 63public async Task GetChildContentAsync_CallsGetChildContentAsync() 76return Task.FromResult<TagHelperContent>(content); 105public async Task GetChildContentAsync_CallsGetChildContentAsyncWithEncoder(HtmlEncoder encoder) 118return Task.FromResult<TagHelperContent>(content); 134public async Task GetChildContentAsync_CallsGetChildContentAsyncWithCachedResult(bool useCachedResult) 147return Task.FromResult<TagHelperContent>(content); 180public async Task GetChildContentAsync_CallsGetChildContentAsyncWithCacheAndEncoder(bool useCachedResult, HtmlEncoder encoder) 193return Task.FromResult<TagHelperContent>(content); 356(cachedResult, encoder) => Task.FromResult<TagHelperContent>(new DefaultTagHelperContent())); 390(cachedResult, encoder) => Task.FromResult<TagHelperContent>(new DefaultTagHelperContent())); 1104getChildContentAsync: (useCachedContent, encoder) => Task.FromResult<TagHelperContent>(
Microsoft.AspNetCore.RequestDecompression (2)
RequestDecompressionMiddleware.cs (2)
45public Task Invoke(HttpContext context) 56private async Task InvokeCore(HttpContext context, Stream decompressionStream)
Microsoft.AspNetCore.RequestDecompression.Microbenchmarks (3)
RequestDecompressionMiddlewareBenchmark.cs (3)
26context => Task.CompletedTask, 36public async Task HandleRequest_Compressed() 46public async Task HandleRequest_Uncompressed()
Microsoft.AspNetCore.RequestDecompression.Tests (18)
RequestDecompressionMiddlewareTests.cs (17)
79public async Task Request_ContentEncodingBrotli_Decompressed() 95public async Task Request_ContentEncodingDeflate_ZlibCompressed_Decompressed() 111public async Task Request_ContentEncodingDeflate_RawDeflateCompressed_Throws() 127public async Task Request_ContentEncodingGzip_Decompressed() 143public async Task Request_NoContentEncoding_NotDecompressed() 158public async Task Request_UnsupportedContentEncoding_NotDecompressed() 174public async Task Request_MultipleContentEncodings_NotDecompressed() 191public async Task Request_MiddlewareAddedMultipleTimes_OnlyDecompressedOnce() 259public async Task Request_Decompressed_ContentEncodingHeaderRemoved(bool isDecompressed) 337public async Task Request_InvalidDataForContentEncoding_ThrowsInvalidOperationException() 403public async Task Options_RegisterCustomDecompressionProvider() 428public async Task Endpoint_HasRequestSizeLimit_UsedForRequest(bool exceedsLimit) 515public async Task Feature_HasRequestSizeLimit_UsedForRequest(bool exceedsLimit) 616static Task requestDelegate(HttpContext context) => Task.FromResult(context); 631static Task requestDelegate(HttpContext context) => Task.FromResult(context);
SizeLimitedStreamTests.cs (1)
24public async Task ReadAsync_InnerStreamExceedsSizeLimit_Throws(bool exceedsLimit)
Microsoft.AspNetCore.ResponseCaching (10)
CacheEntry\CachedResponseBody.cs (1)
20public async Task CopyToAsync(PipeWriter destination, CancellationToken cancellationToken)
ResponseCachingMiddleware.cs (2)
84/// <returns>A <see cref="Task"/> that completes when the middleware has completed processing.</returns> 85public async Task Invoke(HttpContext httpContext)
src\Shared\SegmentWriteStream.cs (2)
152public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 155return Task.CompletedTask;
src\Shared\TaskToApm.cs (3)
32public static IAsyncResult Begin(Task task, AsyncCallback? callback, object? state) => 69internal readonly Task _task; 77internal TaskAsyncResult(Task task, object? state, AsyncCallback? callback)
Streams\ResponseCachingStream.cs (2)
86public override async Task FlushAsync(CancellationToken cancellationToken) 130public override async Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) =>
Microsoft.AspNetCore.ResponseCaching.Microbenchmarks (5)
ResponseCachingBenchmark.cs (5)
52public async Task Cache() 70public async Task ServeFromCache() 123public Task CompleteAsync() => Writer.CompleteAsync().AsTask(); 130public Task SendFileAsync(string path, long offset, long? count, CancellationToken cancellationToken = default) 135public Task StartAsync(CancellationToken cancellationToken = default)
Microsoft.AspNetCore.ResponseCaching.Tests (74)
CachedResponseBodyTests.cs (13)
33public async Task Copy_DoNothingWhenNoSegments() 42var receiverTask = ReceiveDataAsync(pipe.Reader, receivedSegments, cts.Token); 45await Task.WhenAll(receiverTask, copyTask); 51public async Task Copy_SingleSegment() 64var receiverTask = ReceiveDataAsync(pipe.Reader, receivedSegments, cts.Token); 65var copyTask = CopyDataAsync(body, pipe.Writer, cts.Token); 67await Task.WhenAll(receiverTask, copyTask); 73public async Task Copy_MultipleSegments() 87var receiverTask = ReceiveDataAsync(pipe.Reader, receivedSegments, cts.Token); 88var copyTask = CopyDataAsync(body, pipe.Writer, cts.Token); 90await Task.WhenAll(receiverTask, copyTask); 95static async Task CopyDataAsync(CachedResponseBody body, PipeWriter writer, CancellationToken cancellationToken) 101static async Task ReceiveDataAsync(PipeReader reader, List<byte[]> receivedSegments, CancellationToken cancellationToken)
ResponseCachingMiddlewareTests.cs (17)
18public async Task TryServeFromCacheAsync_OnlyIfCached_Serves504() 37public async Task TryServeFromCacheAsync_CachedResponseNotFound_Fails() 52public async Task TryServeFromCacheAsync_CachedResponseFound_Succeeds() 76public async Task TryServeFromCacheAsync_CachedResponseFound_OverwritesExistingHeaders() 105public async Task TryServeFromCacheAsync_VaryByRuleFound_CachedResponseNotFound_Fails() 125public async Task TryServeFromCacheAsync_VaryByRuleFound_CachedResponseFound_Succeeds() 153public async Task TryServeFromCacheAsync_CachedResponseFound_Serves304IfPossible() 687public async Task FinalizeCacheBody_Cache_IfContentLengthMatches() 715public async Task FinalizeCacheBody_DoNotCache_IfContentLengthMismatches(string method) 744public async Task FinalizeCacheBody_RequestHead_Cache_IfContentLengthPresent_AndBodyAbsentOrOfSameLength(bool includeBody) 775public async Task FinalizeCacheBody_Cache_IfContentLengthAbsent() 803public async Task FinalizeCacheBody_DoNotCache_IfShouldCacheResponseFalse() 823public async Task FinalizeCacheBody_DoNotCache_IfBufferingDisabled() 845public async Task FinalizeCacheBody_DoNotCache_IfSizeTooBig() 890public override void OnStarting(Func<object, Task> callback, object state) { } 903public async Task Invoke_AddsResponseCachingFeature_Always(bool allowResponseCaching, bool allowCacheLookup, bool allowCacheStorage) 909return Task.CompletedTask;
ResponseCachingTests.cs (39)
16public async Task ServesCachedContent_IfAvailable(string method) 40public async Task ServesFreshContent_IfNotAvailable(string method) 62public async Task ServesFreshContent_Post() 84public async Task ServesFreshContent_Head_Get() 106public async Task ServesFreshContent_Get_Head() 130public async Task ServesFreshContent_If_CacheControlNoCache(string method) 163public async Task ServesFreshContent_If_PragmaNoCache(string method) 196public async Task ServesCachedContent_If_PathCasingDiffers(string method) 220public async Task ServesFreshContent_If_ResponseExpired(string method) 244public async Task ServesFreshContent_If_Authorization_HeaderExists(string method) 267public async Task ServesCachedContent_IfVaryHeader_Matches() 290public async Task ServesFreshContent_IfVaryHeader_Mismatches() 314public async Task ServesCachedContent_IfVaryQueryKeys_Matches() 336public async Task ServesCachedContent_IfVaryQueryKeysExplicit_Matches_QueryKeyCaseInsensitive() 358public async Task ServesCachedContent_IfVaryQueryKeyStar_Matches_QueryKeyCaseInsensitive() 380public async Task ServesCachedContent_IfVaryQueryKeyExplicit_Matches_OrderInsensitive() 402public async Task ServesCachedContent_IfVaryQueryKeyStar_Matches_OrderInsensitive() 424public async Task ServesFreshContent_IfVaryQueryKey_Mismatches() 446public async Task ServesFreshContent_IfVaryQueryKeyExplicit_Mismatch_QueryKeyCaseSensitive() 468public async Task ServesFreshContent_IfVaryQueryKeyStar_Mismatch_QueryKeyValueCaseSensitive() 490public async Task ServesFreshContent_IfRequestRequirements_NotMet() 516public async Task Serves504_IfOnlyIfCachedHeader_IsSpecified() 543public async Task ServesFreshContent_IfSetCookie_IsSpecified() 565public async Task ServesCachedContent_IfSubsequentRequestContainsNoStore() 591public async Task ServesFreshContent_IfInitialRequestContainsNoStore() 617public async Task ServesFreshContent_IfInitialResponseContainsNoStore() 639public async Task Serves304_IfIfModifiedSince_Satisfied() 669public async Task ServesCachedContent_IfIfModifiedSince_NotSatisfied() 692public async Task Serves304_IfIfNoneMatch_Satisfied() 722public async Task ServesCachedContent_IfIfNoneMatch_NotSatisfied() 745public async Task ServesCachedContent_IfBodySize_IsCacheable() 770public async Task ServesFreshContent_IfBodySize_IsNotCacheable() 795public async Task ServesFreshContent_CaseSensitivePaths_IsNotCacheable() 820public async Task ServesCachedContent_WithoutReplacingCachedVaryBy_OnCacheMiss() 846public async Task ServesFreshContent_IfCachedVaryByUpdated_OnCacheMiss() 881public async Task ServesCachedContent_IfCachedVaryByNotUpdated_OnCacheMiss() 916public async Task ServesCachedContent_IfAvailable_UsingHead_WithContentLength() 953private static async Task AssertCachedResponseAsync(HttpResponseMessage initialResponse, HttpResponseMessage subsequentResponse) 966private static async Task AssertFreshResponseAsync(HttpResponseMessage initialResponse, HttpResponseMessage subsequentResponse)
TestUtils.cs (5)
71internal static async Task TestRequestDelegateWriteAsync(HttpContext context) 80internal static async Task TestRequestDelegateSendFileAsync(HttpContext context) 91internal static Task TestRequestDelegateWrite(HttpContext context) 103return Task.CompletedTask; 199next = httpContext => Task.CompletedTask;
Microsoft.AspNetCore.ResponseCompression (11)
ResponseCompressionBody.cs (6)
39internal async Task FinishCompressionAsync() 120public override Task FlushAsync(CancellationToken cancellationToken) 177public override async Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 285public Task SendFileAsync(string path, long offset, long? count, CancellationToken cancellation) 297public Task StartAsync(CancellationToken token = default) 303public async Task CompleteAsync()
ResponseCompressionMiddleware.cs (2)
37public Task Invoke(HttpContext context) 46private async Task InvokeCore(HttpContext context)
src\Shared\TaskToApm.cs (3)
32public static IAsyncResult Begin(Task task, AsyncCallback? callback, object? state) => 69internal readonly Task _task; 77internal TaskAsyncResult(Task task, object? state, AsyncCallback? callback)
Microsoft.AspNetCore.ResponseCompression.Tests (44)
ResponseCompressionBodyTest.cs (2)
48public async Task WriteAsync_IsPassedToUnderlyingStream_WhenDisableResponseBuffering(bool flushable) 62public async Task SendFileAsync_IsPassedToUnderlyingStream_WhenDisableResponseBuffering()
ResponseCompressionMiddlewareTest.cs (42)
49public async Task Request_NoAcceptEncoding_Uncompressed() 58public async Task Request_AcceptGzipDeflate_CompressedGzip() 67public async Task Request_AcceptBrotli_CompressedBrotli() 78public async Task Request_AcceptMixed_CompressedBrotli(string encoding1, string encoding2) 89public async Task Request_AcceptMixed_ConfiguredOrder_CompressedGzip(string encoding1, string encoding2) 104public async Task Request_AcceptUnknown_NotCompressed() 116public async Task RequestHead_NoAcceptEncoding_Uncompressed() 125public async Task RequestHead_AcceptGzipDeflate_CompressedGzip() 139public async Task ContentType_WithCharset_Compress(string contentType) 148public async Task GZipCompressionProvider_OptionsSetInDI_Compress() 188public async Task MimeTypes_OtherContentTypes_NoMatch(string contentType) 259public async Task MimeTypes_IncludedAndExcluded( 288public async Task NoIncludedMimeTypes_UseDefaults() 307public async Task NoBody_NotCompressed(string contentType) 325return Task.FromResult(0); 344public async Task Request_AcceptStar_Compressed() 353public async Task Request_AcceptIdentity_NotCompressed() 368public async Task Request_AcceptWithHigherCompressionQuality_Compressed(string[] acceptEncodings, int expectedBodyLength) 378public async Task Request_AcceptWithhigherIdentityQuality_NotCompressed(string[] acceptEncodings, int expectedBodyLength) 390public async Task Response_UnknownMimeType_NotCompressed() 401public async Task Response_WithContentRange_NotCompressed() 415public async Task Response_WithContentEncodingAlreadySet_NotReCompressed() 435public async Task Request_Https_CompressedIfEnabled(bool enableHttps, int expectedLength) 496public async Task Request_Https_CompressedIfOptIn(HttpsCompressionMode mode, int expectedLength) 559public async Task Request_Https_NotCompressedIfOptOut(HttpsCompressionMode mode, int expectedLength) 620public async Task FlushHeaders_SendsHeaders_Compresses(string encoding, int expectedBodyLength) 666public async Task FlushAsyncHeaders_SendsHeaders_Compresses(string encoding, int expectedBodyLength) 711public async Task FlushBody_CompressesAndFlushes(string encoding) 770public async Task FlushAsyncBody_CompressesAndFlushes(string encoding) 823public async Task TrickleWriteAndFlush_FlushesEachWrite(string encoding) 893public async Task TrickleWriteAndFlushAsync_FlushesEachWrite(string encoding) 957public async Task UncompressedTrickleWriteAndFlushAsync_FlushesEachWrite(string encoding) 1023public async Task SendFileAsync_DifferentContentType_NotBypassed() 1073public async Task SendFileAsync_FirstWrite_CompressesAndFlushes() 1123public async Task SendFileAsync_AfterFirstWrite_CompressesAndFlushes() 1174public async Task Dispose_SyncWriteOrFlushNotCalled(string encoding) 1264return Task.CompletedTask; 1359public Task CompleteAsync() => InnerFeature.CompleteAsync(); 1363public Task SendFileAsync(string path, long offset, long? count, CancellationToken cancellation) 1370public Task StartAsync(CancellationToken token = default) => InnerFeature.StartAsync(token); 1434public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 1474public override Task FlushAsync(CancellationToken cancellationToken)
Microsoft.AspNetCore.Rewrite (2)
RewriteMiddleware.cs (2)
52public Task Invoke(HttpContext context) 69return Task.CompletedTask;
Microsoft.AspNetCore.Rewrite.Tests (71)
ApacheModRewrite\ModRewriteMiddlewareTest.cs (17)
16public async Task Invoke_RewritePathWhenMatching() 41public async Task Invoke_RewritePathTerminatesOnFirstSuccessOfRule() 67public async Task Invoke_RewritePathDoesNotTerminateOnFirstSuccessOfRule() 93public async Task Invoke_ShouldIgnoreComments() 118public async Task Invoke_ShouldRewriteHomepage() 143public async Task Invoke_ShouldIgnorePorts() 168public async Task Invoke_HandleNegatedRewriteRules() 195public async Task Invoke_BackReferencesShouldBeApplied(string url, string rule, string expected) 226public async Task Invoke_ShouldHandleFlagNoCase(string url, string rule, string expected) 251public async Task Invoke_CheckFullUrlWithOnlyPath() 277public async Task Invoke_CheckFullUrlWithUFlag() 303public async Task Invoke_CheckModFileConditions() 330public async Task Invoke_EnsureHttps(string input) 358public async Task Invoke_CaptureEmptyStringInRegexAssertRedirectLocationHasForwardSlash(string input) 386public async Task Invoke_CaptureEmptyStringInRegexAssertRewriteHasForwardSlash(string input) 411public async Task Invoke_CaptureEmptyStringInRegexAssertLocationHeaderContainsPathBase() 439public async Task CapturedVariablesInConditionsArePreservedToRewriteRule()
IISUrlRewrite\MiddleWareTests.cs (20)
19public async Task Invoke_RedirectPathToPathAndQuery() 51public async Task Invoke_RewritePathToPathAndQuery() 83public async Task Invoke_RewriteBasedOnQueryStringParameters() 119public async Task Invoke_RedirectToLowerCase() 151public async Task Invoke_RedirectRemoveTrailingSlash() 186public async Task Invoke_RedirectAddTrailingSlash() 221public async Task Invoke_RedirectToHttps() 255public async Task Invoke_RewriteToHttps() 295public async Task Invoke_ReverseProxyToAnotherSite() 332public async Task Invoke_CaptureEmptyStringInRegexAssertRedirectLocationHasForwardSlash() 369public async Task Invoke_CaptureEmptyStringInRegexAssertRewriteLocationHasForwardSlash() 403public async Task Invoke_CaptureEmptyStringInRegexAssertLocationHeaderContainsPathBase() 442public async Task VerifyIsFileAndIsDirectoryParsing(string matchType) 476public async Task VerifyTrackAllCaptures() 512public async Task VerifyTrackAllCapturesRuleAndConditionCapture() 548public async Task ThrowArgumentOutOfRangeExceptionWithCorrectMessage() 585public async Task Invoke_GlobalRuleConditionMatchesAgainstFullUri_ParsedRule() 626public async Task Invoke_ReverseProxyToAnotherSiteUsingXmlConfiguredRewriteMap(string requestUri, string expectedRewrittenUri) 667public async Task Invoke_CustomResponse() 703public async Task Invoke_GlobalRuleConditionMatchesAgainstFullUri_CodedRule(string conditionInputPattern, string expectedResult, int uriMatchPart)
MiddlewareTests.cs (34)
17public async Task CheckRewritePath() 47public async Task CheckRewritePathWithSkipRemaining() 77public async Task CheckRewritePath_MultipleRulesWithSkipRemaining() 109public async Task CheckRewritePath_MultipleRules() 150public async Task CheckRedirectPath(string pattern, string replacement, string baseAddress, string requestUrl, string expectedUrl) 178public async Task RewriteRulesCanComeFromConfigureOptions() 208public async Task CheckRedirectPathWithQueryString() 236public async Task CheckRedirectToHttpsStatus(int statusCode) 263public async Task CheckRedirectToHttpsSslPort(int? sslPort) 305public async Task CheckRedirectToHttpsUrl(string baseAddress, string hostPathAndQuery, string expectedHostPathAndQuery) 337public async Task CheckRedirectUsesConfiguredScheme(string hostSchemePathAndQuery, string redirectReplacement) 363public async Task CheckPermanentRedirectToHttps() 390public async Task CheckRedirectToHttpsWithSslPort(int sslPort, string expected) 419public async Task CheckRedirectToWwwWithStatusCode(int statusCode) 448public async Task CheckRedirectToWww(string requestUri, string redirectUri) 473public async Task CheckPermanentRedirectToWww() 508public async Task CheckNoRedirectToWww(string requestUri) 536public async Task CheckRedirectToNonWwwWithStatusCode(int statusCode) 565public async Task CheckRedirectToNonWww(string requestUri, string redirectUri) 590public async Task CheckPermanentRedirectToNonWww() 615public async Task CheckIfEmptyStringRedirectCorrectly() 638public async Task RewriteAfterUseRoutingHitsOriginalEndpoint() 675public async Task CheckIfEmptyStringRewriteCorrectly() 702public async Task SettingPathBase() 735public async Task CheckNoRedirectToWwwInNonWhitelistedDomains(string requestUri) 763public async Task CheckRedirectToWwwInWhitelistedDomains(string requestUri, string redirectUri) 788public async Task CheckPermanentRedirectToWwwInWhitelistedDomains() 817public async Task CheckRedirectToWwwWithStatusCodeInWhitelistedDomains(int statusCode) 844public async Task Rewrite_WorksAfterUseRoutingIfGlobalRouteBuilderUsed(string regex, string output) 880public async Task RewriteFromOptions_WorksAfterUseRoutingIfGlobalRouteBuilderUsed(string regex, string output) 916public async Task RewriteSkipRemaing_WorksAfterUseRoutingIfGlobalRouteBuilderUsed() 952public async Task RewriteWithMultipleRules_WorksAfterUseRoutingIfGlobalRouteBuilderUsed() 989public async Task RewriteWithMultipleRulesAndSkip_WorksAfterUseRoutingIfGlobalRouteBuilderUsed() 1026public async Task Rewrite_WorksWithoutUseRoutingWithWebApplication()
Microsoft.AspNetCore.Routing (65)
EndpointMiddleware.cs (5)
33public Task Invoke(HttpContext httpContext) 72var requestTask = endpoint.RequestDelegate(httpContext); 85return Task.CompletedTask; 91static async Task AwaitRequestTask(Endpoint endpoint, Task requestTask, ILogger logger)
EndpointRoutingMiddleware.cs (13)
59public Task Invoke(HttpContext httpContext) 77var matchTask = matcherTask.Result.MatchAsync(httpContext); 86static async Task AwaitMatcher(EndpointRoutingMiddleware middleware, HttpContext httpContext, Task<Matcher> matcherTask) 93static async Task AwaitMatch(EndpointRoutingMiddleware middleware, HttpContext httpContext, Task matchTask) 101private Task SetRoutingAndContinue(HttpContext httpContext) 158private Task ExecuteShortCircuit(ShortCircuitMetadata shortCircuitMetadata, Endpoint endpoint, HttpContext httpContext) 198var requestTask = endpoint.RequestDelegate(httpContext); 212return Task.CompletedTask; 214static async Task AwaitRequestTask(Endpoint endpoint, Task requestTask, ILogger logger) 231return Task.CompletedTask; 266_initializationTask = Task.FromResult(matcher);
Matching\AcceptsMatcherPolicy.cs (3)
47public Task ApplyAsync(HttpContext httpContext, CandidateSet candidates) 135return Task.CompletedTask; 254return Task.CompletedTask;
Matching\DataSourceDependentMatcher.cs (1)
33public override Task MatchAsync(HttpContext httpContext)
Matching\DefaultEndpointSelector.cs (2)
11public override Task SelectAsync( 19return Task.CompletedTask;
Matching\DfaMatcher.cs (5)
32public sealed override Task MatchAsync(HttpContext httpContext) 60return Task.CompletedTask; 81return Task.CompletedTask; 194return Task.CompletedTask; 316private async Task SelectEndpointWithPoliciesAsync(
Matching\EndpointSelector.cs (2)
20/// <returns>A <see cref="Task"/> that completes asynchronously once endpoint selection is complete.</returns> 26public abstract Task SelectAsync(HttpContext httpContext, CandidateSet candidates);
Matching\HostMatcherPolicy.cs (2)
71public Task ApplyAsync(HttpContext httpContext, CandidateSet candidates) 147return Task.CompletedTask;
Matching\HttpMethodMatcherPolicy.cs (3)
78public Task ApplyAsync(HttpContext httpContext, CandidateSet candidates) 156return Task.CompletedTask; 390return Task.CompletedTask;
Matching\IEndpointSelectorPolicy.cs (1)
46Task ApplyAsync(HttpContext httpContext, CandidateSet candidates);
Matching\ILEmitTrieJumpTable.cs (3)
27private Task _task; 71internal async Task InitializeILDelegateAsync() 74await Task.Run(InitializeILDelegate);
Matching\Matcher.cs (2)
18/// <returns>A <see cref="Task"/> which represents the asynchronous completion of the operation.</returns> 19public abstract Task MatchAsync(HttpContext httpContext);
Matching\NegotiationMatcherPolicy.cs (3)
83public Task ApplyAsync(HttpContext httpContext, CandidateSet candidates) 145return Task.CompletedTask; 315return Task.CompletedTask;
NullRouter.cs (2)
19public Task RouteAsync(RouteContext context) 21return Task.CompletedTask;
RequestDelegateRouteBuilderExtensions.cs (5)
91Func<HttpRequest, HttpResponse, RouteData, Task> handler) 133Func<HttpRequest, HttpResponse, RouteData, Task> handler) 175Func<HttpRequest, HttpResponse, RouteData, Task> handler) 217Func<HttpRequest, HttpResponse, RouteData, Task> handler) 235Func<HttpRequest, HttpResponse, RouteData, Task> handler)
Route.cs (1)
92protected override Task OnRouteMatched(RouteContext context)
RouteBase.cs (4)
96protected abstract Task OnRouteMatched(RouteContext context); 106public virtual Task RouteAsync(RouteContext context) 118return Task.CompletedTask; 136return Task.CompletedTask;
RouteCollection.cs (1)
65public virtual async Task RouteAsync(RouteContext context)
RouteHandler.cs (2)
40public Task RouteAsync(RouteContext context) 43return Task.CompletedTask;
RouterMiddleware.cs (1)
41public async Task Invoke(HttpContext httpContext)
ShortCircuit\RouteShortCircuitEndpointRouteBuilderExtensions.cs (1)
14private static readonly RequestDelegate _shortCircuitDelegate = (context) => Task.CompletedTask;
src\Shared\RouteHandlers\ExecuteHandlerHelper.cs (2)
12public static Task ExecuteReturnAsync(object obj, HttpContext httpContext, JsonTypeInfo<object> jsonTypeInfo) 39public static Task WriteJsonResponseAsync<T>(HttpResponse response, T? value, JsonTypeInfo<T> jsonTypeInfo)
Tree\TreeRouter.cs (1)
171public async Task RouteAsync(RouteContext context)
Microsoft.AspNetCore.Routing.Abstractions (1)
IRouter.cs (1)
15Task RouteAsync(RouteContext context);
Microsoft.AspNetCore.Routing.FunctionalTests (61)
Benchmarks\EndpointRoutingBenchmarkTest.cs (1)
39public async Task RouteEndpoint_ReturnsPlaintextResponse()
Benchmarks\RouterBenchmarkTest.cs (1)
40public async Task RouteHandlerWritesResponse()
EndpointRoutingIntegrationTest.cs (11)
18private static readonly RequestDelegate TestDelegate = async context => await Task.Yield(); 30public async Task AuthorizationMiddleware_WhenNoAuthMetadataIsConfigured() 62public async Task AuthorizationMiddleware_WhenEndpointIsNotFound() 94public async Task AuthorizationMiddleware_WithAuthorizedEndpoint() 126public async Task AuthorizationMiddleware_NotConfigured_Throws() 157public async Task AuthorizationMiddleware_NotConfigured_WhenEndpointIsNotFound() 187public async Task AuthorizationMiddleware_ConfiguredBeforeRouting_Throws() 218public async Task AuthorizationMiddleware_ConfiguredAfterRouting_Throws() 249public async Task CorsMiddleware_WithCorsEndpoint() 281public async Task CorsMiddleware_WithCorsEndpoint_PreflightRequest() 317public async Task CorsMiddleware_ConfiguredBeforeRouting_Throws()
EndpointRoutingSampleTest.cs (13)
33public async Task Routing_CanRouteRequest_ToBranchRouter(string branch) 47public async Task MatchesRootPath_AndReturnsPlaintext() 63public async Task MatchesStaticRouteTemplate_AndReturnsPlaintext() 82public async Task MatchesHelloMiddleware_AndReturnsPlaintext() 101public async Task MatchesEndpoint_WithSuccessfulConstraintMatch() 117public async Task DoesNotMatchEndpoint_IfConstraintMatchFails() 127public async Task MatchesEndpoint_WithSuccessful_OptionalConstraintMatch() 143public async Task MatchesEndpoint_WithSuccessful_OptionalConstraintMatch_NoValueForParameter() 159public async Task DoesNotMatchEndpoint_IfOptionalConstraintMatchFails() 171public async Task GeneratesLink_ToEndpointWithSingleAsteriskCatchAllParameter_EncodesValue( 189public async Task GeneratesLink_ToEndpointWithDoubleAsteriskCatchAllParameter_DoesNotEncodeSlashes( 204public async Task GeneratesLink_ToEndpointWithDoubleAsteriskCatchAllParameter_EncodesContentOtherThanSlashes() 217public async Task MapGet_HasConventionMetadata()
HostMatchingTests.cs (5)
29public async Task Get_CatchAll(string baseAddress) 47public async Task Get_MatchWildcardDomain(string baseAddress) 65public async Task Get_MatchDomain(string baseAddress) 83public async Task Get_MatchWildcardDomainAndPort(string baseAddress) 101public async Task Get_MatchWildcardDomainAndSubdomain(string baseAddress)
MapFallbackTest.cs (5)
22public async Task Get_HelloWorld() 39public async Task Get_FallbackWithPattern_FileName(string path) 56public async Task Get_FallbackWithPattern_NonFileName(string path) 73public async Task Get_Fallback_FileName(string path) 90public async Task Get_Fallback_NonFileName(string path)
MinimalFormTests.cs (15)
25public async Task MapPost_WithForm_ValidToken_Works() 75public async Task MapRequestDelegate_WithForm_RequiresValidation_ValidToken_Works() 135public async Task MapPost_WithForm_InvalidToken_Fails() 175public async Task MapPost_WithForm_WithoutMiddleware_ThrowsException() 219public async Task MapPost_WithForm_WithoutServices_WithMiddleware_ThrowsException() 251public async Task MapPost_WithForm_WithoutAntiforgery_WithoutMiddleware_Works() 296public async Task MapPost_WithForm_WithoutAntiforgery_AndRouteGroup_WithoutMiddleware_Works() 393public async Task MapRequestDelegate_WithForm_RequiresValidation_InvalidToken_Fails(Func<IEndpointRouteBuilder, IEndpointConventionBuilder> addDelegate) 436public async Task MapPost_WithForm_ValidToken_RequestSizeLimit_Works(bool hasLimit) 504public async Task MapPost_WithForm_AndFormMapperOptions_ValidToken_Works() 553public async Task SupportsMergingFormMappingOptionsFromGroupAndEndpoint() 605public async Task SupportsMergingFormOptionsFromGroupAndEndpoint() 657public async Task MapPost_WithForm_AndRequestLimits_ValidToken_Works() 703public async Task MapPost_WithFormFile_MissingBody_ReturnsBadRequest() 730public async Task MapPost_WithFormFile_MissingContentType_ReturnsUnsupportedMediaType()
RouteHandlerTest.cs (2)
22public async Task MapPost_FromBodyWorksWithJsonPayload() 63public async Task CustomEndpointDataSource_IsDisposedIfResolved()
RouterSampleTest.cs (4)
31public async Task Routing_CanRouteRequest_ToBranchRouter(string branch) 45public async Task Routing_CanRouteRequestDelegate_ToSpecificHttpVerb() 59public async Task Routing_CanRouteRequest_ToSpecificMiddleware() 80public async Task Routing_CanRouteRequest_ToDefaultHandler(string httpVerb)
ShortCircuitTests.cs (3)
16public async Task ShortCircuitTest() 35return Task.CompletedTask; 59public async Task MapShortCircuitTest()
WebHostBuilderExtensionsTest.cs (1)
76public async Task UseRouter_MapGet_MatchesRequest(Action<IRouteBuilder> routeBuilder, HttpRequestMessage request, string expected)
Microsoft.AspNetCore.Routing.Microbenchmarks (31)
EndpointRoutingBenchmarkBase.cs (1)
119(context) => Task.CompletedTask,
EndpointRoutingShortCircuitBenchmark.cs (8)
27var normalEndpoint = new Endpoint(context => Task.CompletedTask, new EndpointMetadataCollection(), "normal"); 37context => Task.CompletedTask); 39var shortCircuitEndpoint = new Endpoint(context => Task.CompletedTask, new EndpointMetadataCollection(new ShortCircuitMetadata(200)), "shortcircuit"); 49context => Task.CompletedTask); 53public async Task NormalEndpoint() 60public async Task ShortCircuitEndpoint() 90public override Task MatchAsync(HttpContext httpContext) 93return Task.CompletedTask;
Matching\MatcherAzureBenchmark.cs (2)
35public async Task Baseline() 47public async Task Dfa()
Matching\MatcherBuilderMultipleEntryBenchmark.cs (2)
162public Task ApplyAsync(HttpContext httpContext, CandidateSet candidates) 179public Task ApplyAsync(HttpContext httpContext, CandidateSet candidates)
Matching\MatcherGithubBenchmark.cs (2)
28public async Task Baseline() 39public async Task Dfa()
Matching\MatcherSingleEntryBenchmark.cs (4)
41public async Task Baseline() 50public async Task Dfa() 59public async Task LegacyTreeRouter() 68public async Task LegacyRouter()
Matching\TrivialMatcher.cs (2)
23public sealed override Task MatchAsync(HttpContext httpContext) 34return Task.CompletedTask;
src\Http\Routing\test\UnitTests\Matching\BarebonesMatcher.cs (4)
20public override Task MatchAsync(HttpContext httpContext) 34return Task.CompletedTask; 113public override Task MatchAsync(HttpContext httpContext) 121return Task.CompletedTask;
src\Http\Routing\test\UnitTests\Matching\RouteMatcher.cs (1)
18public override async Task MatchAsync(HttpContext httpContext)
src\Http\Routing\test\UnitTests\Matching\RouteMatcherBuilder.cs (2)
95public async Task RouteAsync(RouteContext routeContext) 103routeContext.Handler = (_) => Task.CompletedTask;
src\Http\Routing\test\UnitTests\Matching\TreeRouterMatcher.cs (1)
19public override async Task MatchAsync(HttpContext httpContext)
src\Http\Routing\test\UnitTests\Matching\TreeRouterMatcherBuilder.cs (2)
97public async Task RouteAsync(RouteContext routeContext) 105routeContext.Handler = (_) => Task.CompletedTask;
Microsoft.AspNetCore.Routing.Tests (399)
Builder\EndpointRoutingApplicationBuilderExtensionsTest.cs (4)
56public async Task UseRouting_ServicesRegistered_NoMatch_DoesNotSetFeature() 76public async Task UseRouting_ServicesRegistered_Match_DoesNotSetsFeature() 151public async Task UseEndpoint_ServicesRegisteredAndEndpointRoutingRegistered_NoMatch_DoesNotSetFeature() 314endpoints.Map("/1", d => Task.CompletedTask).WithDisplayName("Test endpoint 1");
Builder\FallbackEndpointRouteBuilderExtensionsTest.cs (2)
21RequestDelegate initialRequestDelegate = static (context) => Task.CompletedTask; 37RequestDelegate initialRequestDelegate = static (context) => Task.CompletedTask;
Builder\GroupTest.cs (5)
23public async Task Prefix_CanBeEmpty() 54public async Task PrefixWithRouteParameter_CanBeUsed() 88public async Task NestedPrefixWithRouteParameters_CanBeUsed() 202public async Task BuildingEndpointInConvention_Works() 257public async Task ChangingMostEndpointBuilderPropertiesInConvention_Works()
Builder\RequestDelegateEndpointRouteBuilderExtensionsTest.cs (22)
65RequestDelegate requestDelegate = (d) => Task.CompletedTask; 80public async Task MapEndpoint_ReturnGenericTypeTask_GeneratedDelegate(Func<IEndpointRouteBuilder, string, RequestDelegate, IEndpointConventionBuilder> map) 91return await Task.FromResult("String Test"); 112public async Task MapEndpoint_CanBeFiltered_EndpointFilterFactory(Func<IEndpointRouteBuilder, string, RequestDelegate, IEndpointConventionBuilder> map) 119RequestDelegate initialRequestDelegate = static (context) => Task.CompletedTask; 147public async Task MapEndpoint_CanBeFiltered_EndpointFilter() 154RequestDelegate initialRequestDelegate = static (context) => Task.CompletedTask; 177public async Task MapEndpoint_Filtered_DontExecuteEndpointWhenErrorResponseStatus() 226public async Task RequestFilters_CanAssertOnEmptyResult() 261public async Task RequestFilters_ReturnValue_SerializeJson() 268RequestDelegate requestDelegate = (HttpContext context) => Task.CompletedTask; 331RequestDelegate initialRequestDelegate = static (context) => Task.CompletedTask; 352RequestDelegate requestDelegate = (d) => Task.CompletedTask; 388Expression<RequestDelegate> handler = context => Task.CompletedTask; 437var endpointBuilder = map(builder, "/", context => Task.CompletedTask).WithMetadata(new EndpointNameMetadata("MapMe")); 460var endpointBuilder = map(builder, "/", context => Task.CompletedTask).WithMetadata(new EndpointNameMetadata("MapMe")); 515.Map(RoutePatternFactory.Parse("/"), context => Task.CompletedTask) 525private static Task Handle(HttpContext context) => Task.CompletedTask; 528private static Task HandleHttpMetdata(HttpContext context) => Task.CompletedTask; 557public Task ExecuteAsync(HttpContext httpContext) => throw new NotImplementedException();
Builder\RouteHandlerEndpointRouteBuilderExtensionsTest.cs (12)
133public async Task MapGet_WithRouteParameter_BuildsEndpointWithRouteSpecificBinding() 171public async Task MapGet_WithoutRouteParameter_BuildsEndpointWithQuerySpecificBinding() 505public async Task MapVerbWithExplicitRouteParameterIsCaseInsensitive(Func<IEndpointRouteBuilder, string, Delegate, IEndpointConventionBuilder> map, string expectedMethod) 547public async Task MapVerbWithRouteParameterDoesNotFallbackToQuery(Func<IEndpointRouteBuilder, string, Delegate, IEndpointConventionBuilder> map, string expectedMethod) 601public async Task MapGetWithNamedFromRouteParameter_UsesFromRouteName() 624public async Task MapGetWithNamedFromRouteParameter_FailsForParameterName() 808public async Task MapMethod_FlowsThrowOnBadHttpRequest(bool throwOnBadRequest) 837public async Task MapMethod_DefaultsToNotThrowOnBadHttpRequestIfItCannotResolveRouteHandlerOptions() 890private static async Task AssertIdAsync(Endpoint endpoint, string expectedPattern, int expectedId) 915public async Task AddEndpointFilterMethods_CanRegisterFilterWithClassAndDelegateImplementations(Action<IEndpointConventionBuilder> addFilter) 931public async Task AddEndpointFilterMethods_WorkWithMapGroup(Action<IEndpointConventionBuilder> addFilter) 959public async Task RequestDelegateFactory_CanInvokeEndpointFilter_ThatAccessesServices()
Builder\RoutingBuilderExtensionsTest.cs (4)
70public async Task UseRouter_IRouter_CallsRoute() 80.Returns(Task.CompletedTask) 95public async Task UseRouter_Action_CallsRoute() 105.Returns(Task.CompletedTask)
Builder\RoutingEndpointConventionBuilderExtensionsTest.cs (1)
24var endpointModel = new RouteEndpointBuilder((context) => Task.CompletedTask, RoutePatternFactory.Parse("/"), 0);
EndpointMiddlewareTest.cs (22)
19public async Task Invoke_NoFeature_NoOps() 29return Task.CompletedTask; 42public async Task Invoke_NoEndpoint_NoOps() 53return Task.CompletedTask; 66public async Task Invoke_WithEndpoint_InvokesDelegate() 76return Task.CompletedTask; 96public async Task Invoke_WithEndpoint_ThrowsIfAuthAttributesWereFound_ButAuthMiddlewareNotInvoked() 125public async Task Invoke_WithEndpointWithNullRequestDelegate_ThrowsIfAuthAttributesWereFound_ButAuthMiddlewareNotInvoked() 154public async Task Invoke_WithEndpoint_WorksIfAuthAttributesWereFound_AndAuthMiddlewareInvoked() 166return Task.CompletedTask; 188public async Task Invoke_WithEndpoint_DoesNotThrowIfUnhandledAuthAttributesWereFound_ButSuppressedViaOptions() 200return Task.CompletedTask; 222public async Task Invoke_WithEndpoint_ThrowsIfCorsMetadataWasFound_ButCorsMiddlewareNotInvoked() 251public async Task Invoke_WithEndpoint_WorksIfCorsMetadataWasFound_AndCorsMiddlewareInvoked() 263return Task.CompletedTask; 285public async Task Invoke_WithEndpoint_DoesNotThrowIfUnhandledCorsAttributesWereFound_ButSuppressedViaOptions() 297return Task.CompletedTask; 319public async Task Invoke_WithEndpoint_ThrowsIfAntiforgeryMetadataWasFound_ButAntiforgeryMiddlewareNotInvoked() 349public async Task Invoke_WithEndpoint_WorksIfAntiforgeryMetadataWasFound_AndAntiforgeryMiddlewareInvoked() 361return Task.CompletedTask; 383public async Task Invoke_WithEndpoint_DoesNotThrowIfUnhandledAntiforgeryMetadataWereFound_ButSuppressedViaOptions() 395return Task.CompletedTask;
EndpointRoutingMiddlewareFormOptionsTest.cs (13)
24public async Task SupportsSettingFormOptionsFromMetadata() 39c.SetEndpoint(new Endpoint(c => Task.CompletedTask, new EndpointMetadataCollection(formOptionsMetadata), "myapp")); 56public async Task SupportsMergingSettingsFromMultipleFormOptionsMetadata() 73c.SetEndpoint(new Endpoint(c => Task.CompletedTask, new EndpointMetadataCollection(formOptionsMetadata1, formOptionsMetadata2, formOptionsMetadata3), "myapp")); 91public async Task SupportsMergingSettingsFromMetadataAndServices() 111c.SetEndpoint(new Endpoint(c => Task.CompletedTask, new EndpointMetadataCollection(formOptionsMetadata), "myapp")); 129public async Task SettingEndpointManuallyStillResolvesFormOptions() 139var endpoint = new Endpoint(c => Task.CompletedTask, new EndpointMetadataCollection(endpointMetadata), "myapp"); 146c.SetEndpoint(new Endpoint(c => Task.CompletedTask, new EndpointMetadataCollection(formOptionsMetadata), "myapp")); 164public async Task OptionsNotSetForNonFormRequests() 171var endpoint = new Endpoint(c => Task.CompletedTask, new EndpointMetadataCollection(endpointMetadata), "myapp"); 178c.SetEndpoint(new Endpoint(c => Task.CompletedTask, new EndpointMetadataCollection(formOptionsMetadata), "myapp")); 210next ??= c => Task.CompletedTask;
EndpointRoutingMiddlewareTest.cs (23)
25public async Task Invoke_OnCall_SetsEndpointFeature() 41public async Task Invoke_SkipsRouting_IfEndpointSet() 45httpContext.SetEndpoint(new Endpoint(c => Task.CompletedTask, new EndpointMetadataCollection(), "myapp")); 59public async Task Invoke_OnCall_WritesToConfiguredLogger() 93public async Task Invoke_BackCompatGetRouteValue_ValueUsedFromEndpointFeature() 115public async Task Invoke_BackCompatGetDataTokens_ValueUsedFromEndpointMetadata() 138public async Task Invoke_InitializationFailure_AllowsReinitialization() 161public async Task ShortCircuitWithoutStatusCode() 183public async Task ShortCircuitWithStatusCode() 211public async Task ThrowIfSecurityMetadataPresent(int? statusCode, bool hasAuthMetadata, bool hasCorsMetadata) 231public async Task Invoke_CheckForFallbackMetadata_LogIfPresent(bool hasFallbackMetadata) 250c.SetEndpoint(new Endpoint(c => Task.CompletedTask, new EndpointMetadataCollection(metadata), "myapp")); 269public async Task Endpoint_BodySizeFeatureIsReadOnly() 286c.SetEndpoint(new Endpoint(c => Task.CompletedTask, new EndpointMetadataCollection(metadata), "myapp")); 301public async Task Endpoint_DoesNotHaveBodySizeFeature() 315c.SetEndpoint(new Endpoint(c => Task.CompletedTask, new EndpointMetadataCollection(metadata), "myapp")); 327public async Task Endpoint_DoesNotHaveSizeLimitMetadata() 343c.SetEndpoint(new Endpoint(c => Task.CompletedTask, new EndpointMetadataCollection(), "myapp")); 357public async Task Endpoint_HasBodySizeFeature_SetUsingSizeLimitMetadata(bool isRequestSizeLimitDisabled) 374c.SetEndpoint(new Endpoint(c => Task.CompletedTask, new EndpointMetadataCollection(metadata), "myapp")); 398public async Task Create_WithoutHostBuilder_Success() 414endpoints.MapGet("/", (HttpContext c) => Task.CompletedTask); 470next ??= c => Task.CompletedTask;
Matching\AcceptsMatcherPolicyTest.cs (12)
314public async Task ApplyAsync_EndpointWithoutMetadata_MatchWithoutContentType() 335public async Task ApplyAsync_EndpointAllowsAnyContentType_MatchWithoutContentType() 356public async Task ApplyAsync_EndpointHasWildcardContentType_MatchWithoutContentType() 377public async Task ApplyAsync_EndpointWithoutMetadata_MatchWithAnyContentType() 404public async Task ApplyAsync_EndpointAllowsAnyContentType_MatchWithAnyContentType() 431public async Task ApplyAsync_EndpointHasWildcardContentType_MatchWithAnyContentType() 458public async Task ApplyAsync_EndpointHasSubTypeWildcard_MatchWithValidContentType() 485public async Task ApplyAsync_EndpointHasMultipleContentType_MatchWithValidContentType() 512public async Task ApplyAsync_EndpointDoesNotMatch_Returns415() 540public async Task ApplyAsync_EndpointDoesNotMatch_DoesNotReturns415WithContentTypeObliviousEndpoint() 569public async Task ApplyAsync_EndpointDoesNotMatch_DoesNotReturns415WithContentTypeWildcardEndpoint() 612(context) => Task.CompletedTask,
Matching\BarebonesMatcher.cs (4)
20public override Task MatchAsync(HttpContext httpContext) 34return Task.CompletedTask; 113public override Task MatchAsync(HttpContext httpContext) 121return Task.CompletedTask;
Matching\BarebonesMatcherConformanceTest.cs (10)
10public override Task Match_SingleParameter() 12return Task.CompletedTask; 17public override Task Match_SingleParameter_TrailingSlash() 19return Task.CompletedTask; 24public override Task Match_SingleParameter_WeirdNames() 26return Task.CompletedTask; 32public override Task Match_MultipleParameters(string template, string path, string[] keys, string[] values) 35return Task.CompletedTask; 40public override Task Match_Constraint() 42return Task.CompletedTask;
Matching\ContentEncodingNegotiationMatcherPolicyTest.cs (33)
25new Endpoint(_ => Task.CompletedTask, new EndpointMetadataCollection(), "Endpoint -> No Content Encoding"), 42new Endpoint(_ => Task.CompletedTask, new EndpointMetadataCollection(), "Endpoint -> No Content Encoding"), 43new Endpoint(_ => Task.CompletedTask, new EndpointMetadataCollection(), "Endpoint -> No Content Encoding"), 61new Endpoint(_ => Task.CompletedTask, new EndpointMetadataCollection(new DynamicMetadata()), "Endpoint -> Dynamic Endpoint Metadata"), 72public async Task ApplyAsync_SelectsEndpointWithContentEncodingMetadata_IfAcceptHeaderIncludesEncodingMetadata() 78new Endpoint(_ => Task.CompletedTask, new EndpointMetadataCollection(), "Endpoint -> No Content Encoding")); 92public async Task ApplyAsync_SelectsEndpointWihtoutEncodingMetadata_IfAcceptHeaderDoesNotIncludeEncodingMetadata() 98new Endpoint(_ => Task.CompletedTask, new EndpointMetadataCollection(), "Endpoint -> No Content Encoding")); 112public async Task ApplyAsync_SelectsEndpointWihtoutEncodingMetadata_IfAcceptHeaderDoesNotIncludeEncodingMetadata_ReverseCandidateOrder() 117new Endpoint(_ => Task.CompletedTask, new EndpointMetadataCollection(), "Endpoint -> No Content Encoding"), 132public async Task ApplyAsync_SelectsEndpointWithHigherAcceptEncodingQuality_IfHeaderIncludesMultipleEncodingsWithQualityValues() 152public async Task ApplyAsync_SelectsEndpointWithHigherAcceptEncodingQuality_IfHeaderIncludesMultipleEncodingsWithQualityValues_ReverseCandidateOrder() 172public async Task ApplyAsync_SelectsEndpointWithHigherContentEncodingMetadataQuality_IfAcceptEncodingQualityIsEqual() 191public async Task ApplyAsync_SetsEndpointIfNoResourceCanSupportTheAcceptHeaderValues() 211public async Task ApplyAsync_DoesNotSetEndpointIfNoEndpointCanSupportTheAcceptHeaderValues_ButAnEndpointWithoutMetadataExists() 218new Endpoint(_ => Task.CompletedTask, new EndpointMetadataCollection(), "Endpoint -> No Content Encoding")); 233public async Task ApplyAsync_SelectsFirstValidEndpointWhenContentEncodingMetadataQualityIsTheSame_IfAcceptEncodingQualityIsEqual() 252public async Task ApplyAsync_SelectsFirstValidEndpointWhenContentEncodingMetadataQualityIsTheSame_IfAcceptEncodingQualityIsEqual_Reverse() 271public async Task ApplyAsync_SetsAllCandidatesToInvalid_IfNoCandidateMatchesAcceptEncoding() 290public async Task ApplyAsync_SetsEndpointsWithEncodingMetadataToInvalid_IfRequestAsksForIdentity() 295new Endpoint(_ => Task.CompletedTask, new EndpointMetadataCollection(), "Identity"), 309public async Task ApplyAsync_SetsEndpointsWithEncodingMetadataToInvalid_IfRequestHasEmptyAcceptEncodingHeader() 314new Endpoint(_ => Task.CompletedTask, new EndpointMetadataCollection(), "Identity"), 328public async Task ApplyAsync_SetsEndpointsWithEncodingMetadataToInvalid_IfRequestHasNoAcceptEncodingHeader() 333new Endpoint(_ => Task.CompletedTask, new EndpointMetadataCollection(), "Identity"), 386new Endpoint(_ => Task.CompletedTask, new EndpointMetadataCollection(), "Identity"), 446new Endpoint(_ => Task.CompletedTask, new EndpointMetadataCollection(), "Endpoint -> No Content Encoding")); 465new Endpoint(_ => Task.CompletedTask, new EndpointMetadataCollection(), "Endpoint -> No Content Encoding")); 482new Endpoint(_ => Task.CompletedTask, new EndpointMetadataCollection(), "Endpoint -> No Content Encoding"), 572new Endpoint(_ => Task.CompletedTask, new EndpointMetadataCollection(), "Identity"), 590new Endpoint(_ => Task.CompletedTask, new EndpointMetadataCollection(), "Identity"), 608new Endpoint(_ => Task.CompletedTask, new EndpointMetadataCollection(), "Identity"), 637_ => Task.CompletedTask,
Matching\DataSourceDependentMatcherTest.cs (1)
257public override Task MatchAsync(HttpContext httpContext)
Matching\DefaultEndpointSelectorTest.cs (7)
12public async Task SelectAsync_NoCandidates_DoesNothing() 30public async Task SelectAsync_NoValidCandidates_DoesNothing() 51public async Task SelectAsync_SingleCandidate_ChoosesCandidate() 72public async Task SelectAsync_SingleValidCandidate_ChoosesCandidate() 93public async Task SelectAsync_SingleValidCandidateInGroup_ChoosesCandidate() 115public async Task SelectAsync_ManyGroupsLastCandidate_ChoosesCandidate() 146public async Task SelectAsync_MultipleValidCandidatesInGroup_ReportsAmbiguity()
Matching\DfaMatcherConformanceTest.cs (2)
12public override async Task Quirks_CatchAllParameter(string template, string path, string[] keys, string[] values) 31public async Task Match_Regression_1867_CorrectBehavior(string path, int endpointIndex)
Matching\DfaMatcherTest.cs (26)
62public async Task MatchAsync_ValidRouteConstraint_EndpointMatched() 83public async Task MatchAsync_InvalidRouteConstraint_NoEndpointMatched() 112public async Task MatchAsync_ComplexSegmentEndpointAndPathStartingWithLiteral_NoEndpointMatched(string endpoint, string path) 133public async Task MatchAsync_RequireValuesAndDefaultValues_EndpointMatched() 172public async Task MatchAsync_RequireValuesAndDifferentPath_NoEndpointMatched() 198public async Task MatchAsync_RequireValuesAndOptionalParameter_EndpointMatched() 247public async Task MatchAsync_ShortenedPattern_EndpointMatched(string path) 277public async Task MatchAsync_MultipleEndpointsWithDifferentRequiredValues_EndpointMatched() 316public async Task MatchAsync_ParameterTransformer_EndpointMatched() 576public async Task MatchAsync_DifferentDefaultCase_RouteValueUsesDefaultCase() 615public async Task MatchAsync_DuplicateTemplatesAndDifferentOrder_LowerOrderEndpointMatched() 640public async Task MatchAsync_MultipleMatches_EndpointSelectorCalled() 665.Returns(Task.CompletedTask); 686public async Task MatchAsync_MultipleMatches_EndpointSelectorCalled_AllocatesDictionaryForRouteParameter() 711.Returns(Task.CompletedTask); 732public async Task MatchAsync_MultipleMatches_EndpointSelectorCalled_AllocatesDictionaryForRouteConstraint() 758.Returns(Task.CompletedTask); 779public async Task MatchAsync_NoCandidates_Logging() 809public async Task MatchAsync_ConstraintRejectsEndpoint_Logging() 849public async Task MatchAsync_ComplexSegmentRejectsEndpoint_Logging() 889public async Task MatchAsync_MultipleCandidates_Logging() 946public async Task MatchAsync_RunsApplicableEndpointSelectorPolicies() 966return Task.CompletedTask; 982public async Task MatchAsync_SkipsNonApplicableEndpointSelectorPolicies() 1017public async Task MatchAsync_RunsEndpointSelectorPolicies_CanShortCircuit() 1037return Task.CompletedTask;
Matching\FullFeaturedMatcherConformanceTest.cs (18)
22public virtual async Task Match_DefaultValues(string template, string path, string[] keys, string[] values) 36public virtual async Task Match_NonInlineDefaultValues() 51public virtual async Task Match_ExtraDefaultValues() 77public virtual async Task NotMatch_DefaultValues(string template, string path) 109public virtual async Task Match_OptionalParameter(string template, string path, string[] keys, string[] values) 132public virtual async Task NotMatch_OptionalParameter(string template, string path) 156public virtual async Task Match_CatchAllParameter(string template, string path, string[] keys, string[] values) 176public virtual async Task Quirks_CatchAllParameter(string template, string path, string[] keys, string[] values) 211public virtual async Task Match_ComplexSegment(string template, string path, string[] keys, string[] values) 231public virtual async Task NotMatch_ComplexSegment(string template, string path) 260public virtual async Task Match_OptionalSeparator(string template, string path, string[] keys, string[] values) 286public virtual async Task NotMatch_OptionalSeparator(string template, string path) 311public virtual async Task Match_WeirdCharacterCases(string template, string path, string[] keys, string[] values) 336public virtual async Task Match_SelectEndpoint_BasedOnPrecedence(string template1, string template2) 370public virtual async Task Match_SelectEndpoint_BasedOnOrder(string template1, string template2) 405public virtual async Task Match_IntegrationTest_MultipleEndpoints(string path, string expectedTemplate) 443public virtual async Task Match_Regression_16579_Order1() 473public virtual async Task Match_Regression_16579_Order2()
Matching\HostMatcherPolicyIntegrationTestBase.cs (22)
16public async Task Match_Host() 32public async Task Match_HostWithPort() 48public async Task Match_Host_Unicode() 64public async Task Match_HostWithPort_IncorrectPort() 80public async Task Match_HostWithPort_IncorrectHost() 96public async Task Match_HostWithWildcard_Unicode() 112public async Task Match_HostWithWildcard_NoSubdomain() 128public async Task Match_HostWithWildcard_Subdomain() 144public async Task Match_HostWithWildcard_MultipleSubdomains() 160public async Task Match_HostWithWildcard_PrefixNotInSubdomain() 176public async Task Match_HostAndHostWithWildcard_NoSubdomain() 192public async Task Match_Host_CaseInsensitive() 208public async Task Match_HostWithPort_InferHttpPort() 224public async Task Match_HostWithPort_InferHttpsPort() 240public async Task Match_HostWithPort_NoHostHeader() 256public async Task Match_Port_NoHostHeader_InferHttpsPort() 272public async Task Match_NoMetadata_MatchesAnyHost() 288public async Task Match_EmptyHostList_MatchesAnyHost() 304public async Task Match_WildcardHost_MatchesAnyHost() 320public async Task Match_WildcardHostAndWildcardPort_MatchesAnyHost() 336public async Task Match_CatchAllRouteWithMatchingHost_Success() 352public async Task Match_CatchAllRouteFailureHost_NoMatch()
Matching\HostMatcherPolicyTest.cs (1)
272(context) => Task.CompletedTask,
Matching\HttpMethodMatcherPolicyIntegrationTestBase.cs (18)
18public async Task Match_HttpMethod() 34public async Task Match_HttpMethod_CORS() 50public async Task Match_HttpMethod_CORS_Preflight() 66public async Task NotMatch_HttpMethod_CORS_Preflight() 85public async Task Match_HttpMethod_CaseInsensitive(string endpointMethod, string requestMethod) 103public async Task Match_HttpMethod_CaseInsensitive_CORS_Preflight(string endpointMethod, string requestMethod) 119public async Task Match_NoMetadata_MatchesAnyHttpMethod() 135public async Task Match_NoMetadata_MatchesAnyHttpMethod_CORS_Preflight() 151public async Task Match_NoMetadata_MatchesAnyHttpMethod_CORS_Preflight_DoesNotSupportPreflight() 167public async Task Match_EmptyMethodList_MatchesAnyHttpMethod() 183public async Task NotMatch_HttpMethod_Returns405Endpoint() 208public async Task NotMatch_HttpMethod_CORS_DoesNotReturn405() 225public async Task NotMatch_HttpMethod_WithAllMethodEndpoint_DoesNotReturn405() 242public async Task Match_EndpointWithHttpMethodPreferred() 259public async Task Match_EndpointWithHttpMethodPreferred_EmptyList() 276public async Task Match_EndpointWithHttpMethodPreferred_FallsBackToNonSpecific() 293public async Task NotMatch_HttpMethod_Returns405Endpoint_ReExecute() 323public async Task Match_Custom_HttpMethod()
Matching\HttpMethodMatcherPolicyTest.cs (1)
157public async Task IEndpointSelectorPolicy_ApplyAsync_ProcessesInvalidCandidate(int candidateNum)
Matching\ILEmitTrieJumpTableTest.cs (1)
27public async Task InitializeILDelegateAsync_ReplacesDelegate()
Matching\MatcherConformanceTest.SingleEndpoint.cs (17)
9public virtual async Task Match_EmptyRoute() 23public virtual async Task Match_SingleLiteralSegment() 37public virtual async Task Match_SingleLiteralSegment_TrailingSlash() 54public virtual async Task Match_SingleLiteralSegment_CaseInsensitive(string path) 71public virtual async Task Match_SingleLiteralSegment_Unicode(string template, string path) 89public virtual async Task Match_SingleLiteralSegment_PercentEncoded(string template, string path) 109public virtual async Task NotMatch_SingleLiteralSegment(string path) 126public virtual async Task Match_Sanitizies_Template(string template) 149public virtual async Task Match_MultipleLiteralSegments(string template, string path) 180public virtual async Task NotMatch_MultipleLiteralSegments(string template, string path) 194public virtual async Task Match_SingleParameter() 209public virtual async Task Match_Constraint() 224public virtual async Task Match_SingleParameter_TrailingSlash() 239public virtual async Task Match_SingleParameter_WeirdNames() 263public virtual async Task NotMatch_SingleParameter(string path) 284public virtual async Task Match_MultipleParameters(string template, string path, string[] keys, string[] values) 313public virtual async Task NotMatch_MultipleParameters(string template, string path)
Matching\RouteMatcher.cs (1)
18public override async Task MatchAsync(HttpContext httpContext)
Matching\RouteMatcherBuilder.cs (2)
95public async Task RouteAsync(RouteContext routeContext) 103routeContext.Handler = (_) => Task.CompletedTask;
Matching\RouteMatcherConformanceTest.cs (1)
15public async Task Match_Regression_1867(string path, int endpointIndex)
Matching\TreeRouterMatcher.cs (1)
19public override async Task MatchAsync(HttpContext httpContext)
Matching\TreeRouterMatcherBuilder.cs (2)
97public async Task RouteAsync(RouteContext routeContext) 105routeContext.Handler = (_) => Task.CompletedTask;
Matching\TreeRouterMatcherConformanceTest.cs (5)
10public override Task Match_NonInlineDefaultValues() 12return Task.CompletedTask; 17public override Task Match_ExtraDefaultValues() 19return Task.CompletedTask; 29public async Task Match_Regression_1867(string path, int endpointIndex)
RequestDelegateRouteBuilderExtensionsTest.cs (3)
15private static readonly RequestDelegate NullHandler = (c) => Task.CompletedTask; 43public async Task Map_MatchesRequest( 101public async Task Map_DoesNotMatchRequest(
RouteCollectionTest.cs (6)
15private static readonly RequestDelegate NullHandler = (c) => Task.CompletedTask; 161public async Task RouteAsync_FirstMatches() 187public async Task RouteAsync_SecondMatches() 213public async Task RouteAsync_NoMatch() 556.Returns(Task.FromResult<object>(null)) 686.Returns(Task.FromResult<object>(null))
RouteEndpointBuilderTest.cs (5)
23var ex = Assert.Throws<ArgumentNullException>(() => new RouteEndpointBuilder(context => Task.CompletedTask, routePattern: null, order: 0)); 83static Task RequestDelegate(HttpContext d) => null; 103static Task RequestDelegate(HttpContext d) => null; 124static Task RequestDelegate(HttpContext d) => null; 150return Task.CompletedTask;
RouteOptionsTests.cs (2)
37var endpoint1 = new Endpoint((c) => Task.CompletedTask, EndpointMetadataCollection.Empty, string.Empty); 38var endpoint2 = new Endpoint((c) => Task.CompletedTask, EndpointMetadataCollection.Empty, string.Empty);
RouterMiddlewareTest.cs (10)
17public async Task RoutingFeatureSetInIRouter() 49return Task.CompletedTask; 54var middleware = new RouterMiddleware(context => Task.CompletedTask, NullLoggerFactory.Instance, route); 65public async Task Invoke_LogsCorrectValues_WhenNotHandled() 81return Task.FromResult<object>(null); 97public async Task Invoke_DoesNotLog_WhenHandled() 112return Task.FromResult<object>(null); 140public Task RouteAsync(RouteContext context) 142context.Handler = _isHandled ? (RequestDelegate)((c) => Task.CompletedTask) : null; 143return Task.FromResult<object>(null);
RouteTest.cs (29)
21private static readonly RequestDelegate NullHandler = (c) => Task.CompletedTask; 52public async Task RouteAsync_MergesExistingRouteData_IfRouteMatches() 74.Returns(Task.FromResult(true)); 107public async Task RouteAsync_MergesExistingRouteData_PassedToConstraint() 128.Returns(Task.FromResult(true)); 166public async Task RouteAsync_InlineConstraint_OptionalParameter() 182.Returns(Task.FromResult(true)); 208public async Task RouteAsync_InlineConstraint_Regex() 224.Returns(Task.FromResult(true)); 250public async Task RouteAsync_InlineConstraint_OptionalParameter_NotPresent() 266.Returns(Task.FromResult(true)); 290public async Task RouteAsync_InlineConstraint_OptionalParameter_WithInConstructorConstraint() 306.Returns(Task.FromResult(true)); 342public async Task RouteAsync_InlineConstraint_OptionalParameter_ConstraintFails() 358.Returns(Task.FromResult(true)); 380public async Task Match_Success_LeadingSlash() 397public async Task Match_Success_RootUrl() 412public async Task Match_Success_Defaults() 429public async Task Match_Success_CopiesDataTokens() 452public async Task Match_Fails() 466public async Task Match_RejectedByHandler() 484public async Task Match_SetsRouters() 501public async Task Match_RouteValuesDoesntThrowOnKeyNotFound() 515public async Task Match_Success_OptionalParameter_ValueProvided() 533public async Task Match_Success_OptionalParameter_ValueNotProvided() 550public async Task Match_Success_OptionalParameter_DefaultValue() 568public async Task Match_Success_OptionalParameter_EndsWithDot() 1726public async Task RouteAsync_MultipleOptionalParameters_WithEmptyIntermediateSegmentsDoesNotMatch(string url) 1843.Returns(Task.FromResult<object>(null));
RoutingMetricsTests.cs (8)
24public async Task Match_Success() 27var routeEndpointBuilder = new RouteEndpointBuilder(c => Task.CompletedTask, RoutePatternFactory.Parse("/{hi}"), order: 0); 54public async Task Match_SuccessFallback_SetTagIfPresent(bool hasFallbackMetadata) 57var routeEndpointBuilder = new RouteEndpointBuilder(c => Task.CompletedTask, RoutePatternFactory.Parse("/{hi}"), order: 0); 86public async Task Match_Success_MissingRoute() 93c.SetEndpoint(new Endpoint(c => Task.CompletedTask, EndpointMetadataCollection.Empty, "Test name")); 113public async Task Match_Failure() 157next ??= c => Task.CompletedTask;
TestConstants.cs (2)
10internal static readonly RequestDelegate EmptyRequestDelegate = (context) => Task.CompletedTask; 14return Task.CompletedTask;
TestObjects\TestMatcher.cs (2)
26public override Task MatchAsync(HttpContext httpContext) 33return Task.CompletedTask;
TestObjects\TestMatcherFactory.cs (2)
61public override Task MatchAsync(HttpContext httpContext) 81return Task.CompletedTask;
Tree\TreeRouterTest.cs (37)
19private static readonly RequestDelegate NullHandler = (c) => Task.CompletedTask; 33public async Task TreeRouter_RouteAsync_RespectsPrecedence( 75public async Task TreeRouter_RouteAsync_MatchesRouteWithTheRightLength(string url, string expected) 131public async Task TreeRouter_RouteAsync_MatchesRoutesWithDefaults(string url, object[] routeValues) 183public async Task TreeRouter_RouteAsync_MatchesConstrainedRoutesWithDefaults(string url, object[] routeValues) 224public async Task TreeRouter_RouteAsync_MatchesCatchAllRoutesWithDefaults() 267public async Task TreeRouter_RouteAsync_DoesNotMatchRoutesWithIntermediateDefaultRouteValues() 292public async Task TreeRouter_RouteAsync_DoesNotMatchRoutesWithMultipleIntermediateDefaultOrOptionalRouteValues(string template, string url) 313public async Task RouteAsync_MatchRoutesWithMultipleIntermediateDefaultOrOptionalRouteValues_WhenAllIntermediateValuesAreProvided(string template, string url) 332public async Task TreeRouter_RouteAsync_DoesNotMatchShorterUrl() 370public async Task TreeRouter_RouteAsync_RespectsOrderOverPrecedence( 403public async Task TryMatch_MultipleOptionalParameters_WithEmptyIntermediateSegmentsDoesNotMatch(string url) 430public async Task TryMatch_MultipleOptionalParameters_WithIncrementalOptionalValues(string url) 457public async Task TryMatch_MultipleParameters_WithEmptyValues(string url) 478public async Task TryMatch_CatchAllParameters_WithEmptyValuesAtTheEnd(string url) 499public async Task TryMatch_CatchAllParameters_WithEmptyValues(string url) 523public async Task TreeRouter_RouteAsync_MatchesWildCard_ForLargerPathSegments( 546public async Task TreeRouter_RouteAsync_MatchesCatchAll_NullValue( 568public async Task TreeRouter_RouteAsync_MatchesCatchAll_NullValue_DoesNotReplaceExistingValue( 591public async Task TreeRouter_RouteAsync_MatchesCatchAll_UsesDefaultValue( 617public async Task TreeRouter_RouteAsync_RespectsOrder(string template) 645public async Task TreeRouter_RouteAsync_EnsuresStableOrdering(string first, string second) 673public async Task TreeRouter_WithOptionalInlineConstraint( 721public async Task TreeRouter_WithOptionalCompositeParameter_Valid( 769public async Task TreeRouter_WithOptionalCompositeParameter_Invalid( 1695public async Task TreeRouter_ReplacesExistingRouteValues_IfNotNull() 1715public async Task TreeRouter_DoesNotReplaceExistingRouteValues_IfNull() 1735public async Task TreeRouter_SnapshotsRouteData() 1750.Returns(Task.CompletedTask); 1772public async Task TreeRouter_SnapshotsRouteData_ResetsWhenNotMatched() 1787.Returns(Task.CompletedTask); 1816public async Task TreeRouter_SnapshotsRouteData_ResetsWhenThrows() 1831.Returns(Task.CompletedTask); 1858public async Task TreeRouter_SnapshotsRouteData_ResetsBeforeMatchingEachRouteEntry() 1876.Returns(Task.CompletedTask); 2106public Task RouteAsync(RouteContext context) 2117return Task.FromResult(true);
Microsoft.AspNetCore.Security.Microbenchmarks (5)
AuthorizationMiddlewareBenchmark.cs (4)
22_authorizationMiddleware = new AuthorizationMiddleware((context) => Task.CompletedTask, policyProvider); 28Endpoint = new Endpoint((context) => Task.CompletedTask, EndpointMetadataCollection.Empty, "Test endpoint") 35public Task Invoke_NoEndpoint_NoAuthorization() 41public Task Invoke_HasEndpoint_NoAuthorization()
AuthorizationPolicyBenchmark.cs (1)
21public Task CombineAsync()
Microsoft.AspNetCore.Server.HttpSys (75)
AuthenticationHandler.cs (8)
19return Task.FromResult(AuthenticateResult.Success(new AuthenticationTicket(_requestContext.User!, properties: null, authenticationScheme: _scheme!.Name))); 21return Task.FromResult(AuthenticateResult.NoResult()); 24public Task ChallengeAsync(AuthenticationProperties? properties) 27return Task.CompletedTask; 30public Task ForbidAsync(AuthenticationProperties? properties) 33return Task.CompletedTask; 36public Task InitializeAsync(AuthenticationScheme scheme, HttpContext context) 46return Task.CompletedTask;
MessagePump.cs (4)
63public Task StartAsync<TContext>(IHttpApplication<TContext> application, CancellationToken cancellationToken) where TContext : notnull 122return Task.CompletedTask; 172public Task StopAsync(CancellationToken cancellationToken) 248private async Task ExecuteAsync()
RequestProcessing\ClientCertLoader.cs (2)
84private Task Task 151internal Task LoadClientCertificateAsync()
RequestProcessing\OpaqueStream.cs (3)
108public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) 137public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 152public override Task FlushAsync(CancellationToken cancellationToken)
RequestProcessing\RequestContext.cs (3)
110return Task.FromResult<Stream>(opaqueStream); 260public virtual Task ExecuteAsync() 262return Task.CompletedTask;
RequestProcessing\RequestContext.FeatureCollection.cs (19)
70private List<Tuple<Func<object, Task>, object>>? _onStartingActions = new List<Tuple<Func<object, Task>, object>>(); 71private List<Tuple<Func<object, Task>, object>>? _onCompletedActions = new List<Tuple<Func<object, Task>, object>>(); 328_clientCertTask = Task.FromResult(value); 347return _clientCertTask = Task.FromResult(clientCert); 436void IHttpResponseFeature.OnStarting(Func<object, Task> callback, object state) 444_onStartingActions.Add(new Tuple<Func<object, Task>, object>(callback, state)); 447void IHttpResponseFeature.OnCompleted(Func<object, Task> callback, object state) 455_onCompletedActions.Add(new Tuple<Func<object, Task>, object>(callback, state)); 470async Task IHttpResponseBodyFeature.SendFileAsync(string path, long offset, long? length, CancellationToken cancellation) 476Task IHttpResponseBodyFeature.StartAsync(CancellationToken cancellation) 481Task IHttpResponseBodyFeature.CompleteAsync() => CompleteAsync(); 489internal async Task CompleteAsync() 602internal async Task OnResponseStart() 615private async Task NotifiyOnStartingAsync() 696internal Task OnCompleted() 700return Task.CompletedTask; 706private async Task NotifyOnCompletedAsync()
RequestProcessing\RequestContextOfT.cs (1)
23public override async Task ExecuteAsync()
RequestProcessing\RequestStream.cs (9)
82public override Task FlushAsync(CancellationToken cancellationToken) 193return Task.FromResult<int>(0); 198return Task.FromCanceled<int>(cancellationToken); 213return Task.FromException<int>(exception); 216return Task.FromResult<int>((int)dataRead); 270return Task.FromException<int>(exception); 273return Task.FromResult<int>((int)totalRead); 292return Task.FromException<int>(exception); 295return Task.FromResult<int>((int)totalRead);
RequestProcessing\Response.cs (1)
688public Task SendFileAsync(string path, long offset, long? count, CancellationToken cancel)
RequestProcessing\ResponseBody.cs (13)
310public override Task FlushAsync(CancellationToken cancellationToken) 314return Task.CompletedTask; 320private unsafe Task FlushInternalAsync(ArraySegment<byte> data, CancellationToken cancellationToken) 324return Task.CompletedTask; 331return Task.CompletedTask; 337return Task.FromCanceled<int>(cancellationToken); 576public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 586return Task.CompletedTask; 599internal async Task SendFileAsync(string fileName, long offset, long? count, CancellationToken cancellationToken) 613internal unsafe Task SendFileAsyncCore(string fileName, long offset, long? count, CancellationToken cancellationToken) 617return Task.CompletedTask; 624return Task.CompletedTask; 630return Task.FromCanceled<int>(cancellationToken);
RequestProcessing\ResponseStreamAsyncResult.cs (1)
183internal Task Task
ResponseStream.cs (4)
9private readonly Func<Task> _onStart; 11internal ResponseStream(Stream innerStream, Func<Task> onStart) 52public override async Task FlushAsync(CancellationToken cancellationToken) 64public override async Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
src\Shared\Buffers.MemoryPool\DiagnosticMemoryPool.cs (4)
153public async Task WhenAllBlocksReturnedAsync(TimeSpan timeout) 155var task = await Task.WhenAny(_allBlocksReturned.Task, Task.Delay(timeout));
src\Shared\TaskToApm.cs (3)
32public static IAsyncResult Begin(Task task, AsyncCallback? callback, object? state) => 69internal readonly Task _task; 77internal TaskAsyncResult(Task task, object? state, AsyncCallback? callback)
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (536)
AuthenticationTests.cs (27)
28public async Task AuthTypes_AllowAnonymous_NoChallenge(AuthenticationSchemes authType) 35return Task.FromResult(0); 49public async Task AuthType_RequireAuth_ChallengesAdded(AuthenticationSchemes authType) 67public async Task AuthType_AllowAnonymousButSpecify401_ChallengesAdded(AuthenticationSchemes authType) 75return Task.FromResult(0); 85public async Task MultipleAuthTypes_AllowAnonymousButSpecify401_ChallengesAdded() 101return Task.FromResult(0); 116public async Task AuthTypes_AllowAnonymousButSpecify401_Success(AuthenticationSchemes authType) 137return Task.FromResult(0); 151public async Task AuthTypes_RequireAuth_Success(AuthenticationSchemes authType) 158return Task.FromResult(0); 168public async Task AuthTypes_AccessUserInOnCompleted_Success() 182return Task.CompletedTask; 184return Task.FromResult(0); 200public async Task AuthTypes_AuthenticateWithNoUser_NoResults(AuthenticationSchemes authType) 225public async Task AuthTypes_AuthenticateWithUser_OneResult(AuthenticationSchemes authType) 247public async Task AuthTypes_ChallengeWithoutAuthTypes_AllChallengesSent(AuthenticationSchemes authType) 270public async Task AuthTypes_ChallengeWithAllAuthTypes_AllChallengesSent(AuthenticationSchemes authType) 288public async Task AuthTypes_OneChallengeSent() 314public async Task AuthTypes_ChallengeWillAskForAllEnabledSchemes(AuthenticationSchemes authType) 332public async Task AuthTypes_Forbid_Forbidden() 354public async Task AuthTypes_UnathorizedAuthenticatedAuthType_Unauthorized(AuthenticationSchemes authType) 377public async Task AuthTypes_DisableAutomaticAuthentication(AuthenticationSchemes authType) 407public async Task AuthTypes_EnableKerberosCredentialCaching(AuthenticationSchemes authType) 422return Task.FromResult(0); 434public async Task AuthTypes_CaptureCredentials(AuthenticationSchemes authType) 449return Task.FromResult(0);
DelegateTests.cs (14)
37public async Task DelegateRequestTest() 55return Task.CompletedTask; 68public async Task DelegateAfterWriteToResponseBodyShouldThrowTest() 74return Task.CompletedTask; 101public async Task WriteToBodyAfterDelegateShouldNoOp() 121return Task.CompletedTask; 134public async Task DelegateAfterRequestBodyReadShouldThrow() 140return Task.CompletedTask; 166public async Task DelegationFeaturesAreNull() 175return Task.CompletedTask; 186public async Task UpdateDelegationRuleTest() 204return Task.CompletedTask; 220public async Task DelegateAfterReceiverRestart() 237return Task.CompletedTask;
DummyApplication.cs (2)
16public DummyApplication() : this(context => Task.CompletedTask) { } 33public async Task ProcessRequestAsync(HttpContext httpContext)
Http2Tests.cs (29)
31public async Task EmptyResponse_200() 39return Task.CompletedTask; 68public async Task RequestWithoutData_LengthRequired_Rejected(string method) 114public async Task RequestWithoutData_Success(string method) 122return Task.CompletedTask; 164public async Task RequestWithDataAndContentLength_Success(string method) 228public async Task RequestWithDataAndNoContentLength_Success(string method) 285public async Task ResponseWithData_Success() 320public async Task ConnectionClose_NoOSSupport_NoGoAway() 325return Task.FromResult(0); 364public async Task ConnectionHeaderClose_OSSupport_SendsGoAway() 369return Task.FromResult(0); 403public async Task ConnectionRequestClose_OSSupport_SendsGoAway() 408return Task.FromResult(0); 442public async Task ConnectionClose_AdditionalRequests_ReceivesSecondGoAway() 447return Task.FromResult(0); 516public async Task AppException_BeforeResponseHeaders_500() 549public async Task AppException_AfterHeaders_PriorOSVersions_ResetCancel() 581public async Task AppException_AfterHeaders_ResetInternalError() 612public async Task Reset_Http1_NotSupported() 634public async Task Reset_PriorOSVersions_NotSupported() 654public async Task Reset_BeforeResponse_Resets() 671return Task.FromResult(0); 696public async Task Reset_AfterResponseHeaders_Resets() 743public async Task Reset_DurringResponseBody_Resets() 793public async Task Reset_AfterCompleteAsync_NoReset() 845public async Task Reset_BeforeRequestBody_Resets() 891public async Task Reset_DurringRequestBody_Resets() 940public async Task Reset_CompleteAsyncDurringRequestBody_Resets()
Http3Tests.cs (9)
24public async Task Http3_Direct() 49public async Task Http3_AltSvcHeader_UpgradeFromHttp1() 89public async Task Http3_AltSvcHeader_UpgradeFromHttp2() 127public async Task Http3_ResponseTrailers() 156public async Task Http3_ResetBeforeHeaders() 183public async Task Http3_ResetAfterHeaders() 216public async Task Http3_AppExceptionAfterHeaders_InternalError() 242public async Task Http3_Abort_Cancel() 247return Task.CompletedTask;
HttpsTests.cs (10)
25public async Task Https_200OK_Success() 29return Task.FromResult(0); 38public async Task Https_SendHelloWorld_Success() 53public async Task Https_EchoHelloWorld_Success() 73public async Task Https_ClientCertNotSent_ClientCertNotPresent(ClientCertificateMethod clientCertificateMethod) 98public async Task Https_ClientCertRequested_ClientCertPresent(ClientCertificateMethod clientCertificateMethod) 130public async Task Https_SkipsITlsHandshakeFeatureOnWin7() 152public async Task Https_SetsITlsHandshakeFeature() 196public async Task Https_ITlsHandshakeFeature_MatchesIHttpSysExtensionInfoFeature() 236public async Task Https_SetsIHttpSysRequestTimingFeature()
Listener\AuthenticationOnExistingQueueTests.cs (6)
55public async Task AuthTypes_AllowAnonymous_NoChallenge(AuthenticationSchemes authType) 78public async Task AuthType_RequireAuth_ChallengesAdded(AuthenticationSchemes authType) 96public async Task AuthType_AllowAnonymousButSpecify401_ChallengesAdded(AuthenticationSchemes authType) 116public async Task MultipleAuthTypes_AllowAnonymousButSpecify401_ChallengesAdded() 146public async Task AuthTypes_AllowAnonymousButSpecify401_Success(AuthenticationSchemes authType) 176public async Task AuthTypes_RequireAuth_Success(AuthenticationSchemes authType)
Listener\RequestBodyTests.cs (8)
20public async Task RequestBody_SyncReadDisabledByDefault_WorksWhenEnabled() 46public async Task RequestBody_ReadAsyncAlreadyCanceled_ReturnsCanceledTask() 70public async Task RequestBody_ReadAsyncPartialBodyWithCancellationToken_Success() 94public async Task RequestBody_ReadAsyncPartialBodyWithTimeout_Success() 119public async Task RequestBody_ReadAsyncPartialBodyAndCancel_Canceled() 144public async Task RequestBody_ReadAsyncPartialBodyAndExpiredTimeout_Canceled() 171public async Task RequestBody_ReadAsyncPartialBodyAndDisconnectedClient_Canceled() 220protected override async Task SerializeToStreamAsync(Stream stream, TransportContext context)
Listener\RequestHeaderTests.cs (14)
19public async Task RequestHeaders_RemoveHeaders_Success() 25Task responseTask = SendRequestAsync(address, "Custom-Header", customValues, Encoding.UTF8); 60public async Task RequestHeaders_ClientSendsUtf8Headers_Success() 66Task responseTask = SendRequestAsync(address, "Custom-Header", customValues, Encoding.UTF8); 87public async Task RequestHeaders_Latin1Replaced() 93Task responseTask = SendRequestAsync(address, "Custom-Header", customValues, Encoding.Latin1); 114public async Task RequestHeaders_ClientSendsLatin1Headers_Success() 121Task responseTask = SendRequestAsync(address, "Custom-Header", customValues, Encoding.Latin1); 142public async Task RequestHeaders_ClientSendsBadLatin1Headers_Rejected() 156public async Task RequestHeaders_ClientSendsKnownHeaderWithNoValue_Success() 162Task responseTask = SendRequestAsync(address, "If-None-Match", customValues, Encoding.UTF8); 181public async Task RequestHeaders_ClientSendsUnknownHeaderWithNoValue_Success() 187Task responseTask = SendRequestAsync(address, "Custom-Header", customValues, Encoding.UTF8); 230await Task.Run(() => socket.Receive(response));
Listener\RequestTests.cs (7)
24public async Task Request_MalformedPathReturns400StatusCode(string requestPath) 38public async Task Request_OptionsStar_EmptyPath() 75public async Task Request_PathDecodingValidUTF8(string requestPath, string expect) 101public async Task Request_PathDecodingInvalidUTF8(string requestPath) 126public async Task Request_OverlongUTF8Path(string requestPath, string expectedPath) 164public async Task Request_WithPathBase(string pathBase, string requestPath, string expectedPathBase, string expectedPath) 194await Task.Run(() => socket.Receive(response));
Listener\ResponseBodyTests.cs (21)
20public async Task ResponseBody_SyncWriteDisabledByDefault_WorksWhenEnabled() 53public async Task ResponseBody_FlushThenWrite_DefaultsToChunkedAndTerminates() 77public async Task ResponseBody_WriteZeroCount_StartsChunkedResponse() 102public async Task ResponseBody_WriteAsyncWithActiveCancellationToken_Success() 123public async Task ResponseBody_WriteAsyncWithTimerCancellationToken_Success() 145public async Task ResponseBodyWriteExceptions_FirstWriteAsyncWithCanceledCancellationToken_CancelsAndAborts() 166public async Task ResponseBody_FirstWriteAsyncWithCanceledCancellationToken_CancelsAndAborts() 186public async Task ResponseBodyWriteExceptions_SecondWriteAsyncWithCanceledCancellationToken_CancelsAndAborts() 209public async Task ResponseBody_SecondWriteAsyncWithCanceledCancellationToken_CancelsAndAborts() 231public async Task ResponseBodyWriteExceptions_ClientDisconnectsBeforeFirstWrite_WriteThrows() 257await Task.Delay(TimeSpan.FromMilliseconds(50)); 268public async Task ResponseBodyWriteExceptions_ClientDisconnectsBeforeFirstWriteAsync_WriteThrows() 293await Task.Delay(TimeSpan.FromMilliseconds(50)); 304public async Task ResponseBody_ClientDisconnectsBeforeFirstWrite_WriteCompletesSilently() 332public async Task ResponseBody_ClientDisconnectsBeforeFirstWriteAsync_WriteCompletesSilently() 359public async Task ResponseBodyWriteExceptions_ClientDisconnectsBeforeSecondWrite_WriteThrows() 391await Task.Delay(TimeSpan.FromMilliseconds(50)); 399public async Task ResponseBodyWriteExceptions_ClientDisconnectsBeforeSecondWriteAsync_WriteThrows() 430await Task.Delay(TimeSpan.FromMilliseconds(50)); 438public async Task ResponseBody_ClientDisconnectsBeforeSecondWrite_WriteCompletesSilently() 473public async Task ResponseBody_ClientDisconnectsBeforeSecondWriteAsync_WriteCompletesSilently()
Listener\ResponseHeaderTests.cs (9)
27public async Task ResponseHeaders_11Request_ServerSendsDefaultHeaders() 49public async Task ResponseHeaders_10Request_ServerSendsDefaultHeaders() 72public async Task ResponseHeaders_11HeadRequest_ServerSendsDefaultHeaders() 100public async Task ResponseHeaders_10HeadRequest_ServerSendsDefaultHeaders() 129public async Task ResponseHeaders_11HeadRequestWithContentLength_Success() 158public async Task ResponseHeaders_11RequestStatusCodeWithoutBody_NoContentLengthOrChunkedOrClose() 181public async Task ResponseHeaders_11HeadRequestStatusCodeWithoutBody_NoContentLengthOrChunkedOrClose() 210public async Task ResponseHeaders_HTTP10KeepAliveRequest_Gets11Close() 247public async Task AddingControlCharactersToHeadersThrows(string key, string value)
Listener\ServerOnExistingQueueTests.cs (13)
19public async Task Server_200OK_Success() 34public async Task Server_SendHelloWorld_Success() 53public async Task Server_EchoHelloWorld_Success() 75public async Task Server_SetQueueLimit_Success() 90public async Task Server_PathBase_Success() 108public async Task Server_PathBaseMismatch_Success() 132public async Task Server_PathSplitting(string pathBase, string requestPath, string expectedPathBase, string expectedPath) 150public async Task Server_LongestPathSplitting() 171public async Task Server_HotAddPrefix_Success() 204public async Task Server_HotRemovePrefix_Success() 238public async Task Server_CreateOrAttach_NoUrlPrefix_NewUrlPrefixWorks() 271public async Task Server_CreateOrAttach_UrlPrefixExist_ExistingUrlPrefixWorks() 291public async Task Server_CreateOrAttach_UrlPrefixExist_NewAndExistingUrlPrefixsWork()
Listener\ServerTests.cs (6)
22public async Task Server_TokenRegisteredAfterClientDisconnects_CallCanceled() 51public async Task Server_TokenRegisteredAfterResponseSent_Success() 81public async Task Server_ConnectionCloseHeader_CancellationTokenFires() 113public async Task Server_SetRejectionVerbosityLevel_Success() 144public async Task Server_HotAddPrefix_Success() 175public async Task Server_HotRemovePrefix_Success()
Listener\Utilities.cs (5)
130var completedTask = await Task.WhenAny(acceptTask, Task.Delay(timeout)); 146var completedTask = await Task.WhenAny(acceptTask, responseTask);
OpaqueUpgradeTests.cs (14)
23public async Task OpaqueUpgrade_DownLevel_FeatureIsAbsent() 36return Task.FromResult(0); 49public async Task OpaqueUpgrade_SupportKeys_Present() 64return Task.FromResult(0); 77public async Task OpaqueUpgrade_AfterHeadersSent_Throws() 107public async Task OpaqueUpgrade_GetUpgrade_Success() 129public async Task OpaqueUpgrade_GetUpgrade_NotAffectedByMaxRequestBodyLimit() 161public async Task OpaqueUpgrade_WithOnStarting_CallbackCalled() 170return Task.FromResult(0); 212public async Task OpaqueUpgrade_VariousMethodsUpgradeSendAndReceive_Success(string method, string extraHeader) 255public async Task OpaqueUpgrade_InvalidMethodUpgrade_Disconnected(string method, string extraHeader) 279public async Task OpaqueUpgrade_PostWithBodyAndUpgradeHeaders_Accepted() 307public async Task OpaqueUpgrade_Http10_ThrowsIfUpgraded() 431private async Task ParseResponseAsync(NetworkStream stream)
RequestBodyLimitTests.cs (27)
20public async Task ContentLengthEqualsLimit_ReadSync_Success() 34return Task.FromResult(0); 43public async Task ContentLengthEqualsLimit_ReadAsync_Success() 65public async Task ContentLengthEqualsLimit_ReadBeginEnd_Success() 78return Task.FromResult(0); 87public async Task ChunkedEqualsLimit_ReadSync_Success() 101return Task.FromResult(0); 110public async Task ChunkedEqualsLimit_ReadAsync_Success() 132public async Task ChunkedEqualsLimit_ReadBeginEnd_Success() 145return Task.FromResult(0); 154public async Task ContentLengthExceedsLimit_ReadSync_ThrowsImmediately() 171return Task.FromResult(0); 180public async Task ContentLengthExceedsLimit_ReadAsync_ThrowsImmediately() 196return Task.FromResult(0); 205public async Task ContentLengthExceedsLimit_ReadBeginEnd_ThrowsImmediately() 221return Task.FromResult(0); 230public async Task ChunkedExceedsLimit_ReadSync_ThrowsAtLimit() 247return Task.FromResult(0); 256public async Task ChunkedExceedsLimit_ReadAsync_ThrowsAtLimit() 280public async Task ChunkedExceedsLimit_ReadBeginEnd_ThrowsAtLimit() 297return Task.FromResult(0); 306public async Task Chunked_ReadSyncPartialBodyUnderLimit_ThrowsAfterLimit() 324return Task.FromResult(0); 333public async Task Chunked_ReadAsyncPartialBodyUnderLimit_ThrowsAfterLimit() 358public async Task AdjustLimitPerRequest_ContentLength_ReadAsync_Success() 382public async Task AdjustLimitPerRequest_Chunked_ReadAsync_Success() 430protected override async Task SerializeToStreamAsync(Stream stream, TransportContext context)
RequestBodyTests.cs (18)
24public async Task RequestBody_ReadSync_Success() 35return Task.FromResult(0); 44public async Task RequestBody_Read0ByteSync_Success() 57return Task.FromResult(0); 66public async Task RequestBody_ReadAsync_Success() 84public async Task RequestBody_Read0ByteAsync_Success() 104public async Task RequestBody_ReadBeginEnd_Success() 113return Task.FromResult(0); 122public async Task RequestBody_InvalidBuffer_ArgumentException() 135return Task.FromResult(0); 144public async Task RequestBody_ReadSyncPartialBody_Success() 157return Task.FromResult(0); 166public async Task RequestBody_ReadAsyncPartialBody_Success() 186public async Task RequestBody_PostWithImidateBody_Success() 209public async Task RequestBody_ChangeContentLength_Success() 240public async Task RequestBody_RemoveHeaderOnEmptyValueSet_Success() 286return Task.CompletedTask; 364protected override async Task SerializeToStreamAsync(Stream stream, TransportContext context)
RequestHeaderTests.cs (19)
19public async Task RequestHeaders_ClientSendsDefaultHeaders_Success() 30return Task.FromResult(0); 39public async Task RequestHeaders_ClientSendsCustomHeaders_Success() 52return Task.FromResult(0); 77var read = await Task.Run(() => socket.Receive(response)); 84public async Task RequestHeaders_ServerAddsCustomHeaders_Success() 94return Task.FromResult(0); 103public async Task RequestHeaders_ClientSendTransferEncodingHeaders() 113return Task.FromResult(0); 126public async Task RequestHeaders_ClientSendTransferEncodingHeadersWithMultipleValues() 136return Task.FromResult(0); 149public async Task RequestHeaders_ClientSendTransferEncodingAndContentLength_ContentLengthShouldBeRemoved() 167return Task.FromResult(0); 181public async Task RequestHeaders_AllKnownHeadersKeys_Received() 193return Task.FromResult(0); 209public async Task RequestHeaders_AllUnknownHeadersKeys_Received() 221return Task.FromResult(0); 233private async Task SendRequestAsync(string uri, IReadOnlyDictionary<string, string> headers) 278var read = await Task.Run(() => socket.Receive(response));
RequestTests.cs (29)
28public async Task Request_SimpleGet_ExpectedFieldsSet() 68return Task.FromResult(0); 77public async Task Request_FieldsCanBeSet_Set() 132return Task.FromResult(0); 141public async Task Request_FieldsCanBeSetToNull_Set() 195return Task.FromResult(0); 212public async Task Request_PathSplitting(string pathBase, string requestPath, string expectedPathBase, string expectedPath) 239return Task.FromResult(0); 248public async Task Request_DoubleEscapingAllowed() 256return Task.FromResult(0); 266public async Task Request_FullUriInRequestLine_ParsesPath() 273return Task.CompletedTask; 285public async Task Request_FullUriInRequestLineWithSlashesInQuery_BlockedByHttpSys() 289return Task.CompletedTask; 314public async Task Request_MultiplePrefixes(string requestPath, string expectedPathBase, string expectedPath) 336return Task.FromResult(0); 345public async Task Request_UrlUnescaping() 362return Task.FromResult(0); 372public async Task Request_WithDoubleSlashes_LeftAlone() 381return Task.FromResult(0); 397public async Task Request_WithNavigation_Removed(string basePath, string input, string expectedPathBase, string expectedPath) 406return Task.FromResult(0); 418public async Task Request_WithEscapedNavigation_Removed(string input, string expected) 426return Task.FromResult(0); 436public async Task Request_ControlCharacters_400() 458public async Task Request_EscapedControlCharacters_400() 476public async Task RequestAborted_AfterAccessingProperty_Notified() 525public async Task RequestAbortedDurringRead_BeforeAccessingProperty_TokenAlreadyCanceled() 612await Task.Run(() => socket.Receive(response));
ResponseBodyTests.cs (27)
15public async Task ResponseBody_StartAsync_LocksHeadersAndTriggersOnStarting() 23return Task.CompletedTask; 43public async Task ResponseBody_CompleteAsync_TriggersOnStartingAndLocksHeaders() 52return Task.CompletedTask; 70public async Task ResponseBody_CompleteAsync_FlushesThePipe() 91public async Task ResponseBody_PipeAdapter_AutomaticallyFlushed() 98return Task.CompletedTask; 109public async Task ResponseBody_WriteNoHeaders_SetsChunked() 132public async Task ResponseBody_WriteNoHeaders_SetsChunked_LargeBody(bool enableKernelBuffering) 165public async Task ResponseBody_WriteNoHeadersAndFlush_DefaultsToChunked() 187public async Task ResponseBody_WriteChunked_ManuallyChunked() 209public async Task ResponseBody_WriteContentLength_PassedThrough() 234public async Task ResponseBody_WriteContentLengthNoneWritten_Throws() 240return Task.FromResult(0); 248public async Task ResponseBody_WriteContentLengthNotEnoughWritten_Throws() 262public async Task ResponseBody_WriteContentLengthTooMuchWritten_Throws() 281public async Task ResponseBody_WriteContentLengthExtraWritten_Throws() 298return Task.FromResult(0); 316public async Task ResponseBody_Write_TriggersOnStarting() 327return Task.FromResult(0); 330return Task.FromResult(0); 345public async Task ResponseBody_BeginWrite_TriggersOnStarting() 355return Task.FromResult(0); 358return Task.FromResult(0); 373public async Task ResponseBody_WriteAsync_TriggersOnStarting() 383return Task.FromResult(0); 402public async Task ResponseBody_ZeroLengthTrailingWrite_Success(bool setContentLength)
ResponseCachingTests.cs (19)
30public async Task Caching_NoCacheControl_NotCached() 49public async Task Caching_JustPublic_NotCached() 70public async Task Caching_WithoutContentType_NotCached() 90public async Task Caching_304_NotCached() 111public async Task Caching_WithoutContentType_Cached_OnWin7AndWin2008R2() 136public async Task Caching_MaxAge_Cached() 156public async Task Caching_MaxAgeHuge_Cached() 176public async Task Caching_SMaxAge_Cached() 196public async Task Caching_SMaxAgeAndMaxAge_SMaxAgePreferredCached() 216public async Task Caching_Expires_Cached() 240public async Task Caching_DisallowedResponseHeaders_NotCached(string headerName) 263public async Task Caching_InvalidExpires_NotCached(string expiresValue) 284public async Task Caching_ExpiresWithoutPublic_NotCached() 304public async Task Caching_MaxAgeAndExpires_MaxAgePreferred() 325public async Task Caching_Flush_NotCached() 346public async Task Caching_WriteFullContentLength_Cached() 368public async Task Caching_SendFileNoContentLength_NotCached() 387public async Task Caching_SendFileWithFullContentLength_Cached() 407public async Task Caching_VariousStatusCodes_Cached()
ResponseHeaderTests.cs (19)
21public async Task ResponseHeaders_ServerSendsDefaultHeaders_Success() 26return Task.FromResult(0); 41public async Task ResponseHeaders_ServerSendsSingleValueKnownHeaders_Success() 49return Task.FromResult(0); 67public async Task ResponseHeaders_ServerSendsMultiValueKnownHeaders_Success() 75return Task.FromResult(0); 92public async Task ResponseHeaders_ServerSendsCustomHeaders_Success() 100return Task.FromResult(0); 117public async Task ResponseHeaders_ServerSendsNonAsciiHeaders_Success() 125return Task.FromResult(0); 138public async Task ResponseHeaders_ServerSendsConnectionClose_Closed() 162public async Task ResponseHeaders_HTTP10Request_Gets11Close() 167return Task.FromResult(0); 185public async Task ResponseHeaders_HTTP10RequestWithChunkedHeader_ManualChunking() 214public async Task Headers_FlushSendsHeaders_Success() 230return Task.FromResult(0); 246public async Task Headers_FlushAsyncSendsHeaders_Success() 276public async Task Headers_IgnoreNullHeaders(string headerName, StringValues headerValue, StringValues expectedValue) 283return Task.FromResult(0);
ResponseSendFileTests.cs (33)
36public async Task ResponseSendFile_MissingFile_Throws() 61public async Task ResponseSendFile_NoHeaders_DefaultsToChunked() 80public async Task ResponseSendFile_RelativeFile_Success() 99public async Task ResponseSendFile_Unspecified_Chunked() 118public async Task ResponseSendFile_MultipleWrites_Chunked() 138public async Task ResponseSendFile_HalfOfFile_Chunked() 157public async Task ResponseSendFile_OffsetOutOfRange_Throws() 176public async Task ResponseSendFile_CountOutOfRange_Throws() 195public async Task ResponseSendFile_Count0_Chunked() 214public async Task ResponseSendFile_ContentLength_PassedThrough() 235public async Task ResponseSendFile_ContentLengthSpecific_PassedThrough() 256public async Task ResponseSendFile_ContentLength0_PassedThrough() 277public async Task ResponseSendFile_TriggersOnStarting() 287return Task.FromResult(0); 305public async Task ResponseSendFile_EmptyFileCountUnspecified_SetsChunkedAndFlushesHeaders() 333public async Task ResponseSendFile_WithActiveCancellationToken_Success() 350public async Task ResponseSendFile_WithTimerCancellationToken_Success() 368public async Task ResponseSendFileWriteExceptions_FirstCallWithCanceledCancellationToken_CancelsAndAborts() 378var writeTask = httpContext.Response.SendFileAsync(AbsoluteFilePath, 0, null, cts.Token); 387return Task.CompletedTask; 396public async Task ResponseSendFile_FirstSendWithCanceledCancellationToken_CancelsAndAborts() 406var writeTask = httpContext.Response.SendFileAsync(AbsoluteFilePath, 0, null, cts.Token); 415return Task.CompletedTask; 424public async Task ResponseSendFileExceptions_SecondSendWithCanceledCancellationToken_CancelsAndAborts() 435var writeTask = httpContext.Response.SendFileAsync(AbsoluteFilePath, 0, null, cts.Token); 451public async Task ResponseSendFile_SecondSendWithCanceledCancellationToken_CancelsAndAborts() 462var writeTask = httpContext.Response.SendFileAsync(AbsoluteFilePath, 0, null, cts.Token); 478public async Task ResponseSendFileExceptions_ClientDisconnectsBeforeFirstSend_SendThrows() 531public async Task ResponseSendFile_ClientDisconnectsBeforeFirstSend_SendCompletesSilently() 574public async Task ResponseSendFileExceptions_ClientDisconnectsBeforeSecondSend_SendThrows() 616var bufferTask = response.Content.LoadIntoBufferAsync(); 630public async Task ResponseSendFile_ClientDisconnectsBeforeSecondSend_SendCompletesSilently() 665var bufferTask = response.Content.LoadIntoBufferAsync();
ResponseTests.cs (23)
23public async Task Response_ServerSendsDefaultResponse_ServerProvidesStatusCodeAndReasonPhrase() 30return Task.FromResult(0); 42public async Task Response_ServerSendsSpecificStatus_ServerProvidesReasonPhrase() 49return Task.FromResult(0); 61public async Task Response_ServerSendsSpecificStatusAndReasonPhrase_PassedThrough() 69return Task.FromResult(0); 81public async Task Response_ServerSendsCustomStatus_NoReasonPhrase() 87return Task.FromResult(0); 98public async Task Response_StatusCode100_Throws() 104return Task.FromResult(0); 113public async Task Response_StatusCode0_Throws() 119return Task.FromResult(0); 128public async Task Response_Empty_CallsOnStartingAndOnCompleted() 139return Task.CompletedTask; 145return Task.CompletedTask; 147return Task.CompletedTask; 159public async Task Response_OnStartingThrows_StillCallsOnCompleted() 174return Task.CompletedTask; 176return Task.CompletedTask; 188public async Task Response_OnStartingThrowsAfterWrite_WriteThrowsAndStillCallsOnCompleted() 203return Task.CompletedTask; 206return Task.CompletedTask; 218public async Task ClientDisconnectsBeforeResponse_ResponseCanStillBeModified()
ResponseTrailersTests.cs (21)
23public async Task ResponseTrailers_HTTP11_TrailersNotAvailable() 29return Task.FromResult(0); 41public async Task ResponseTrailers_HTTP2_TrailersAvailable() 47return Task.FromResult(0); 59public async Task ResponseTrailers_ProhibitedTrailers_Blocked() 68return Task.FromResult(0); 80public async Task ResponseTrailers_NoBody_TrailersSent() 86return Task.FromResult(0); 99public async Task ResponseTrailers_WithBody_TrailersSent() 118public async Task ResponseTrailers_WithContentLengthBody_TrailersNotSent() 149public async Task ResponseTrailers_WithTrailersBeforeContentLengthBody_TrailersSent() 174public async Task ResponseTrailers_WithContentLengthBodyAndDeclared_TrailersSent() 200public async Task ResponseTrailers_WithContentLengthBodyAndDeclaredButMissingTrailers_Completes() 225public async Task ResponseTrailers_CompleteAsyncNoBody_TrailersSent() 246public async Task ResponseTrailers_CompleteAsyncWithBody_TrailersSent() 269public async Task ResponseTrailers_MultipleValues_SentAsSeparateHeaders() 274return Task.FromResult(0); 289public async Task ResponseTrailers_LargeTrailers_Success() 302return Task.FromResult(0); 317public async Task ResponseTrailers_NullValues_Ignored(string headerName, StringValues headerValue, StringValues expectedValue) 322return Task.FromResult(0);
ServerTests.cs (54)
27public async Task Server_200OK_Success() 31return Task.FromResult(0); 42public async Task Server_ConnectExistingQueueName_Success(RequestQueueMode queueMode) 59return Task.FromResult(0); 92public async Task Server_SetQueueName_Success() 97return Task.FromResult(0); 115public async Task Server_SendHelloWorld_Success() 129public async Task Server_EchoHelloWorld_Success() 145public async Task Server_ShutdownDuringRequest_Success() 165public async Task Server_DisposeWithoutStopDuringRequest_Aborts() 186public async Task Server_ShutdownDuringLongRunningRequest_TimesOut() 208public async Task Server_AppException_ClientReset() 227public async Task Server_BadHttpRequestException_SetStatusCode() 264List<Task> requestTasks = new List<Task>(); 270Assert.True(Task.WaitAll(requestTasks.ToArray(), TimeSpan.FromSeconds(60)), "Timed out"); 275public async Task Server_ClientDisconnects_CallCanceled() 309public async Task Server_Abort_CallCanceled() 336public async Task Server_SetQueueLimit_Success() 340using (Utilities.CreateHttpServer(out address, httpContext => Task.FromResult(0), LoggerFactory)) { } 355public async Task Server_SetHttp503VebosityHittingThrottle_Success() 362}, httpContext => Task.FromResult(0), LoggerFactory)) 395public async Task Server_SetConnectionLimitInfinite_Success() 401}, httpContext => Task.FromResult(0), LoggerFactory)) 415public async Task Server_MultipleStopAsyncCallsWaitForRequestsToDrain_Success() 432var stopTask1 = server.StopAsync(cts.Token); 433var stopTask2 = server.StopAsync(cts.Token); 434var stopTask3 = server.StopAsync(cts.Token); 442await Task.WhenAll(stopTask1, stopTask2, stopTask3).TimeoutAfter(TimeSpan.FromSeconds(10)); 449public async Task Server_MultipleStopAsyncCallsCompleteOnCancellation_SameToken_Success() 466var stopTask1 = server.StopAsync(cts.Token); 467var stopTask2 = server.StopAsync(cts.Token); 468var stopTask3 = server.StopAsync(cts.Token); 476await Task.WhenAll(stopTask1, stopTask2, stopTask3).TimeoutAfter(TimeSpan.FromSeconds(10)); 486public async Task Server_MultipleStopAsyncCallsCompleteOnSingleCancellation_FirstToken_Success() 503var stopTask1 = server.StopAsync(cts.Token); 504var stopTask2 = server.StopAsync(new CancellationTokenSource().Token); 505var stopTask3 = server.StopAsync(new CancellationTokenSource().Token); 513await Task.WhenAll(stopTask1, stopTask2, stopTask3).TimeoutAfter(TimeSpan.FromSeconds(10)); 523public async Task Server_MultipleStopAsyncCallsCompleteOnSingleCancellation_SubsequentToken_Success() 540var stopTask1 = server.StopAsync(new CancellationTokenSource().Token); 541var stopTask2 = server.StopAsync(cts.Token); 542var stopTask3 = server.StopAsync(new CancellationTokenSource().Token); 550await Task.WhenAll(stopTask1, stopTask2, stopTask3).TimeoutAfter(TimeSpan.FromSeconds(10)); 560public async Task Server_DisposeContinuesPendingStopAsyncCalls() 565Task stopTask1; 566Task stopTask2; 585await Task.WhenAll(stopTask1, stopTask2).TimeoutAfter(TimeSpan.FromSeconds(10)); 590public async Task Server_StopAsyncCalledWithNoRequests_Success() 592using (var server = Utilities.CreateHttpServer(out _, httpContext => Task.CompletedTask, LoggerFactory)) 601public async Task Server_AttachToExistingQueue_NoIServerAddresses_NoDefaultAdded(RequestQueueMode queueMode) 604using var server = Utilities.CreateHttpServer(out var address, httpContext => Task.CompletedTask, options => 613await attachedServer.StartAsync(new DummyApplication(context => Task.CompletedTask), default); 620public async Task Server_UnsafePreferInlineScheduling()
src\Shared\Http2cat\Http2CatHostedService.cs (5)
29private Task _backgroundTask; 43public Task StartAsync(CancellationToken cancellationToken) 46return Task.CompletedTask; 49public Task StopAsync(CancellationToken cancellationToken) 55private async Task RunAsync()
src\Shared\Http2cat\Http2CatIHostBuilderExtensions.cs (1)
13public static IHostBuilder UseHttp2Cat(this IHostBuilder hostBuilder, string address, Func<Http2Utilities, Task> scenario)
src\Shared\Http2cat\Http2CatOptions.cs (1)
12public Func<Http2Utilities, Task> Scenaro { get; set; }
src\Shared\Http2cat\Http2Utilities.cs (42)
153public async Task InitializeConnectionAsync(int expectedSettingsCount = 3) 174public Task StartStreamAsync(int streamId, IEnumerable<KeyValuePair<string, string>> headers, bool endStream) 272public Task SendHeadersWithPaddingAsync(int streamId, IEnumerable<KeyValuePair<string, string>> headers, byte padLength, bool endStream) 312public Task SendHeadersWithPriorityAsync(int streamId, IEnumerable<KeyValuePair<string, string>> headers, byte priority, int streamDependency, bool endStream) 355public Task SendHeadersWithPaddingAndPriorityAsync(int streamId, IEnumerable<KeyValuePair<string, string>> headers, byte padLength, byte priority, int streamDependency, bool endStream) 389public Task SendAsync(ReadOnlySpan<byte> span) 396public static async Task FlushAsync(PipeWriter writableBuffer) 401public Task SendPreambleAsync() => SendAsync(ClientPreface); 403public async Task SendSettingsAsync() 426public async Task SendSettingsAckWithInvalidLengthAsync(int length) 436public async Task SendSettingsWithInvalidStreamIdAsync(int streamId) 450public async Task SendSettingsWithInvalidLengthAsync(int length) 462internal async Task SendSettingsWithInvalidParameterValueAsync(Http2SettingsParameter parameter, uint value) 480public Task SendPushPromiseFrameAsync() 508internal async Task SendHeadersAsync(int streamId, Http2HeadersFrameFlags flags, byte[] headerBlock) 520public async Task SendInvalidHeadersFrameAsync(int streamId, int payloadLength, byte padLength) 539public async Task SendIncompleteHeadersFrameAsync(int streamId) 573internal async Task SendContinuationAsync(int streamId, Http2ContinuationFrameFlags flags, byte[] payload) 601internal Task SendEmptyContinuationFrameAsync(int streamId, Http2ContinuationFrameFlags flags) 613public async Task SendIncompleteContinuationFrameAsync(int streamId) 631public Task SendDataAsync(int streamId, Memory<byte> data, bool endStream) 644public async Task SendDataWithPaddingAsync(int streamId, Memory<byte> data, byte padLength, bool endStream) 664public Task SendInvalidDataFrameAsync(int streamId, int frameLength, byte padLength) 684internal Task SendPingAsync(Http2PingFrameFlags flags) 693public Task SendPingWithInvalidLengthAsync(int length) 703public Task SendPingWithInvalidStreamIdAsync(int streamId) 722public Task SendPriorityAsync(int streamId, int streamDependency = 0) 736public Task SendInvalidPriorityFrameAsync(int streamId, int length) 752public Task SendRstStreamAsync(int streamId) 764public Task SendInvalidRstStreamFrameAsync(int streamId, int length) 774public Task SendGoAwayAsync() 783public Task SendInvalidGoAwayFrameAsync() 793public Task SendWindowUpdateAsync(int streamId, int sizeIncrement) 805public Task SendInvalidWindowUpdateAsync(int streamId, int sizeIncrement, int length) 815public Task SendUnknownFrameTypeAsync(int streamId, int frameType) 877public async Task StopConnectionAsync(int expectedLastStreamId, bool ignoreNonGoAwayFrames) 885public Task WaitForConnectionStopAsync(int expectedLastStreamId, bool ignoreNonGoAwayFrames) 890internal Task ReceiveHeadersAsync(int expectedStreamId, Action<IDictionary<string, string>> verifyHeaders = null) 893internal async Task ReceiveHeadersAsync(int expectedStreamId, bool endStream = false, Action<IDictionary<string, string>> verifyHeaders = null) 934internal async Task WaitForConnectionErrorAsync<TException>(bool ignoreNonGoAwayFrames, int expectedLastStreamId, Http2ErrorCode expectedErrorCode) 941internal async Task WaitForConnectionErrorAsyncDoNotCloseTransport<TException>(bool ignoreNonGoAwayFrames, int expectedLastStreamId, Http2ErrorCode expectedErrorCode) 957internal async Task WaitForStreamErrorAsync(int expectedStreamId, Http2ErrorCode expectedErrorCode)
src\Shared\ServerInfrastructure\DuplexPipeStream.cs (2)
96public override Task WriteAsync(byte[]? buffer, int offset, int count, CancellationToken cancellationToken) 111public override Task FlushAsync(CancellationToken cancellationToken)
src\Shared\ValueTaskExtensions\ValueTaskExtensions.cs (2)
13public static Task GetAsTask(this in ValueTask<FlushResult> valueTask) 20return Task.CompletedTask;
Microsoft.AspNetCore.Server.HttpSys.NonHelixTests (4)
DelegateOutOfProcTests.cs (2)
17public async Task CanDelegateOutOfProcess() 57return Task.CompletedTask;
DummyApplication.cs (2)
14public DummyApplication() : this(context => Task.CompletedTask) { } 31public async Task ProcessRequestAsync(HttpContext httpContext)
Microsoft.AspNetCore.Server.IIS (96)
Core\DuplexStream.cs (3)
63public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 73public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) 78public override Task FlushAsync(CancellationToken cancellationToken)
Core\EmptyStream.cs (3)
25public override Task FlushAsync(CancellationToken cancellationToken) 27return Task.CompletedTask; 44return Task.FromResult(0);
Core\HttpRequestStream.cs (1)
71public override async Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken)
Core\HttpResponseStream.cs (2)
26public override Task FlushAsync(CancellationToken cancellationToken) 53public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
Core\HttpUpgradeStream.cs (3)
107public override Task FlushAsync(CancellationToken cancellationToken) 148public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) 153public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
Core\IISHttpContext.cs (21)
47protected Stack<KeyValuePair<Func<object, Task>, object>>? _onStarting; 48protected Stack<KeyValuePair<Func<object, Task>, object>>? _onCompleted; 59protected Task? _readBodyTask; 60protected Task? _writeBodyTask; 428private async Task InitializeResponse(bool flushHeaders) 440private async Task ProduceStart(bool flushHeaders) 512protected Task ProduceEnd() 519return Task.CompletedTask; 540return Task.CompletedTask; 550private async Task ProduceEndAwaited() 664public void OnStarting(Func<object, Task> callback, object state) 675_onStarting = new Stack<KeyValuePair<Func<object, Task>, object>>(); 677_onStarting.Push(new KeyValuePair<Func<object, Task>, object>(callback, state)); 681public void OnCompleted(Func<object, Task> callback, object state) 687_onCompleted = new Stack<KeyValuePair<Func<object, Task>, object>>(); 689_onCompleted.Push(new KeyValuePair<Func<object, Task>, object>(callback, state)); 693protected async Task FireOnStarting() 695Stack<KeyValuePair<Func<object, Task>, object>>? onStarting = null; 717protected async Task FireOnCompleted() 719Stack<KeyValuePair<Func<object, Task>, object>>? onCompleted = null; 857private async Task HandleRequest()
Core\IISHttpContext.FeatureCollection.cs (11)
204Task IHttpResponseBodyFeature.StartAsync(CancellationToken cancellationToken) 211return Task.CompletedTask; 214Task IHttpResponseBodyFeature.SendFileAsync(string path, long offset, long? count, CancellationToken cancellation) 219Task IHttpResponseBodyFeature.CompleteAsync() 233var initializeTask = InitializeResponse(flushHeaders: false); 248private async Task CompleteResponseBodyAwaited(ValueTask completeAsyncTask) 261private async Task CompleteInitializeResponseAwaited(Task initializeTask) 326void IHttpResponseFeature.OnStarting(Func<object, Task> callback, object state) 331void IHttpResponseFeature.OnCompleted(Func<object, Task> callback, object state) 379return Task.FromResult(((ITlsConnectionFeature)this).ClientCertificate);
Core\IISHttpContext.IO.cs (7)
53internal Task CopyToAsync(Stream destination, CancellationToken cancellationToken) 69internal Task WriteAsync(ReadOnlyMemory<byte> memory, CancellationToken cancellationToken = default(CancellationToken)) 71async Task WriteFirstAsync() 85internal Task FlushAsync(CancellationToken cancellationToken = default(CancellationToken)) 87async Task FlushFirstAsync() 96private async Task ReadBody() 155private async Task WriteBody(bool flush = false)
Core\IISHttpServer.cs (3)
95public unsafe Task StartAsync<TContext>(IHttpApplication<TContext> application, CancellationToken cancellationToken) where TContext : notnull 111return Task.CompletedTask; 114public Task StopAsync(CancellationToken cancellationToken)
Core\IISServerAuthenticationHandlerInternal.cs (8)
30return Task.FromResult(AuthenticateResult.Success(new AuthenticationTicket(user, Scheme.Name))); 34return Task.FromResult(AuthenticateResult.NoResult()); 39public Task ChallengeAsync(AuthenticationProperties? properties) 45return Task.CompletedTask; 49public Task ForbidAsync(AuthenticationProperties? properties) 54return Task.CompletedTask; 58public Task InitializeAsync(AuthenticationScheme scheme, HttpContext context) 65return Task.CompletedTask;
Core\IO\WebSocketsAsyncIOEngine.cs (1)
67return new ValueTask(Task.CompletedTask);
Core\OutputProducer.cs (11)
24private Task _lastFlushTask = Task.CompletedTask; 35public Task FlushAsync(CancellationToken cancellationToken) 72public Task WriteAsync(ReadOnlyMemory<byte> buffer, CancellationToken cancellationToken) 78return Task.CompletedTask; 87private Task FlushAsync(PipeWriter pipeWriter, CancellationToken cancellationToken) 99private Task FlushNowAsync(PipeWriter pipeWriter, CancellationToken cancellationToken) 102return awaitable.IsCompleted ? Task.CompletedTask : FlushNowAsyncAwaited(awaitable, cancellationToken); 105private async Task FlushNowAsyncAwaited(ValueTask<FlushResult> awaitable, CancellationToken cancellationToken) 123private async Task AwaitLastFlushAndThenFlushAsync(Task lastFlushTask, PipeWriter pipeWriter, CancellationToken cancellationToken)
Core\ReadOnlyStream.cs (3)
33public override Task FlushAsync(CancellationToken cancellationToken) 35return Task.CompletedTask; 53public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
Core\ThrowingWasUpgradedWriteOnlyStreamInternal.cs (1)
19public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
Core\WrappingStream.cs (3)
54public override Task FlushAsync(CancellationToken cancellationToken) 78public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 87public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken)
src\Shared\Buffers.MemoryPool\DiagnosticMemoryPool.cs (4)
153public async Task WhenAllBlocksReturnedAsync(TimeSpan timeout) 155var task = await Task.WhenAny(_allBlocksReturned.Task, Task.Delay(timeout));
src\Shared\ErrorPage\ErrorPage.Designer.cs (1)
52public async override global::System.Threading.Tasks.Task ExecuteAsync()
src\Shared\RazorViews\BaseView.cs (3)
64public async Task ExecuteAsync(Stream stream) 80public async Task ExecuteAsync(HttpContext context) 97public abstract Task ExecuteAsync();
src\Shared\ServerInfrastructure\DuplexPipeStream.cs (2)
96public override Task WriteAsync(byte[]? buffer, int offset, int count, CancellationToken cancellationToken) 111public override Task FlushAsync(CancellationToken cancellationToken)
src\Shared\TaskToApm.cs (3)
32public static IAsyncResult Begin(Task task, AsyncCallback? callback, object? state) => 69internal readonly Task _task; 77internal TaskAsyncResult(Task task, object? state, AsyncCallback? callback)
src\Shared\ValueTaskExtensions\ValueTaskExtensions.cs (2)
13public static Task GetAsTask(this in ValueTask<FlushResult> valueTask) 20return Task.CompletedTask;
Microsoft.AspNetCore.Server.IISIntegration (19)
AuthenticationHandler.cs (8)
23return Task.FromResult(AuthenticateResult.Success(new AuthenticationTicket(_user, _scheme.Name))); 27return Task.FromResult(AuthenticateResult.NoResult()); 31public Task ChallengeAsync(AuthenticationProperties? properties) 37return Task.CompletedTask; 40public Task ForbidAsync(AuthenticationProperties? properties) 45return Task.CompletedTask; 48public Task InitializeAsync(AuthenticationScheme scheme, HttpContext context) 53return Task.CompletedTask;
ForwardedTlsConnectionFeature.cs (1)
50return Task.FromResult(ClientCertificate);
IISMiddleware.cs (10)
29private static readonly Func<object, Task> ClearUserDelegate = ClearUser; 100/// <returns>A <see cref="Task"/> that represents the asynchronous operation.</returns> 101public Task Invoke(HttpContext httpContext) 107return Task.CompletedTask; 116var shutdownTask = Task.Run(_applicationLifetime.StopApplication); 118return Task.CompletedTask; 125return Task.CompletedTask; 192private static Task ClearUser(object arg) 201return Task.CompletedTask;
Microsoft.AspNetCore.Server.IISIntegration.Tests (23)
IISExtensionTests.cs (1)
19public async Task CallingUseIISIntegrationMultipleTimesWorks()
IISMiddlewareTests.cs (22)
25public async Task MiddlewareSkippedIfTokenIsMissing() 43return Task.FromResult(0); 62public async Task MiddlewareRejectsRequestIfTokenHeaderIsMissing() 81return Task.FromResult(0); 103public async Task MiddlewareShutsdownGivenANCMShutdown(string pathBase, string requestPath, string shutdownEvent) 123return Task.CompletedTask; 162public async Task MiddlewareIgnoresShutdownGivenWrongMethod(HttpMethod method) 182return Task.CompletedTask; 207public async Task MiddlewareIgnoresShutdownGivenWrongPath(string path) 227return Task.CompletedTask; 252public async Task MiddlewareIgnoresShutdownGivenWrongEvent(string shutdownEvent) 272return Task.CompletedTask; 294public async Task UrlDelayRegisteredAndPreferHostingUrlsSet() 306app.Run(context => Task.FromResult(0)); 327public async Task PathBaseHiddenFromServer() 339app.Run(context => Task.FromResult(0)); 354public async Task AddsUsePathBaseMiddlewareWhenPathBaseSpecified() 372return Task.FromResult(0); 392public async Task AddsAuthenticationHandlerByDefault() 434public async Task OnlyAddAuthenticationHandlerIfForwardWindowsAuthentication(bool forward) 491public async Task DoesNotBlowUpWithoutAuth(bool forward) 508return Task.FromResult(0);
Microsoft.AspNetCore.Server.IntegrationTesting (5)
ApplicationPublisher.cs (1)
99return Task.FromResult(new PublishedApplication(publishDirectory.FullName, logger));
Common\RetryHelper.cs (1)
59await Task.Delay(1 * 1000); //Wait for a while before retry.
Deployers\RemoteWindowsDeployer\RemoteWindowsDeployer.cs (2)
192private async Task RunScriptAsync(string serverAction) 259await Task.Delay(TimeSpan.FromMinutes(1));
src\Shared\Process\ProcessEx.cs (1)
71public Task Exited => _exited.Task;
Microsoft.AspNetCore.Server.IntegrationTesting.IIS (4)
IISDeployer.cs (1)
117return Task.FromResult<DeploymentResult>(new IISDeploymentResult(
IISExpressDeployer.cs (1)
249await Task.Delay(1000); // Wait a second to make sure the socket is completely cleaned up
LoggingHandler.cs (1)
32private async Task LogResponse(LogLevel logLevel, HttpResponseMessage response)
RetryHandler.cs (1)
52await Task.Delay(RetryDelay, cancellationToken);
Microsoft.AspNetCore.Server.Kestrel.Core (251)
AnyIPListenOptions.cs (1)
18internal override async Task BindAsync(AddressBindContext context, CancellationToken cancellationToken)
Internal\AddressBindContext.cs (2)
14Func<ListenOptions, CancellationToken, Task> createBinding) 28public Func<ListenOptions, CancellationToken, Task> CreateBinding { get; }
Internal\AddressBinder.cs (8)
19public static Task BindAsync(ListenOptions[] listenOptions, AddressBindContext context, Func<ListenOptions, ListenOptions> useHttps, CancellationToken cancellationToken) 86internal static async Task BindEndpointAsync(ListenOptions endpoint, AddressBindContext context, CancellationToken cancellationToken) 148Task BindAsync(AddressBindContext context, CancellationToken cancellationToken); 153public async Task BindAsync(AddressBindContext context, CancellationToken cancellationToken) 173public override Task BindAsync(AddressBindContext context, CancellationToken cancellationToken) 195public override Task BindAsync(AddressBindContext context, CancellationToken cancellationToken) 215public virtual async Task BindAsync(AddressBindContext context, CancellationToken cancellationToken) 235public virtual async Task BindAsync(AddressBindContext context, CancellationToken cancellationToken)
Internal\ConnectionDispatcher.cs (4)
13private readonly Func<T, Task> _connectionDelegate; 17public ConnectionDispatcher(ServiceContext serviceContext, Func<T, Task> connectionDelegate, TransportConnectionManager transportConnectionManager) 27public Task StartAcceptingConnections(IConnectionListener<T> listener) 38async Task AcceptConnectionsAsync()
Internal\Http\Http1ChunkedEncodingMessageBody.cs (5)
25private Task? _pumpTask; 88private async Task PumpAsync() 184private async ValueTask StopAsyncAwaited(Task pumpTask) 194protected override Task OnReadStartedAsync() 197return Task.CompletedTask;
Internal\Http\Http1Connection.cs (1)
790protected override Task TryProduceInvalidRequestResponse()
Internal\Http\Http1MessageBody.cs (5)
48protected override Task OnConsumeAsync() 58return Task.CompletedTask; 67return Task.CompletedTask; 76return Task.CompletedTask; 82protected async Task OnConsumeAsyncAwaited()
Internal\Http\Http1OutputProducer.cs (3)
92public Task WriteDataAsync(ReadOnlySpan<byte> buffer, CancellationToken cancellationToken = default) 96return Task.FromCanceled(cancellationToken); 106return new ValueTask<FlushResult>(Task.FromCanceled<FlushResult>(cancellationToken));
Internal\Http\Http1UpgradeMessageBody.cs (2)
49public override Task ConsumeAsync() 51return Task.CompletedTask;
Internal\Http\HttpProtocol.cs (43)
36private Stack<KeyValuePair<Func<object, Task>, object>>? _onStarting; 37private Stack<KeyValuePair<Func<object, Task>, object>>? _onCompleted; 570public async Task ProcessRequestsAsync<TContext>(IHttpApplication<TContext> application) where TContext : notnull 624private async Task ProcessRequests<TContext>(IHttpApplication<TContext> application) where TContext : notnull 775public void OnStarting(Func<object, Task> callback, object state) 784_onStarting = new Stack<KeyValuePair<Func<object, Task>, object>>(); 786_onStarting.Push(new KeyValuePair<Func<object, Task>, object>(callback, state)); 789public void OnCompleted(Func<object, Task> callback, object state) 793_onCompleted = new Stack<KeyValuePair<Func<object, Task>, object>>(); 795_onCompleted.Push(new KeyValuePair<Func<object, Task>, object>(callback, state)); 798protected Task FireOnStarting() 806return Task.CompletedTask; 808static async Task ProcessEvents(HttpProtocol protocol, Stack<KeyValuePair<Func<object, Task>, object>> events) 826protected Task FireOnCompleted() 834return Task.CompletedTask; 836static async Task ProcessEvents(HttpProtocol protocol, Stack<KeyValuePair<Func<object, Task>, object>> events) 945public Task InitializeResponseAsync(int firstWriteByteCount) 947var startingTask = FireOnStarting(); 957return Task.CompletedTask; 961public async Task InitializeResponseAwaited(Task startingTask, int firstWriteByteCount) 1008protected virtual Task TryProduceInvalidRequestResponse() 1018return Task.CompletedTask; 1021protected Task ProduceEnd() 1025return Task.CompletedTask; 1037return Task.CompletedTask; 1061private Task WriteSuffix() 1090return Task.CompletedTask; 1093private async Task WriteSuffixAwaited(ValueTask<FlushResult> writeTask) 1501var initializeTask = InitializeResponseAsync(0); 1516public Task CompleteAsync(Exception? exception = null) 1532var onStartingTask = FireOnStarting(); 1554return Task.CompletedTask; 1557private async Task CompleteAsyncAwaited(Task onStartingTask) 1618var startingTask = FireOnStarting(); 1627private async ValueTask<FlushResult> FirstWriteAsyncAwaited(Task initializeTask, ReadOnlyMemory<byte> data, CancellationToken cancellationToken) 1664public Task FlushAsync(CancellationToken cancellationToken = default) 1670private async ValueTask<FlushResult> FlushAsyncAwaited(Task initializeTask, CancellationToken cancellationToken) 1676public Task WriteAsync(ReadOnlyMemory<byte> data, CancellationToken cancellationToken = default) 1681public async ValueTask<FlushResult> WriteAsyncAwaited(Task initializeTask, ReadOnlyMemory<byte> data, CancellationToken cancellationToken)
Internal\Http\HttpProtocol.FeatureCollection.cs (7)
100return Task.CompletedTask; 249void IHttpResponseFeature.OnStarting(Func<object, Task> callback, object state) 254void IHttpResponseFeature.OnCompleted(Func<object, Task> callback, object state) 321Task IHttpResponseBodyFeature.StartAsync(CancellationToken cancellationToken) 325return Task.CompletedTask; 337Task IHttpResponseBodyFeature.SendFileAsync(string path, long offset, long? count, CancellationToken cancellation) 342Task IHttpResponseBodyFeature.CompleteAsync()
Internal\Http\HttpRequestStream.cs (4)
65public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 85public override Task FlushAsync(CancellationToken cancellationToken) 87return Task.CompletedTask; 155public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken)
Internal\Http\HttpResponsePipeWriter.cs (3)
14private Task _completeTask = Task.CompletedTask; 79public Task StopAcceptingWritesAsync()
Internal\Http\HttpResponseStream.cs (2)
59public override Task FlushAsync(CancellationToken cancellationToken) 92public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
Internal\Http\HttpUpgradeStream.cs (3)
107public override Task FlushAsync(CancellationToken cancellationToken) 148public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) 153public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
Internal\Http\IHttpOutputProducer.cs (1)
16Task WriteDataAsync(ReadOnlySpan<byte> data, CancellationToken cancellationToken);
Internal\Http\IHttpResponseControl.cs (1)
17Task CompleteAsync(Exception? exception = null);
Internal\Http\MessageBody.cs (10)
69public virtual Task ConsumeAsync() 71Task startTask = TryStartAsync(); 80private async Task ConsumeAwaited(Task startTask) 93protected virtual Task OnConsumeAsync() => Task.CompletedTask; 119protected Task TryStartAsync() 123return Task.CompletedTask; 182protected virtual Task OnReadStartedAsync() 184return Task.CompletedTask;
Internal\Http\ZeroContentLengthMessageBody.cs (2)
20public override Task ConsumeAsync() => Task.CompletedTask;
Internal\Http2\Http2Connection.cs (26)
92private readonly Task _inputTask; 249public async Task ProcessRequestsAsync<TContext>(IHttpApplication<TContext> application) where TContext : notnull 624private Task ProcessFrameAsync<TContext>(IHttpApplication<TContext> application, in ReadOnlySequence<byte> payload) where TContext : notnull 651private Task ProcessDataFrameAsync(in ReadOnlySequence<byte> payload) 707private Task ProcessHeadersFrameAsync<TContext>(IHttpApplication<TContext> application, in ReadOnlySequence<byte> payload) where TContext : notnull 835private Task ProcessPriorityFrameAsync() 857return Task.CompletedTask; 860private Task ProcessRstStreamFrameAsync() 890return Task.CompletedTask; 897return Task.CompletedTask; 900private Task ProcessSettingsFrameAsync(in ReadOnlySequence<byte> payload) 919return Task.CompletedTask; 980private Task ProcessPingFrameAsync(in ReadOnlySequence<byte> payload) 1006return Task.CompletedTask; 1012private Task ProcessGoAwayFrameAsync() 1028return Task.CompletedTask; 1031private Task ProcessWindowUpdateFrameAsync() 1092return Task.CompletedTask; 1095private Task ProcessContinuationFrameAsync(in ReadOnlySequence<byte> payload) 1124private Task ProcessUnknownFrameAsync() 1131return Task.CompletedTask; 1134private Task DecodeHeadersAsync(bool endHeaders, in ReadOnlySequence<byte> payload) 1158return Task.CompletedTask; 1161private Task DecodeTrailersAsync(bool endHeaders, in ReadOnlySequence<byte> payload) 1173return Task.CompletedTask; 1758private async Task CopyPipeAsync(PipeReader reader, PipeWriter writer)
Internal\Http2\Http2FrameWriter.cs (5)
86private readonly Task _writeQueueTask; 141_writeQueueTask = Task.Run(WriteToOutputPipe); 156private async Task WriteToOutputPipe() 319private async Task HandleFlowControlErrorAsync() 414public Task ShutdownAsync()
Internal\Http2\Http2MessageBody.cs (2)
36protected override Task OnReadStartedAsync() 48return Task.CompletedTask;
Internal\Http2\Http2OutputProducer.cs (6)
258return new ValueTask<FlushResult>(Task.FromCanceled<FlushResult>(cancellationToken)); 381public Task WriteDataAsync(ReadOnlySpan<byte> data, CancellationToken cancellationToken) 385return Task.FromCanceled(cancellationToken); 396return Task.CompletedTask; 405var task = _flusher.FlushAsync(this, cancellationToken).GetAsTask(); 519return new ValueTask<FlushResult>(Task.FromCanceled<FlushResult>(cancellationToken));
Internal\Http2\Http2Stream.cs (2)
449public Task OnDataAsync(Http2Frame dataFrame, in ReadOnlySequence<byte> payload) 516return Task.CompletedTask;
Internal\Http3\Http3Connection.cs (3)
323public async Task ProcessRequestsAsync<TContext>(IHttpApplication<TContext> application) where TContext : notnull 561private async Task CreateHttp3Stream<TContext>(ConnectionContext streamContext, IHttpApplication<TContext> application, long streamId) where TContext : notnull 603private async Task CreateAndAddWebTransportStream(Http3PendingStream stream, long streamId, WebTransportStreamType type)
Internal\Http3\Http3ControlStream.cs (2)
183public async Task ProcessRequestAsync<TContext>(IHttpApplication<TContext> application) where TContext : notnull 248private async Task HandleControlStream()
Internal\Http3\Http3FrameWriter.cs (2)
94internal Task WriteSettingsAsync(List<Http3PeerSetting> settings) 153internal Task WriteStreamIdAsync(long id)
Internal\Http3\Http3OutputProducer.cs (5)
157return new ValueTask<FlushResult>(Task.FromCanceled<FlushResult>(cancellationToken)); 312public Task WriteDataAsync(ReadOnlySpan<byte> data, CancellationToken cancellationToken) 316return Task.FromCanceled(cancellationToken); 327return Task.CompletedTask; 341return new ValueTask<FlushResult>(Task.FromCanceled<FlushResult>(cancellationToken));
Internal\Http3\Http3Stream.cs (6)
581public async Task ProcessRequestAsync<TContext>(IHttpApplication<TContext> application) where TContext : notnull 748private Task ProcessHttp3Stream<TContext>(IHttpApplication<TContext> application, in ReadOnlySequence<byte> payload, bool isCompleted) where TContext : notnull 768private static Task ProcessUnknownFrameAsync() 772return Task.CompletedTask; 775private async Task ProcessHeadersFrameAsync<TContext>(IHttpApplication<TContext> application, ReadOnlySequence<byte> payload, bool isCompleted) where TContext : notnull 874private Task ProcessDataFrameAsync(in ReadOnlySequence<byte> payload)
Internal\HttpConnection.cs (1)
46public async Task ProcessRequestsAsync<TContext>(IHttpApplication<TContext> httpApplication) where TContext : notnull
Internal\Infrastructure\BodyControl.cs (1)
89public Task StopAsync()
Internal\Infrastructure\KestrelConnection.cs (14)
15private Stack<KeyValuePair<Func<object, Task>, object>>? _onCompleted; 42public Task ExecutionTask => _completionTcs.Task; 75void IConnectionCompleteFeature.OnCompleted(Func<object, Task> callback, object state) 84_onCompleted = new Stack<KeyValuePair<Func<object, Task>, object>>(); 86_onCompleted.Push(new KeyValuePair<Func<object, Task>, object>(callback, state)); 89public Task FireOnCompletedAsync() 101return Task.CompletedTask; 107private Task CompleteAsyncMayAwait(Stack<KeyValuePair<Func<object, Task>, object>> onCompleted) 113var task = entry.Key.Invoke(entry.Value); 125return Task.CompletedTask; 128private async Task CompleteAsyncAwaited(Task currentTask, Stack<KeyValuePair<Func<object, Task>, object>> onCompleted)
Internal\Infrastructure\KestrelConnectionOfT.cs (3)
13private readonly Func<T, Task> _connectionDelegate; 19Func<T, Task> connectionDelegate, 41internal async Task ExecuteAsync()
Internal\Infrastructure\PipeWriterHelpers\ConcurrentPipeWriter.cs (1)
143private async Task FlushAsyncAwaited(ValueTask<FlushResult> flushTask, CancellationToken cancellationToken)
Internal\Infrastructure\ReadOnlyStream.cs (1)
21public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
Internal\Infrastructure\StatusCheckWriteStream.cs (2)
70public override Task FlushAsync(CancellationToken cancellationToken) 82public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
Internal\Infrastructure\StreamCloseAwaitable.cs (1)
32Task.Run(continuation);
Internal\Infrastructure\ThrowingWasUpgradedWriteOnlyStream.cs (1)
21public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
Internal\Infrastructure\TransportConnectionManager.cs (11)
57var closeTasks = new List<Task>(); 68var allClosedTask = Task.WhenAll(closeTasks.ToArray()); 69return await Task.WhenAny(allClosedTask, CancellationTokenAsTask(token)).ConfigureAwait(false) == allClosedTask; 74var abortTasks = new List<Task>(); 85var allAbortedTask = Task.WhenAll(abortTasks.ToArray()); 86return await Task.WhenAny(allAbortedTask, Task.Delay(1000)).ConfigureAwait(false) == allAbortedTask; 89private static Task CancellationTokenAsTask(CancellationToken token) 93return Task.CompletedTask;
Internal\Infrastructure\TransportManager.cs (13)
98private void StartAcceptLoop<T>(IConnectionListener<T> connectionListener, Func<T, Task> connectionDelegate, EndpointConfig? endpointConfig) where T : BaseConnectionContext 102var acceptLoopTask = connectionDispatcher.StartAcceptingConnections(connectionListener); 107public Task StopEndpointsAsync(List<EndpointConfig> endpointsToStop, CancellationToken cancellationToken) 120public Task StopAsync(CancellationToken cancellationToken) 125private async Task StopTransportsAsync(List<ActiveTransport> transportsToStop, CancellationToken cancellationToken) 127var tasks = new Task[transportsToStop.Count]; 134await Task.WhenAll(tasks).ConfigureAwait(false); 136async Task StopTransportConnection(ActiveTransport transport) 154await Task.WhenAll(tasks).ConfigureAwait(false); 161await Task.WhenAll(tasks).ConfigureAwait(false); 171public ActiveTransport(IConnectionListenerBase transport, Task acceptLoopTask, TransportConnectionManager transportConnectionManager, EndpointConfig? endpointConfig = null) 180public Task AcceptLoopTask { get; } 185public async Task UnbindAsync(CancellationToken cancellationToken)
Internal\Infrastructure\WrappingStream.cs (3)
53public override Task FlushAsync(CancellationToken cancellationToken) 77public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 86public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken)
Internal\IRequestProcessor.cs (1)
11Task ProcessRequestsAsync<TContext>(IHttpApplication<TContext> application) where TContext : notnull;
Internal\KestrelServerImpl.cs (5)
120public async Task StartAsync<TContext>(IHttpApplication<TContext> application, CancellationToken cancellationToken) where TContext : notnull 135async Task OnBind(ListenOptions options, CancellationToken onBindCancellationToken) 239public async Task StopAsync(CancellationToken cancellationToken) 286private async Task BindAsync(CancellationToken cancellationToken) 326private async Task RebindAsync()
Internal\TlsConnectionFeature.cs (2)
41_clientCertTask = Task.FromResult(value); 82return _clientCertTask = Task.FromResult(ClientCertificate);
KestrelServer.cs (2)
51public Task StartAsync<TContext>(IHttpApplication<TContext> application, CancellationToken cancellationToken) where TContext : notnull 58public Task StopAsync(CancellationToken cancellationToken)
ListenOptions.cs (3)
194return Task.CompletedTask; 210return Task.CompletedTask; 222internal virtual async Task BindAsync(AddressBindContext context, CancellationToken cancellationToken)
LocalhostListenOptions.cs (1)
29internal override async Task BindAsync(AddressBindContext context, CancellationToken cancellationToken)
Middleware\ConnectionLimitMiddleware.cs (4)
13private readonly Func<T, Task> _next; 18public ConnectionLimitMiddleware(Func<T, Task> next, long connectionLimit, KestrelTrace trace, KestrelMetrics metrics) 24internal ConnectionLimitMiddleware(Func<T, Task> next, ResourceCounter concurrentConnectionCounter, KestrelTrace trace, KestrelMetrics metrics) 32public async Task OnConnectionAsync(T connection)
Middleware\HttpConnectionMiddleware.cs (1)
28public Task OnConnectionAsync(ConnectionContext connectionContext)
Middleware\HttpMultiplexedConnectionMiddleware.cs (1)
27public Task OnConnectionAsync(MultiplexedConnectionContext connectionContext)
Middleware\HttpsConnectionMiddleware.cs (2)
134public async Task OnConnectionAsync(ConnectionContext context) 313private Task DoOptionsBasedHandshakeAsync(ConnectionContext context, SslStream sslStream, Core.Internal.TlsConnectionFeature feature, CancellationToken cancellationToken)
Middleware\Internal\LoggingStream.cs (2)
71public override Task FlushAsync(CancellationToken cancellationToken) 138public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
Middleware\LoggingConnectionMiddleware.cs (1)
20public async Task OnConnectionAsync(ConnectionContext context)
Middleware\LoggingMultiplexedConnectionMiddleware.cs (1)
23public Task OnConnectionAsync(MultiplexedConnectionContext context)
src\Shared\ServerInfrastructure\DuplexPipeStream.cs (2)
96public override Task WriteAsync(byte[]? buffer, int offset, int count, CancellationToken cancellationToken) 111public override Task FlushAsync(CancellationToken cancellationToken)
src\Shared\TaskToApm.cs (3)
32public static IAsyncResult Begin(Task task, AsyncCallback? callback, object? state) => 69internal readonly Task _task; 77internal TaskAsyncResult(Task task, object? state, AsyncCallback? callback)
src\Shared\ValueTaskExtensions\ValueTaskExtensions.cs (2)
13public static Task GetAsTask(this in ValueTask<FlushResult> valueTask) 20return Task.CompletedTask;
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (235)
AddressBinderTests.cs (11)
156public async Task WrapsAddressInUseExceptionAsIOException() 188endpoint => Task.CompletedTask); 190var bindTask = AddressBinder.BindAsync(options.GetListenOptions(), addressBindContext, _noopUseHttps, CancellationToken.None); 214endpoint => Task.CompletedTask); 218var bindTask = AddressBinder.BindAsync(options.GetListenOptions(), addressBindContext, _noopUseHttps, CancellationToken.None); 227public async Task FlowsCancellationTokenToCreateBinddingCallback() 240return Task.CompletedTask; 251public async Task FallbackToIPv4WhenIPv6AnyBindFails(string address) 278return Task.CompletedTask; 289public async Task DefaultAddressBinderBindsToHttpPort5000() 309return Task.CompletedTask;
BodyControlTests.cs (6)
19public async Task BodyControlThrowAfterAbort() 35public async Task BodyControlThrowOnAbortAfterUpgrade() 60public async Task BodyControlThrowOnUpgradeAfterAbort() 85public async Task RequestPipeMethodsThrowAfterAbort() 107public async Task RequestPipeThrowsObjectDisposedExceptionAfterStop() 124public async Task ResponsePipeThrowsObjectDisposedExceptionAfterStop()
CertificatePathWatcherTests.cs (3)
119public async Task FileChanged(int observerCount) 169public async Task OutOfOrderLastModifiedTime() 341public async Task IgnoreDeletion(bool restoredWithNewerLastModifiedTime)
ConcurrentPipeWriterTests.cs (5)
18public async Task PassthroughIfAllFlushesAreAwaited() 81public async Task QueuesIfFlushIsNotAwaited() 179public async Task KeepsQueueIfInnerFlushFinishesBetweenGetMemoryAndAdvance() 263public async Task CompleteFlushesQueuedBytes() 331public async Task CancelPendingFlushInterruptsFlushLoop()
ConnectionDispatcherTests.cs (9)
24public async Task OnConnectionCreatesLogScopeWithConnectionId() 39var task = kestrelConnection.ExecuteAsync(); 58public async Task StartAcceptingConnectionsAsyncLogsIfAcceptAsyncThrows() 62var dispatcher = new ConnectionDispatcher<ConnectionContext>(serviceContext, _ => Task.CompletedTask, new TransportConnectionManager(serviceContext.ConnectionManager)); 73public async Task OnConnectionFiresOnCompleted() 87completeFeature.OnCompleted(state => { callbackState = state; return Task.CompletedTask; }, stateObject); 95public async Task OnConnectionOnCompletedExceptionCaught() 118private static KestrelConnection<ConnectionContext> CreateKestrelConnection(TestServiceContext serviceContext, DefaultConnectionContext connection, TransportConnectionManager transportConnectionManager, Func<ConnectionContext, Task> connectionDelegate = null) 120connectionDelegate ??= _ => Task.CompletedTask;
DiagnosticMemoryPoolTests.cs (2)
177public async Task DoesNotThrowWithLateReturns() 187public async Task ThrowsOnAccessToLateBlocks()
HeartbeatTests.cs (6)
102public async Task HeartbeatTakingLongerThanIntervalIsLoggedAsWarning() 119Task blockedHeartbeatTask; 123blockedHeartbeatTask = Task.Run(() => heartbeat.OnHeartbeat()); 145public async Task HeartbeatTakingLongerThanIntervalIsNotLoggedIfDebuggerAttached() 162Task blockedHeartbeatTask; 166blockedHeartbeatTask = Task.Run(() => heartbeat.OnHeartbeat());
Http1\Http1ConnectionTests.cs (44)
25public async Task TakeMessageHeadersSucceedsWhenHeaderValueContainsUTF8() 44public async Task TakeMessageHeadersThrowsWhenHeaderValueContainsExtendedASCII() 60public async Task MaxRequestHeadersTotalSizeDoesNotThrowForMaxValue() 71public async Task TakeMessageHeadersThrowsWhenHeadersExceedTotalSizeLimit() 88public async Task TakeMessageHeadersThrowsWhenHeadersExceedCountLimit() 105public async Task TakeMessageHeadersDoesNotCountAlreadyConsumedBytesTowardsSizeLimit() 184public async Task TraceIdentifierCountsRequestsPerHttp1Connection() 192async Task SendRequestAsync() 263public async Task ResetResetsHeaderLimits() 297public async Task ThrowsWhenStatusCodeIsSetAfterResponseStarted() 308public async Task ThrowsWhenReasonPhraseIsSetAfterResponseStarted() 319public async Task ThrowsWhenOnStartingIsSetAfterResponseStarted() 325Assert.Throws<InvalidOperationException>(() => ((IHttpResponseFeature)_http1Connection).OnStarting(_ => Task.CompletedTask, null)); 396public async Task TakeStartLineSetsHttpProtocolProperties( 426public async Task TakeStartLineRemovesDotSegmentsFromTarget( 446public async Task ParseRequestStartsRequestHeadersTimeoutOnFirstByteAvailable() 457public async Task TakeStartLineThrowsWhenTooLong() 474public async Task TakeStartLineThrowsOnEncodedNullCharInTarget(string target) 488public async Task TakeStartLineThrowsOnNullCharInTarget(string target) 502public async Task TakeStartLineThrowsOnNullCharInMethod(string method) 518public async Task TakeStartLineThrowsOnNullCharInQueryString(string queryString) 534public async Task TakeStartLineThrowsWhenRequestTargetIsInvalid(string method, string target) 550public async Task TakeStartLineThrowsWhenMethodNotAllowed(string requestLine, int intAllowedMethod) 568public async Task ProcessRequestsAsyncEnablesKeepAliveTimeout() 582public async Task WriteThrowsForNonBodyResponse() 592public async Task WriteAsyncThrowsForNonBodyResponse() 603public async Task WriteDoesNotThrowForHeadResponse() 614public async Task WriteAsyncDoesNotThrowForHeadResponse() 625public async Task ManuallySettingTransferEncodingThrowsForHeadResponse() 639public async Task ManuallySettingTransferEncodingThrowsForNoBodyResponse() 653public async Task RequestProcessingTaskIsUnwrapped() 661Assert.IsNotType<Task<Task>>(requestProcessingTask); 668public async Task RequestAbortedTokenIsResetBeforeLastWriteWithContentLength() 690public async Task RequestAbortedTokenIsResetBeforeLastWriteAsyncWithContentLength() 745public async Task RequestAbortedTokenIsResetBeforeLastWriteAsyncAwaitedWithContentLength() 752var startingTask = _http1Connection.InitializeResponseAwaited(Task.CompletedTask, 1); 772public async Task RequestAbortedTokenIsResetBeforeLastWriteWithChunkedEncoding() 820public async Task RequestAbortedTokenIsFiredAfterTransportReturnsCompletedFlushResult() 834public async Task ExceptionDetailNotIncludedWhenLogLevelInformationNotEnabled() 865public async Task AcceptsHeadersAcrossSends(int header0Count, int header1Count) 897public async Task KeepsSameHeaderCollectionAcrossSends(int header0Count, int header1Count) 950public async Task ConsumesRequestWhenApplicationDoesNotConsumeIt() 1088private static async Task WaitForCondition(TimeSpan timeout, Func<bool> condition) 1098await Task.Delay(delay);
Http1\Http1OutputProducerTests.cs (3)
33public async Task WritesNoopAfterConnectionCloses() 58public async Task FlushAsync_OnDisposedSocket_ReturnsResultWithIsCompletedTrue() 86public async Task FlushAsync_OnSocketWithCanceledPendingFlush_ReturnsResultWithIsCanceledTrue()
Http2\Http2FrameWriterTests.cs (3)
41public async Task WriteWindowUpdate_UnsetsReservedBit() 63public async Task WriteGoAway_UnsetsReservedBit() 79public async Task WriteHeader_UnsetsReservedBit()
Http3\Http3FrameWriterTests.cs (3)
39public async Task WriteSettings_NoSettingsWrittenWithProtocolDefault() 53public async Task WriteSettings_OneSettingsWrittenWithKestrelDefaults() 72public async Task WriteSettings_TwoSettingsWritten()
HttpConnectionManagerTests.cs (1)
49var httpConnection = new KestrelConnection<ConnectionContext>(0, serviceContext, transportConnectionManager, _ => Task.CompletedTask, mock.Object, trace, TestContextFactory.CreateMetricsContext(mock.Object));
HttpConnectionTests.cs (1)
20public async Task WriteDataRateTimeoutAbortsConnection()
HttpRequestPipeReaderTests.cs (3)
14public async Task StopAcceptingReadsCausesReadToThrowObjectDisposedException() 24public async Task AbortCausesReadToCancel() 34public async Task AbortWithErrorCausesReadToCancel()
HttpRequestStreamTests.cs (11)
83public async Task WriteAsyncThrows() 98public async Task FlushAsyncDoesNotThrow() 105public async Task SynchronousReadsThrowIfDisallowedByIHttpBodyControlFeature() 131public async Task AbortCausesReadToCancel() 142public async Task AbortWithErrorCausesReadToCancel() 155public async Task StopAcceptingReadsCausesReadToThrowObjectDisposedException() 167public async Task AbortCausesCopyToAsyncToCancel() 177public async Task AbortWithErrorCausesCopyToAsyncToCancel() 189public async Task StopAcceptingReadsCausesCopyToAsyncToThrowObjectDisposedException() 200public async Task NullDestinationCausesCopyToAsyncToThrowArgumentNullException() 209public async Task ZeroBufferSizeCausesCopyToAsyncToThrowArgumentException()
HttpResponseStreamTests.cs (3)
54public async Task ReadAsyncThrows() 97public async Task StopAcceptingWritesCausesWriteToThrowObjectDisposedException() 108public async Task SynchronousWritesThrowIfDisallowedByIHttpBodyControlFeature()
KestrelServerTests.cs (34)
339public async Task StartWithNoValidTransportFactoryThrows() 350async () => await server.StartAsync(new DummyApplication(context => Task.CompletedTask), CancellationToken.None)); 356public async Task StartWithMultipleTransportFactories_UseSupported() 369await server.StartAsync(new DummyApplication(context => Task.CompletedTask), CancellationToken.None); 376public async Task StartWithNoValidTransportFactoryThrows_Http3() 391async () => await server.StartAsync(new DummyApplication(context => Task.CompletedTask), CancellationToken.None)); 397public async Task StartWithMultipleTransportFactories_Http3_UseSupported() 414await server.StartAsync(new DummyApplication(context => Task.CompletedTask), CancellationToken.None); 421public async Task ListenWithCustomEndpoint_DoesNotThrow() 440await server.StartAsync(new DummyApplication(context => Task.CompletedTask), CancellationToken.None); 450public async Task ListenIPWithStaticPort_TransportsGetIPv6Any() 467await server.StartAsync(new DummyApplication(context => Task.CompletedTask), CancellationToken.None); 481public async Task ListenIPWithEphemeralPort_TransportsGetIPv6Any() 498await server.StartAsync(new DummyApplication(context => Task.CompletedTask), CancellationToken.None); 509public async Task ListenIPWithEphemeralPort_MultiplexedTransportsGetIPv6Any() 526await server.StartAsync(new DummyApplication(context => Task.CompletedTask), CancellationToken.None); 537public async Task StopAsyncCallsCompleteWhenFirstCallCompletes() 577var stopTask1 = server.StopAsync(default); 578var stopTask2 = server.StopAsync(default); 579var stopTask3 = server.StopAsync(default); 588await Task.WhenAll(new[] { stopTask1, stopTask2, stopTask3 }).DefaultTimeout(); 594public async Task StopAsyncCallsCompleteWithThrownException() 635var stopTask1 = server.StopAsync(default); 636var stopTask2 = server.StopAsync(default); 637var stopTask3 = server.StopAsync(default); 654public async Task StopAsyncDispatchesSubsequentStopAsyncContinuations() 690var stopTask1 = server.StopAsync(default); 691var stopTask2 = server.StopAsync(default); 696var continuationTask = Task.Run(async () => 753public async Task ReloadsOnConfigurationChangeWhenOptedIn() 761Func<Task> changeCallback = null; 912public async Task DoesNotReloadOnConfigurationChangeByDefault() 984server.StartAsync(new DummyApplication(context => Task.CompletedTask), CancellationToken.None).GetAwaiter().GetResult();
ListenOptionsTests.cs (1)
35return context => Task.CompletedTask;
MessageBodyTests.cs (55)
28public async Task CanReadFromContentLength(int intHttpVersion) 58public async Task CanReadFromContentLengthPipeApis(int intHttpVersion) 86public async Task CanTryReadFromContentLengthPipeApis(int intHttpVersion) 113public async Task ReadAsyncWithoutAdvanceFromContentLengthThrows(int intHttpVersion) 134public async Task TryReadWithoutAdvanceFromContentLengthThrows(int intHttpVersion) 155public async Task CanReadAsyncFromContentLength(int intHttpVersion) 182public async Task CanReadFromChunkedEncoding() 211public async Task BadChunkPrefixThrowsBadRequestException() 236public async Task WritingChunkOverMaxChunkSizeThrowsBadRequest() 264public async Task InvalidChunkSuffixThrowsBadRequest() 276async Task ReadAsync() 284var task = ReadAsync(); 305public async Task CanReadAsyncFromChunkedEncoding() 332public async Task ReadExitsGivenIncompleteChunkedExtension() 366public async Task ReadThrowsGivenChunkPrefixGreaterThanMaxInt() 388public async Task ReadThrowsGivenChunkPrefixGreaterThan8Bytes() 414public async Task CanReadFromRemainingData(int intHttpVersion) 443public async Task CanReadAsyncFromRemainingData(int intHttpVersion) 470public async Task ReadFromNoContentLengthReturnsZero(int intHttpVersion) 494public async Task ReadAsyncFromNoContentLengthReturnsZero(int intHttpVersion) 514public async Task CanHandleLargeBlocks() 592public async Task CopyToAsyncDoesNotCompletePipeReader() 615public async Task ConsumeAsyncConsumesAllRemainingInput() 632public async Task ConsumeAsyncAbortsConnectionInputAfterStartingTryReadWithoutAdvance() 653public async Task ConnectionUpgradeKeepAlive(string headerConnection) 676public async Task UpgradeConnectionAcceptsContentLengthZero() 703public async Task PumpAsyncDoesNotReturnAfterCancelingInput() 727public async Task ReadAsyncThrowsOnTimeout() 756public async Task ConsumeAsyncCompletesAndDoesNotThrowOnTimeout() 789public async Task CopyToAsyncThrowsOnTimeout() 821public async Task LogsWhenStartsReadingRequestBody() 848public async Task LogsWhenStopsReadingRequestBody() 883public async Task PausesAndResumesRequestBodyTimeoutOnBackpressure() 912public async Task OnlyEnforcesRequestBodyTimeoutAfterFirstRead() 943public async Task DoesNotEnforceRequestBodyTimeoutOnUpgradeRequests() 979public async Task CancelPendingReadContentLengthWorks() 1000public async Task CancelPendingReadChunkedWorks() 1021public async Task CancelPendingReadUpgradeWorks() 1042public async Task CancelPendingReadForZeroContentLengthCannotBeCanceled() 1065public async Task TryReadReturnsCompletedResultAfterReadingEntireContentLength() 1084public async Task TryReadReturnsCompletedResultAfterReadingEntireChunk() 1111public async Task TryReadDoesNotReturnCompletedReadResultFromUpgradeStreamUntilCompleted() 1137public async Task TryReadDoesReturnsCompletedReadResultForZeroContentLength() 1160public async Task CompleteForContentLengthAllowsConsumeToWork() 1184public async Task CompleteForContentLengthDoesNotCompleteConnectionPipeMakesReadReturnThrow() 1210public async Task UnexpectedEndOfRequestContentIsRepeatedlyThrownForContentLengthBody() 1237public async Task UnexpectedEndOfRequestContentIsRepeatedlyThrownForContentLengthBodyAfterExaminingButNotConsumingBytes() 1270public async Task UnexpectedEndOfRequestContentIsRepeatedlyThrownForChunkedBody() 1297public async Task CompleteForChunkedAllowsConsumeToWork() 1321public async Task CompleteForChunkedDoesNotCompleteConnectionPipeMakesReadThrow() 1347public async Task CompleteForUpgradeDoesNotCompleteConnectionPipeMakesReadThrow() 1373public async Task CompleteForZeroByteBodyDoesNotCompleteConnectionPipeNoopsReads() 1450public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 1489public override async Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 1491await Task.Delay(1);
src\Servers\Kestrel\shared\test\DummyApplication.cs (2)
18: this(_ => Task.CompletedTask) 43public async Task ProcessRequestAsync(HttpContext context)
src\Servers\Kestrel\shared\test\PassThroughConnectionMiddleware.cs (1)
21public Task OnConnectionAsync(ConnectionContext context)
src\Servers\Kestrel\shared\test\RevocationResponder.cs (1)
105internal async Task HandleRequestAsync()
src\Servers\Kestrel\shared\test\ServerRetryHelper.cs (2)
17public static async Task BindPortsWithRetry(Func<int, Task> retryFunc, ILogger logger)
src\Servers\Kestrel\shared\test\StreamBackedTestConnection.cs (10)
42public Task SendEmptyGet() 50public Task SendEmptyGetWithUpgradeAndKeepAlive() 53public Task SendEmptyGetWithUpgrade() 56public Task SendEmptyGetAsKeepAlive() 59private Task SendEmptyGetWithConnection(string connection) 68public async Task SendAll(params string[] lines) 77public async Task Send(params string[] lines) 93public async Task Receive(params string[] lines) 129public async Task ReceiveEnd(params string[] lines) 138public async Task WaitForConnectionClose()
src\Servers\Kestrel\shared\test\TestApp.cs (6)
14public static async Task EchoApp(HttpContext httpContext) 27public static async Task EchoAppChunked(HttpContext httpContext) 39public static Task EmptyApp(HttpContext httpContext) 41return Task.CompletedTask; 44public static async Task EchoAppPipeWriter(HttpContext httpContext) 61public static async Task EchoAppPipeWriterChunked(HttpContext httpContext)
src\Servers\Kestrel\shared\test\TestContextFactory.cs (2)
105Func<ListenOptions, Task> createBinding) 120Func<ListenOptions, CancellationToken, Task> createBinding)
src\Servers\Kestrel\shared\test\TestHttp1Connection.cs (1)
31public Task ProduceEndAsync()
src\Shared\Buffers.MemoryPool\DiagnosticMemoryPool.cs (4)
153public async Task WhenAllBlocksReturnedAsync(TimeSpan timeout) 155var task = await Task.WhenAny(_allBlocksReturned.Task, Task.Delay(timeout));
TestHelpers\TestInput.cs (1)
63async Task Write() => await Application.Output.WriteAsync(data);
ThrowingWasUpgradedWriteOnlyStreamTests.cs (1)
14public async Task ThrowsOnWrite()
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (95)
ChunkWriterBenchmark.cs (1)
33public async Task WriteBeginChunkBytes()
Http1LargeWritingBenchmark.cs (4)
23private Task _consumeResponseBodyTask; 45public Task WriteAsync() 51public Task WriteSegmentsUnawaitedAsync() 93private async Task ConsumeResponseBody()
Http1ReadingBenchmark.cs (6)
24private static readonly Func<object, Task> _syncTaskFunc = (obj) => Task.CompletedTask; 26private static readonly Task _pseudoAsyncTask = Task.FromResult(27); 27private static readonly Func<object, Task> _pseudoAsyncTaskFunc = (obj) => _pseudoAsyncTask; 87public Task ReadAsync()
Http1WritingBenchmark.cs (8)
23private static readonly Func<object, Task> _syncTaskFunc = (obj) => Task.CompletedTask; 25private static readonly Task _pseudoAsyncTask = Task.FromResult(27); 26private static readonly Func<object, Task> _pseudoAsyncTaskFunc = (obj) => _pseudoAsyncTask; 31private Task _consumeResponseBodyTask; 92public Task WriteAsync() 127private async Task ConsumeResponseBody()
Http2\Http2ConnectionBenchmarkBase.cs (3)
33private Task _requestProcessingTask; 38protected abstract Task ProcessRequest(HttpContext httpContext); 111public async Task MakeRequest()
Http2\Http2ConnectionEmptyBenchmark.cs (2)
24protected override Task ProcessRequest(HttpContext httpContext) 26return ResponseDataLength == 0 ? Task.CompletedTask : httpContext.Response.WriteAsync(_responseData);
Http2\Http2ConnectionHeadersBenchmark.cs (2)
33protected override Task ProcessRequest(HttpContext httpContext) 45return Task.CompletedTask;
Http3\Http3ConnectionBenchmarkBase.cs (2)
25protected abstract Task ProcessRequest(HttpContext httpContext); 58public async Task MakeRequest()
Http3\Http3ConnectionEmptyBenchmark.cs (2)
24protected override Task ProcessRequest(HttpContext httpContext) 26return ResponseDataLength == 0 ? Task.CompletedTask : httpContext.Response.WriteAsync(_responseData);
InMemoryTransportBenchmark.cs (6)
68private async Task ValidateResponseAsync(byte[] request, string expectedResponse) 91public async Task Plaintext() 98public async Task PlaintextPipelined() 192public async Task ReadResponseAsync(int length) 249public Task Invoke(HttpContext httpContext) 259public static Task WriteResponse(HttpResponse response)
NamedPipesTransportBenchmark.cs (7)
65private async Task ValidateResponseAsync(byte[] request, string expectedResponse) 93public async Task Plaintext() 95var parallelTasks = new Task[_parallelCount]; 98parallelTasks[i] = Task.Run(async () => 120await Task.WhenAll(parallelTasks); 147public Task Invoke(HttpContext httpContext) 157public static Task WriteResponse(HttpResponse response)
PipeThroughputBenchmark.cs (5)
29var writing = Task.Run(async () => 39var reading = Task.Run(async () => 50Task.WaitAll(writing, reading);
src\Servers\Kestrel\shared\ConnectionCompletion.cs (10)
12public static Task FireOnCompletedAsync(ILogger logger, Stack<KeyValuePair<Func<object, Task>, object>>? onCompleted) 16return Task.CompletedTask; 22private static Task CompleteAsyncMayAwait(ILogger logger, Stack<KeyValuePair<Func<object, Task>, object>> onCompleted) 28var task = entry.Key.Invoke(entry.Value); 40return Task.CompletedTask; 43private static async Task CompleteAsyncAwaited(Task currentTask, ILogger logger, Stack<KeyValuePair<Func<object, Task>, object>> onCompleted)
src\Servers\Kestrel\shared\test\DummyApplication.cs (2)
18: this(_ => Task.CompletedTask) 43public async Task ProcessRequestAsync(HttpContext context)
src\Servers\Kestrel\shared\test\Http3\Http3InMemory.cs (28)
79protected Task _connectionTask; 137internal Task WaitForConnectionStopAsync(long expectedLastStreamId, bool ignoreNonGoAwayFrames, Http3ErrorCode? expectedErrorCode = null) 142internal async Task WaitForConnectionErrorAsync<TException>(bool ignoreNonGoAwayFrames, long? expectedLastStreamId, Http3ErrorCode expectedErrorCode, Action<Type, string[]> matchExpectedErrorMessage = null, params string[] expectedErrorMessage) 157internal async Task WaitForGoAwayAsync(bool ignoreNonGoAwayFrames, long? expectedLastStreamId) 224public async Task InitializeConnectionAsync(RequestDelegate application) 488public Task OnUnidentifiedStreamCreatedTask => OnUnidentifiedStreamCreatedTcs.Task; 489public Task OnStreamCreatedTask => OnStreamCreatedTcs.Task; 490public Task OnStreamCompletedTask => OnStreamCompletedTcs.Task; 491public Task OnHeaderReceivedTask => OnHeaderReceivedTcs.Task; 502protected Task SendAsync(ReadOnlySpan<byte> span) 509protected static Task FlushAsync(PipeWriter writableBuffer) 519internal async Task ReceiveEndAsync() 597internal async Task SendFrameAsync(Http3FrameType frameType, Memory<byte> data, bool endStream = false) 614internal Task EndStreamAsync(ReadOnlySpan<byte> span = default) 624internal async Task WaitForStreamErrorAsync(Http3ErrorCode protocolError, Action<string> matchExpectedErrorMessage = null, string expectedErrorMessage = null) 669public Task OnDisposedTask => _testStreamContext.OnDisposedTask; 670public Task OnDisposingTask => _testStreamContext.OnDisposingTask; 688public Task SendHeadersAsync(IEnumerable<KeyValuePair<string, string>> headers, bool endStream = false) 693public async Task SendHeadersAsync(Http3HeadersEnumerator headers, bool endStream = false) 717internal async Task SendHeadersPartialAsync() 725internal async Task SendDataAsync(Memory<byte> data, bool endStream = false) 758internal async Task ExpectReceiveEndOfStream() 863public async Task WriteStreamIdAsync(int id) 879internal async Task SendGoAwayAsync(long streamId, bool endStream = false) 887internal async Task SendSettingsAsync(List<Http3PeerSetting> settings, bool endStream = false) 951internal async Task WaitForGoAwayAsync(bool ignoreNonGoAwayFrames, long? expectedLastStreamId) 1170public Task OnDisposingTask => _disposingTcs.Task; 1171public Task OnDisposedTask => _disposedTcs.Task;
src\Servers\Kestrel\shared\test\TestContextFactory.cs (2)
105Func<ListenOptions, Task> createBinding) 120Func<ListenOptions, CancellationToken, Task> createBinding)
src\Servers\Kestrel\shared\test\TestHttp1Connection.cs (1)
31public Task ProduceEndAsync()
src\Shared\Buffers.MemoryPool\DiagnosticMemoryPool.cs (4)
153public async Task WhenAllBlocksReturnedAsync(TimeSpan timeout) 155var task = await Task.WhenAny(_allBlocksReturned.Task, Task.Delay(timeout));
Microsoft.AspNetCore.Server.Kestrel.Tests (9)
HttpsConfigurationTests.cs (6)
22public async Task BindAddressFromSetting(string address, bool useKestrelHttpsConfiguration) 81public async Task BindAddressFromEndpoint(string address, bool useKestrelHttpsConfiguration) 119public async Task LoadDefaultCertificate(bool useKestrelHttpsConfiguration) 151public async Task LoadEndpointCertificate(string address, bool useKestrelHttpsConfiguration) 187public async Task UseHttpsJustWorks() 212public async Task UseHttpsMayNotImplyUseKestrelHttpsConfiguration()
KestrelConfigurationLoaderTests.cs (3)
848public async Task CertificateChangedOnDisk(bool reloadOnChange) 904await Task.Delay(TimeSpan.FromSeconds(1)); 930public async Task CertificateChangedOnDisk_Symlink()
Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes (16)
Internal\NamedPipeConnection.cs (6)
31internal Task _receivingTask = Task.CompletedTask; 32internal Task _sendingTask = Task.CompletedTask; 77private async Task DoReceiveAsync() 148private async Task DoSendAsync()
Internal\NamedPipeConnectionListener.cs (6)
31private Task? _completeListeningTask; 73var listeningTasks = new Task[_options.ListenerQueueCount]; 81listeningTasks[i] = Task.Run(() => StartAsync(initialStream)); 84_completeListeningTask = Task.Run(async () => 88await Task.WhenAll(listeningTasks); 101private async Task StartAsync(NamedPipeServerStream nextStream)
src\Shared\Buffers.MemoryPool\DiagnosticMemoryPool.cs (4)
153public async Task WhenAllBlocksReturnedAsync(TimeSpan timeout) 155var task = await Task.WhenAny(_allBlocksReturned.Task, Task.Delay(timeout));
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (23)
Internal\QuicConnectionContext.cs (1)
31private Task? _closeTask;
Internal\QuicConnectionContext.FeatureCollection.cs (2)
32_clientCertTask = Task.FromResult(value); 38return _clientCertTask ??= Task.FromResult(ClientCertificate);
Internal\QuicStreamContext.cs (3)
21internal Task _processingTask = Task.CompletedTask; 148private async Task StartAsync()
src\Servers\Kestrel\shared\ConnectionCompletion.cs (10)
12public static Task FireOnCompletedAsync(ILogger logger, Stack<KeyValuePair<Func<object, Task>, object>>? onCompleted) 16return Task.CompletedTask; 22private static Task CompleteAsyncMayAwait(ILogger logger, Stack<KeyValuePair<Func<object, Task>, object>> onCompleted) 28var task = entry.Key.Invoke(entry.Value); 40return Task.CompletedTask; 43private static async Task CompleteAsyncAwaited(Task currentTask, ILogger logger, Stack<KeyValuePair<Func<object, Task>, object>> onCompleted)
src\Shared\Buffers.MemoryPool\DiagnosticMemoryPool.cs (4)
153public async Task WhenAllBlocksReturnedAsync(TimeSpan timeout) 155var task = await Task.WhenAny(_allBlocksReturned.Task, Task.Delay(timeout));
src\Shared\TaskToApm.cs (3)
32public static IAsyncResult Begin(Task task, AsyncCallback? callback, object? state) => 69internal readonly Task _task; 77internal TaskAsyncResult(Task task, object? state, AsyncCallback? callback)
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Tests (68)
QuicConnectionContextTests.cs (20)
25public async Task Abort_AbortAfterDispose_Ignored() 49public async Task DisposeAsync_DisposeConnectionAfterAcceptingStream_DefaultCloseErrorCodeReported() 77public async Task AcceptAsync_CancellationThenAccept_AcceptStreamAfterCancellation() 116public async Task AcceptAsync_ClientClosesConnection_ServerNotified() 148public async Task AcceptAsync_ClientStartsAndStopsUnidirectionStream_ServerAccepts() 190public async Task AcceptAsync_ClientStartsAndStopsBidirectionStream_ServerAccepts() 240public async Task AcceptAsync_ServerStartsAndStopsUnidirectionStream_ClientAccepts() 285public async Task AcceptAsync_ClientClosesConnection_ExceptionThrown() 311public async Task StreamPool_StreamAbortedOnServer_NotPooled() 354public async Task StreamPool_StreamAbortedOnServerAfterComplete_NotPooled() 399public async Task StreamPool_StreamAbortedOnClient_NotPooled() 446public async Task StreamPool_StreamAbortedOnClientAndServer_NotPooled() 503public async Task StreamPool_Heartbeat_ExpiredStreamRemoved() 557public async Task StreamPool_ManyConcurrentStreams_StreamPoolFull() 576var streamTasks = new List<Task>(); 588await Task.WhenAll(streamTasks).DefaultTimeout(); 594static async Task SendStream(RequestState requestState) 632public async Task PersistentState_StreamsReused_StatePersisted() 713public async Task IProtocolErrorFeature_InvalidErrorCode(long errorCode) 740Task PauseCompleteTask)
QuicConnectionListenerTests.cs (16)
29public async Task AcceptAsync_AfterUnbind_ReturnNull() 43public async Task AcceptAsync_ClientCreatesConnection_ServerAccepts() 67public async Task AcceptAsync_ClientCreatesInvalidConnection_ServerContinuesToAccept() 112public async Task ClientCertificate_Required_Sent_Populated() 151public async Task ClientCertificate_Required_NotSent_AcceptedViaCallback() 163public async Task AcceptAsync_NoCertificateOrApplicationProtocol_Log() 193public async Task AcceptAsync_UnbindAfterCall_CleanExitAndLog() 211public async Task AcceptAsync_DisposeAfterCall_CleanExitAndLog() 229public async Task AcceptAsync_ErrorFromServerCallback_CleanExitAndLog() 272public async Task BindAsync_ListenersSharePort_ThrowAddressInUse() 285public async Task BindAsync_ListenersSharePortWithPlainUdpSocket_ThrowAddressInUse() 300public async Task AcceptAsync_NoApplicationProtocolsInCallback_DefaultToConnectionProtocols() 331public async Task AcceptAsync_Success_RemovedFromPendingConnections() 374public async Task AcceptAsync_NoCertificateCallback_RemovedFromPendingConnections() 419await Task.Delay(100 * i); 427public async Task AcceptAsync_TlsCallback_ConnectionContextInArguments()
QuicStreamContextTests.cs (14)
30public async Task BidirectionalStream_ServerReadsDataAndCompletes_GracefullyClosed() 56public async Task BidirectionalStream_ReadAborted_NotPooled() 102public async Task BidirectionalStream_ClientAbortedAfterDisposeCalled_NotPooled() 164public async Task BidirectionalStream_ServerWritesDataAndDisposes_ClientReadsData(int dataLength) 229public async Task BidirectionalStream_MultipleStreamsOnConnection_ReusedFromPool() 251public async Task BidirectionalStream_ClientAbortWrite_ServerReceivesAbort() 295public async Task ClientToServerUnidirectionalStream_ServerReadsData_GracefullyClosed() 329public async Task ClientToServerUnidirectionalStream_ClientAbort_ServerReceivesAbort() 368public async Task ClientToServerUnidirectionalStream_CompleteWrites_PipeProvidesDataAndCompleteTogether() 399public async Task ServerToClientUnidirectionalStream_ServerWritesDataAndCompletes_GracefullyClosed() 440public async Task ServerToClientUnidirectionalStream_ServerAborts_ClientGetsAbort() 484public async Task StreamAbortFeature_AbortWrite_ClientReceivesAbort() 534public async Task IProtocolErrorFeature_InvalidErrorCode(long errorCode) 561public async Task IStreamAbortFeature_InvalidErrorCode(long errorCode)
QuicTransportFactoryTests.cs (3)
25public async Task BindAsync_NoFeatures_Error() 40public async Task BindAsync_NoApplicationProtocols_Error() 57public async Task BindAsync_SslServerAuthenticationOptions_Success()
src\Servers\Kestrel\shared\test\ServerRetryHelper.cs (2)
17public static async Task BindPortsWithRetry(Func<int, Task> retryFunc, ILogger logger)
src\Shared\SyncPoint\SyncPoint.cs (5)
18public Task WaitForSyncPoint() => _atSyncPoint.Task; 32public Task WaitToContinue() 38public static Func<Task> Create(out SyncPoint syncPoint) 51public static Func<Task> Create(int count, out SyncPoint[] syncPoints) 67return Task.CompletedTask;
WebHostTests.cs (8)
43public async Task UseUrls_HelloWorld_ClientSuccess() 100public async Task Listen_Http3AndSocketsCoexistOnDifferentEndpoints_ClientSuccess(int http3Port, int http1Port) 140public async Task Listen_Http3AndSocketsOnDynamicEndpoint_Http3Disabled() 175public async Task Listen_Http3AndSocketsCoexistOnSameEndpoint_ClientSuccess() 213public async Task Listen_Http3AndSocketsCoexistOnSameEndpoint_AltSvcEnabled_Upgrade() 280public async Task Listen_Http3AndSocketsCoexistOnSameEndpoint_AltSvcDisabled_NoUpgrade() 347private static async Task CallHttp3AndHttp1EndpointsAsync(int http3Port, int http1Port) 381public async Task StartAsync_Http3WithNonIPListener_ThrowError()
Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets (8)
Internal\SocketConnection.cs (4)
27private Task? _sendingTask; 28private Task? _receivingTask; 132private async Task DoReceive() 265private async Task DoSend()
src\Shared\Buffers.MemoryPool\DiagnosticMemoryPool.cs (4)
153public async Task WhenAllBlocksReturnedAsync(TimeSpan timeout) 155var task = await Task.WhenAny(_allBlocksReturned.Task, Task.Delay(timeout));
Microsoft.AspNetCore.Session (6)
DistributedSession.cs (2)
211public async Task LoadAsync(CancellationToken cancellationToken = default) 244public async Task CommitAsync(CancellationToken cancellationToken = default)
SessionMiddleware.cs (4)
59/// <returns>A <see cref="Task"/> that completes when the middleware has completed processing.</returns> 60public async Task Invoke(HttpContext context) 129private static Task OnStartingCallback(object state) 136return Task.CompletedTask;
Microsoft.AspNetCore.Session.Tests (35)
SessionTests.cs (35)
26public async Task ReadingEmptySessionDoesNotCreateCookie() 40return Task.FromResult(0); 62public async Task SettingAValueCausesTheCookieToBeCreated() 77return Task.FromResult(0); 107public async Task SecureSessionBasedOnHttpsAndSecurePolicy( 132return Task.FromResult(0); 163public async Task SessionCanBeAccessedOnTheNextRequest() 212public async Task RemovedItemCannotBeAccessedAgain() 271public async Task ClearedItemsCannotBeAccessedAgain() 329public async Task SessionStart_LogsInformation() 346return Task.FromResult(0); 376public async Task ExpiredSession_LogsInfo() 444public async Task RefreshesSession_WhenSessionData_IsNotModified() 510public async Task SessionFeature_IsUnregistered_WhenResponseGoingOut() 531return Task.FromResult(0); 552public async Task SessionFeature_IsUnregistered_WhenResponseGoingOut_AndAnUnhandledExcetionIsThrown() 601public async Task SessionKeys_AreCaseSensitive() 617return Task.FromResult(0); 638public async Task SessionLogsCacheReadException() 658return Task.FromResult(0); 688public async Task SessionLogsCacheLoadAsyncException() 737public async Task SessionLogsCacheLoadAsyncTimeoutException() 785public async Task SessionLoadAsyncCanceledException() 831public async Task SessionLogsCacheCommitException() 856return Task.FromResult(0); 891public async Task SessionLogsCacheCommitTimeoutException() 919return Task.FromResult(0); 957public async Task SessionLogsCacheCommitCanceledException() 1021public async Task RequestAbortedIgnored() 1050return Task.CompletedTask; 1085public async Task SessionLogsCacheRefreshException() 1102return Task.FromResult(0); 1186public Task RefreshAsync(string key, CancellationToken token = default) 1202public Task RemoveAsync(string key, CancellationToken token = default) => _cache.RemoveAsync(key); 1206public Task SetAsync(string key, byte[] value, DistributedCacheEntryOptions options, CancellationToken token = default)
Microsoft.AspNetCore.Shared.Tests (53)
NonCapturingTimerTest.cs (2)
14public async Task NonCapturingTimer_DoesntCaptureExecutionContext() 37Assert.NotNull(await Task.Run(() => message.Value));
ObjectMethodExecutorTest.cs (33)
81public async Task ExecuteValueMethodAsync() 92public async Task ExecuteValueMethodWithReturnTypeAsync() 104public async Task ExecuteValueMethodUpdateValueAsync() 117public async Task ExecuteValueMethodWithReturnTypeThrowsExceptionAsync() 134public async Task ExecuteValueMethodWithReturnVoidThrowsExceptionAsync(string method) 163public async Task TargetMethodReturningCustomAwaitableOfReferenceType_CanInvokeViaExecute() 179public async Task TargetMethodReturningCustomAwaitableOfValueType_CanInvokeViaExecute() 194public async Task TargetMethodReturningCustomAwaitableOfReferenceType_CanInvokeViaExecuteAsync() 211public async Task TargetMethodReturningCustomAwaitableOfValueType_CanInvokeViaExecuteAsync() 233public async Task TargetMethodReturningAwaitableOfVoidType_CanInvokeViaExecuteAsync(string method) 248public async Task TargetMethodReturningAwaitableWithICriticalNotifyCompletion_UsesUnsafeOnCompleted() 263public async Task TargetMethodReturningAwaitableWithoutICriticalNotifyCompletion_UsesOnCompleted() 278public async Task TargetMethodReturningValueTaskOfValueType_CanBeInvokedViaExecute() 293public async Task TargetMethodReturningValueTaskOfReferenceType_CanBeInvokedViaExecute() 308public async Task TargetMethodReturningValueTaskOfValueType_CanBeInvokedViaExecuteAsync() 324public async Task TargetMethodReturningValueTaskOfReferenceType_CanBeInvokedViaExecuteAsync() 339public async Task TargetMethodReturningFSharpAsync_CanBeInvokedViaExecute() 357public async Task TargetMethodReturningFailingFSharpAsync_CanBeInvokedViaExecute() 378public async Task TargetMethodReturningFSharpAsync_CanBeInvokedViaExecuteAsync() 393public async Task TargetMethodReturningFailingFSharpAsync_CanBeInvokedViaExecuteAsync() 453return Task.FromResult<int>(i + j); 456public async Task VoidValueMethodAsync(int i) 463return Task.FromResult(default(Unit)); 483return Task.FromResult<TestObject>(new TestObject() { value = "Hello" }); 486public async Task ValueMethodWithReturnVoidThrowsExceptionAsync(TestObject i) 488await Task.CompletedTask; 494await Task.FromResult(default(Unit)); 514static Task Run() 516Task.FromResult(default(Unit)); 523await Task.CompletedTask; 530return Task.FromResult<TestObject>(parameter); 576return FSharpAsync.AwaitTask(Task.FromResult(parameter)); 582Task.FromException<string>(new InvalidOperationException("Test exception")));
src\Shared\ObjectMethodExecutor\ObjectMethodExecutorFSharpSupport.cs (6)
39/// or to a <see cref="Task"/>, if <c>TResult</c> is <see href="https://fsharp.github.io/fsharp-core-docs/reference/fsharp-core-unit-0.html">FSharp.Core.Unit</see>. 49/// to a <see cref="Task{TResult}"/>, or to a <see cref="Task"/>, if <c>TResult</c> is <see href="https://fsharp.github.io/fsharp-core-docs/reference/fsharp-core-unit-0.html">FSharp.Core.Unit</see>; 53/// When this method returns, contains the type of the closed generic instantiation of <see cref="Task{TResult}"/> or of <see cref="Task"/> that will be returned 114/// to a void-returning <see cref="Task"/> or <see cref="ValueTask"/>. 145var typeDef when typeDef == typeof(Task<>) && IsFSharpUnit(genericAwaitableType.GetGenericArguments()[0]) => (typeof(Task), MakeTaskOfUnitToTaskExpression(genericAwaitableType)), 155return Expression.Lambda(Expression.Convert(closedGenericTaskParam, typeof(Task)), closedGenericTaskParam);
src\Shared\SegmentWriteStream.cs (2)
152public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 155return Task.CompletedTask;
src\Shared\ServerInfrastructure\DuplexPipeStream.cs (2)
96public override Task WriteAsync(byte[]? buffer, int offset, int count, CancellationToken cancellationToken) 111public override Task FlushAsync(CancellationToken cancellationToken)
src\Shared\TaskToApm.cs (3)
32public static IAsyncResult Begin(Task task, AsyncCallback? callback, object? state) => 69internal readonly Task _task; 77internal TaskAsyncResult(Task task, object? state, AsyncCallback? callback)
src\Shared\ValueTaskExtensions\ValueTaskExtensions.cs (2)
13public static Task GetAsTask(this in ValueTask<FlushResult> valueTask) 20return Task.CompletedTask;
StackTraceHelperTest.cs (1)
253await Task.Delay(0);
ValueStopwatchTest.cs (2)
32public async Task GetElapsedTimeReturnsTimeElapsedSinceStart() 35await Task.Delay(200);
Microsoft.AspNetCore.SignalR.Client.Core (117)
HubConnection.cs (60)
115public event Func<Exception?, Task>? Closed; 133public event Func<Exception?, Task>? Reconnecting; 151public event Func<string?, Task>? Reconnected; 249/// <returns>A <see cref="Task"/> that represents the asynchronous start.</returns> 250public virtual async Task StartAsync(CancellationToken cancellationToken = default) 259private async Task StartAsyncInner(CancellationToken cancellationToken = default) 302/// <returns>A <see cref="Task"/> that represents the asynchronous stop.</returns> 303public virtual async Task StopAsync(CancellationToken cancellationToken = default) 374public virtual IDisposable On(string methodName, Type[] parameterTypes, Func<object?[], object, Task> handler, object state) 457/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns> 461public virtual async Task SendCoreAsync(string methodName, object?[] args, CancellationToken cancellationToken = default) 469private async Task StartAsyncCore(CancellationToken cancellationToken) 547private async Task StopAsyncCore(bool disposing) 559var reconnectTask = _state.ReconnectTask; 574var connectionStateStopTask = Task.CompletedTask; 593var writeTask = SendHubMessage(connectionState, CloseMessage.Empty); 689async Task OnStreamCanceled(InvocationRequest irq) 850private Task SendStreamItems<T>(ConnectionState connectionState, string streamId, ChannelReader<T> reader, CancellationTokenSource tokenSource) 852async Task ReadChannelStream() 868private Task SendIAsyncEnumerableStreamItems<T>(ConnectionState connectionState, string streamId, IAsyncEnumerable<T> stream, CancellationTokenSource tokenSource) 870async Task ReadAsyncEnumerableStream() 884private async Task CommonStreaming(ConnectionState connectionState, string streamId, Func<Task> createAndConsumeStream, CancellationTokenSource cts) 960private async Task InvokeCore(ConnectionState connectionState, string methodName, InvocationRequest irq, object?[] args, string[]? streams, CancellationToken cancellationToken) 985private async Task InvokeStreamCore(ConnectionState connectionState, string methodName, InvocationRequest irq, object?[] args, string[]? streams, CancellationToken cancellationToken) 1012private async Task SendHubMessage(ConnectionState connectionState, HubMessage hubMessage, CancellationToken cancellationToken = default) 1034private async Task SendCoreAsyncCore(string methodName, object?[] args, CancellationToken cancellationToken) 1058private async Task SendWithLock(ConnectionState expectedConnectionState, HubMessage message, CancellationToken cancellationToken, [CallerMemberName] string callerName = "") 1159private async Task DispatchInvocationAsync(InvocationMessage invocation, ConnectionState connectionState) 1193var task = handler.InvokeAsync(invocation.Arguments); 1243private async Task DispatchInvocationStreamItemAsync(StreamItemMessage streamItem, InvocationRequest irq) 1276private async Task HandshakeAsync(ConnectionState startingConnectionState, int protocolVersion, CancellationToken cancellationToken) 1381private async Task ReceiveLoop(ConnectionState connectionState) 1392var timerTask = connectionState.TimerLoop(timer); 1401async Task StartProcessingInvocationMessages(ChannelReader<InvocationMessage> invocationMessageChannelReader) 1407var invokeTask = DispatchInvocationAsync(invocationMessage, connectionState); 1505internal Task RunTimerActions() 1518private async Task HandleConnectionClose(ConnectionState connectionState) 1571async Task RunClosedEventAsync() 1595private async Task ReconnectAsync(Exception? closeException) 1634await Task.Delay(nextRetryDelay.Value, _state.StopCts.Token).ConfigureAwait(false); 1749async Task RunReconnectingEventAsync() 1776async Task RunReconnectedEventAsync() 1891private readonly Func<object?[], object, Task> _callback; 1894public InvocationHandler(Type[] parameterTypes, Func<object?[], object, Task> callback, object state) 1901public Task InvokeAsync(object?[] parameters) 1926public Task? ReceiveTask { get; set; } 1931public Task? InvocationMessageReceiveTask { get; set; } 2024public Task StopAsync() 2042private async Task StopAsyncCore() 2054await ((ReceiveTask ?? Task.CompletedTask).ConfigureAwait(false)); 2067public async Task TimerLoop(TimerAwaitable timer) 2103public Task AckAsync(AckMessage ackMessage) 2110return Task.CompletedTask; 2127internal async Task RunTimerActions() 2229ReconnectTask = Task.CompletedTask; 2238public Task ReconnectTask { get; set; } = Task.CompletedTask; 2274public Task WaitConnectionLockAsync(CancellationToken token, [CallerMemberName] string? memberName = null, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = 0)
HubConnectionExtensions.cs (12)
21return Task.CompletedTask; 211public static IDisposable On(this HubConnection hubConnection, string methodName, Type[] parameterTypes, Func<object?[], Task> handler) 215var currentHandler = (Func<object?[], Task>)state; 227public static IDisposable On(this HubConnection hubConnection, string methodName, Func<Task> handler) 242public static IDisposable On<T1>(this HubConnection hubConnection, string methodName, Func<T1, Task> handler) 260public static IDisposable On<T1, T2>(this HubConnection hubConnection, string methodName, Func<T1, T2, Task> handler) 279public static IDisposable On<T1, T2, T3>(this HubConnection hubConnection, string methodName, Func<T1, T2, T3, Task> handler) 299public static IDisposable On<T1, T2, T3, T4>(this HubConnection hubConnection, string methodName, Func<T1, T2, T3, T4, Task> handler) 320public static IDisposable On<T1, T2, T3, T4, T5>(this HubConnection hubConnection, string methodName, Func<T1, T2, T3, T4, T5, Task> handler) 342public static IDisposable On<T1, T2, T3, T4, T5, T6>(this HubConnection hubConnection, string methodName, Func<T1, T2, T3, T4, T5, T6, Task> handler) 365public static IDisposable On<T1, T2, T3, T4, T5, T6, T7>(this HubConnection hubConnection, string methodName, Func<T1, T2, T3, T4, T5, T6, T7, Task> handler) 389public static IDisposable On<T1, T2, T3, T4, T5, T6, T7, T8>(this HubConnection hubConnection, string methodName, Func<T1, T2, T3, T4, T5, T6, T7, T8, Task> handler)
HubConnectionExtensions.InvokeAsync.cs (23)
25public static Task InvokeAsync(this HubConnection hubConnection, string methodName, CancellationToken cancellationToken = default) 37/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns> 39public static Task InvokeAsync(this HubConnection hubConnection, string methodName, object? arg1, CancellationToken cancellationToken = default) 52/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns> 54public static Task InvokeAsync(this HubConnection hubConnection, string methodName, object? arg1, object? arg2, CancellationToken cancellationToken = default) 68/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns> 70public static Task InvokeAsync(this HubConnection hubConnection, string methodName, object? arg1, object? arg2, object? arg3, CancellationToken cancellationToken = default) 85/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns> 87public static Task InvokeAsync(this HubConnection hubConnection, string methodName, object? arg1, object? arg2, object? arg3, object? arg4, CancellationToken cancellationToken = default) 103/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns> 105public static Task InvokeAsync(this HubConnection hubConnection, string methodName, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, CancellationToken cancellationToken = default) 122/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns> 124public static Task InvokeAsync(this HubConnection hubConnection, string methodName, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, CancellationToken cancellationToken = default) 142/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns> 144public static Task InvokeAsync(this HubConnection hubConnection, string methodName, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, CancellationToken cancellationToken = default) 163/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns> 165public static Task InvokeAsync(this HubConnection hubConnection, string methodName, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, object? arg8, CancellationToken cancellationToken = default) 185/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns> 187public static Task InvokeAsync(this HubConnection hubConnection, string methodName, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, object? arg8, object? arg9, CancellationToken cancellationToken = default) 208/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns> 210public static Task InvokeAsync(this HubConnection hubConnection, string methodName, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, object? arg8, object? arg9, object? arg10, CancellationToken cancellationToken = default) 222/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns> 223public static Task InvokeCoreAsync(this HubConnection hubConnection, string methodName, object?[] args, CancellationToken cancellationToken = default)
HubConnectionExtensions.OnResult.cs (1)
19return Task.FromResult<object?>(currentHandler(parameters));
HubConnectionExtensions.SendAsync.cs (11)
25public static Task SendAsync(this HubConnection hubConnection, string methodName, CancellationToken cancellationToken = default) 40public static Task SendAsync(this HubConnection hubConnection, string methodName, object? arg1, CancellationToken cancellationToken = default) 56public static Task SendAsync(this HubConnection hubConnection, string methodName, object? arg1, object? arg2, CancellationToken cancellationToken = default) 73public static Task SendAsync(this HubConnection hubConnection, string methodName, object? arg1, object? arg2, object? arg3, CancellationToken cancellationToken = default) 91public static Task SendAsync(this HubConnection hubConnection, string methodName, object? arg1, object? arg2, object? arg3, object? arg4, CancellationToken cancellationToken = default) 110public static Task SendAsync(this HubConnection hubConnection, string methodName, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, CancellationToken cancellationToken = default) 130public static Task SendAsync(this HubConnection hubConnection, string methodName, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, CancellationToken cancellationToken = default) 151public static Task SendAsync(this HubConnection hubConnection, string methodName, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, CancellationToken cancellationToken = default) 173public static Task SendAsync(this HubConnection hubConnection, string methodName, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, object? arg8, CancellationToken cancellationToken = default) 196public static Task SendAsync(this HubConnection hubConnection, string methodName, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, object? arg8, object? arg9, CancellationToken cancellationToken = default) 220public static Task SendAsync(this HubConnection hubConnection, string methodName, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, object? arg8, object? arg9, object? arg10, CancellationToken cancellationToken = default)
HubConnectionExtensions.StreamAsChannelAsync.cs (1)
287private static async Task RunChannel<TResult>(ChannelReader<object?> inputChannel, Channel<TResult> outputChannel)
src\Shared\ValueTaskExtensions\ValueTaskExtensions.cs (2)
13public static Task GetAsTask(this in ValueTask<FlushResult> valueTask) 20return Task.CompletedTask;
src\SignalR\common\Shared\AwaitableThreadPool.cs (1)
29Task.Run(continuation);
src\SignalR\common\Shared\MessageBuffer.cs (3)
88private async Task RunTimer() 183public async Task AckAsync(AckMessage ackMessage) 248internal async Task ResendAsync(PipeWriter writer)
src\SignalR\common\Shared\PipeWriterStream.cs (2)
56public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 72return new ValueTask(Task.FromCanceled(cancellationToken));
src\SignalR\common\Shared\TimerAwaitable.cs (1)
85Task.Run(continuation);
Microsoft.AspNetCore.SignalR.Client.FunctionalTests (111)
HubConnectionTests.cs (92)
84public async Task CheckFixedMessage(string protocolName, HttpTransportType transportType, string path) 117public async Task ServerRejectsClientWithOldProtocol() 153public async Task ClientCanConnectToServerWithLowerMinimumProtocol() 183public async Task CanSendAndReceiveMessage(string protocolName, HttpTransportType transportType, string path) 212public async Task CanSendNull(string protocolName) 241public async Task CanStopAndStartConnection(string protocolName, HttpTransportType transportType, string path) 273public async Task CanAccessConnectionIdFromHubConnection(string protocolName, HttpTransportType transportType, string path) 308public async Task CanStartConnectionFromClosedEvent(string protocolName, HttpTransportType transportType, string path) 370public async Task MethodsAreCaseInsensitive(string protocolName, HttpTransportType transportType, string path) 400public async Task CanInvokeFromOnHandler(string protocolName, HttpTransportType transportType, string path) 440public async Task StreamAsyncCoreTest(string protocolName, HttpTransportType transportType, string path) 475public async Task CanStreamToHubWithIAsyncEnumerableMethodArg(string protocolName) 488await Task.Delay(10); 521public async Task StreamAsyncTest(string protocolName, HttpTransportType transportType, string path) 556public async Task StreamAsyncDoesNotStartIfTokenAlreadyCanceled(string protocolName, HttpTransportType transportType, string path) 593public async Task StreamAsyncCanBeCanceled(string protocolName, HttpTransportType transportType, string path) 635public async Task StreamAsyncWithException(string protocolName, HttpTransportType transportType, string path) 677public async Task CanInvokeClientMethodFromServer(string protocolName, HttpTransportType transportType, string path) 711public async Task InvokeNonExistantClientMethodFromServer(string protocolName, HttpTransportType transportType, string path) 728return Task.CompletedTask; 753public async Task CanStreamClientMethodFromServer(string protocolName, HttpTransportType transportType, string path) 783public async Task CanStreamToAndFromClientInSameInvocation(string protocolName, HttpTransportType transportType, string path) 820public async Task CanStreamToServerWithIAsyncEnumerable(string protocolName, HttpTransportType transportType, string path) 833await Task.Delay(10); 867public async Task CanCancelIAsyncEnumerableClientToServerUpload(string protocolName, HttpTransportType transportType, string path) 880await Task.Delay(10); 920public async Task StreamAsyncCanBeCanceledThroughGetAsyncEnumerator(string protocolName, HttpTransportType transportType, string path) 961public async Task CanCloseStreamMethodEarly(string protocolName, HttpTransportType transportType, string path) 1002public async Task StreamDoesNotStartIfTokenAlreadyCanceled(string protocolName, HttpTransportType transportType, string path) 1031public async Task ExceptionFromStreamingSentToClient(string protocolName, HttpTransportType transportType, string path) 1065public async Task ServerThrowsHubExceptionIfHubMethodCannotBeResolved(string hubProtocolName, HttpTransportType transportType, string hubPath) 1092public async Task ServerThrowsHubExceptionIfHubMethodCannotBeResolvedAndArgumentsPassedIn(string hubProtocolName, HttpTransportType transportType, string hubPath) 1119public async Task ServerThrowsHubExceptionOnHubMethodArgumentCountMismatch(string hubProtocolName) 1146public async Task ServerThrowsHubExceptionOnHubMethodArgumentTypeMismatch(string hubProtocolName, HttpTransportType transportType, string hubPath) 1173public async Task ServerThrowsHubExceptionIfStreamingHubMethodCannotBeResolved(string hubProtocolName, HttpTransportType transportType, string hubPath) 1201public async Task ServerThrowsHubExceptionOnStreamingHubMethodArgumentCountMismatch(string hubProtocolName, HttpTransportType transportType, string hubPath) 1229public async Task ServerThrowsHubExceptionOnStreamingHubMethodArgumentTypeMismatch(string hubProtocolName, HttpTransportType transportType, string hubPath) 1257public async Task ServerThrowsHubExceptionIfNonStreamMethodInvokedWithStreamAsync(string hubProtocolName, HttpTransportType transportType, string hubPath) 1284public async Task ServerThrowsHubExceptionIfStreamMethodInvokedWithInvoke(string hubProtocolName, HttpTransportType transportType, string hubPath) 1311public async Task ServerThrowsHubExceptionIfBuildingAsyncEnumeratorIsNotPossible(string hubProtocolName, HttpTransportType transportType, string hubPath) 1338public async Task ServerLogsErrorIfClientInvokeCannotBeSerialized(string protocolName) 1358connection.Closed += (ex) => { closedTcs.TrySetResult(ex); return Task.CompletedTask; }; 1392public async Task ServerLogsErrorIfReturnValueCannotBeSerialized(string protocolName) 1412connection.Closed += (ex) => { closedTcs.TrySetResult(ex); return Task.CompletedTask; }; 1445public async Task RandomGenericIsNotTreatedAsStream() 1466public async Task ClientCanUseJwtBearerTokenForAuthentication(HttpTransportType transportType) 1504public async Task ClientWillFailAuthEndPointIfNotAuthorized(HttpTransportType transportType, string hubPath) 1531public async Task ClientCanUseJwtBearerTokenForAuthenticationWhenRedirected(HttpTransportType transportType) 1559public async Task ClientCanSendHeaders(HttpTransportType transportType) 1590public async Task UserAgentIsSet() 1632public async Task UserAgentCanBeCleared() 1667public async Task UserAgentCanBeSet() 1703public async Task WebSocketOptionsAreApplied() 1738public async Task WebSocketsCanConnectOverHttp2() 1796public async Task TransportFallsbackFromHttp2WhenUsingCredentials(HttpTransportType httpTransportType) 1855public async Task WebSocketsFailsWhenHttp1NotAllowedAndUsingCredentials() 1898public async Task WebSocketsWithAccessTokenOverHttp2() 1931return Task.FromResult("test"); 1963public async Task CookiesFromNegotiateAreAppliedToWebSockets() 1990public async Task CheckHttpConnectionFeatures() 2026public async Task UserIdProviderCanAccessHttpContext() 2057public async Task NegotiationSkipsServerSentEventsWhenUsingBinaryProtocol() 2087public async Task StopCausesPollToReturnImmediately() 2110var stopTask = hubConnection.StopAsync(); 2129public async Task CanAutomaticallyReconnect(HttpTransportType transportType) 2155return Task.CompletedTask; 2161return Task.CompletedTask; 2190public async Task CanAutomaticallyReconnectAfterRedirect() 2215return Task.CompletedTask; 2221return Task.CompletedTask; 2250public async Task CanAutomaticallyReconnectAfterSkippingNegotiation() 2281return Task.CompletedTask; 2287return Task.CompletedTask; 2317public async Task CanBlockOnAsyncOperationsWithOneAtATimeSynchronizationContext(HttpTransportType transportType) 2331await Task.Yield(); 2354public async Task LongPollingUsesHttp2ByDefault() 2407public async Task LongPollingWorksWithHttp2OnlyEndpoint() 2450public async Task ServerSentEventsUsesHttp2ByDefault() 2500public async Task ServerSentEventsWorksWithHttp2OnlyEndpoint() 2543public async Task CanReconnectAndSendMessageWhileDisconnected() 2602public async Task CanReconnectAndSendMessageOnceConnected() 2631return Task.CompletedTask; 2672public async Task ChangingUserNameDuringReconnectLogsWarning() 2706return Task.CompletedTask; 2744public async Task ServerAbortsConnectionWithAckingEnabledNoReconnectAttempted() 2770return Task.CompletedTask; 2796public async Task CanSetMessageBufferSizeOnClient() 2839public async Task ServerWithOldProtocolVersionClientWithNewProtocolVersionWorksDoesNotAllowStatefulReconnect() 2877return Task.CompletedTask; 2918private readonly Task _runTask; 2924_runTask = Task.Run(Run); 2947private async Task Run()
HubProtocolVersionTests.cs (4)
37public async Task ClientUsingOldCallWithOriginalProtocol(HttpTransportType transportType) 69public async Task ClientUsingOldCallWithNewProtocol(HttpTransportType transportType) 102public async Task ClientUsingNewCallWithNewProtocol(HttpTransportType transportType) 163public async Task ClientWithUnsupportedProtocolVersionDoesNotConnect(HttpTransportType transportType)
Hubs.cs (15)
29public async Task CallEcho(string message) 34public async Task CallHandlerThatDoesntExist() 109public async Task CallWithUnserializableObject() 149public async Task CallEcho(string message) 154public async Task CallHandlerThatDoesntExist() 183public async Task CallEcho(string message) 188public async Task CallHandlerThatDoesntExist() 221Task.Run(async () => 226await Task.Delay(20); 245_ = Task.Run(async () => 269_ = Task.Run(async () => 293Task Echo(string message); 294Task Send(string message); 295Task NoClientHandler(); 302public Task NewProtocolMethodServer()
Microsoft.AspNetCore.SignalR.Client.Tests (524)
HttpConnectionFactoryTests.cs (5)
26public async Task ConnectionIsDisposedIfItFailsToStartAsync() 29testHandler.OnRequest((req, next, ct) => Task.FromException<HttpResponseMessage>(new Exception("BOOM"))); 47public async Task DoesNotSupportNonUriEndPoints() 59public async Task OptionsUrlMustMatchEndPointIfSet() 80Func<Task<string>> tokenProvider = () => Task.FromResult("");
HttpConnectionTests.ConnectionLifecycle.cs (32)
25public async Task CanStartStartedConnection() 38public async Task CanStartStartingConnection() 46var firstStart = connection.StartAsync(); 48var secondStart = connection.StartAsync(); 58public async Task CannotStartConnectionOnceDisposed() 80public async Task TransportThatFailsToStartFallsBack(int passThreshold) 102Task OnTransportStart() 108return Task.FromException(expected); 112return Task.CompletedTask; 131public async Task StartThrowsAfterAllTransportsFail() 144Task OnTransportStart() 147return Task.FromException(expected); 174public async Task CanDisposeUnstartedConnection() 188public async Task CanDisposeStartingConnection() 201var startTask = connection.StartAsync(); 222public async Task CanDisposeDisposingConnection() 257public async Task TransportIsStoppedWhenConnectionIsDisposed() 281public async Task TransportPipeIsCompletedWhenErrorOccursInTransport() 307return Task.FromResult(ResponseUtils.CreateResponse(HttpStatusCode.InternalServerError)); 323public async Task SSEWontStartIfSuccessfulConnectionIsNotEstablished() 337return Task.FromResult(ResponseUtils.CreateResponse(HttpStatusCode.InternalServerError)); 353public async Task SSEWaitsForResponseToStart() 372var startTask = connection.StartAsync(); 382public async Task CanCancelStartingConnectionAfterNegotiate() 407var startTask = connection.StartAsync(cts.Token); 428public async Task CancellationTokenFromStartPassedToTransport() 441return Task.CompletedTask; 457public async Task CanceledCancellationTokenPassedToStartThrows() 469return Task.CompletedTask; 481public async Task SSECanBeCanceled() 510public async Task LongPollingTransportCanBeCanceled() 535private static async Task AssertDisposedAsync(HttpConnection connection)
HttpConnectionTests.cs (3)
72public async Task HttpOptionsSetOntoHttpClientHandler() 126public async Task HttpRequestAndErrorResponseLogged() 167public async Task NegotiateAsyncAppendsCorrectAcceptHeader()
HttpConnectionTests.Helpers.cs (2)
70private static async Task WithConnectionAsync(HttpConnection connection, Func<HttpConnection, Task> body)
HttpConnectionTests.Negotiate.cs (20)
29public Task StartThrowsFormatExceptionIfNegotiationResponseIsInvalid(string negotiatePayload) 35public Task StartThrowsFormatExceptionIfNegotiationResponseHasNoConnectionId() 41public Task NegotiateResponseWithNegotiateVersionRequiresConnectionToken() 47public Task ConnectionCannotBeStartedIfNoCommonTransportsBetweenClientAndServer() 54public Task ConnectionCannotBeStartedIfNoTransportProvidedByServer() 66public async Task CorrectlyHandlesQueryStringWhenAppendingNegotiateToUrl(string requestedUrl, string expectedNegotiate) 94public async Task NegotiateReturnedConnectionIdIsSetOnConnection() 130public async Task NegotiateCanHaveNewFields() 167public async Task ConnectionIdGetsSetWithNegotiateProtocolGreaterThanZero() 208public async Task ConnectionTokenFieldIsIgnoredForNegotiateIdLessThanOne() 248public async Task NegotiateThatReturnsUrlGetFollowed() 308public async Task NegotiateThatReturnsRedirectUrlForeverThrowsAfter100Tries() 333public async Task NegotiateThatReturnsUrlGetFollowedWithAccessToken() 383return Task.FromResult(ResponseUtils.CreateResponse(HttpStatusCode.Unauthorized)); 394Task<string> AccessTokenProvider() => Task.FromResult<string>("firstSecret"); 415public async Task NegotiateThatReturnsRedirectUrlDoesNotAddAnotherNegotiateVersionQueryString() 477public async Task StartSkipsOverTransportsThatTheClientDoesNotUnderstand() 526public async Task StartSkipsOverTransportsThatDoNotSupportTheRequiredTransferFormat() 572public async Task NegotiateThatReturnsErrorThrowsFromStart() 602private async Task RunInvalidNegotiateResponseTest<TException>(string negotiatePayload, string expectedExceptionMessage) where TException : Exception
HttpConnectionTests.Transport.cs (33)
31public async Task HttpConnectionSetsAccessTokenOnAllRequests(HttpTransportType transportType) 56return Task.FromResult(ResponseUtils.CreateResponse(HttpStatusCode.NoContent)); 62return Task.FromResult(callCount.ToString(CultureInfo.InvariantCulture)); 81public async Task HttpConnectionSetsInherentKeepAliveFeature(HttpTransportType transportType, bool expectedValue) 89testHttpHandler.OnRequest((request, next, token) => Task.FromResult(ResponseUtils.CreateResponse(HttpStatusCode.NoContent))); 107public async Task HttpConnectionSetsUserAgentOnAllRequests(HttpTransportType transportType) 138return Task.FromResult(ResponseUtils.CreateResponse(HttpStatusCode.NoContent)); 155public async Task HttpConnectionSetsRequestedWithOnAllRequests(HttpTransportType transportType) 178return Task.FromResult(ResponseUtils.CreateResponse(HttpStatusCode.NoContent)); 193public async Task CanReceiveData() 223public async Task CanSendData() 237return Task.FromResult(ResponseUtils.CreateResponse(HttpStatusCode.Accepted)); 255public Task SendThrowsIfConnectionIsNotStarted() 268public Task TransportPipeCannotBeAccessedAfterConnectionIsDisposed() 284public Task TransportIsShutDownAfterDispose() 301public Task StartAsyncTransferFormatOverridesOptions() 316public async Task HttpConnectionFailsOnNegotiateWhenAuthFails() 331return Task.FromResult(accessTokenCallCount.ToString(CultureInfo.InvariantCulture)); 345public async Task HttpConnectionRetriesAccessTokenProviderWhenAuthFailsLongPolling() 386return Task.FromResult(ResponseUtils.CreateResponse(HttpStatusCode.Unauthorized)); 395return Task.FromResult(ResponseUtils.CreateResponse(HttpStatusCode.OK)); 401return Task.FromResult(accessTokenCallCount.ToString(CultureInfo.InvariantCulture)); 421public async Task HttpConnectionFailsAfterFirstRetryFailsLongPolling() 439return Task.FromResult(accessTokenCallCount.ToString(CultureInfo.InvariantCulture)); 455public async Task HttpConnectionRetriesAccessTokenProviderWhenAuthFailsServerSentEvents() 486return Task.FromResult(ResponseUtils.CreateResponse(HttpStatusCode.Unauthorized)); 493return Task.FromResult(ResponseUtils.CreateResponse(HttpStatusCode.OK, new StreamContent(stream))); 499return Task.FromResult(accessTokenCallCount.ToString(CultureInfo.InvariantCulture)); 517public async Task HttpConnectionFailsAfterFirstRetryFailsServerSentEvents() 536return Task.FromResult(ResponseUtils.CreateResponse(HttpStatusCode.OK, new StreamContent(stream))); 542return Task.FromResult(accessTokenCallCount.ToString(CultureInfo.InvariantCulture)); 571public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) 600public override async Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
HubClientProxyGeneratorTests.cs (24)
31Task ReturnTask(); 55public Task ReturnTask() 58return Task.CompletedTask; 78It.IsAny<Func<object[], object, Task>>(), 86It.IsAny<Func<object[], object, Task>>(), 94It.IsAny<Func<object[], object, Task>>(), 102It.IsAny<Func<object[], object, Task>>(), 129It.IsAny<Func<object[], object, Task>>(), 137It.IsAny<Func<object[], object, Task>>(), 145It.IsAny<Func<object[], object, Task>>(), 153It.IsAny<Func<object[], object, Task>>(), 171public async Task CallbacksGetTriggered() 176Func<object[], object, Task> noArgFunc = null; 182It.IsAny<Func<object[], object, Task>>(), 185(string methodName, Type[] parameterTypes, Func<object[], object, Task> handler, object state) => 191Func<object[], object, Task> singleArgFunc = null; 198It.IsAny<Func<object[], object, Task>>(), 201(string methodName, Type[] parameterTypes, Func<object[], object, Task> handler, object state) => 207Func<object[], object, Task> manyArgsFunc = null; 214It.IsAny<Func<object[], object, Task>>(), 217(string methodName, Type[] parameterTypes, Func<object[], object, Task> handler, object state) => 224Func<object[], object, Task> returnTaskFunc = null; 230It.IsAny<Func<object[], object, Task>>(), 233(string methodName, Type[] parameterTypes, Func<object[], object, Task> handler, object state) =>
HubConnectionTests.ConnectionLifecycle.cs (44)
28private static readonly IDictionary<string, Func<HubConnection, Task>> MethodsThatRequireActiveConnection = new Dictionary<string, Func<HubConnection, Task>>() 38public async Task StartAsyncStartsTheUnderlyingConnection() 52public async Task StartAsyncThrowsIfPreviousStartIsAlreadyStarting() 58var firstStart = connection.StartAsync(); 65var secondStart = connection.StartAsync(); 78public async Task StartingAfterStopCreatesANewConnection() 109public async Task StartingDuringStopCreatesANewConnection() 129var stopTask = connection.StopAsync(); 136var startTask = connection.StartAsync(); 149public async Task StartAsyncWithFailedHandshakeCanBeStopped() 192public async Task MethodsThatRequireStartedConnectionFailIfConnectionNotYetStarted(string name) 206public async Task MethodsThatRequireStartedConnectionWaitForStartIfConnectionIsCurrentlyStarting(string name) 215var startTask = connection.StartAsync(); 220var targetTask = method(connection); 240public async Task StatusIsNotConnectedUntilStartAsyncIsFinished() 247var startTask = connection.StartAsync(); 264public async Task StatusIsDisconnectedInCloseEvent() 274return Task.CompletedTask; 292public async Task StopAsyncStopsConnection() 306public async Task StopAsyncNoOpsIfConnectionNotYetStarted() 317public async Task StopAsyncNoOpsIfConnectionAlreadyStopped() 338public async Task StopAsyncOnInactiveConnectionDoesNotAffectNextStartAsync() 358public async Task CompletingTheTransportSideMarksConnectionAsClosed() 367return Task.CompletedTask; 383public async Task TransportCompletionWhileShuttingDownIsNoOp() 392return Task.CompletedTask; 399var stopTask = connection.StopAsync(); 422public async Task StopAsyncDuringUnderlyingConnectionCloseWaitsAndNoOps() 431return Task.CompletedTask; 441var stopTask = connection.StopAsync(); 457public async Task MethodsThatRequireActiveConnectionWaitForStopAndFailIfConnectionIsCurrentlyStopping(string methodName) 469var disposeTask = connection.StopAsync(); 474var targetTask = method(connection); 488public async Task ClientTimesoutWhenHandshakeResponseTakesTooLong() 530public async Task StartAsyncWithTriggeredCancellationTokenIsCanceled() 538return Task.CompletedTask; 555public async Task StartAsyncCanTriggerCancellationTokenToCancelHandshake() 588var startTask = hubConnection.StartAsync(cts.Token); 607public async Task HubConnectionClosesWithErrorIfTerminatedWithPartialMessage() 621return Task.CompletedTask; 633private static async Task ForceLastInvocationToComplete(TestConnection testConnection) 646private static async Task AsyncUsing(HubConnection connection, Func<HubConnection, Task> action)
HubConnectionTests.cs (54)
26public async Task InvokeThrowsIfSerializingMessageFails() 46public async Task SendAsyncThrowsIfSerializingMessageFails() 61public async Task ClosedEventRaisedWhenTheClientIsStopped() 74return Task.CompletedTask; 83public async Task StopAsyncCanBeCalledFromOnHandler() 103public async Task StopAsyncDoesNotWaitForOnHandlers() 127public async Task PendingInvocationsAreCanceledWhenConnectionClosesCleanly() 142public async Task PendingInvocationsAreTerminatedWithExceptionWhenTransportCompletesWithError() 167public async Task PendingInvocationsAreCanceledWhenTokenTriggered() 183public async Task InvokeAsyncCanceledWhenPassedCanceledToken() 202public async Task SendAsyncCanceledWhenPassedCanceledToken() 221public async Task SendAsyncCanceledWhenTokenCanceledDuringSend() 233var sendTask = hubConnection.SendAsync("testMethod", new byte[100], cts.Token); 244public async Task StreamAsChannelAsyncCanceledWhenPassedCanceledToken() 263public async Task StreamAsyncCanceledWhenPassedCanceledToken() 282public async Task CanCancelTokenAfterStreamIsCompleted() 312public async Task CanCancelTokenDuringStream_SendsCancelInvocation() 346public async Task ConnectionTerminatedIfServerTimeoutIntervalElapsesWithNoMessages() 362return Task.CompletedTask; 375public async Task ServerTimeoutIsDisabledWhenUsingTransportWithInherentKeepAlive() 390return Task.CompletedTask; 403public async Task PendingInvocationsAreTerminatedIfServerTimeoutIntervalElapsesWithNoMessages() 419var invokeTask = hubConnection.InvokeAsync("Method").DefaultTimeout(); 430public async Task StreamIntsToServer() 470public async Task StreamIntsToServerViaSend() 479var sendTask = hubConnection.SendAsync("SomeMethod", channel.Reader); 501public async Task StreamsObjectsToServer() 545public async Task UploadStreamCancellationSendsStreamComplete() 577public async Task UploadStreamErrorSendsStreamComplete() 603public async Task ActiveUploadStreamWhenConnectionClosesObservesException() 637public async Task InvocationCanCompleteBeforeStreamCompletes() 663public async Task WrongTypeOnServerResponse() 702public async Task CanAwaitInvokeFromOnHandlerWithServerClosingConnection() 732return Task.CompletedTask; 748public async Task CanAwaitUsingHubConnection() 759public async Task VerifyUserOptionsAreNotChanged() 764var accessTokenFactory = new Func<Task<string>>(() => Task.FromResult("fakeAccessToken")); 807public async Task ClientResultResponseAfterConnectionCloseObservesException() 842public async Task HubConnectionIsMockable() 847mockConnection.Setup(c => c.StartAsync(default)).Returns(() => Task.CompletedTask); 848mockConnection.Setup(c => c.StopAsync(default)).Returns(() => Task.CompletedTask); 850mockConnection.Setup(c => c.On(It.IsAny<string>(), It.IsAny<Type[]>(), It.IsAny<Func<object[], object, Task>>(), It.IsAny<object>())); 853.Returns(() => Task.FromResult(It.IsAny<ChannelReader<object>>())); 854mockConnection.Setup(c => c.InvokeCoreAsync(It.IsAny<string>(), It.IsAny<Type>(), It.IsAny<object[]>(), It.IsAny<CancellationToken>())).Returns(() => Task.FromResult(It.IsAny<object>())); 855mockConnection.Setup(c => c.SendCoreAsync(It.IsAny<string>(), It.IsAny<object[]>(), It.IsAny<CancellationToken>())).Returns(() => Task.CompletedTask); 862_ = hubConnection.On("someMethod2", new Type[] { typeof(int) }, (args, obj) => Task.CompletedTask, 2); 871mockConnection.Verify(c => c.On("someMethod", It.IsAny<Type[]>(), It.IsAny<Func<object[], object, Task>>(), It.IsAny<object>()), Times.Once); 872mockConnection.Verify(c => c.On("someMethod2", It.IsAny<Type[]>(), It.IsAny<Func<object[], object, Task>>(), 2), Times.Once); 883public async Task DisableReconnectCalledWhenCloseMessageReceived() 901return Task.CompletedTask; 915public async Task DisableReconnectCalledWhenSendingCloseMessage() 933return Task.CompletedTask; 1037public Task DisableReconnectCalled => _disableReconnect.Task; 1040public void OnReconnected(Func<PipeWriter, Task> notifyOnReconnected) { }
HubConnectionTests.Extensions.cs (56)
17public async Task On() 26public async Task OnAsync() 33return Task.CompletedTask; 39public async Task OnT1() 48public async Task OnT1Async() 55return Task.CompletedTask; 61public async Task OnT2() 70public async Task OnT2Async() 77return Task.CompletedTask; 83public async Task OnT3() 92public async Task OnT3Async() 99return Task.CompletedTask; 105public async Task OnT4() 114public async Task OnT4Async() 121return Task.CompletedTask; 127public async Task OnT5() 136public async Task OnT5Async() 143return Task.CompletedTask; 149public async Task OnT6() 158public async Task OnT6Async() 165return Task.CompletedTask; 171public async Task OnT7() 180public async Task OnT7Async() 187return Task.CompletedTask; 193public async Task OnT8() 202public async Task OnT8Async() 209return Task.CompletedTask; 214private async Task InvokeOn(Action<HubConnection, TaskCompletionSource<object[]>> onAction, object[] args) 242public async Task ConnectionNotClosedOnCallbackArgumentCountMismatch() 280public async Task ConnectionNotClosedOnAsyncCallbackArgumentCountMismatch() 291return Task.CompletedTask; 322public async Task ConnectionNotClosedOnCallbackArgumentTypeMismatch() 360public async Task ConnectionNotClosedOnAsyncCallbackArgumentTypeMismatch() 371return Task.CompletedTask; 402public async Task OnWithResult() 417public async Task OnAsyncWithResult() 425await Task.CompletedTask; 433public async Task OnT1WithResult() 448public async Task OnT1AsyncWithResult() 456await Task.CompletedTask; 465public async Task OnT2WithResult() 480public async Task OnT2AsyncWithResult() 488return Task.FromResult(returnResult); 495public async Task OnT3WithResult() 510public async Task OnT3AsyncWithResult() 518return Task.FromResult(returnResult); 525public async Task OnT4WithResult() 540public async Task OnT4AsyncWithResult() 555public async Task OnT5WithResult() 570public async Task OnT5AsyncWithResult() 585public async Task OnT6WithResult() 600public async Task OnT6AsyncWithResult() 615public async Task OnT7WithResult() 630public async Task OnT7AsyncWithResult() 645public async Task OnT8WithResult() 660public async Task OnT8AsyncWithResult()
HubConnectionTests.Protocol.cs (46)
22public async Task SendAsyncSendsANonBlockingInvocationMessage() 30var invokeTask = hubConnection.SendAsync("Foo").DefaultTimeout(); 47public async Task ClientSendsHandshakeMessageWhenStartingConnection() 54var startTask = hubConnection.StartAsync(); 71public async Task InvalidHandshakeResponseCausesStartToFail() 80var startTask = hubConnection.StartAsync(); 100public async Task ClientIsOkayReceivingMinorVersionInHandshake() 109var startTask = hubConnection.StartAsync(); 122public async Task InvokeSendsAnInvocationMessage() 130var invokeTask = hubConnection.InvokeAsync("Foo"); 147public async Task ReceiveCloseMessageWithoutErrorWillCloseHubConnection() 156return Task.CompletedTask; 176public async Task ReceiveCloseMessageWithErrorWillCloseHubConnection() 185return Task.CompletedTask; 205public async Task StreamSendsAnInvocationMessage() 232public async Task InvokeCompletedWhenCompletionMessageReceived() 240var invokeTask = hubConnection.InvokeAsync("Foo"); 254public async Task StreamCompletesWhenCompletionMessageIsReceived() 276public async Task InvokeYieldsResultWhenCompletionMessageReceived() 298public async Task InvokeFailsWithExceptionWhenCompletionWithErrorReceived() 321public async Task StreamFailsIfCompletionMessageHasPayload() 344public async Task StreamFailsWithExceptionWhenCompletionWithErrorReceived() 367public async Task InvokeFailsWithErrorWhenStreamingItemReceived() 390public async Task StreamYieldsItemsAsTheyArrive() 417public async Task HandlerRegisteredWithOnIsFiredWhenInvocationReceived() 441public async Task HandlerIsRemovedProperlyWithOff() 473public async Task DisposingSubscriptionAfterCallingRemoveHandlerDoesntFail() 507public async Task AcceptsPingMessages() 517var invokeTask = hubConnection.InvokeAsync("Foo"); 536public async Task PartialHandshakeResponseWorks() 542var task = hubConnection.StartAsync(); 564public async Task HandshakeAndInvocationInSameBufferWorks() 592public async Task PartialInvocationWorks() 628public async Task ClientPingsMultipleTimes() 654public async Task ClientWithInherentKeepAliveDoesNotPing() 666await Task.Delay(1000); 683public async Task ClientCanReturnResult() 707public async Task ThrowsWhenMultipleReturningHandlersRegistered() 728public async Task ClientReturnHandlerCanMixWithNonReturnHandler() 755public async Task ClientCanThrowErrorResult() 782public async Task ClientResultIgnoresErrorWhenLastHandlerSuccessful() 811public async Task ClientResultReturnsErrorIfNoHandlerFromClient() 833public async Task ClientResultReturnsErrorIfNoResultFromClient() 858public async Task ClientResultReturnsErrorIfCannotParseArgument() 883public async Task ClientResultCanReturnNullResult() 908public async Task ClientResultHandlerDoesNotBlockOtherHandlers()
HubConnectionTests.Reconnect.cs (61)
29public async Task IsNotEnabledByDefault() 51return Task.CompletedTask; 57return Task.CompletedTask; 70public async Task CanBeOptedInto() 89async Task OnTestConnectionStart() 135return Task.CompletedTask; 142return Task.CompletedTask; 148return Task.CompletedTask; 184public async Task StopsIfTheReconnectPolicyReturnsNull() 200Task OnTestConnectionStart() 210return Task.CompletedTask; 235return Task.CompletedTask; 241return Task.CompletedTask; 247return Task.CompletedTask; 279public async Task HasCorrectRetryNumberAfterRetriesExhausted() 295Task OnTestConnectionStart() 305return Task.CompletedTask; 330return Task.CompletedTask; 336return Task.CompletedTask; 342return Task.CompletedTask; 376public async Task CanHappenMultipleTimes() 411return Task.CompletedTask; 418return Task.CompletedTask; 424return Task.CompletedTask; 472public async Task CanBeInducedByCloseMessageWithAllowReconnectSet() 509return Task.CompletedTask; 516return Task.CompletedTask; 522return Task.CompletedTask; 556public async Task CannotBeInducedByCloseMessageWithAllowReconnectOmitted() 591return Task.CompletedTask; 597return Task.CompletedTask; 618public async Task EventsNotFiredIfFirstRetryDelayIsNull() 644return Task.CompletedTask; 650return Task.CompletedTask; 656return Task.CompletedTask; 672public async Task DoesNotStartIfConnectionIsLostDuringInitialHandshake() 699return Task.CompletedTask; 705return Task.CompletedTask; 711return Task.CompletedTask; 714var startTask = hubConnection.StartAsync().DefaultTimeout(); 728public async Task ContinuesIfConnectionLostDuringReconnectHandshake() 772return Task.CompletedTask; 779return Task.CompletedTask; 785return Task.CompletedTask; 788var startTask = hubConnection.StartAsync(); 834public async Task ContinuesIfInvalidHandshakeResponse() 879return Task.CompletedTask; 886return Task.CompletedTask; 892return Task.CompletedTask; 895var startTask = hubConnection.StartAsync(); 954public async Task CanBeStoppedWhileRestartingUnderlyingConnection() 970async Task OnTestConnectionStart() 1004return Task.CompletedTask; 1010return Task.CompletedTask; 1016return Task.CompletedTask; 1033var stopTask = hubConnection.StopAsync(); 1045public async Task CanBeStoppedDuringRetryDelay() 1082return Task.CompletedTask; 1088return Task.CompletedTask; 1094return Task.CompletedTask; 1155public async Task DisposeAsync(ConnectionContext connection)
HubServerProxyGeneratorTests.cs (26)
31Task GetNothing(); 39Task StreamFromClientViaChannel(ChannelReader<int> reader); 40Task StreamFromClientViaEnumerable(IAsyncEnumerable<int> reader); 52public async Task GetNothing() 62.Returns(Task.FromResult(default(object))); 74public async Task GetScalar() 84.Returns(Task.FromResult((object)10)); 97public async Task GetCollection() 107.Returns(Task.FromResult((object)new List<int> { 10 })); 123public async Task SetScalar() 133.Returns(Task.FromResult((object)10)); 146public async Task SetCollection() 157.Returns(Task.FromResult((object)new List<int> { 10 })); 171public async Task StreamToClient() 186.Returns(Task.FromResult(channel.Reader)); 193.Returns(Task.FromResult(channel.Reader)); 213public async Task StreamFromClient() 226.Returns(Task.CompletedTask); 232.Returns(Task.CompletedTask); 239.Returns(Task.FromResult((object)6)); 254public async Task BidirectionalStream() 273.Returns(Task.FromResult(retChannelReader)); 280.Returns(Task.FromResult(retChannelReader)); 307public async Task ReturnValueTask() 317.Returns(Task.FromResult(default(object))); 324.Returns(Task.FromResult((object)10));
LongPollingTransportTests.cs (39)
31public async Task LongPollingTransportStopsPollAndSendLoopsWhenTransportStopped() 38await Task.Yield(); 42Task transportActiveTask; 66public async Task LongPollingTransportStopsWhenPollReceives204() 73await Task.Yield(); 99public async Task LongPollingTransportResponseWithNoContentDoesNotStopPoll() 107await Task.Yield(); 155public async Task LongPollingTransportStartAsyncFailsIfFirstRequestFails() 162await Task.Yield(); 182public async Task LongPollingTransportStopsWhenPollRequestFails() 190await Task.Yield(); 209async Task ReadAsync() 226public async Task StopTransportWhenConnectionAlreadyStoppedOnServer() 236await Task.Yield(); 263var stopTask = longPollingTransport.StopAsync(); 273public async Task LongPollingTransportStopsWhenSendRequestFails() 281await Task.Yield(); 322public async Task LongPollingTransportShutsDownWhenChannelIsClosed() 330await Task.Yield(); 365public async Task LongPollingTransportShutsDownImmediatelyEvenIfServerDoesntCompletePoll() 372await Task.Yield(); 398public async Task LongPollingTransportDispatchesMessagesReceivedFromPoll() 411await Task.Yield(); 455public async Task LongPollingTransportSendsAvailableMessagesWhenTheyArrive() 466await Task.Yield(); 522public async Task LongPollingTransportSendsDeleteAfterPollEnds() 534await Task.Yield(); 572var task = longPollingTransport.StopAsync(); 583public async Task LongPollingTransportSetsTransferFormat(TransferFormat transferFormat) 590await Task.Yield(); 612public async Task LongPollingTransportThrowsForInvalidTransferFormat(TransferFormat transferFormat) 619await Task.Yield(); 635public async Task LongPollingTransportRePollsIfRequestCanceled() 645await Task.Yield(); 670var completedTask = await Task.WhenAny(completionTcs.Task, longPollingTransport.Running).DefaultTimeout(); 681public async Task SendsDeleteRequestWhenTransportCompleted() 699public async Task PollRequestsContainCorrectAcceptHeader() 733return await Task.FromResult(new HttpResponseMessage(HttpStatusCode.OK)); 741var startTask = transport.StartAsync(TestUri, TransferFormat.Text);
SendUtilsTests.cs (1)
17public async Task SendMessagesSetsCorrectAcceptHeader()
ServerSentEventsParserTests.cs (3)
103public async Task ParseMessageAcrossMultipleReadsSuccess(string[] messageParts, string expectedMessage) 140public async Task ParseMessageAcrossMultipleReadsFailure(string encodedMessagePart1, string encodedMessagePart2, string expectedMessage) 165public async Task ParseMultipleMessagesText(string message1, string message2)
ServerSentEventsTransportTests.cs (22)
28public async Task CanStartStopSSETransport() 38await Task.Yield(); 72public async Task SSETransportStopsSendAndReceiveLoopsWhenTransportStopped() 90await Task.Delay(100); 95return Task.FromResult(new HttpResponseMessage { Content = new StreamContent(mockStream.Object) }); 103Task transportActiveTask; 124public async Task SSETransportStopsWithErrorIfServerSendsIncompleteResults() 132await Task.Yield(); 168public async Task SSETransportStopsWithErrorIfSendingMessageFails() 184await Task.Yield(); 229public async Task SSETransportStopsIfChannelClosed() 239await Task.Yield(); 275public async Task SSETransportStopsIfTheServerClosesTheStream() 282await Task.Yield(); 302public async Task SSETransportCancelsSendOnStop() 313await Task.Yield(); 354var stopTask = sseTransport.StopAsync(); 364public async Task SSETransportDoesNotSupportBinary() 371await Task.Yield(); 391public async Task SSETransportThrowsForInvalidTransferFormat(TransferFormat transferFormat) 398await Task.Yield(); 415public async Task StartAsyncSetsCorrectAcceptHeaderForSSE()
src\Shared\SyncPoint\SyncPoint.cs (5)
18public Task WaitForSyncPoint() => _atSyncPoint.Task; 32public Task WaitToContinue() 38public static Func<Task> Create(out SyncPoint syncPoint) 51public static Func<Task> Create(int count, out SyncPoint[] syncPoints) 67return Task.CompletedTask;
src\SignalR\common\Shared\MemoryBufferWriter.cs (4)
138public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) 191private async Task CopyToSlowAsync(Stream destination, CancellationToken cancellationToken) 277public override Task FlushAsync(CancellationToken cancellationToken) => Task.CompletedTask;
TestConnection.cs (11)
29public Task Started => _started.Task; 30public Task Disposed => _disposed.Task; 32private readonly Func<Task> _onStart; 33private readonly Func<Task> _onDispose; 48public TestConnection(Func<Task> onStart = null, Func<Task> onDispose = null, bool autoHandshake = true, bool hasInherentKeepAlive = false, PipeOptions pipeOptions = null) 51_onStart = onStart ?? (() => Task.CompletedTask); 52_onDispose = onDispose ?? (() => Task.CompletedTask); 104public Task ReceiveJsonMessage(object jsonObject) 112public Task ReceiveTextAsync(string rawText) 117public Task ReceiveBytesAsync(byte[] bytes)
TestHttpMessageHandler.cs (8)
80await Task.Yield(); 126return Task.FromResult(ResponseUtils.CreateResponse(HttpStatusCode.Accepted)); 175public void OnNegotiate(Func<HttpRequestMessage, CancellationToken, HttpResponseMessage> handler) => OnNegotiate((req, cancellationToken) => Task.FromResult(handler(req, cancellationToken))); 192public void OnLongPollDelete(Func<CancellationToken, HttpResponseMessage> handler) => OnLongPollDelete((cancellationToken) => Task.FromResult(handler(cancellationToken))); 209public void OnLongPoll(Func<CancellationToken, HttpResponseMessage> handler) => OnLongPoll(cancellationToken => Task.FromResult(handler(cancellationToken))); 218OnLongPoll((request, token) => Task.FromResult(handler(request, token))); 236public void OnSocketSend(Func<byte[], CancellationToken, HttpResponseMessage> handler) => OnSocketSend((data, cancellationToken) => Task.FromResult(handler(data, cancellationToken))); 256return Task.FromException<HttpResponseMessage>(new InvalidOperationException($"Http endpoint not implemented: {request.Method} {request.RequestUri}"));
TestServerTests.cs (3)
18public async Task WebSocketsWorks() 70public async Task LongPollingWorks() 116public Task Echo(string message)
TestTransport.cs (12)
16private readonly Func<Task> _stopHandler; 17private readonly Func<Task> _startHandler; 21public Task Receiving { get; private set; } 29public TestTransport(Func<Task> onTransportStop = null, Func<Task> onTransportStart = null, TransferFormat transferFormat = TransferFormat.Text) 31_stopHandler = onTransportStop ?? new Func<Task>(() => Task.CompletedTask); 32_startHandler = onTransportStart ?? new Func<Task>(() => Task.CompletedTask); 36public async Task StartAsync(Uri url, TransferFormat transferFormat, CancellationToken cancellationToken = default) 55async Task ReceiveLoop() 85public Task StopAsync()
TimerAwaitableTests.cs (2)
16public async Task FinalizerRunsIfTimerAwaitableReferencesObject() 49public async Task Start()
WebSocketsTransportTests.cs (8)
17public async Task StopCancelsSendAndReceive() 30var webSocketsTransport = new WebSocketsTransport(options, loggerFactory: LoggerFactory, () => Task.FromResult<string>(null), null); 43public Task ConnectAsync(Uri uri, CancellationToken cancellationToken) => Task.CompletedTask; 55public override Task CloseAsync(WebSocketCloseStatus closeStatus, string statusDescription, CancellationToken cancellationToken) 56=> Task.CompletedTask; 58public override async Task CloseOutputAsync(WebSocketCloseStatus closeStatus, string statusDescription, CancellationToken cancellationToken) 73public override async Task SendAsync(ArraySegment<byte> buffer, WebSocketMessageType messageType, bool endOfMessage, CancellationToken cancellationToken)
Microsoft.AspNetCore.SignalR.Common (4)
src\SignalR\common\Shared\MemoryBufferWriter.cs (4)
138public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) 191private async Task CopyToSlowAsync(Stream destination, CancellationToken cancellationToken) 277public override Task FlushAsync(CancellationToken cancellationToken) => Task.CompletedTask;
Microsoft.AspNetCore.SignalR.Common.Tests (2)
Internal\Protocol\MemoryBufferWriterTests.cs (2)
229public async Task CopyToAsyncWithExactlyFullSegmentsWorks() 247public async Task CopyToAsyncWithSomeFullSegmentsWorks()
Microsoft.AspNetCore.SignalR.Core (194)
ClientProxyExtensions.cs (33)
20/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns> 22public static Task SendAsync(this IClientProxy clientProxy, string method, CancellationToken cancellationToken = default) 35/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns> 37public static Task SendAsync(this IClientProxy clientProxy, string method, object? arg1, CancellationToken cancellationToken = default) 51/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns> 53public static Task SendAsync(this IClientProxy clientProxy, string method, object? arg1, object? arg2, CancellationToken cancellationToken = default) 68/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns> 70public static Task SendAsync(this IClientProxy clientProxy, string method, object? arg1, object? arg2, object? arg3, CancellationToken cancellationToken = default) 86/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns> 88public static Task SendAsync(this IClientProxy clientProxy, string method, object? arg1, object? arg2, object? arg3, object? arg4, CancellationToken cancellationToken = default) 105/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns> 107public static Task SendAsync(this IClientProxy clientProxy, string method, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, CancellationToken cancellationToken = default) 125/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns> 127public static Task SendAsync(this IClientProxy clientProxy, string method, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, CancellationToken cancellationToken = default) 146/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns> 148public static Task SendAsync(this IClientProxy clientProxy, string method, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, CancellationToken cancellationToken = default) 168/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns> 170public static Task SendAsync(this IClientProxy clientProxy, string method, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, object? arg8, CancellationToken cancellationToken = default) 191/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns> 193public static Task SendAsync(this IClientProxy clientProxy, string method, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, object? arg8, object? arg9, CancellationToken cancellationToken = default) 215/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns> 217public static Task SendAsync(this IClientProxy clientProxy, string method, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, object? arg8, object? arg9, object? arg10, CancellationToken cancellationToken = default) 228/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns> 242/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns> 257/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns> 273/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns> 290/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns> 308/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns> 327/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns> 347/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns> 368/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns> 390/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns> 413/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns>
DefaultHubLifetimeManager.cs (40)
34public override Task AddToGroupAsync(string connectionId, string groupName, CancellationToken cancellationToken = default) 42return Task.CompletedTask; 51return Task.CompletedTask; 63return Task.CompletedTask; 67public override Task RemoveFromGroupAsync(string connectionId, string groupName, CancellationToken cancellationToken = default) 75return Task.CompletedTask; 84return Task.CompletedTask; 90return Task.CompletedTask; 94public override Task SendAllAsync(string methodName, object?[] args, CancellationToken cancellationToken = default) 99private Task SendToAllConnections(string methodName, object?[] args, Func<HubConnectionContext, object?, bool>? include, object? state = null, CancellationToken cancellationToken = default) 101List<Task>? tasks = null; 123tasks = new List<Task>(); 138return Task.CompletedTask; 142return Task.WhenAll(tasks); 147private static void SendToGroupConnections(string methodName, object?[] args, ConcurrentDictionary<string, HubConnectionContext> connections, Func<HubConnectionContext, object?, bool>? include, object? state, ref List<Task>? tasks, ref SerializedHubMessage? message, CancellationToken cancellationToken) 168tasks = new List<Task>(); 183public override Task SendConnectionAsync(string connectionId, string methodName, object?[] args, CancellationToken cancellationToken = default) 191return Task.CompletedTask; 202public override Task SendGroupAsync(string groupName, string methodName, object?[] args, CancellationToken cancellationToken = default) 211List<Task>? tasks = null; 217return Task.WhenAll(tasks); 221return Task.CompletedTask; 225public override Task SendGroupsAsync(IReadOnlyList<string> groupNames, string methodName, object?[] args, CancellationToken cancellationToken = default) 228List<Task>? tasks = null; 247return Task.WhenAll(tasks); 250return Task.CompletedTask; 254public override Task SendGroupExceptAsync(string groupName, string methodName, object?[] args, IReadOnlyList<string> excludedConnectionIds, CancellationToken cancellationToken = default) 261List<Task>? tasks = null; 268return Task.WhenAll(tasks); 272return Task.CompletedTask; 286public override Task SendUserAsync(string userId, string methodName, object?[] args, CancellationToken cancellationToken = default) 292public override Task OnConnectedAsync(HubConnectionContext connection) 295return Task.CompletedTask; 299public override Task OnDisconnectedAsync(HubConnectionContext connection) 312return Task.CompletedTask; 316public override Task SendAllExceptAsync(string methodName, object?[] args, IReadOnlyList<string> excludedConnectionIds, CancellationToken cancellationToken = default) 322public override Task SendConnectionsAsync(IReadOnlyList<string> connectionIds, string methodName, object?[] args, CancellationToken cancellationToken = default) 328public override Task SendUsersAsync(IReadOnlyList<string> userIds, string methodName, object?[] args, CancellationToken cancellationToken = default) 384public override Task SetConnectionResultAsync(string connectionId, CompletionMessage result) 387return Task.CompletedTask;
Hub.cs (6)
70/// <returns>A <see cref="Task"/> that represents the asynchronous connect.</returns> 71public virtual Task OnConnectedAsync() 73return Task.CompletedTask; 79/// <returns>A <see cref="Task"/> that represents the asynchronous disconnect.</returns> 80public virtual Task OnDisconnectedAsync(Exception? exception) 82return Task.CompletedTask;
HubConnectionContext.cs (10)
322private async Task CompleteWriteAsync(ValueTask<FlushResult> task) 342private async Task WriteSlowAsync(HubMessage message, bool ignoreAbort, CancellationToken cancellationToken) 368private async Task WriteSlowAsync(SerializedHubMessage message, CancellationToken cancellationToken) 407private async Task TryWritePingSlowAsync() 432private async Task WriteHandshakeResponseAsync(HandshakeResponseMessage message) 647internal Task AbortAsync() 660private async Task AbortAsyncSlow() 742static async Task InnerAbortConnection(HubConnectionContext connection) 790internal Task AckAsync(AckMessage ackMessage) 797return Task.CompletedTask;
HubConnectionHandler.cs (5)
106public override async Task OnConnectedAsync(ConnectionContext connection) 156private async Task RunHubAsync(HubConnectionContext connection) 195private async Task HubOnDisconnectedAsync(HubConnectionContext connection, Exception? exception) 234private async Task SendCloseAsync(HubConnectionContext connection, Exception? exception, bool allowReconnect) 258private async Task DispatchMessagesAsync(HubConnectionContext connection)
HubLifetimeManager.cs (28)
19/// <returns>A <see cref="Task"/> that represents the asynchronous connect.</returns> 20public abstract Task OnConnectedAsync(HubConnectionContext connection); 27/// <returns>A <see cref="Task"/> that represents the asynchronous disconnect.</returns> 28public abstract Task OnDisconnectedAsync(HubConnectionContext connection); 36/// <returns>A <see cref="Task"/> that represents the asynchronous send.</returns> 37public abstract Task SendAllAsync(string methodName, object?[] args, CancellationToken cancellationToken = default); 46/// <returns>A <see cref="Task"/> that represents the asynchronous send.</returns> 47public abstract Task SendAllExceptAsync(string methodName, object?[] args, IReadOnlyList<string> excludedConnectionIds, CancellationToken cancellationToken = default); 56/// <returns>A <see cref="Task"/> that represents the asynchronous send.</returns> 57public abstract Task SendConnectionAsync(string connectionId, string methodName, object?[] args, CancellationToken cancellationToken = default); 66/// <returns>A <see cref="Task"/> that represents the asynchronous send.</returns> 67public abstract Task SendConnectionsAsync(IReadOnlyList<string> connectionIds, string methodName, object?[] args, CancellationToken cancellationToken = default); 76/// <returns>A <see cref="Task"/> that represents the asynchronous send.</returns> 77public abstract Task SendGroupAsync(string groupName, string methodName, object?[] args, CancellationToken cancellationToken = default); 86/// <returns>A <see cref="Task"/> that represents the asynchronous send.</returns> 87public abstract Task SendGroupsAsync(IReadOnlyList<string> groupNames, string methodName, object?[] args, CancellationToken cancellationToken = default); 97/// <returns>A <see cref="Task"/> that represents the asynchronous send.</returns> 98public abstract Task SendGroupExceptAsync(string groupName, string methodName, object?[] args, IReadOnlyList<string> excludedConnectionIds, CancellationToken cancellationToken = default); 107/// <returns>A <see cref="Task"/> that represents the asynchronous send.</returns> 108public abstract Task SendUserAsync(string userId, string methodName, object?[] args, CancellationToken cancellationToken = default); 117/// <returns>A <see cref="Task"/> that represents the asynchronous send.</returns> 118public abstract Task SendUsersAsync(IReadOnlyList<string> userIds, string methodName, object?[] args, CancellationToken cancellationToken = default); 126/// <returns>A <see cref="Task"/> that represents the asynchronous add.</returns> 127public abstract Task AddToGroupAsync(string connectionId, string groupName, CancellationToken cancellationToken = default); 135/// <returns>A <see cref="Task"/> that represents the asynchronous remove.</returns> 136public abstract Task RemoveFromGroupAsync(string connectionId, string groupName, CancellationToken cancellationToken = default); 157/// <returns>A <see cref="Task"/> that represents the result being set or being forwarded to another server.</returns> 158public virtual Task SetConnectionResultAsync(string connectionId, CompletionMessage result)
IClientProxy.cs (2)
22/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns> 23Task SendCoreAsync(string method, object?[] args, CancellationToken cancellationToken = default);
IGroupManager.cs (4)
17/// <returns>A <see cref="Task"/> that represents the asynchronous add.</returns> 18Task AddToGroupAsync(string connectionId, string groupName, CancellationToken cancellationToken = default); 26/// <returns>A <see cref="Task"/> that represents the asynchronous remove.</returns> 27Task RemoveFromGroupAsync(string connectionId, string groupName, CancellationToken cancellationToken = default);
IHubFilter.cs (4)
25Task OnConnectedAsync(HubLifetimeContext context, Func<HubLifetimeContext, Task> next) => next(context); 34Task OnDisconnectedAsync(HubLifetimeContext context, Exception? exception, Func<HubLifetimeContext, Exception?, Task> next) => next(context, exception);
Internal\ChannelBasedSemaphore.cs (1)
60private async Task RunTask<TState>(Func<TState, Task<bool>> callback, TState state)
Internal\DefaultHubDispatcher.cs (21)
28private readonly Func<HubLifetimeContext, Task>? _onConnectedMiddleware; 29private readonly Func<HubLifetimeContext, Exception?, Task>? _onDisconnectedMiddleware; 73public override async Task OnConnectedAsync(HubConnectionContext connection) 100public override async Task OnDisconnectedAsync(HubConnectionContext connection, Exception? exception) 126public override Task DispatchMessageAsync(HubConnectionContext connection, HubMessage hubMessage) 136return Task.CompletedTask; 214return Task.CompletedTask; 217private Task ProcessInvocationBindingFailure(HubConnectionContext connection, InvocationBindingFailureMessage bindingFailureMessage) 226private Task ProcessStreamBindingFailure(HubConnectionContext connection, StreamBindingFailureMessage bindingFailureMessage) 239return Task.CompletedTask; 242private Task ProcessStreamItem(HubConnectionContext connection, StreamItemMessage message) 244if (!connection.StreamTracker.TryProcessItem(message, out var processTask)) 247return Task.CompletedTask; 254private Task ProcessInvocation(HubConnectionContext connection, 269return Task.CompletedTask; 332Task? invocation = null; 357static async Task ExecuteInvocation(DefaultHubDispatcher<THub> dispatcher, 463private async Task StreamAsync(string invocationId, HubConnectionContext connection, object?[] arguments, AsyncServiceScope scope, 561if (methodExecutor.MethodReturnType == typeof(Task)) 563await (Task)methodExecutor.Execute(hub, arguments)!; 577private static async Task SendInvocationError(string? invocationId, HubConnectionContext connection, string errorMessage)
Internal\GroupManager.cs (2)
15public Task AddToGroupAsync(string connectionId, string groupName, CancellationToken cancellationToken = default) 20public Task RemoveFromGroupAsync(string connectionId, string groupName, CancellationToken cancellationToken = default)
Internal\HubCallerClients.cs (2)
113public Task SendCoreAsync(string method, object?[] args, CancellationToken cancellationToken = default) 144public Task SendCoreAsync(string method, object?[] args, CancellationToken cancellationToken = default)
Internal\HubDispatcher.cs (3)
10public abstract Task OnConnectedAsync(HubConnectionContext connection); 11public abstract Task OnDisconnectedAsync(HubConnectionContext connection, Exception? exception); 12public abstract Task DispatchMessageAsync(HubConnectionContext connection, HubMessage hubMessage);
Internal\HubFilterFactory.cs (4)
39public async Task OnConnectedAsync(HubLifetimeContext context, Func<HubLifetimeContext, Task> next) 56public async Task OnDisconnectedAsync(HubLifetimeContext context, Exception? exception, Func<HubLifetimeContext, Exception?, Task> next)
Internal\NonInvokingSingleClientProxy.cs (1)
17public Task SendCoreAsync(string method, object?[] args, CancellationToken cancellationToken = default) =>
Internal\Proxies.cs (9)
19public Task SendCoreAsync(string method, object?[] args, CancellationToken cancellationToken = default) 36public Task SendCoreAsync(string method, object?[] args, CancellationToken cancellationToken = default) 55public Task SendCoreAsync(string method, object?[] args, CancellationToken cancellationToken = default) 72public Task SendCoreAsync(string method, object?[] args, CancellationToken cancellationToken = default) 93public Task SendCoreAsync(string method, object?[] args, CancellationToken cancellationToken = default) 108public Task SendCoreAsync(string method, object?[] args, CancellationToken cancellationToken = default) 125public Task SendCoreAsync(string method, object?[] args, CancellationToken cancellationToken = default) 142public Task SendCoreAsync(string method, object?[] args, CancellationToken cancellationToken = default) 160public Task SendCoreAsync(string method, object?[] args, CancellationToken cancellationToken = default)
Internal\TypedClientBuilder.cs (4)
117bool isInvoke = returnType != typeof(Task); 272if (!typeof(Task).IsAssignableFrom(interfaceMethod.ReturnType)) 275$"Cannot generate proxy implementation for '{typeof(T).FullName}.{interfaceMethod.Name}'. All client proxy methods must return '{typeof(Task).FullName}' or '{typeof(Task).FullName}<T>'.");
ISingleClientProxy.cs (1)
22/// <returns>A <see cref="Task"/> that represents the asynchronous invoke and wait for a client result.</returns>
src\Shared\ObjectMethodExecutor\ObjectMethodExecutorFSharpSupport.cs (6)
39/// or to a <see cref="Task"/>, if <c>TResult</c> is <see href="https://fsharp.github.io/fsharp-core-docs/reference/fsharp-core-unit-0.html">FSharp.Core.Unit</see>. 49/// to a <see cref="Task{TResult}"/>, or to a <see cref="Task"/>, if <c>TResult</c> is <see href="https://fsharp.github.io/fsharp-core-docs/reference/fsharp-core-unit-0.html">FSharp.Core.Unit</see>; 53/// When this method returns, contains the type of the closed generic instantiation of <see cref="Task{TResult}"/> or of <see cref="Task"/> that will be returned 114/// to a void-returning <see cref="Task"/> or <see cref="ValueTask"/>. 145var typeDef when typeDef == typeof(Task<>) && IsFSharpUnit(genericAwaitableType.GetGenericArguments()[0]) => (typeof(Task), MakeTaskOfUnitToTaskExpression(genericAwaitableType)), 155return Expression.Lambda(Expression.Convert(closedGenericTaskParam, typeof(Task)), closedGenericTaskParam);
src\SignalR\common\Shared\MessageBuffer.cs (3)
88private async Task RunTimer() 183public async Task AckAsync(AckMessage ackMessage) 248internal async Task ResendAsync(PipeWriter writer)
src\SignalR\common\Shared\TaskCache.cs (2)
8public static readonly Task<bool> True = Task.FromResult(true); 9public static readonly Task<bool> False = Task.FromResult(false);
StreamTracker.cs (3)
44public bool TryProcessItem(StreamItemMessage message, [NotNullWhen(true)] out Task? task) 94Task WriteToStream(object? item); 124public Task WriteToStream(object? o)
Microsoft.AspNetCore.SignalR.Microbenchmarks (70)
BroadcastBenchmark.cs (3)
62public Task SendAsyncGroup() 68public Task SendAsyncAll() 74private static async Task ConsumeAsync(IDuplexPipe application)
DefaultHubDispatcherBenchmark.cs (30)
114public Task InvocationAsync() 116return Task.CompletedTask; 126return Task.FromResult(1); 147return Task.FromResult<ChannelReader<int>>(channel); 162_ = Task.Run(async () => 176await Task.Yield(); 186await Task.CompletedTask; 194public async Task UploadStream(ChannelReader<string> channelReader) 204public async Task UploadStreamIAsynEnumerable(IAsyncEnumerable<string> stream) 213public Task Invocation() 219public Task InvocationAsync() 225public Task InvocationReturnValue() 231public Task InvocationReturnAsync() 237public Task InvocationValueTaskAsync() 243public Task StreamChannelReader() 249public Task StreamChannelReaderAsync() 255public Task StreamChannelReaderValueTaskAsync() 261public async Task StreamChannelReaderCount_Zero() 270public async Task StreamIAsyncEnumerableCount_Zero() 279public async Task StreamIAsyncEnumerableCompletedTaskCount_Zero() 288public async Task StreamChannelReaderCount_One() 297public async Task StreamIAsyncEnumerableCount_One() 306public async Task StreamIAsyncEnumerableCompletedTaskCount_One() 315public async Task StreamChannelReaderCount_Thousand() 324public async Task StreamIAsyncEnumerableCount_Thousand() 333public async Task StreamIAsyncEnumerableCompletedTaskCount_Thousand() 342public async Task UploadStream_One() 353public async Task UploadStreamIAsyncEnumerable_One() 364public async Task UploadStream_Thousand() 378public async Task UploadStreamIAsyncEnumerable_Thousand()
DefaultHubLifetimeManagerBenchmark.cs (9)
73public Task SendAllAsync() 79public Task SendGroupAsync() 85public Task SendGroupsAsync() 91public Task SendGroupExceptAsync() 97public Task SendAllExceptAsync() 103public Task SendConnectionAsync() 109public Task SendConnectionsAsync() 115public Task SendUserAsync() 121public Task SendUsersAsync()
HubConnectionContextBenchmark.cs (2)
55public async Task SuccessHandshakeAsync() 64public async Task ErrorHandshakeAsync()
HubConnectionReceiveBenchmark.cs (3)
92private Task OnInvoke(object[] args) 111return Task.CompletedTask; 148public async Task ReceiveAsync()
HubConnectionSendBenchmark.cs (1)
91public Task SendAsync()
HubConnectionStartBenchmark.cs (1)
62public async Task StartAsync()
NegotiateProtocolBenchmark.cs (1)
54public Task WriteResponse_MemoryBufferWriter()
RedisHubLifetimeManagerBenchmark.cs (14)
42ConnectionFactory = _ => Task.FromResult<IConnectionMultiplexer>(new TestConnectionMultiplexer(server)) 49async Task ConnectClient(TestClient client, IHubProtocol protocol, string userId, string groupName) 58var tasks = new Task[ClientCount]; 83Task.WaitAll(tasks); 103private async Task ConsumeAsync(TestClient testClient) 112public async Task SendAll() 118public async Task SendGroup() 124public async Task SendUser() 130public async Task SendConnection() 136public async Task SendConnections() 142public async Task SendAllExcept() 148public async Task SendGroupExcept() 154public async Task SendGroups() 160public async Task SendUsers()
ServerSentEventsBenchmark.cs (1)
81public Task WriteSingleMessage()
Shared\TestPipeWriter.cs (1)
51await Task.CompletedTask.ConfigureAwait(ConfigureAwaitOptions.ForceYielding);
src\SignalR\common\Http.Connections\src\ServerSentEventsMessageFormatter.cs (2)
15public static async Task WriteMessageAsync(ReadOnlySequence<byte> payload, Stream output, CancellationToken token) 66private static async Task WriteMessageToMemory(Stream output, ReadOnlySequence<byte> payload)
TypedClientBuilderBenchmark.cs (2)
23public Task SendCoreAsync(string method, object[] args, CancellationToken cancellationToken = default) 25return Task.CompletedTask;
Microsoft.AspNetCore.SignalR.Protocols.MessagePack (4)
src\SignalR\common\Shared\MemoryBufferWriter.cs (4)
138public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) 191private async Task CopyToSlowAsync(Stream destination, CancellationToken cancellationToken) 277public override Task FlushAsync(CancellationToken cancellationToken) => Task.CompletedTask;
Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson (4)
src\SignalR\common\Shared\MemoryBufferWriter.cs (4)
138public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) 191private async Task CopyToSlowAsync(Stream destination, CancellationToken cancellationToken) 277public override Task FlushAsync(CancellationToken cancellationToken) => Task.CompletedTask;
Microsoft.AspNetCore.SignalR.Specification.Tests (99)
HubLifetimeManagerTestBase.cs (24)
32/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns> 34public async Task SendAllAsyncWritesToAllConnectionsOutput() 63/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns> 65public async Task SendAllAsyncDoesNotWriteToDisconnectedConnectionsOutput() 93/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns> 95public async Task SendGroupAsyncWritesToAllConnectionsInGroupOutput() 123/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns> 125public async Task SendGroupExceptAsyncDoesNotWriteToExcludedConnections() 154/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns> 156public async Task SendConnectionAsyncWritesToConnectionOutput() 177/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns> 179public async Task CanProcessClientReturnResult() 204/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns> 206public async Task CanProcessClientReturnErrorResult() 231/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns> 233public async Task ExceptionWhenIncorrectClientCompletesClientResult() 267/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns> 269public async Task ConnectionIDNotPresentWhenInvokingClientResult() 287/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns> 289public async Task InvokesForMultipleClientsDoNotCollide() 320/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns> 322public async Task ClientDisconnectsWithoutCompletingClientResult() 345/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns> 347public async Task CanCancelClientResult()
Internal\TaskExtensions.cs (6)
25if (task == await Task.WhenAny(task, Task.Delay(timeout, cts.Token))) 36public static async Task TimeoutAfter(this Task task, TimeSpan timeout, 49if (task == await Task.WhenAny(task, Task.Delay(timeout, cts.Token)))
ScaleoutHubLifetimeManagerTests.cs (47)
30private static async Task AssertMessageAsync(TestClient client) 41/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns> 43public async Task InvokeAllAsyncWithMultipleServersWritesToAllConnectionsOutput() 68/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns> 70public async Task InvokeAllAsyncWithMultipleServersDoesNotWriteToDisconnectedConnectionsOutput() 98/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns> 100public async Task InvokeConnectionAsyncOnServerWithoutConnectionWritesOutputToConnection() 122/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns> 124public async Task InvokeGroupAsyncOnServerWithoutConnectionWritesOutputToGroupConnection() 148/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns> 150public async Task DisconnectConnectionRemovesConnectionFromGroup() 174/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns> 176public async Task RemoveGroupFromLocalConnectionNotInGroupDoesNothing() 194/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns> 196public async Task RemoveGroupFromConnectionOnDifferentServerNotInGroupDoesNothing() 215/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns> 217public async Task AddGroupAsyncForConnectionOnDifferentServerWorks() 240/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns> 242public async Task AddGroupAsyncForLocalConnectionAlreadyInGroupDoesNothing() 266/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns> 268public async Task AddGroupAsyncForConnectionOnDifferentServerAlreadyInGroupDoesNothing() 293/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns> 295public async Task RemoveGroupAsyncForConnectionOnDifferentServerWorks() 324/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns> 326public async Task InvokeConnectionAsyncForLocalConnectionDoesNotPublishToBackplane() 350/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns> 352public async Task WritingToRemoteConnectionThatFailsDoesNotThrow() 374/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns> 376public async Task WritingToGroupWithOneConnectionFailingSecondConnectionStillReceivesMessage() 409/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns> 411public async Task InvokeUserSendsToAllConnectionsForUser() 437/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns> 439public async Task StillSubscribedToUserAfterOneOfMultipleConnectionsAssociatedWithUserDisconnects() 470/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns> 472public async Task CanProcessClientReturnResultAcrossServers() 501/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns> 503public async Task CanProcessClientReturnErrorResultAcrossServers() 532/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns> 534public async Task ConnectionIDNotPresentMultiServerWhenInvokingClientResult() 554/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns> 556public async Task ClientDisconnectsWithoutCompletingClientResultOnSecondServer() 583/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns> 585public async Task InvocationsFromDifferentServersUseUniqueIDs() 618/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns> 620public async Task ConnectionDoesNotExist_FailsInvokeConnectionAsync() 633/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns> 635public async Task ClientReturnResultAcrossServersWithWrongReturnedTypeErrors()
src\Shared\TaskExtensions.cs (8)
34public static Task DefaultTimeout(this Task task, int milliseconds = DefaultTimeoutDuration, [CallerFilePath] string filePath = null, [CallerLineNumber] int lineNumber = default) 39public static Task DefaultTimeout(this Task task, TimeSpan timeout, [CallerFilePath] string filePath = null, [CallerLineNumber] int lineNumber = default) 44public static Task DefaultTimeout(this ValueTask task, int milliseconds = DefaultTimeoutDuration, [CallerFilePath] string filePath = null, [CallerLineNumber] int lineNumber = default) 49public static Task DefaultTimeout(this ValueTask task, TimeSpan timeout, [CallerFilePath] string filePath = null, [CallerLineNumber] int lineNumber = default) 109public static async Task TimeoutAfter(this Task task, TimeSpan timeout,
src\SignalR\common\Shared\MemoryBufferWriter.cs (4)
138public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) 191private async Task CopyToSlowAsync(Stream destination, CancellationToken cancellationToken) 277public override Task FlushAsync(CancellationToken cancellationToken) => Task.CompletedTask;
src\SignalR\common\testassets\Tests.Utils\TaskExtensions.cs (7)
12public static async Task OrThrowIfOtherFails(this Task task, Task otherTask) 14var completed = await Task.WhenAny(task, otherTask); 28public static async Task<T> OrThrowIfOtherFails<T>(this Task<T> task, Task otherTask) 30await OrThrowIfOtherFails((Task)task, otherTask);
src\SignalR\common\testassets\Tests.Utils\TestClient.cs (3)
34public Task Connected => ((TaskCompletionSource)Connection.Items["ConnectedTask"]).Task; 68public async Task<Task> ConnectAsync( 78var connection = handler.OnConnectedAsync(Connection);
Microsoft.AspNetCore.SignalR.StackExchangeRedis (59)
Internal\AckHandler.cs (2)
23public Task CreateAck(int id) 29return Task.CompletedTask;
Internal\RedisSubscriptionManager.cs (4)
13public async Task AddSubscriptionAsync(string id, HubConnectionContext connection, Func<string, HubConnectionStore, Task> subscribeMethod) 42public async Task RemoveSubscriptionAsync(string id, HubConnectionContext connection, object state, Func<object, string, Task> unsubscribeMethod)
RedisHubLifetimeManager.cs (49)
91public override async Task OnConnectedAsync(HubConnectionContext connection) 98var userTask = Task.CompletedTask; 102var connectionTask = SubscribeToConnection(connection); 109await Task.WhenAll(connectionTask, userTask); 113public override Task OnDisconnectedAsync(HubConnectionContext connection) 120return Task.CompletedTask; 124var tasks = new List<Task>(); 149return Task.WhenAll(tasks); 153public override Task SendAllAsync(string methodName, object?[] args, CancellationToken cancellationToken = default) 160public override Task SendAllExceptAsync(string methodName, object?[] args, IReadOnlyList<string> excludedConnectionIds, CancellationToken cancellationToken = default) 167public override Task SendConnectionAsync(string connectionId, string methodName, object?[] args, CancellationToken cancellationToken = default) 184public override Task SendGroupAsync(string groupName, string methodName, object?[] args, CancellationToken cancellationToken = default) 193public override Task SendGroupExceptAsync(string groupName, string methodName, object?[] args, IReadOnlyList<string> excludedConnectionIds, CancellationToken cancellationToken = default) 202public override Task SendUserAsync(string userId, string methodName, object?[] args, CancellationToken cancellationToken = default) 209public override Task AddToGroupAsync(string connectionId, string groupName, CancellationToken cancellationToken = default) 225public override Task RemoveFromGroupAsync(string connectionId, string groupName, CancellationToken cancellationToken = default) 241public override Task SendConnectionsAsync(IReadOnlyList<string> connectionIds, string methodName, object?[] args, CancellationToken cancellationToken = default) 245var publishTasks = new List<Task>(connectionIds.Count); 253return Task.WhenAll(publishTasks); 257public override Task SendGroupsAsync(IReadOnlyList<string> groupNames, string methodName, object?[] args, CancellationToken cancellationToken = default) 260var publishTasks = new List<Task>(groupNames.Count); 271return Task.WhenAll(publishTasks); 275public override Task SendUsersAsync(IReadOnlyList<string> userIds, string methodName, object?[] args, CancellationToken cancellationToken = default) 280var publishTasks = new List<Task>(userIds.Count); 289return Task.WhenAll(publishTasks); 292return Task.CompletedTask; 302private Task AddGroupAsyncCore(HubConnectionContext connection, string groupName) 312return Task.CompletedTask; 324private async Task RemoveGroupAsyncCore(HubConnectionContext connection, string groupName) 346private async Task SendGroupActionAndWaitForAck(string connectionId, string groupName, GroupAction action) 349var ack = _ackHandler.CreateAck(id); 357private Task RemoveUserAsync(HubConnectionContext connection) 437public override Task SetConnectionResultAsync(string connectionId, CompletionMessage result) 440return Task.CompletedTask; 449private async Task SubscribeToAll() 461var tasks = new List<Task>(_connections.Count); 471await Task.WhenAll(tasks); 480private async Task SubscribeToGroupManagementChannel() 516private async Task SubscribeToAckChannel() 528private async Task SubscribeToConnection(HubConnectionContext connection) 583private Task SubscribeToUser(HubConnectionContext connection) 597var tasks = new List<Task>(subscriptions.Count); 603await Task.WhenAll(tasks); 613private async Task SubscribeToGroupAsync(string groupChannel, HubConnectionStore groupConnections) 623var tasks = new List<Task>(groupConnections.Count); 634await Task.WhenAll(tasks); 643private async Task SubscribeToReturnResultsAsync() 734private async Task EnsureRedisServerConnection()
src\SignalR\common\Shared\MemoryBufferWriter.cs (4)
138public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) 191private async Task CopyToSlowAsync(Stream destination, CancellationToken cancellationToken) 277public override Task FlushAsync(CancellationToken cancellationToken) => Task.CompletedTask;
Microsoft.AspNetCore.SignalR.StackExchangeRedis.Tests (28)
EchoHub.cs (3)
16public Task EchoGroup(string groupName, string message) 21public Task EchoUser(string userName, string message) 26public Task AddSelfToGroup(string groupName)
RedisEndToEnd.cs (6)
40public async Task HubConnectionCanSendAndReceiveMessages(HttpTransportType transportType, string protocolName) 60public async Task HubConnectionCanSendAndReceiveGroupMessages(HttpTransportType transportType, string protocolName) 92public async Task CanSendAndReceiveUserMessagesFromMultipleConnectionsWithSameUser(HttpTransportType transportType, string protocolName) 121public async Task CanSendAndReceiveUserMessagesWhenOneConnectionWithUserDisconnects(HttpTransportType transportType, string protocolName) 150public async Task HubConnectionCanSendAndReceiveGroupMessagesGroupNameWithPatternIsTreatedAsLiteral(HttpTransportType transportType, string protocolName) 185public async Task CanSendAndReceiveUserMessagesUserNameWithPatternIsTreatedAsLiteral(HttpTransportType transportType, string protocolName)
RedisHubLifetimeManagerTests.cs (4)
32var options = new RedisOptions() { ConnectionFactory = async (t) => await Task.FromResult(new TestConnectionMultiplexer(server)) }; 46public async Task CamelCasedJsonIsPreservedAcrossRedisBoundary() 90public async Task ErrorFromConnectionFactoryLogsAndAllowsDisconnect() 130public async Task PatternGroupAndUser()
RedisServerFixture.cs (2)
39public async Task DisposeAsync() 50public async Task InitializeAsync()
TestConnectionMultiplexer.cs (13)
97public Task CloseAsync(bool allowCommandsToComplete = true) 197public void Wait(Task task) 207public void WaitAll(params Task[] tasks) 353await Task.Yield(); 362public Task SubscribeAsync(RedisChannel channel, Action<RedisChannel, RedisValue> handler, CommandFlags flags = CommandFlags.None) 367return Task.CompletedTask; 375public bool TryWait(Task task) 392public Task UnsubscribeAllAsync(CommandFlags flags = CommandFlags.None) 397public Task UnsubscribeAsync(RedisChannel channel, Action<RedisChannel, RedisValue> handler = null, CommandFlags flags = CommandFlags.None) 402return Task.CompletedTask; 405public void Wait(Task task) 415public void WaitAll(params Task[] tasks) 440return Task.FromResult(t);
Microsoft.AspNetCore.SignalR.Tests (711)
AddSignalRTests.cs (13)
261public override Task AddToGroupAsync(string connectionId, string groupName, CancellationToken cancellationToken = default) 266public override Task OnConnectedAsync(HubConnectionContext connection) 271public override Task OnDisconnectedAsync(HubConnectionContext connection) 276public override Task RemoveFromGroupAsync(string connectionId, string groupName, CancellationToken cancellationToken = default) 281public override Task SendAllAsync(string methodName, object[] args, CancellationToken cancellationToken = default) 286public override Task SendAllExceptAsync(string methodName, object[] args, IReadOnlyList<string> excludedConnectionIds, CancellationToken cancellationToken = default) 291public override Task SendConnectionAsync(string connectionId, string methodName, object[] args, CancellationToken cancellationToken = default) 296public override Task SendConnectionsAsync(IReadOnlyList<string> connectionIds, string methodName, object[] args, CancellationToken cancellationToken = default) 301public override Task SendGroupAsync(string groupName, string methodName, object[] args, CancellationToken cancellationToken = default) 306public override Task SendGroupExceptAsync(string groupName, string methodName, object[] args, IReadOnlyList<string> excludedConnectionIds, CancellationToken cancellationToken = default) 311public override Task SendGroupsAsync(IReadOnlyList<string> groupNames, string methodName, object[] args, CancellationToken cancellationToken = default) 316public override Task SendUserAsync(string userId, string methodName, object[] args, CancellationToken cancellationToken = default) 321public override Task SendUsersAsync(IReadOnlyList<string> userIds, string methodName, object[] args, CancellationToken cancellationToken = default)
AuthConnectionHandler.cs (1)
14public override async Task OnConnectedAsync(ConnectionContext connection)
ClientProxyTests.cs (32)
22public async Task UserProxy_SendAsync_ArrayArgumentNotExpanded() 29.Returns(Task.CompletedTask); 43public async Task MultipleUserProxy_SendAsync_ArrayArgumentNotExpanded() 50.Returns(Task.CompletedTask); 64public async Task GroupProxy_SendAsync_ArrayArgumentNotExpanded() 71.Returns(Task.CompletedTask); 85public async Task MultipleGroupProxy_SendAsync_ArrayArgumentNotExpanded() 92.Returns(Task.CompletedTask); 106public async Task GroupExceptProxy_SendAsync_ArrayArgumentNotExpanded() 113.Returns(Task.CompletedTask); 127public async Task AllClientProxy_SendAsync_ArrayArgumentNotExpanded() 134.Returns(Task.CompletedTask); 148public async Task AllClientsExceptProxy_SendAsync_ArrayArgumentNotExpanded() 155.Returns(Task.CompletedTask); 169public async Task SingleClientProxy_SendAsync_ArrayArgumentNotExpanded() 176.Returns(Task.CompletedTask); 190public async Task MultipleClientProxy_SendAsync_ArrayArgumentNotExpanded() 197.Returns(Task.CompletedTask); 211public async Task SingleClientProxyWithInvoke_ThrowsNotSupported() 222public override Task AddToGroupAsync(string connectionId, string groupName, CancellationToken cancellationToken = default) 227public override Task OnConnectedAsync(HubConnectionContext connection) 232public override Task OnDisconnectedAsync(HubConnectionContext connection) 237public override Task RemoveFromGroupAsync(string connectionId, string groupName, CancellationToken cancellationToken = default) 242public override Task SendAllAsync(string methodName, object[] args, CancellationToken cancellationToken = default) 247public override Task SendAllExceptAsync(string methodName, object[] args, IReadOnlyList<string> excludedConnectionIds, CancellationToken cancellationToken = default) 252public override Task SendConnectionAsync(string connectionId, string methodName, object[] args, CancellationToken cancellationToken = default) 257public override Task SendConnectionsAsync(IReadOnlyList<string> connectionIds, string methodName, object[] args, CancellationToken cancellationToken = default) 262public override Task SendGroupAsync(string groupName, string methodName, object[] args, CancellationToken cancellationToken = default) 267public override Task SendGroupExceptAsync(string groupName, string methodName, object[] args, IReadOnlyList<string> excludedConnectionIds, CancellationToken cancellationToken = default) 272public override Task SendGroupsAsync(IReadOnlyList<string> groupNames, string methodName, object[] args, CancellationToken cancellationToken = default) 277public override Task SendUserAsync(string userId, string methodName, object[] args, CancellationToken cancellationToken = default) 282public override Task SendUsersAsync(IReadOnlyList<string> userIds, string methodName, object[] args, CancellationToken cancellationToken = default)
DefaultHubLifetimeManagerTests.cs (18)
24public async Task SendAllAsyncWillCancelWithToken() 35var sendTask = manager.SendAllAsync("Hello", new object[] { "World" }, cts.Token).DefaultTimeout(); 54public async Task SendAllExceptAsyncWillCancelWithToken() 65var sendTask = manager.SendAllExceptAsync("Hello", new object[] { "World" }, new List<string> { connection1.ConnectionId }, cts.Token).DefaultTimeout(); 81public async Task SendConnectionAsyncWillCancelWithToken() 89var sendTask = manager.SendConnectionAsync(connection1.ConnectionId, "Hello", new object[] { "World" }, cts.Token).DefaultTimeout(); 103public async Task SendConnectionsAsyncWillCancelWithToken() 111var sendTask = manager.SendConnectionsAsync(new List<string> { connection1.ConnectionId }, "Hello", new object[] { "World" }, cts.Token).DefaultTimeout(); 125public async Task SendGroupAsyncWillCancelWithToken() 134var sendTask = manager.SendGroupAsync("group", "Hello", new object[] { "World" }, cts.Token).DefaultTimeout(); 148public async Task SendGroupExceptAsyncWillCancelWithToken() 161var sendTask = manager.SendGroupExceptAsync("group", "Hello", new object[] { "World" }, new List<string> { connection1.ConnectionId }, cts.Token).DefaultTimeout(); 177public async Task SendGroupsAsyncWillCancelWithToken() 186var sendTask = manager.SendGroupsAsync(new List<string> { "group" }, "Hello", new object[] { "World" }, cts.Token).DefaultTimeout(); 200public async Task SendUserAsyncWillCancelWithToken() 211var sendTask = manager.SendUserAsync("user", "Hello", new object[] { "World" }, cts.Token).DefaultTimeout(); 230public async Task SendUsersAsyncWillCancelWithToken() 241var sendTask = manager.SendUsersAsync(new List<string> { "user1", "user2" }, "Hello", new object[] { "World" }, cts.Token).DefaultTimeout();
EchoConnectionHandler.cs (1)
12public override async Task OnConnectedAsync(ConnectionContext connection)
EndToEndTests.cs (32)
37public async Task CanStartAndStopConnectionUsingDefaultTransport() 51public async Task TransportThatFallsbackCreatesNewConnection() 75public async Task CanStartAndStopConnectionUsingGivenTransport(HttpTransportType transportType) 88public async Task WebSocketsTest() 126public async Task WebSocketsReceivesAndSendsPartialFramesTest() 165public async Task HttpRequestsNotSentWhenWebSocketsTransportRequestedAndSkipNegotiationSet() 176(request, cancellationToken) => Task.FromException<HttpResponseMessage>(new InvalidOperationException("HTTP requests should not be sent."))); 215public async Task HttpConnectionThrowsIfSkipNegotiationSetAndTransportIsNotWebSockets(HttpTransportType transportType) 226(request, cancellationToken) => Task.FromException<HttpResponseMessage>(new InvalidOperationException("HTTP requests should not be sent."))); 258public async Task ConnectionCanSendAndReceiveMessages(HttpTransportType transportType, TransferFormat requestedTransferFormat) 315public async Task ConnectionCanSendAndReceiveDifferentMessageSizesWebSocketsTransport(int length) 333async Task SendMessage() 340async Task ReceiveMessage() 351var sendingTask = SendMessage(); 352var receivingTask = ReceiveMessage(); 374public async Task UnauthorizedWebSocketsConnectionDoesNotConnect() 398public async Task UnauthorizedDirectWebSocketsConnectionDoesNotConnect() 428public async Task UnauthorizedConnectionDoesNotConnect(HttpTransportType transportType) 464public async Task AuthorizedConnectionCanConnect() 490AccessTokenProvider = () => Task.FromResult(token), 513public async Task ServerClosesConnectionWithErrorIfHubCannotBeCreated_WebSocket() 527public async Task ServerClosesConnectionWithErrorIfHubCannotBeCreated_LongPolling() 540private async Task ServerClosesConnectionWithErrorIfHubCannotBeCreated(HttpTransportType transportType) 564return Task.CompletedTask; 599public async Task UnauthorizedHubConnectionDoesNotConnect() 638public async Task AuthorizedHubConnectionCanConnect() 664o.AccessTokenProvider = () => Task.FromResult(token); 719public Task StartAsync(Uri url, TransferFormat transferFormat, CancellationToken cancellationToken = default) 740return Task.FromException(new Exception()); 744return Task.CompletedTask; 748public Task StopAsync() 752return Task.CompletedTask;
HttpHeaderConnectionHandler.cs (1)
16public override async Task OnConnectedAsync(ConnectionContext connection)
HubConnectionHandlerTests.ClientResult.cs (28)
14public async Task CanReturnClientResultToHub() 23var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 41public async Task CanReturnClientResultErrorToHub() 56var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 73public async Task ThrowsWhenUsedInOnConnectedAsync() 88var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 100public async Task ThrowsWhenUsedInOnDisconnectedAsync() 115var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 131public async Task CanUseClientResultsWithIHubContext() 140var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 163public async Task CanUseClientResultsWithIHubContextT() 173var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 197public async Task CanReturnClientResultToTypedHubTwoWays() 206var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 229public async Task ClientResultFromHubDoesNotBlockReceiveLoop() 241var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 282public async Task ClientResultFromBackgroundThreadInHubMethodWorks() 295var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 301var task = await Task.WhenAny(tcsService.EndMethod.Task, client.ReadAsync()).DefaultTimeout(); 342public async Task CanCancelClientResultsWithIHubContextT(string protocol) 365var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 400public async Task CanCancelClientResultsWithIHubContext() 410var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 445public async Task ClientResultInUploadStreamingMethodWorks() 454var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 482public async Task ClientResultInStreamingMethodWorks() 495var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout();
HubConnectionHandlerTests.cs (365)
39public async Task HubsAreDisposed() 49var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 62public async Task AsyncDisposablesInHubsAreSupported() 77var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 93public async Task ConnectionAbortedTokenTriggers() 103var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 118public async Task OnDisconnectedAsyncTriggersWhenAbortedTokenCallbackThrows() 127var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 144public async Task AbortFromHubMethodForcesClientDisconnect() 153var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 168public async Task MissingHandshakeAndMessageSentFromHubConnectionCanBeDisposedCleanly() 177var connectionHandlerTask = await client.ConnectAsync(connectionHandler, false, false); 190public async Task HandshakeTimesOut() 205var connectionHandlerTask = await client.ConnectAsync(connectionHandler, false); 216public async Task CanLoadHubContext() 227public async Task CanLoadTypedHubContext() 245Assert.Equal($"Cannot generate proxy implementation for '{typeof(IVoidReturningTypedHubClient).FullName}.{nameof(IVoidReturningTypedHubClient.Send)}'. All client proxy methods must return '{typeof(Task).FullName}' or 'System.Threading.Tasks.Task<T>'.", ex.Message); 250public async Task HandshakeFailureFromUnknownProtocolSendsResponseWithError() 261var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 274public async Task HandshakeFailureFromUnsupportedFormatSendsResponseWithError() 287var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 300public async Task ConnectionClosedWhenHandshakeLargerThanMaxMessageSize() 317var connectionHandlerTask = await client.ConnectAsync(connectionHandler, 334public async Task SendingHandshakeRequestInChunksWorks() 347var connectionHandlerTask = await client.ConnectAsync(connectionHandler, 377public async Task SendingInvocatonInChunksWorks() 390var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 418public async Task SendingHandshakeRequestAndInvocationInSamePayloadParsesHandshakeAndInvocation() 429var connectionHandlerTask = await client.ConnectAsync(connectionHandler, 456public async Task HandshakeSuccessSendsResponseWithoutError() 464var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 477public async Task HubMessageOverTheMaxMessageSizeThrows() 489var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 506public async Task ChunkedHubMessageOverTheMaxMessageSizeThrows() 518var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 536public async Task ManyHubMessagesOneOverTheMaxMessageSizeThrows() 552var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 587public async Task ManyHubMessagesUnderTheMessageSizeButConfiguredWithMax() 603var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 634public async Task HandshakeFailureFromIncompatibleProtocolVersionSendsResponseWithError() 646var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 659public async Task ConnectionClosesOnServerWithPartialHandshakeMessageAndCompletedPipe() 671var connectionHandlerTask = await client.ConnectAsync(connectionHandler, sendHandshakeRequestMessage: false, expectedHandshakeResponseMessage: false); 688public async Task LifetimeManagerOnDisconnectedAsyncCalledIfLifetimeManagerOnConnectedAsyncThrows() 712var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 729public async Task HubOnDisconnectedAsyncCalledIfHubOnConnectedAsyncThrows() 749var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 761public async Task LifetimeManagerOnDisconnectedAsyncCalledIfHubOnDisconnectedAsyncThrows() 781var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 794public async Task HubMethodCanReturnValueFromTask() 804var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 820public async Task HubMethodCanReturnValueFromValueTask() 830var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 846public async Task HubMethodCanReturnValueTask() 856var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 872public async Task HubMethodsAreCaseInsensitive(Type hubType) 880var connectionHandlerTask = (Task)await client.ConnectAsync(connectionHandler); 897public async Task HubMethodCanThrowOrYieldFailedTask(string methodName, bool detailedErrors) 926var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 950public async Task HubMethodListeningToConnectionAbortedClosesOnConnectionContextAbort() 958var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 977public async Task DetailedExceptionEvenWhenNotExplicitlySet() 995var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 1010public async Task HubMethodDoesNotSendResultWhenInvocationIsNonBlocking() 1020var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 1039public async Task HubMethodCanBeVoid() 1049var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 1064public async Task HubMethodCanBeRenamedWithAttribute() 1074var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 1090public async Task HubMethodNameAttributeIsInherited() 1100var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 1119public async Task NonBlockingInvocationDoesNotSendCompletion(string methodName) 1135var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 1153public async Task HubMethodWithMultiParam() 1163var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 1178public async Task CanCallInheritedHubMethodFromInheritingHub() 1188var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 1203public async Task CanCallOverridenVirtualHubMethod() 1213var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 1228public async Task CannotCallOverriddenBaseHubMethod() 1238var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 1272public async Task CannotCallStaticHubMethods() 1282var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 1297public async Task CannotCallObjectMethodsOnHub() 1307var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 1330public async Task CannotCallDisposeMethodOnHub() 1340var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 1369public async Task BroadcastHubMethodSendsToAllClients(Type hubType) 1378var firstConnectionHandlerTask = await firstClient.ConnectAsync(connectionHandler); 1379var secondConnectionHandlerTask = await secondClient.ConnectAsync(connectionHandler); 1381await Task.WhenAll(firstClient.Connected, secondClient.Connected).DefaultTimeout(); 1385foreach (var result in await Task.WhenAll( 1399await Task.WhenAll(firstConnectionHandlerTask, secondConnectionHandlerTask).DefaultTimeout(); 1405public async Task SendArraySendsArrayToAllClients() 1416var firstConnectionHandlerTask = await firstClient.ConnectAsync(connectionHandler); 1417var secondConnectionHandlerTask = await secondClient.ConnectAsync(connectionHandler); 1419await Task.WhenAll(firstClient.Connected, secondClient.Connected).DefaultTimeout(); 1423foreach (var result in await Task.WhenAll( 1438await Task.WhenAll(firstConnectionHandlerTask, secondConnectionHandlerTask).DefaultTimeout(); 1445public async Task SendToOthers(Type hubType) 1454var firstConnectionHandlerTask = await firstClient.ConnectAsync(connectionHandler); 1455var secondConnectionHandlerTask = await secondClient.ConnectAsync(connectionHandler); 1457await Task.WhenAll(firstClient.Connected, secondClient.Connected).DefaultTimeout(); 1479await Task.WhenAll(firstConnectionHandlerTask, secondConnectionHandlerTask).DefaultTimeout(); 1486public async Task SendToCaller(Type hubType) 1495var firstConnectionHandlerTask = await firstClient.ConnectAsync(connectionHandler); 1496var secondConnectionHandlerTask = await secondClient.ConnectAsync(connectionHandler); 1498await Task.WhenAll(firstClient.Connected, secondClient.Connected).DefaultTimeout(); 1517await Task.WhenAll(firstConnectionHandlerTask, secondConnectionHandlerTask).DefaultTimeout(); 1523public async Task FailsToInitializeInvalidTypedHub() 1538var connectionTask = await firstClient.ConnectAsync(connectionHandler); 1549public async Task SendToAllExcept(Type hubType) 1559var firstConnectionHandlerTask = await firstClient.ConnectAsync(connectionHandler); 1560var secondConnectionHandlerTask = await secondClient.ConnectAsync(connectionHandler); 1561var thirdConnectionHandlerTask = await thirdClient.ConnectAsync(connectionHandler); 1563await Task.WhenAll(firstClient.Connected, secondClient.Connected, thirdClient.Connected).DefaultTimeout(); 1588await Task.WhenAll(firstConnectionHandlerTask, secondConnectionHandlerTask, thirdConnectionHandlerTask).DefaultTimeout(); 1595public async Task SendToMultipleClients(Type hubType) 1605var firstConnectionHandlerTask = await firstClient.ConnectAsync(connectionHandler); 1606var secondConnectionHandlerTask = await secondClient.ConnectAsync(connectionHandler); 1607var thirdConnectionHandlerTask = await thirdClient.ConnectAsync(connectionHandler); 1609await Task.WhenAll(firstClient.Connected, secondClient.Connected, thirdClient.Connected).DefaultTimeout(); 1636await Task.WhenAll(firstConnectionHandlerTask, secondConnectionHandlerTask, thirdConnectionHandlerTask).DefaultTimeout(); 1643public async Task SendToMultipleUsers(Type hubType) 1653var firstConnectionHandlerTask = await firstClient.ConnectAsync(connectionHandler); 1654var secondConnectionHandlerTask = await secondClient.ConnectAsync(connectionHandler); 1655var thirdConnectionHandlerTask = await thirdClient.ConnectAsync(connectionHandler); 1657await Task.WhenAll(firstClient.Connected, secondClient.Connected, thirdClient.Connected).DefaultTimeout(); 1681await Task.WhenAll(firstConnectionHandlerTask, secondConnectionHandlerTask, thirdConnectionHandlerTask).DefaultTimeout(); 1688public async Task HubsCanAddAndSendToGroup(Type hubType) 1697var firstConnectionHandlerTask = await firstClient.ConnectAsync(connectionHandler); 1698var secondConnectionHandlerTask = await secondClient.ConnectAsync(connectionHandler); 1700await Task.WhenAll(firstClient.Connected, secondClient.Connected).DefaultTimeout(); 1725await Task.WhenAll(firstConnectionHandlerTask, secondConnectionHandlerTask).DefaultTimeout(); 1732public async Task SendToGroupExcept(Type hubType) 1741var firstConnectionHandlerTask = await firstClient.ConnectAsync(connectionHandler); 1742var secondConnectionHandlerTask = await secondClient.ConnectAsync(connectionHandler); 1744await Task.WhenAll(firstClient.Connected, secondClient.Connected).DefaultTimeout(); 1778await Task.WhenAll(firstConnectionHandlerTask, secondConnectionHandlerTask).DefaultTimeout(); 1785public async Task SendToOthersInGroup(Type hubType) 1794var firstConnectionHandlerTask = await firstClient.ConnectAsync(connectionHandler); 1795var secondConnectionHandlerTask = await secondClient.ConnectAsync(connectionHandler); 1797await Task.WhenAll(firstClient.Connected, secondClient.Connected).DefaultTimeout(); 1829await Task.WhenAll(firstConnectionHandlerTask, secondConnectionHandlerTask).DefaultTimeout(); 1836public async Task InvokeMultipleGroups(Type hubType) 1845var firstConnectionHandlerTask = await firstClient.ConnectAsync(connectionHandler); 1846var secondConnectionHandlerTask = await secondClient.ConnectAsync(connectionHandler); 1848await Task.WhenAll(firstClient.Connected, secondClient.Connected).DefaultTimeout(); 1872await Task.WhenAll(firstConnectionHandlerTask, secondConnectionHandlerTask).DefaultTimeout(); 1878public async Task RemoveFromGroupWhenNotInGroupDoesNotFail() 1888var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 1902public async Task HubsCanSendToUser(Type hubType) 1911var firstConnectionHandlerTask = await firstClient.ConnectAsync(connectionHandler); 1912var secondConnectionHandlerTask = await secondClient.ConnectAsync(connectionHandler); 1914await Task.WhenAll(firstClient.Connected, secondClient.Connected).DefaultTimeout(); 1929await Task.WhenAll(firstConnectionHandlerTask, secondConnectionHandlerTask).DefaultTimeout(); 1936public async Task HubsCanSendToConnection(Type hubType) 1945var firstConnectionHandlerTask = await firstClient.ConnectAsync(connectionHandler); 1946var secondConnectionHandlerTask = await secondClient.ConnectAsync(connectionHandler); 1948await Task.WhenAll(firstClient.Connected, secondClient.Connected).DefaultTimeout(); 1963await Task.WhenAll(firstConnectionHandlerTask, secondConnectionHandlerTask).DefaultTimeout(); 1969public async Task DelayedSendTest() 1978var firstConnectionHandlerTask = await firstClient.ConnectAsync(connectionHandler); 1979var secondConnectionHandlerTask = await secondClient.ConnectAsync(connectionHandler); 1981await Task.WhenAll(firstClient.Connected, secondClient.Connected).DefaultTimeout(); 1996await Task.WhenAll(firstConnectionHandlerTask, secondConnectionHandlerTask).DefaultTimeout(); 2003public async Task HubsCanStreamResponses(string method, string protocolName) 2018var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 2040public async Task NonErrorCompletionSentWhenStreamCanceledFromClient() 2049var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 2079public async Task ReceiveCorrectErrorFromStreamThrowing(string streamMethod, string detailedError) 2098var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 2124public async Task CanSendToConnectionsWithDifferentProtocols() 2134var firstConnectionHandlerTask = await client1.ConnectAsync(connectionHandler); 2135var secondConnectionHandlerTask = await client2.ConnectAsync(connectionHandler); 2189public async Task UnauthorizedConnectionCannotInvokeHubMethodWithAuthorization() 2209var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 2225public async Task AuthorizedConnectionCanInvokeHubMethodWithAuthorization() 2246var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 2274public async Task ConnectionLifetimeNotificationClosesConnectionWithReconnectAllowed() 2286var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 2305public Task HandleAsync(AuthorizationHandlerContext context) 2320return Task.CompletedTask; 2325public async Task HubMethodWithAuthorizationProvidesResourceToAuthHandlers() 2354var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 2370public async Task HubOptionsCanUseCustomJsonSerializerSettings() 2391var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 2412public async Task JsonHubProtocolUsesCamelCasingByDefault() 2421var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 2442public async Task HubOptionsCanUseCustomMessagePackSettings() 2461var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 2481public async Task HubOptionsCanNotHaveNullSupportedProtocols() 2505public async Task HubOptionsCanNotHaveEmptySupportedProtocols() 2529public async Task ConnectionUserIdIsAssignedByUserIdProvider() 2555var connectionHandlerTask1 = await client1.ConnectAsync(connectionHandler); 2556var connectionHandlerTask2 = await client2.ConnectAsync(connectionHandler); 2608public async Task CanGetHttpContextFromHubConnectionContext() 2624var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 2639public async Task GetHttpContextFromHubConnectionContextHandlesNull() 2649var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 2664public async Task AcceptsPingMessages() 2673var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 2691public async Task DoesNotWritePingMessagesIfSufficientOtherMessagesAreSent() 2702var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 2711await Task.Delay(10); 2735public async Task WritesPingMessageIfNothingWrittenWhenKeepAliveIntervalElapses() 2749var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 2797public async Task ConnectionNotTimedOutIfClientNeverPings() 2811var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 2833public async Task ConnectionTimesOutIfInitialPingAndThenNoMessages() 2847var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 2860public async Task OnDisconnectedAsyncReceivesExceptionOnPingTimeout() 2880var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 2896public async Task ReceivingMessagesPreventsConnectionTimeoutFromOccuring() 2910var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 2979public Task WaitForReadStart() 3005public async Task HubMethodInvokeDoesNotCountTowardsClientTimeout() 3026var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 3064public async Task HubMethodInvokeCountsTowardsClientTimeoutIfParallelNotMaxed() 3082var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 3100public async Task EndingConnectionSendsCloseMessageWithNoError() 3109var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 3131public async Task ErrorInHubOnConnectSendsCloseMessageWithError(bool detailedErrors) 3152var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 3172public async Task StreamingInvocationsDoNotBlockOtherInvocations() 3187var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 3204public async Task StreamMethodThatThrowsWillCleanup() 3222var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 3245public async Task StreamMethodThatReturnsNullWillCleanup() 3257var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 3280public async Task StreamMethodWithDuplicateIdFails() 3292var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 3316public async Task InvocationsRunInOrderWithNoParallelism() 3335var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 3371public async Task InvocationsCanRunOutOfOrderWithParallelism() 3390var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 3427public async Task PendingInvocationUnblockedWhenBlockingMethodCompletesWithParallelism() 3446var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 3497public async Task StreamInvocationsDoNotBlockOtherInvocations() 3517var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 3552public async Task ServerSendsCloseWithErrorWhenConnectionClosedWithPartialMessage() 3564var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 3587public async Task StreamUploadBufferCapacityBlocksOtherInvocations() 3601var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 3618public async Task UploadStringsToConcat() 3625var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 3641public async Task UploadStreamedObjects() 3648var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 3669public async Task UploadManyStreams() 3676var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 3712protected override async Task HandleRequirementAsync(AuthorizationHandlerContext context, DelayRequirement requirement, HubInvocationContext resource) 3722public async Task UploadStreamStreamItemsSentAsSoonAsPossible() 3740var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 3764public async Task UploadStreamDoesNotCountTowardsMaxInvocationLimit() 3776var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 3794public async Task ConnectionAbortedIfSendFailsWithProtocolError() 3806var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 3815public async Task SerializationExceptionsSendSelfArePassedToOnDisconnectedAsync() 3825var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 3838public async Task SerializationExceptionsSendAllArePassedToOnDisconnectedAsync() 3848var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 3861public async Task UploadStreamItemInvalidTypeAutoCasts() 3872var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 3889public async Task ServerReportsProtocolMinorVersion() 3903var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 3914public async Task UploadStreamItemInvalidType() 3923var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 3938public async Task UploadStreamItemInvalidId() 3950var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 3963public async Task UploadStreamCompleteInvalidId() 3975var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 3990public async Task UploadStreamCompleteWithError() 4010public async Task UploadStreamWithTooManyStreamsFails() 4029public async Task UploadStreamWithTooFewStreamsFails() 4048public async Task UploadStreamReleasesHubActivatorOnceComplete() 4060var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 4086public async Task UploadStreamFromSendReleasesHubActivatorOnceComplete() 4098var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 4101var createTask = hubActivator.CreateTask.Task; 4126public async Task UploadStreamClosesStreamsOnServerWhenMethodCompletes() 4135var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 4163public async Task UploadStreamAndStreamingMethodClosesStreamsOnServerWhenMethodCompletes() 4172var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 4205public async Task StreamHubMethodCanBeTriggeredOnCancellation(string methodName, params object[] args) 4218var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 4246public async Task CancellationAfterGivenMessagesEndsStreaming(string methodName, int count) 4261var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 4291public async Task StreamHubMethodCanAcceptCancellationTokenAsArgumentAndBeTriggeredOnConnectionAborted() 4304var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 4322public async Task StreamHubMethodCanAcceptNullableParameter() 4335var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 4349public async Task StreamHubMethodCanAcceptNullableParameterWithCancellationToken() 4362var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 4379public async Task InvokeHubMethodCannotAcceptCancellationTokenAsArgument() 4388var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 4404public async Task CanPassStreamingParameterToStreamHubMethod() 4415Task connectionHandlerTask = await client.ConnectAsync(connectionHandler); 4456public async Task CanPassDerivedParameterToStreamHubMethod(string method) 4485var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 4504public async Task ClientsCallerPropertyCanBeUsedOutsideOfHub() 4517var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 4533public async Task CanSendThroughIHubContext() 4542var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 4560public async Task ConnectionCloseCleansUploadStreams() 4569var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 4591public async Task SpecificHubOptionForMaximumReceiveMessageSizeIsUsedOverGlobalHubOption() 4611var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 4623public async Task CanSendThroughIHubContextBaseHub() 4632var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 4650public async Task HubMethodFailsIfServiceNotFound() 4660var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 4667public async Task HubMethodCanInjectService() 4677var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 4684public async Task HubMethodCanInjectMultipleServices() 4696var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 4703public async Task HubMethodCanInjectServicesWithOtherParameters() 4715var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 4729public async Task StreamFromServiceDoesNotWork() 4740var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 4747public async Task ServiceNotResolvedWithoutAttribute_WithSettingDisabledGlobally() 4762var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 4769public async Task ServiceResolvedWithoutAttribute() 4783var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 4790public async Task ServiceResolvedForIEnumerableParameter() 4804var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 4811public async Task ServiceResolvedWithoutAttribute_WithHubSpecificSettingEnabled() 4829var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 4836public async Task ServiceNotResolvedWithAndWithoutAttribute_WithOptionDisabled() 4852var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 4859public async Task ServiceResolvedWithAndWithoutAttribute() 4874var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 4881public async Task ServiceNotResolvedIfNotInDI() 4894var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 4901public async Task ServiceNotResolvedForIEnumerableParameterIfNotInDI() 4914var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 4921public async Task KeyedServiceResolvedIfInDI() 4937var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 4944public async Task HubMethodCanInjectKeyedServiceWithOtherParameters() 4960var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 4967public async Task HubMethodCanInjectKeyedServiceWithNonKeyedService() 4984var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 4991public async Task MultipleKeyedServicesResolved() 5007var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 5014public async Task MultipleKeyedServicesWithSameNameResolved() 5030var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 5078public async Task SendToAnotherClientFromOnConnectedAsync() 5100var connectionHandlerTask = await client1.ConnectAsync(connectionHandler).DefaultTimeout(); 5111public async Task ConnectionClosesWhenClientSendsCloseMessage() 5121var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 5135public async Task ConnectionClosesWhenClientSendsCloseMessageWithError() 5145var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 5163public async Task UnsolicitedSequenceAndAckMessagesDoNothing() 5177var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 5190public async Task CanSetMessageBufferSizeOnServer() 5207var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 5229public void OnReconnected(Func<PipeWriter, Task> notifyOnReconnect) { } 5239public async Task IReconnectNotifyTriggersSequenceMessage() 5253var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 5302public async Task GracefulCloseDisablesReconnect() 5317var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 5337private Func<PipeWriter, Task> _notifyOnReconnect; 5339public Task ReconnectDisabled => _reconnectDisabled.Task; 5341public Task NotifyOnReconnect(PipeWriter writer) 5347public void OnReconnected(Func<PipeWriter, Task> notifyOnReconnect)
HubConnectionHandlerTestUtils\Hubs.cs (102)
17public Task GroupRemoveMethod(string groupName) 22public Task ClientSendMethod(string userId, string message) 27public Task SendToMultipleUsers(IReadOnlyList<string> userIds, string message) 32public Task ConnectionSendMethod(string connectionId, string message) 37public Task SendToMultipleClients(string message, IReadOnlyList<string> connectionIds) 42public Task GroupAddMethod(string groupName) 47public Task GroupSendMethod(string groupName, string message) 52public Task GroupExceptSendMethod(string groupName, string message, IReadOnlyList<string> excludedConnectionIds) 57public Task SendToMultipleGroups(string message, IReadOnlyList<string> groupNames) 62public Task SendToOthersInGroup(string groupName, string message) 67public Task BroadcastMethod(string message) 72public Task BroadcastItem() 77public Task SendArray() 84return Task.FromResult(42); 94return new ValueTask(Task.CompletedTask); 122public Task SendAnonymousObject() 127public override Task OnDisconnectedAsync(Exception e) 129return Task.CompletedTask; 142public Task MethodThatYieldsFailedTask() 144return Task.FromException(new InvalidOperationException("BOOM!")); 161public Task SendToAllExcept(string message, IReadOnlyList<string> excludedConnectionIds) 171public Task SendToOthers(string message) 176public Task SendToCaller(string message) 181public Task ProtocolError() 205public async Task StreamDontRead(ChannelReader<string> source) 284public Task UploadIgnoreItems(ChannelReader<string> source) 297async Task ChannelFunc(ChannelWriter<string> output, ChannelReader<string> input) 305public async Task UploadDoesWorkOnComplete(ChannelReader<string> source) 329public async Task BlockingMethod() 346_ = Task.Run(async () => 386public override Task OnConnectedAsync() 396public override Task OnConnectedAsync() 408public Task ClientSendMethod(string userId, string message) 413public Task SendToMultipleUsers(List<string> userIds, string message) 418public Task ConnectionSendMethod(string connectionId, string message) 423public Task SendToMultipleClients(string message, IReadOnlyList<string> connectionIds) 428public Task GroupAddMethod(string groupName) 433public Task GroupSendMethod(string groupName, string message) 438public Task GroupExceptSendMethod(string groupName, string message, IReadOnlyList<string> excludedConnectionIds) 443public Task SendToOthersInGroup(string groupName, string message) 448public Task SendToMultipleGroups(string message, IReadOnlyList<string> groupNames) 453public Task BroadcastMethod(string message) 458public Task SendToAllExcept(string message, IReadOnlyList<string> excludedConnectionIds) 463public Task SendToOthers(string message) 468public Task SendToCaller(string message) 476public override Task OnConnectedAsync() 488public Task ClientSendMethod(string userId, string message) 493public Task SendToMultipleUsers(List<string> userIds, string message) 498public Task ConnectionSendMethod(string connectionId, string message) 503public Task SendToMultipleClients(string message, IReadOnlyList<string> connectionIds) 508public async Task DelayedSend(string connectionId, string message) 510await Task.Delay(100); 514public Task GroupAddMethod(string groupName) 519public Task GroupSendMethod(string groupName, string message) 524public Task GroupExceptSendMethod(string groupName, string message, IReadOnlyList<string> excludedConnectionIds) 529public Task SendToMultipleGroups(string message, IReadOnlyList<string> groupNames) 534public Task SendToOthersInGroup(string groupName, string message) 539public Task BroadcastMethod(string message) 544public Task SendToAllExcept(string message, IReadOnlyList<string> excludedConnectionIds) 549public Task SendToOthers(string message) 554public Task SendToCaller(string message) 567Task Send(string message); 568Task Broadcast(string message); 579public override Task OnConnectedAsync() 589public override Task OnDisconnectedAsync(Exception exception) 694_ = Task.Run(async () => 708await Task.Yield(); 714await Task.Yield(); 722await Task.Yield(); 729await Task.Yield(); 738await Task.Yield(); 797_ = Task.Run(async () => 815await Task.Yield(); 821await Task.Yield(); 827await Task.Yield(); 833await Task.Yield(); 964public override async Task OnConnectedAsync() 973public override Task OnConnectedAsync() 977return Task.CompletedTask; 983public override async Task OnConnectedAsync() 1018Task.Run(async () => 1033Task.Run(async () => 1048Task.Run(async () => 1063Task.Run(() => 1068return Task.CompletedTask; 1078Task.Run(async () => 1101await Task.Yield(); 1114Task.Run(async () => 1118await Task.Yield(); 1140public async Task Upload(ChannelReader<string> stream) 1209Task Send(string message); 1219public override Task OnConnectedAsync() 1231public override Task OnDisconnectedAsync(Exception exception) 1248public override Task OnConnectedAsync() 1260public Task ProtocolErrorSelf() 1265public Task ProtocolErrorAll() 1270public override Task OnDisconnectedAsync(Exception exception) 1292public override async Task OnConnectedAsync() 1300public override async Task OnDisconnectedAsync(Exception ex) 1315public override Task OnConnectedAsync() 1381public async Task Stream(ChannelReader<int> channelReader) 1440public override async Task OnConnectedAsync()
HubFilterTests.cs (42)
17public async Task GlobalHubFilterByType_MethodsAreCalled() 37public async Task GlobalHubFilterByInstance_MethodsAreCalled() 55public async Task PerHubFilterByInstance_MethodsAreCalled() 73public async Task PerHubFilterByCompileTimeType_MethodsAreCalled() 93public async Task PerHubFilterByRuntimeType_MethodsAreCalled() 112private async Task AssertMethodsCalled(IServiceProvider serviceProvider, TcsService tcsService) 118var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 140public async Task HubFilterDoesNotNeedToImplementMethods() 157var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 173public async Task MutlipleFilters_MethodsAreCalled() 192var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 221public async Task MixingTypeAndInstanceGlobalFilters_MethodsAreCalled() 242var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 271public async Task MixingTypeAndInstanceHubSpecificFilters_MethodsAreCalled() 293var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 322public async Task GlobalFiltersRunInOrder() 341var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 381public async Task HubSpecificFiltersRunInOrder() 401var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 441public async Task GlobalFiltersRunBeforeHubSpecificFilters() 463var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 503public async Task FilterCanBeResolvedFromDI() 524public async Task FiltersHaveTransientScopeByDefault() 543var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 572public async Task FiltersCanBeSingletonIfAddedToDI() 592var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 618public async Task ConnectionContinuesIfOnConnectedAsyncThrowsAndFilterDoesNot() 635var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 649public async Task ConnectionContinuesIfOnConnectedAsyncNotCalledByFilter() 666var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 680public async Task FilterCanSkipCallingHubMethod() 696var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 713public async Task FiltersWithIDisposableAreDisposed() 733var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 754public async Task InstanceFiltersWithIDisposableAreNotDisposed() 774var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 789public async Task FiltersWithIAsyncDisposableAreDisposed() 809var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 830public async Task InstanceFiltersWithIAsyncDisposableAreNotDisposed() 850var connectionHandlerTask = await client.ConnectAsync(connectionHandler); 865public async Task InvokeFailsWhenFilterCallsNonExistantMethod() 888var connectionHandlerTask = await client.ConnectAsync(connectionHandler);
Internal\MessageBufferTests.cs (12)
18public async Task CanWriteNonBufferedMessagesWithoutBlocking() 46public async Task WriteBlocksOnAckWhenMessageBufferFull() 83public async Task BackpressureWriteMessageSurvivesReconnect() 124public async Task UnAckedMessageResentOnReconnect() 173public async Task AckedMessageNotResentOnReconnect() 217public async Task ReceiveSequenceMessageWithLargerIDThanMessagesReceived() 241public async Task WriteManyMessagesAckSomeProperlyBuffers() 284public async Task MessageBufferLimitCanBeModified() 321public async Task CanSendMessagesWhilePipeClosed() 363public async Task AckMessagesSentAutomatically() 400public async Task ReceiveAckDuringResendStillSendsAllMessages() 442public async Task SendingAckMessageDelayedDuringResend()
Internal\ReflectionHelperTests.cs (1)
38await Task.Delay(10);
Internal\TypedClientBuilderTests.cs (20)
12public async Task ProducesImplementationThatProxiesMethodsToIClientProxyAsync() 36public async Task ProducesImplementationThatProxiesMethodsToIRenamedClientProxyAsync() 60public async Task SupportsSubInterfaces() 97public async Task SupportsCancellationToken() 160Assert.Equal($"Cannot generate proxy implementation for '{typeof(IVoidMethodClient).FullName}.{nameof(IVoidMethodClient.Method)}'. All client proxy methods must return '{typeof(Task).FullName}' or '{typeof(Task).FullName}<T>'.", ex.Message); 168Assert.Equal($"Cannot generate proxy implementation for '{typeof(IStringMethodClient).FullName}.{nameof(IStringMethodClient.Method)}'. All client proxy methods must return '{typeof(Task).FullName}' or '{typeof(Task).FullName}<T>'.", ex.Message); 206public async Task ProducesImplementationThatProxiesMethodsToISingleClientProxyAsync() 232public async Task ThrowsIfReturnMethodUsedWithoutSingleClientProxy() 245public async Task ResultMethodSupportsCancellationToken() 283Task Method(string arg1, int arg2, object arg3); 290Task MethodAsync(string arg1, int arg2, object arg3); 305Task Method(out string arg1); 310Task Method(ref string arg1); 315Task SubMethod(string foo); 320Task Method(string foo, CancellationToken cancellationToken); 321Task NoArgumentMethod(CancellationToken cancellationToken); 346public Task SendCoreAsync(string method, object[] args, CancellationToken cancellationToken) 360public Task SendCoreAsync(string method, object[] args, CancellationToken cancellationToken)
SerializedHubMessageTests.cs (3)
54public async Task SerializingTwoMessagesFromTheSameProtocolSimultaneouslyResultsInOneCachedItemAsync(int numberOfSerializationsToPreCache) 69var firstSerialization = Task.Run(() => message.GetSerializedMessage(protocol)); 73var secondSerialization = Task.Run(() => message.GetSerializedMessage(protocol));
src\Shared\SyncPoint\SyncPoint.cs (5)
18public Task WaitForSyncPoint() => _atSyncPoint.Task; 32public Task WaitToContinue() 38public static Func<Task> Create(out SyncPoint syncPoint) 51public static Func<Task> Create(int count, out SyncPoint[] syncPoints) 67return Task.CompletedTask;
Startup.cs (1)
63return Task.CompletedTask;
TestAuthHandler.cs (2)
12public Task HandleAsync(AuthorizationHandlerContext context) 26return Task.CompletedTask;
TestFilters.cs (22)
19public async Task OnConnectedAsync(HubLifetimeContext context, Func<HubLifetimeContext, Task> next) 35public async Task OnDisconnectedAsync(HubLifetimeContext context, Exception exception, Func<HubLifetimeContext, Exception, Task> next) 52public async Task OnConnectedAsync(HubLifetimeContext context, Func<HubLifetimeContext, Task> next) 66public async Task OnDisconnectedAsync(HubLifetimeContext context, Exception exception, Func<HubLifetimeContext, Exception, Task> next) 91public Task OnConnectedAsync(HubLifetimeContext context, Func<HubLifetimeContext, Task> next) 97public Task OnDisconnectedAsync(HubLifetimeContext context, Exception exception, Func<HubLifetimeContext, Exception, Task> next) 112public async Task OnConnectedAsync(HubLifetimeContext context, Func<HubLifetimeContext, Task> next) 121public async Task OnDisconnectedAsync(HubLifetimeContext context, Exception exception, Func<HubLifetimeContext, Exception, Task> next) 155public Task OnConnectedAsync(HubLifetimeContext context, Func<HubLifetimeContext, Task> next) 159return Task.CompletedTask; 165public Task OnDisconnectedAsync(HubLifetimeContext context, Exception exception, Func<HubLifetimeContext, Exception, Task> next) 169return Task.CompletedTask;
WebSocketsTransportTests.cs (9)
28public async Task HttpOptionsSetOntoWebSocketOptions() 63public async Task HttpOptionsWebSocketFactoryIsUsed() 90public async Task WebSocketsTransportStopsSendAndReceiveLoopsWhenTransportIsStopped() 104public async Task WebSocketsTransportSendsUserAgent() 135public async Task WebSocketsTransportSendsXRequestedWithHeader() 158public async Task WebSocketsTransportStopsWhenConnectionChannelClosed() 174public async Task WebSocketsTransportStopsWhenConnectionClosedByTheServer(TransferFormat transferFormat) 196public async Task WebSocketsTransportSetsTransferFormat(TransferFormat transferFormat) 214public async Task WebSocketsTransportThrowsForInvalidTransferFormat(TransferFormat transferFormat)
WriteThenCloseConnectionHandler.cs (1)
12public override async Task OnConnectedAsync(ConnectionContext connection)
Microsoft.AspNetCore.SignalR.Tests.Utils (13)
CancellationTokenExtensions.cs (1)
8public static Task WaitForCancellationAsync(this CancellationToken token)
PipeReaderExtensions.cs (1)
53public static async Task ConsumeAsync(this PipeReader pipeReader, int numBytes)
src\Shared\SignalR\InProcessTestServer.cs (1)
92private async Task StartServerInner()
TaskExtensions.cs (7)
12public static async Task OrThrowIfOtherFails(this Task task, Task otherTask) 14var completed = await Task.WhenAny(task, otherTask); 28public static async Task<T> OrThrowIfOtherFails<T>(this Task<T> task, Task otherTask) 30await OrThrowIfOtherFails((Task)task, otherTask);
TestClient.cs (3)
34public Task Connected => ((TaskCompletionSource)Connection.Items["ConnectedTask"]).Task; 68public async Task<Task> ConnectAsync( 78var connection = handler.OnConnectedAsync(Connection);
Microsoft.AspNetCore.SpaProxy (10)
SpaProxyLaunchManager.cs (7)
21private Task? _launchTask; 53async Task UpdateStatus(Task launchTask) 125private async Task StartSpaProcessAndProbeForLiveness(CancellationToken cancellationToken) 146await Task.Delay(1000, cancellationToken); 317public Task StopAsync() 320return Task.CompletedTask;
SpaProxyMiddleware.cs (2)
44public Task Invoke(HttpContext context) 53private async Task InvokeCore(HttpContext context)
SpaProxyStartupFilter.cs (1)
36async Task StartIfNotRunning()
Microsoft.AspNetCore.SpaServices.Extensions (21)
AngularCli\AngularCliBuilder.cs (1)
39public async Task Build(ISpaBuilder spaBuilder)
AngularCli\AngularCliMiddleware.cs (2)
97private static async Task WaitForAngularCliServerToAcceptRequests(Uri cliServerUri) 120await Task.Delay(500);
Prerendering\ISpaPrerendererBuilder.cs (2)
20/// <returns>A <see cref="Task"/> representing completion of the build process.</returns> 21Task Build(ISpaBuilder spaBuilder);
Proxying\ConditionalProxyMiddleware.cs (2)
43public Task Invoke(HttpContext context) 52private async Task InvokeCore(HttpContext context)
Proxying\SpaProxy.cs (4)
165private static async Task CopyProxyHttpResponse(HttpContext context, HttpResponseMessage responseMessage, CancellationToken cancellationToken) 263await Task.WhenAll( 272private static async Task PumpWebSocket(WebSocket source, WebSocket destination, int bufferSize, CancellationToken cancellationToken) 296await Task.Delay(100, cancellationToken);
Proxying\SpaProxyingExtensions.cs (2)
46() => Task.FromResult(baseUri)); 55/// <param name="baseUriTaskFactory">A callback that will be invoked on each request to supply a <see cref="Task"/> that resolves with the target base URI to which requests should be proxied.</param>
Util\EventedStreamReader.cs (2)
30Task.Factory.StartNew(Run, CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default); 74private async Task Run()
Util\TaskTimeoutExtensions.cs (6)
8public static async Task WithTimeout(this Task task, TimeSpan timeoutDelay, string message) 10if (task == await Task.WhenAny(task, Task.Delay(timeoutDelay))) 22if (task == await Task.WhenAny(task, Task.Delay(timeoutDelay)))
Microsoft.AspNetCore.SpaServices.Extensions.Tests (2)
SpaProxyTests.cs (2)
53public async Task PerformProxyRequest_TestUrlCombination(string baseUrl, string path, string queryString, string expected) 57var baseUriTask = Task.FromResult(new Uri(baseUrl));
Microsoft.AspNetCore.StaticAssets (10)
Development\StaticAssetDevelopmentRuntimeHandler.cs (4)
84public Task CompleteAsync() 94public Task SendFileAsync(string path, long offset, long? count, CancellationToken cancellationToken = default) 140public Task StartAsync(CancellationToken cancellationToken = default) 202return Task.CompletedTask;
StaticAssetsInvoker.cs (6)
82private Task ApplyResponseHeadersAsync(StaticAssetInvocationContext context, int statusCode) 104return Task.CompletedTask; 107private Task SendStatusAsync(StaticAssetInvocationContext context, int statusCode) 120public async Task Invoke(HttpContext context) 174private async Task SendAsync(StaticAssetInvocationContext context) 189private async Task SendRangeAsync(StaticAssetInvocationContext requestContext, RangeItemHeaderValue? range)
Microsoft.AspNetCore.StaticAssets.Tests (25)
StaticAssetsIntegrationTests.cs (25)
24public async Task CanServeAssetsFromManifestAsync() 74public async Task CanServeNewFilesAddedAfterBuildDuringDevelopment() 128public async Task CanModifyAssetsOnTheFlyInDevelopment() 181public async Task CanModifyAssetsWithCompressedVersionsOnTheFlyInDevelopment() 399public async Task ServerShouldReturnETag() 409public async Task SameETagShouldBeReturnedAgain() 427public async Task IfMatchShouldReturn412WhenNotListed(HttpMethod method) 438public async Task IfMatchShouldBeServedWhenListed(HttpMethod method) 451public async Task IfMatchShouldBeServedForAsterisk(HttpMethod method) 462public async Task IfMatchShouldBeIgnoredForUnsupportedMethods(HttpMethod method) 487public async Task IfNoneMatchShouldReturn304ForMatching(HttpMethod method) 500public async Task IfNoneMatchAllShouldReturn304ForMatching(HttpMethod method) 513public async Task IfNoneMatchShouldBeIgnoredForNonTwoHundredAnd304Responses(HttpMethod method) 536public async Task ServerShouldReturnLastModified(HttpMethod method) 559public async Task MatchingBothConditionsReturnsNotModified(HttpMethod method) 575public async Task MatchingAtLeastOneETagReturnsNotModified(HttpMethod method) 598public async Task MissingEitherOrBothConditionsReturnsNormally(HttpMethod method) 642public async Task InvalidIfModifiedSinceDateFormatGivesNormalGet(HttpMethod method) 655public async Task FutureIfModifiedSinceDateFormatGivesNormalGet(HttpMethod method) 675public async Task IfModifiedSinceDateGreaterThanLastModifiedShouldReturn304(HttpMethod method) 691public async Task SupportsIfModifiedDateFormats(HttpMethod method) 716public async Task IfModifiedSinceDateLessThanLastModifiedShouldReturn200(HttpMethod method) 732public async Task InvalidIfUnmodifiedSinceDateFormatGivesNormalGet(HttpMethod method) 745public async Task FutureIfUnmodifiedSinceDateFormatGivesNormalGet(HttpMethod method) 757public async Task IfUnmodifiedSinceDateLessThanLastModifiedShouldReturn412(HttpMethod method)
Microsoft.AspNetCore.StaticFiles (18)
DefaultFilesMiddleware.cs (2)
49public Task Invoke(HttpContext context) 72return Task.CompletedTask;
DirectoryBrowserMiddleware.cs (2)
61public Task Invoke(HttpContext context) 74return Task.CompletedTask;
HtmlDirectoryFormatter.cs (2)
35public virtual Task GenerateContentAsync(HttpContext context, IEnumerable<IFileInfo> contents) 45return Task.CompletedTask;
IDirectoryFormatter.cs (1)
19Task GenerateContentAsync(HttpContext context, IEnumerable<IFileInfo> contents);
StaticFileContext.cs (6)
243public Task ApplyResponseHeadersAsync(int statusCode) 278return Task.CompletedTask; 297public Task SendStatusAsync(int statusCode) 304public async Task ServeStaticFile(HttpContext context, RequestDelegate next) 350public async Task SendAsync() 366internal async Task SendRangeAsync()
StaticFileMiddleware.cs (2)
58public Task Invoke(HttpContext context) 111private Task TryServeStaticFile(HttpContext context, string? contentType, PathString subPath)
StaticFileOptions.cs (3)
16internal static readonly Func<StaticFileResponseContext, Task> _defaultOnPrepareResponseAsync = _ => Task.CompletedTask; 78public Func<StaticFileResponseContext, Task> OnPrepareResponseAsync { get; set; }
Microsoft.AspNetCore.StaticFiles.FunctionalTests (12)
FallbackStaticFileTest.cs (2)
21public async Task ReturnsFileForDefaultPattern() 74public async Task ReturnsFileForCustomPattern()
StaticFileMiddlewareTests.cs (10)
22public async Task ReturnsNotFoundWithoutWwwroot() 45public async Task Endpoint_PassesThrough() 91public async Task FoundFile_LastModifiedTrimsSeconds() 119public async Task FoundFile_Served_All(string baseUrl, string baseDir, string requestUrl) 131public async Task FoundFile_Served_Windows(string baseUrl, string baseDir, string requestUrl) 136private async Task FoundFile_Served(string baseUrl, string baseDir, string requestUrl) 178public async Task HeadFile_HeadersButNotBodyServed(string baseUrl, string baseDir, string requestUrl) 222public Task ClientDisconnect_Kestrel_NoWriteExceptionThrown() 230public Task ClientDisconnect_WebListener_NoWriteExceptionThrown() 235private async Task ClientDisconnect_NoWriteExceptionThrown(ServerType serverType)
Microsoft.AspNetCore.StaticFiles.Tests (106)
CacheHeaderTests.cs (21)
15public async Task ServerShouldReturnETag() 26public async Task SameETagShouldBeReturnedAgain() 46public async Task IfMatchShouldReturn412WhenNotListed(HttpMethod method) 58public async Task IfMatchShouldBeServedWhenListed(HttpMethod method) 72public async Task IfMatchShouldBeServedForAsterisk(HttpMethod method) 84public async Task IfMatchShouldBeIgnoredForUnsupportedMethods(HttpMethod method) 110public async Task IfNoneMatchShouldReturn304ForMatching(HttpMethod method) 124public async Task IfNoneMatchAllShouldReturn304ForMatching(HttpMethod method) 138public async Task IfNoneMatchShouldBeIgnoredForNonTwoHundredAnd304Responses(HttpMethod method) 162public async Task ServerShouldReturnLastModified(HttpMethod method) 186public async Task MatchingBothConditionsReturnsNotModified(HttpMethod method) 205public async Task MatchingAtLeastOneETagReturnsNotModified(HttpMethod method) 231public async Task MissingEitherOrBothConditionsReturnsNormally(HttpMethod method) 280public async Task InvalidIfModifiedSinceDateFormatGivesNormalGet(HttpMethod method) 295public async Task FutureIfModifiedSinceDateFormatGivesNormalGet(HttpMethod method) 317public async Task IfModifiedSinceDateGreaterThanLastModifiedShouldReturn304(HttpMethod method) 336public async Task SupportsIfModifiedDateFormats(HttpMethod method) 364public async Task IfModifiedSinceDateLessThanLastModifiedShouldReturn200(HttpMethod method) 383public async Task InvalidIfUnmodifiedSinceDateFormatGivesNormalGet(HttpMethod method) 398public async Task FutureIfUnmodifiedSinceDateFormatGivesNormalGet(HttpMethod method) 413public async Task IfUnmodifiedSinceDateLessThanLastModifiedShouldReturn412(HttpMethod method)
DefaultFilesMiddlewareTests.cs (15)
17public async Task NullArguments() 41public async Task NoMatch_PassesThrough_All(string baseUrl, string baseDir, string requestUrl, bool appendTrailingSlash = true) 53public async Task NoMatch_PassesThrough_Windows(string baseUrl, string baseDir, string requestUrl, bool appendTrailingSlash = true) 58private async Task NoMatch_PassesThrough(string baseUrl, string baseDir, string requestUrl, bool appendTrailingSlash = true) 81public async Task Endpoint_With_RequestDelegate_PassesThrough() 124public async Task Endpoint_With_Null_RequestDelegate_Does_Not_PassThrough() 181public async Task FoundDirectoryWithDefaultFile_PathModified_All(string baseUrl, string baseDir, string requestUrl, bool appendTrailingSlash = true) 201public async Task FoundDirectoryWithDefaultFile_PathModified_Windows(string baseUrl, string baseDir, string requestUrl, bool appendTrailingSlash = true) 206private async Task FoundDirectoryWithDefaultFile_PathModified(string baseUrl, string baseDir, string requestUrl, bool appendTrailingSlash = true) 236public async Task NearMatch_RedirectAddSlash_All(string baseUrl, string baseDir, string requestUrl, string queryString) 248public async Task NearMatch_RedirectAddSlash_Windows(string baseUrl, string baseDir, string requestUrl, string queryString) 253private async Task NearMatch_RedirectAddSlash(string baseUrl, string baseDir, string requestUrl, string queryString) 286public async Task PostDirectory_PassesThrough_All(string baseUrl, string baseDir, string requestUrl, bool appendTrailingSlash = true) 303public async Task PostDirectory_PassesThrough_Windows(string baseUrl, string baseDir, string requestUrl, bool appendTrailingSlash = true) 308private async Task PostDirectory_PassesThrough(string baseUrl, string baseDir, string requestUrl, bool appendTrailingSlash = true)
DirectoryBrowserMiddlewareTests.cs (19)
17public async Task WorksWithoutEncoderRegistered() 25public async Task NullArguments() 62public async Task NoMatch_PassesThrough_All(string baseUrl, string baseDir, string requestUrl, bool appendTrailingSlash = true) 74public async Task NoMatch_PassesThrough_Windows(string baseUrl, string baseDir, string requestUrl, bool appendTrailingSlash = true) 79private async Task NoMatch_PassesThrough(string baseUrl, string baseDir, string requestUrl, bool appendTrailingSlash = true) 98public async Task Endpoint_With_RequestDelegate_PassesThrough() 139public async Task Endpoint_With_Null_RequestDelegate_Does_Not_PassThrough() 193public async Task FoundDirectory_Served_All(string baseUrl, string baseDir, string requestUrl, bool appendTrailingSlash = true) 207public async Task FoundDirectory_Served_Windows(string baseUrl, string baseDir, string requestUrl, bool appendTrailingSlash = true) 212private async Task FoundDirectory_Served(string baseUrl, string baseDir, string requestUrl, bool appendTrailingSlash = true) 241public async Task NearMatch_RedirectAddSlash_All(string baseUrl, string baseDir, string requestUrl, string queryString) 251public async Task NearMatch_RedirectAddSlash_Windows(string baseUrl, string baseDir, string requestUrl, string queryString) 256private async Task NearMatch_RedirectAddSlash(string baseUrl, string baseDir, string requestUrl, string queryString) 290public async Task PostDirectory_PassesThrough_All(string baseUrl, string baseDir, string requestUrl, bool appendTrailingSlash = true) 301public async Task PostDirectory_PassesThrough_Windows(string baseUrl, string baseDir, string requestUrl, bool appendTrailingSlash = true) 306private async Task PostDirectory_PassesThrough(string baseUrl, string baseDir, string requestUrl, bool appendTrailingSlash = true) 338public async Task HeadDirectory_HeadersButNotBodyServed_All(string baseUrl, string baseDir, string requestUrl, bool appendTrailingSlash = true) 349public async Task HeadDirectory_HeadersButNotBodyServed_Windows(string baseUrl, string baseDir, string requestUrl, bool appendTrailingSlash = true) 354private async Task HeadDirectory_HeadersButNotBodyServed(string baseUrl, string baseDir, string requestUrl, bool appendTrailingSlash = true)
RangeHeaderTests.cs (22)
17public async Task IfRangeWithCurrentEtagShouldServePartialContent() 38public async Task HEADIfRangeWithCurrentEtagShouldReturn200Ok() 59public async Task IfRangeWithCurrentDateShouldServePartialContent() 76public async Task IfModifiedSinceWithPastDateShouldServePartialContent() 93public async Task IfModifiedSinceWithCurrentDateShouldReturn304() 110public async Task HEADIfRangeWithCurrentDateShouldReturn200Ok() 131public async Task IfRangeWithOldEtagShouldServeFullContent() 148public async Task HEADIfRangeWithOldEtagShouldServeFullContent() 165public async Task IfRangeWithOldDateShouldServeFullContent() 184public async Task HEADIfRangeWithOldDateShouldServeFullContent() 204public async Task IfRangeWithoutRangeShouldServeFullContent() 231public async Task HEADIfRangeWithoutRangeShouldServeFullContent() 266public async Task SingleValidRangeShouldServePartialContent(string range, string expectedRange, int length, string expectedData) 287public async Task SingleValidRangeShouldServePartialContentSingleByteFile(string range, string expectedRange, int length, string expectedData) 308public async Task SingleValidRangeShouldServeRequestedRangeNotSatisfiableEmptyFile(string range) 322public async Task HEADSingleValidRangeShouldReturnOk(string range) 340public async Task SingleNotSatisfiableRange(string range) 355public async Task HEADSingleNotSatisfiableRangeReturnsOk(string range) 375public async Task SingleInvalidRangeIgnored(string range) 397public async Task HEADSingleInvalidRangeIgnored(string range) 418public async Task MultipleValidRangesShouldServeFullContent(string ranges) 438public async Task HEADMultipleValidRangesShouldServeFullContent(string range)
StaticFileContextTest.cs (2)
63public async Task EnablesHttpsCompression_IfMatched() 119public async Task RequestAborted_DoesntThrow()
StaticFileMiddlewareTests.cs (27)
23public async Task ReturnsNotFoundWithoutWwwroot() 49public async Task ReturnsNotFoundForBrokenSymlink() 84public async Task ReturnsNotFoundIfSendFileThrows() 119public async Task FoundFile_LastModifiedTrimsSeconds() 139public async Task NullArguments() 158public async Task FoundFile_Served_All(string baseUrl, string baseDir, string requestUrl) 170public async Task FoundFile_Served_Windows(string baseUrl, string baseDir, string requestUrl) 175private async Task FoundFile_Served(string baseUrl, string baseDir, string requestUrl) 205public async Task OnPrepareResponse_Executed_Test() 245public async Task OnPrepareResponseAsync_Executed_Test() 262return Task.CompletedTask; 287public async Task OnPrepareResponse_Execution_Order_Test() 312return Task.CompletedTask; 338public async Task File_Served_If_Endpoint_With_Null_RequestDelegate_Is_Active() 379public async Task File_NotServed_If_Endpoint_With_RequestDelegate_Is_Active() 418public async Task OverrideDefaultStatusCode() 440public async Task DontOverrideNonDefaultStatusCode() 468public async Task HeadFile_HeadersButNotBodyServed(string baseUrl, string baseDir, string requestUrl) 490public async Task Get_NoMatch_PassesThrough(string baseUrl, string baseDir, string requestUrl) => 495public async Task Head_NoMatch_PassesThrough(string baseUrl, string baseDir, string requestUrl) => 500public async Task Unknown_NoMatch_PassesThrough(string baseUrl, string baseDir, string requestUrl) => 505public async Task Options_Match_PassesThrough(string baseUrl, string baseDir, string requestUrl) => 510public async Task Trace_Match_PassesThrough(string baseUrl, string baseDir, string requestUrl) => 515public async Task Post_Match_PassesThrough(string baseUrl, string baseDir, string requestUrl) => 520public async Task Put_Match_PassesThrough(string baseUrl, string baseDir, string requestUrl) => 525public async Task Unknown_Match_PassesThrough(string baseUrl, string baseDir, string requestUrl) => 528private async Task PassesThrough(string method, string baseUrl, string baseDir, string requestUrl)
Microsoft.AspNetCore.TestHost (44)
ApplicationWrapper.cs (3)
13internal abstract Task ProcessRequestAsync(object context); 49internal override Task ProcessRequestAsync(object context) 54Task IHttpApplication<TContext>.ProcessRequestAsync(TContext context)
AsyncStreamWrapper.cs (2)
37public override Task FlushAsync(CancellationToken cancellationToken) 102public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
HttpContextBuilder.cs (7)
28private Func<PipeWriter, Task>? _sendRequestStream; 68internal void SendRequestStream(Func<PipeWriter, Task> sendRequestStream) 89async Task RunRequestAsync() 108var requestTask = _sendRequestStream(_requestPipe.Writer); 157_ = Task.Factory.StartNew(RunRequestAsync, default, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default); 204internal async Task CompleteResponseAsync() 212internal async Task ReturnResponseMessageAsync()
NoopHostLifetime.cs (4)
10public Task StopAsync(CancellationToken cancellationToken) 12return Task.CompletedTask; 15public Task WaitForStartAsync(CancellationToken cancellationToken) 17return Task.CompletedTask;
ResponseBodyPipeWriter.cs (4)
11private readonly Func<Task> _onFirstWriteAsync; 17internal ResponseBodyPipeWriter(Pipe pipe, Func<Task> onFirstWriteAsync) 33private Task FirstWriteAsync() 40return Task.CompletedTask;
ResponseBodyReaderStream.cs (2)
53public override Task FlushAsync(CancellationToken cancellationToken) => throw new NotSupportedException(); 58public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) => throw new NotSupportedException();
ResponseBodyWriterStream.cs (2)
52public override async Task FlushAsync(CancellationToken cancellationToken) 68public override async Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
ResponseFeature.cs (11)
15private Func<Task> _responseStartingAsync = () => Task.CompletedTask; 16private Func<Task> _responseCompletedAsync = () => Task.CompletedTask; 74public void OnStarting(Func<object, Task> callback, object state) 89public void OnCompleted(Func<object, Task> callback, object state) 105public async Task FireOnSendingHeadersAsync() 121public Task FireOnResponseCompletedAsync() 126public async Task StartAsync(CancellationToken token = default) 143public Task SendFileAsync(string path, long offset, long? count, CancellationToken cancellation) 148public Task CompleteAsync()
TestServer.cs (4)
245Task IServer.StartAsync<TContext>(IHttpApplication<TContext> application, CancellationToken cancellationToken) 252return Task.CompletedTask; 255Task IServer.StopAsync(CancellationToken cancellationToken) 257return Task.CompletedTask;
TestWebSocket.cs (5)
46public override async Task CloseAsync(WebSocketCloseStatus closeStatus, string? statusDescription, CancellationToken cancellationToken) 69public override async Task CloseOutputAsync(WebSocketCloseStatus closeStatus, string? statusDescription, CancellationToken cancellationToken) 154public override Task SendAsync(ArraySegment<byte> buffer, WebSocketMessageType messageType, bool endOfMessage, CancellationToken cancellationToken) 278public Task SendAsync(Message message) 297return Task.FromResult(true);
Microsoft.AspNetCore.TestHost.Tests (163)
ClientHandlerTests.cs (48)
22public async Task SlashUrlEncodedDoesNotGetDecoded() 45public Task ExpectedKeysAreAvailable() 64return Task.FromResult(0); 71public Task ExpectedKeysAreInFeatures() 96public Task SingleSlashNotMovedToPathBase() 103return Task.FromResult(0); 110public Task UserAgentHeaderWorks() 118return Task.CompletedTask; 127public Task ContentLengthWithBodyWorks() 136return Task.CompletedTask; 145public Task ContentLengthNotPresentWithNoBody() 153return Task.CompletedTask; 161public Task ContentLengthWithImplicitChunkedTransferEncodingWorks() 169return Task.CompletedTask; 178public Task ContentLengthWithExplicitChunkedTransferEncodingWorks() 186return Task.CompletedTask; 198public async Task ServerTrailersSetOnResponseAfterContentRead() 263public Task AdditionalConfigurationAllowsSettingConnectionInfo() 278public Task AdditionalConfigurationAllowsOverridingDefaultBehavior() 293public async Task ResponseStartAsync() 322await Task.Delay(100); 339new DummyApplication(context => { return Task.CompletedTask; })); 348public async Task ResubmitRequestWorks() 371public async Task MiddlewareOnlySetsHeaders() 376return Task.FromResult(0); 384public async Task BlockingMiddlewareShouldNotBlockClient() 390return Task.FromResult(0); 401public async Task HeadersAvailableBeforeBodyFinished() 420public async Task FlushSendsHeaders() 439public async Task ClientDisposalCloses() 461public async Task ClientCancellationAborts() 484public async Task ExceptionFromDisposedRequestContent() 490return Task.CompletedTask; 507public Task ExceptionBeforeFirstWriteIsReported() 519public async Task ExceptionAfterFirstWriteIsReported() 539public Task ExceptionFromOnStartingFirstWriteIsReported() 555public Task ExceptionFromOnStartingWithNoWriteIsReported() 563return Task.CompletedTask; 571public Task ExceptionFromOnStartingWithErrorHandlerIsReported() 627internal override Task ProcessRequestAsync(object context) 632Task IHttpApplication<TestHostingContext>.ProcessRequestAsync(TestHostingContext context) 671internal override Task ProcessRequestAsync(object context) 676Task IHttpApplication<TestHostingContext>.ProcessRequestAsync(TestHostingContext context) 678return Task.FromResult(0); 688public async Task ClientHandlerCreateContextWithDefaultRequestParameters() 701return Task.FromResult(0); 729protected override Task SerializeToStreamAsync(Stream stream, TransportContext context) 731return Task.CompletedTask;
HttpContextBuilderTests.cs (20)
18public async Task ExpectedValuesAreAvailable() 48public async Task UserAgentHeaderWorks() 64public async Task SingleSlashNotMovedToPathBase() 78public async Task MiddlewareOnlySetsHeaders() 85return Task.FromResult(0); 95public async Task BlockingMiddlewareShouldNotBlockClient() 103return Task.FromResult(0); 116public async Task HeadersAvailableBeforeSyncBodyFinished() 143public async Task HeadersAvailableBeforeAsyncBodyFinished() 167public async Task FlushSendsHeaders() 189public async Task ClientDisposalCloses() 215public async Task ClientCancellationAborts() 225return Task.CompletedTask; 238public async Task ClientCancellationAbortsReadAsync() 265public Task ExceptionBeforeFirstWriteIsReported() 279public async Task ExceptionAfterFirstWriteIsReported() 303public async Task ClientHandlerCreateContextWithDefaultRequestParameters() 316return Task.FromResult(0); 326public async Task CallingAbortInsideHandlerShouldSetRequestAborted() 336return Task.CompletedTask;
RequestLifetimeTests.cs (4)
16public async Task LifetimeFeature_Abort_TriggersRequestAbortedToken() 34public async Task LifetimeFeature_AbortBeforeHeadersSent_ClientThrows() 50public async Task LifetimeFeature_AbortAfterHeadersSent_ClientBodyThrows() 73public async Task LifetimeFeature_AbortAfterSomeDataSent_ClientBodyThrows()
ResponseBodyTests.cs (8)
16public async Task BodyWriter_GetMemoryAdvance_AutoCompleted() 24return Task.CompletedTask; 33public async Task BodyWriter_StartAsyncGetMemoryAdvance_AutoCompleted() 50public async Task BodyStream_SyncDisabled_WriteThrows() 66public async Task BodyStream_SyncEnabled_WriteSucceeds() 85public async Task BodyStream_SyncDisabled_FlushThrows() 104public async Task BodyStream_SyncEnabled_FlushSucceeds() 124public async Task BodyStream_ZeroByteRead_Success()
ResponseFeatureTests.cs (3)
9public async Task StatusCode_DefaultsTo200() 25public async Task StartAsync_StartsResponse() 52return Task.FromResult(string.Empty);
ResponseResetTests.cs (10)
19public async Task ResetFeature_Http11_Missing() 25return Task.CompletedTask; 35public async Task ResetFeature_Http2_Present() 41return Task.CompletedTask; 51public async Task ResetFeature_Http3_Present() 57return Task.CompletedTask; 67public async Task ResetFeature_Reset_TriggersRequestAbortedToken() 88public async Task ResetFeature_ResetBeforeHeadersSent_ClientThrows() 107public async Task ResetFeature_ResetAfterHeadersSent_ClientBodyThrows() 133public async Task ResetFeature_ResetAfterSomeDataSent_ClientBodyThrows()
src\Shared\SyncPoint\SyncPoint.cs (5)
18public Task WaitForSyncPoint() => _atSyncPoint.Task; 32public Task WaitToContinue() 38public static Func<Task> Create(out SyncPoint syncPoint) 51public static Func<Task> Create(int count, out SyncPoint[] syncPoints) 67return Task.CompletedTask;
TestClientTests.cs (34)
23public async Task GetAsyncWorks() 41public async Task NoTrailingSlash_NoPathBase() 63public async Task SingleTrailingSlash_NoPathBase() 85public async Task PutAsyncWorks() 106public async Task PostAsyncWorks() 124public async Task LargePayload_DisposesRequest_AfterResponseIsCompleted() 166public async Task ClientStreamingWorks() 240public async Task ClientStreaming_HttpContentException() 246return Task.CompletedTask; 262public async Task ClientStreaming_Cancellation() 343public async Task ClientStreaming_ResponseCompletesWithoutReadingRequest() 382var writeTask = Task.Run(async () => 405public async Task ClientStreaming_ResponseCompletesWithPendingRead_ThrowError() 453public async Task ClientStreaming_ResponseCompletesWithoutResponseBodyWrite() 461return Task.CompletedTask; 500public async Task ClientStreaming_ServerAbort() 553private readonly Func<Stream, Task> _sendContent; 555public PushContent(Func<Stream, Task> sendContent) 560protected override Task SerializeToStreamAsync(Stream stream, TransportContext context) 573public async Task WebSocketWorks() 644public async Task WebSocketSubProtocolsWorks() 696public async Task WebSocketAcceptThrowsWhenCancelled() 755public async Task WebSocketDisposalThrowsOnPeer() 782public async Task WebSocketTinyReceiveGeneratesEndOfMessage() 826public async Task ClientDisposalAbortsRequest() 860public async Task ClientCancellationAbortsRequest() 867await Task.Delay(TimeSpan.FromSeconds(30), ctx.RequestAborted); 886public async Task AsyncLocalValueOnClientIsNotPreserved() 911public async Task AsyncLocalValueOnClientIsPreservedIfPreserveExecutionContextIsTrue() 939public async Task SendAsync_Default_Protocol11() 965public async Task SendAsync_ExplicitlySet_Protocol20() 992public async Task SendAsync_ExplicitlySet_Protocol30() 1019public async Task VerifyWebSocketAndUpgradeFeaturesForNonWebSocket()
TestServerTests.cs (27)
24public async Task GenericRawCreateAndStartHost_GetTestServer() 44public async Task GenericCreateAndStartHost_GetTestServer() 60public async Task GenericCreateAndStartHost_GetTestClient() 76public async Task UseTestServerRegistersNoopHostLifetime() 122public async Task ServicesCanBeOverridenForTestingAsync() 192public async Task RequestServicesAutoCreated() 208public async Task DispoingTheRequestBodyDoesNotDisposeClientStreams() 251public async Task CustomServiceProviderSetsApplicationServices() 339public async Task TestServerConstructorShouldProvideServicesFromHostBuilder() 362public async Task TestServerConstructorSetOptions() 401public Task Invoke(HttpContext httpContext) 424public async Task ExistingRequestServicesWillNotBeReplaced() 445public async Task CanSetCustomServiceProvider() 493public async Task ExistingServiceProviderFeatureWillNotBeReplaced() 535public async Task WillReplaceServiceProviderFeatureWithNullRequestServices() 556public async Task CanAccessLogger() 573public async Task CanAccessHttpContext() 604public async Task CanAddNewHostServices() 626public async Task CreateInvokesApp() 642public async Task DisposeStreamIgnored() 660public async Task DisposedServerThrows() 679public async Task CancelAborts() 697public async Task CanCreateViaStartupType() 708public async Task CanCreateViaStartupTypeAndSpecifyEnv() 721public async Task BeginEndDiagnosticAvailable() 750public async Task ExceptionDiagnosticAvailable() 781public async Task ManuallySetHostWinsOverInferredHostFromRequestUri(string uri)
WebSocketClientTests.cs (4)
16public async Task ConnectAsync_ShouldSetRequestProperties(string requestUri, string expectedHost) 33return Task.FromResult(0); 57public async Task CanAcceptWebSocket() 95public async Task VerifyWebSocketAndUpgradeFeatures()
Microsoft.AspNetCore.Tests (82)
WebApplicationTests.cs (79)
162public async Task WebApplicationBuilder_New(CreateBuilderArgsFunc createBuilder) 173public async Task WebApplicationBuilderConfiguration_IncludesCommandLineArguments(CreateBuilderArgsFunc createBuilder) 196public async Task WebApplicationRunAsync_UsesDefaultUrls(CreateBuilderFunc createBuilder) 215public async Task WebApplicationRunUrls_UpdatesIServerAddressesFeature(CreateBuilderFunc createBuilder) 223var runTask = app.RunAsync("http://localhost:5001"); 234public async Task WebApplicationUrls_UpdatesIServerAddressesFeature(CreateBuilderFunc createBuilder) 254public async Task WebApplicationRunUrls_OverridesIServerAddressesFeature(CreateBuilderFunc createBuilder) 265var runTask = app.RunAsync("http://localhost:5001"); 276public async Task WebApplicationUrls_ThrowsInvalidOperationExceptionIfThereIsNoIServerAddressesFeature(CreateBuilderFunc createBuilder) 287public async Task HostedServicesRunBeforeTheServerStarts(CreateBuilderFunc createBuilder) 313public Task StartAsync(CancellationToken cancellationToken) 316return Task.CompletedTask; 319public Task StopAsync(CancellationToken cancellationToken) => Task.CompletedTask; 335public Task StartAsync<TContext>(IHttpApplication<TContext> application, CancellationToken cancellationToken) where TContext : notnull 338return Task.CompletedTask; 341public Task StopAsync(CancellationToken cancellationToken) 343return Task.CompletedTask; 349public async Task WebApplicationRunUrls_ThrowsInvalidOperationExceptionIfThereIsNoIServerAddressesFeature(CreateBuilderFunc createBuilder) 360public async Task WebApplicationRunUrls_ThrowsInvalidOperationExceptionIfServerAddressesFeatureIsReadOnly(CreateBuilderFunc createBuilder) 1115public async Task WebApplicationCanObserveConfigurationChangesMadeInBuild(CreateBuilderFunc createBuilder) 1174public async Task WebApplicationCanObserveSourcesClearedInBuild(CreateBuilderFunc createBuilder) 1218public async Task WebApplicationCanObserveSourcesClearedInHostConfiguration(CreateBuilderOptionsFunc createBuilder) 1261public async Task WebApplicationCanHandleStreamBackedConfigurationAddedInBuild(CreateBuilderFunc createBuilder) 1287public async Task WebApplicationDisposesConfigurationProvidersAddedInBuild(CreateBuilderFunc createBuilder) 1323public async Task WebApplicationMakesOriginalConfigurationProvidersAddedInBuildAccessable(CreateBuilderFunc createBuilder) 1352public async Task WebApplicationConfiguration_HostFilterOptionsAreReloadable(CreateBuilderFunc createBuilder) 1438public async Task WebApplicationConfiguration_EnablesForwardedHeadersFromConfig(CreateBuilderFunc createBuilder) 1448return Task.CompletedTask; 1489public async Task WebApplication_CanResolveServicesAddedAfterBuildFromServiceCollection(CreateBuilderFunc createBuilder) 1518public async Task WebApplication_CanResolveIConfigurationFromServiceCollection(CreateBuilderFunc createBuilder) 1573public async Task WebApplication_CanCallUseRoutingWithoutUseEndpoints(CreateBuilderFunc createBuilder) 1612public async Task WebApplication_CanCallUseEndpointsWithoutUseRoutingFails(CreateBuilderFunc createBuilder) 1662public async Task WebApplicationBuilder_StartupFilterCanAddTerminalMiddleware(CreateBuilderFunc createBuilder) 1684public async Task StartupFilter_WithUseRoutingWorks(CreateBuilderFunc createBuilder) 1711public async Task CanAddMiddlewareBeforeUseRouting(CreateBuilderFunc createBuilder) 1749public async Task WebApplicationBuilder_OnlyAddsDefaultServicesOnce(CreateBuilderFunc createBuilder) 1812public async Task WebApplicationBuilder_ThrowsExceptionIfServicesAlreadyBuilt(CreateBuilderFunc createBuilder) 1856public async Task EndpointDataSourceOnlyAddsOnce(CreateBuilderFunc createBuilder) 1883public async Task RoutesAddedToCorrectMatcher(CreateBuilderFunc createBuilder) 1919public async Task WebApplication_CallsUseRoutingAndUseEndpoints(CreateBuilderFunc createBuilder) 1946public async Task BranchingPipelineHasOwnRoutes(CreateBuilderFunc createBuilder) 2011public async Task PropertiesPreservedFromInnerApplication(CreateBuilderFunc createBuilder) 2025public async Task DeveloperExceptionPageIsOnByDefaultInDevelopment(CreateBuilderOptionsFunc createBuilder) 2047public async Task DeveloperExceptionPageDoesNotGetCaughtByStartupFilters(CreateBuilderOptionsFunc createBuilder) 2065public async Task DeveloperExceptionPageIsNotOnInProduction(CreateBuilderOptionsFunc createBuilder) 2072public async Task DeveloperExceptionPageIsNotOnInDevelopmentWithEmptyBuilder() 2078private async Task DeveloperExceptionPageIsNotOn(WebApplicationBuilder builder) 2095public async Task HostingStartupRunsWhenApplicationIsNotEntryPoint() 2105public async Task HostingStartupRunsWhenApplicationIsNotEntryPointWithArgs() 2115public async Task HostingStartupRunsWhenApplicationIsNotEntryPointApplicationNameWinsOverArgs() 2131public async Task DeveloperExceptionPageWritesBadRequestDetailsToResponseByDefaultInDevelopment(CreateBuilderOptionsFunc createBuilder) 2156public async Task NoExceptionAreThrownForBadRequestsInProduction(CreateBuilderOptionsFunc createBuilder) 2396public async Task CanUseMiddleware(CreateBuilderFunc createBuilder) 2431public async Task RegisterAuthMiddlewaresCorrectly(CreateBuilderFunc createBuilder) 2476public async Task SupportsDisablingMiddlewareAutoRegistration(CreateBuilderFunc createBuilder) 2536public async Task UsingCreateBuilderResultsInRegexConstraintBeingPresent() 2562public async Task UsingCreateSlimBuilderResultsInAlphaConstraintStillWorking() 2588public async Task UsingCreateSlimBuilderResultsInErrorWhenTryingToUseRegexConstraint() 2614public async Task UsingCreateSlimBuilderWorksIfRegexConstraintAddedViaAddRouting() 2641public async Task UsingCreateSlimBuilderWorksIfRegexConstraintAddedViaAddRoutingCoreWithActionDelegate() 2729public async Task DebugView_UseMiddleware_HasEndpointsAndAuth_Run_HasAutomaticMiddleware() 2757public async Task DebugView_NoMiddleware_Run_HasAutomaticMiddleware() 2798public async Task DebugView_Endpoints_AvailableBeforeAndAfterStart() 2818public async Task DebugView_Endpoints_UseEndpoints_AvailableBeforeAndAfterStart() 2843public Task InvokeAsync(HttpContext context, RequestDelegate next) 2853protected override Task HandleChallengeAsync(AuthenticationProperties properties) => Task.CompletedTask; 2855protected override Task HandleForbiddenAsync(AuthenticationProperties properties) => Task.CompletedTask; 2857public Task<bool> HandleRequestAsync() => Task.FromResult(false); 2866return Task.FromResult(AuthenticateResult.Success( 3030public Task StopAsync(CancellationToken cancellationToken) 3035public Task WaitForStartAsync(CancellationToken cancellationToken) 3112public Task StartAsync<TContext>(IHttpApplication<TContext> application, CancellationToken cancellationToken) where TContext : notnull 3121return Task.CompletedTask; 3124public Task StopAsync(CancellationToken cancellationToken) 3126return Task.CompletedTask; 3150return Task.CompletedTask;
WebHostTests.cs (3)
30public async Task WebHostConfiguration_HostFilterOptionsAreReloadable() 58public async Task WebHostConfiguration_EnablesForwardedHeadersFromConfig() 75return Task.CompletedTask;
Microsoft.AspNetCore.WebSockets (6)
ServerWebSocket.cs (3)
41public override Task CloseAsync(WebSocketCloseStatus closeStatus, string? statusDescription, CancellationToken cancellationToken) 46public override Task CloseOutputAsync(WebSocketCloseStatus closeStatus, string? statusDescription, CancellationToken cancellationToken) 76public override Task SendAsync(ArraySegment<byte> buffer, WebSocketMessageType messageType, bool endOfMessage, CancellationToken cancellationToken)
WebSocketMiddleware.cs (3)
55/// <returns>The <see cref="Task"/> that represents the completion of the middleware pipeline.</returns> 56public Task Invoke(HttpContext context) 80return Task.CompletedTask;
Microsoft.AspNetCore.WebSockets.ConformanceTests (2)
Autobahn\AutobahnTester.cs (1)
126public async Task DeployTestAndAddToSpec(ServerType server, bool ssl, string environment, CancellationToken cancellationToken, Action<AutobahnExpectations> expectationConfig = null)
AutobahnTests.cs (1)
25public async Task AutobahnTestSuite()
Microsoft.AspNetCore.WebSockets.Tests (45)
BufferStream.cs (6)
86public override Task FlushAsync(CancellationToken cancellationToken) 99return Task.FromResult(0); 258public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 269return Task.FromResult<object>(null); 288Task.Factory.StartNew(() => _readWaitingForData.TrySetResult()); 291private Task WaitForDataAsync()
DuplexStream.cs (3)
105public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) 140public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 145public override Task FlushAsync(CancellationToken cancellationToken)
Http2WebSocketTests.cs (1)
17public async Task Http2Handshake_Success()
KestrelWebSocketHelpers.cs (1)
18public static IAsyncDisposable CreateServer(ILoggerFactory loggerFactory, out int port, Func<HttpContext, Task> app, Action<WebSocketOptions> configure = null)
SendReceiveTests.cs (5)
12public async Task ClientToServerTextMessage() 29public async Task ServerToClientTextMessage() 46public async Task ClientToServerBinaryMessage() 61public async Task ServerToClientBinaryMessage() 76public async Task ThrowsWhenUnderlyingStreamClosed()
WebSocketCompressionMiddlewareTests.cs (4)
16public async Task CompressionNegotiationServerCanChooseSevrverNoContextTakeover() 48public async Task CompressionNegotiationIgnoredIfNotEnabledOnServer() 78public async Task CompressionNegotiationCanChooseExtension(string clientHeader, string expectedResponse) 111public async Task CanSendAndReceiveCompressedData()
WebSocketMiddlewareTests.cs (25)
19public async Task Connect_Success() 35public async Task NegotiateSubProtocol_Success() 63public async Task SendEmptyData_Success() 87public async Task SendShortData_Success() 112public async Task SendMediumData_Success() 137public async Task SendLongData_Success() 168public async Task SendFragmentedData_Success() 218public async Task ReceiveShortData_Success() 243public async Task ReceiveMediumData_Success() 268public async Task ReceiveLongData() 301public async Task ReceiveFragmentedData_Success() 344public async Task SendClose_Success() 372public async Task ReceiveClose_Success() 400public async Task CloseFromOpen_Success() 430public async Task CloseFromCloseSent_Success() 462public async Task CloseFromCloseReceived_Success() 502public async Task WebSocket_Abort_Interrupts_Pending_ReceiveAsync() 580public async Task WebSocket_AllowsCancelling_Pending_ReceiveAsync_When_CancellationTokenProvided() 651public async Task OriginIsValidatedForWebSocketRequests(HttpStatusCode expectedCode, params string[] origins) 656return Task.CompletedTask; 694public async Task OriginIsNotValidatedForNonWebSocketRequests() 699return Task.CompletedTask; 720public async Task CommonHeadersAreSetToInternedStrings() 741public async Task MultipleValueHeadersNotOverridden() 777public async Task AcceptingWebSocketRequestDisablesTimeout()
Microsoft.AspNetCore.WebUtilities (57)
BufferedReadStream.cs (2)
178public override Task FlushAsync(CancellationToken cancellationToken) 196public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
FileBufferingReadStream.cs (3)
409public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 427public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) 440async Task CopyToAsyncImpl()
FileBufferingWriteStream.cs (7)
140public override async Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 184public override Task FlushAsync(CancellationToken cancellationToken) => Task.CompletedTask; 194/// <returns>A <see cref="Task" /> that represents the asynchronous drain operation.</returns> 195public async Task DrainBufferAsync(Stream destination, CancellationToken cancellationToken = default) 219/// <returns>A <see cref="Task" /> that represents the asynchronous drain operation.</returns> 221public async Task DrainBufferAsync(PipeWriter destination, CancellationToken cancellationToken = default)
FormReader.cs (2)
168private async Task ReadNextPairAsyncImpl(CancellationToken cancellationToken = new CancellationToken()) 270private async Task BufferAsync(CancellationToken cancellationToken)
HttpResponseStreamWriter.cs (36)
193public override Task WriteAsync(char value) 209return Task.CompletedTask; 213private async Task WriteAsyncAwaited(char value) 224public override Task WriteAsync(char[] values, int index, int count) 233return Task.CompletedTask; 241return Task.CompletedTask; 249private async Task WriteAsyncAwaited(char[] values, int index, int count) 266public override Task WriteAsync(string? value) 275return Task.CompletedTask; 283return Task.CompletedTask; 291private async Task WriteAsyncAwaited(string value) 312public override Task WriteAsync(ReadOnlyMemory<char> value, CancellationToken cancellationToken = default) 321return Task.FromCanceled(cancellationToken); 326return Task.CompletedTask; 334return Task.CompletedTask; 342private async Task WriteAsyncAwaited(ReadOnlyMemory<char> value) 364public override Task WriteLineAsync(ReadOnlyMemory<char> value, CancellationToken cancellationToken = default) 373return Task.FromCanceled(cancellationToken); 378return Task.CompletedTask; 387return Task.CompletedTask; 395private async Task WriteLineAsyncAwaited(ReadOnlyMemory<char> value) 402public override Task WriteLineAsync(char[] values, int index, int count) 411return Task.CompletedTask; 422return Task.CompletedTask; 430private async Task WriteLineAsyncAwaited(char[] values, int index, int count) 437public override Task WriteLineAsync(char value) 453return Task.CompletedTask; 461private async Task WriteLineAsyncAwaited(char value) 468public override Task WriteLineAsync(string? value) 477return Task.CompletedTask; 488return Task.CompletedTask; 496private async Task WriteLineAsyncAwaited(string value) 514public override Task FlushAsync() 591private async Task FlushInternalAsync(bool flushEncoder) 672private static Task GetObjectDisposedTask() 674return Task.FromException(new ObjectDisposedException(nameof(HttpResponseStreamWriter)));
MultipartReaderStream.cs (2)
124public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 356public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken)
PagedByteBuffer.cs (2)
81public async Task MoveToAsync(PipeWriter writer, CancellationToken cancellationToken) 98public async Task MoveToAsync(Stream stream, CancellationToken cancellationToken)
StreamHelperExtensions.cs (3)
24public static Task DrainAsync(this Stream stream, CancellationToken cancellationToken) 39public static Task DrainAsync(this Stream stream, long? limit, CancellationToken cancellationToken) 55public static async Task DrainAsync(this Stream stream, ArrayPool<byte> bytePool, long? limit, CancellationToken cancellationToken)
Microsoft.AspNetCore.WebUtilities.Microbenchmarks (4)
FormReaderBenchmark.cs (2)
14public async Task ReadSmallFormAsyncStream() 28public async Task ReadSmallFormAsyncPipe()
MultipartReaderBenchmark.cs (2)
94public async Task MultipartReaderParsing() 116public async Task MultipartReaderParsingWithRead()
Microsoft.AspNetCore.WebUtilities.Tests (126)
FileBufferingReadStreamTests.cs (13)
203public async Task FileBufferingReadStream_Async0ByteReadUnderThreshold_DoesntCreateFile() 236public async Task FileBufferingReadStream_AsyncReadUnderThreshold_DoesntCreateFile() 269public async Task FileBufferingReadStream_AsyncReadOverThreshold_CreatesFile() 308public async Task FileBufferingReadStream_Async0ByteReadAfterBuffering_ReadsFromFile() 349public async Task FileBufferingReadStream_AsyncReadWithInMemoryLimit_EnforcesLimit() 371public async Task FileBufferingReadStream_AsyncReadWithOnDiskLimit_EnforcesLimit() 433public async Task FileBufferingReadStream_UsingMemoryStream_RentsAndReturnsRentedBuffer_WhenCopyingFromMemoryStreamDuringReadAsync() 462public async Task CopyToAsyncWorks() 486public async Task CopyToAsyncWorksWithFileThreshold() 510public async Task ReadAsyncThenCopyToAsyncWorks() 527public async Task ReadThenCopyToAsyncWorks() 545public async Task ReadThenSeekThenCopyToAsyncWorks() 584public async Task PartialReadAsyncThenSeekReplaysBuffer()
FileBufferingWriteStreamTests.cs (10)
135public async Task WriteAsync_BuffersContentToMemory() 154public async Task WriteAsync_BeforeMemoryThresholdIsReached_WritesToMemory() 176public async Task WriteAsync_BuffersContentToDisk_WhenMemoryThresholdIsReached() 200public async Task WriteAsync_BuffersContentToDisk_WhenWriteWillOverflowMemoryThreshold() 223public async Task WriteAsync_AfterMemoryThresholdIsReached_BuffersToMemory() 292public async Task WriteAsync_Throws_IfSingleWriteExceedsBufferLimit() 306public async Task WriteAsync_Throws_IfWriteCumulativeWritesExceedsBuffersLimit() 322public async Task WriteAsync_DoesNotThrow_IfBufferLimitIsReached() 336public async Task DrainBufferAsync_CopiesContentFromMemoryStream() 353public async Task DrainBufferAsync_WithContentInDisk_CopiesContentFromMemoryStream()
FormPipeReaderTests.cs (18)
15public async Task ReadFormAsync_EmptyKeyAtEndAllowed() 25public async Task ReadFormAsync_EmptyKeyWithAdditionalEntryAllowed() 36public async Task ReadFormAsync_EmptyValueAtEndAllowed() 46public async Task ReadFormAsync_EmptyValueWithoutEqualsAtEndAllowed() 56public async Task ReadFormAsync_EmptyValueWithAdditionalEntryAllowed() 67public async Task ReadFormAsync_EmptyValueWithoutEqualsWithAdditionalEntryAllowed() 78public async Task ReadFormAsync_ValueContainsInvalidCharacters_Throw() 90public async Task ReadFormAsync_ValueCountLimitMet_Success() 103public async Task ReadFormAsync_ValueCountLimitExceeded_Throw() 118public async Task ReadFormAsync_ValueCountLimitExceededSameKey_Throw() 133public async Task ReadFormAsync_KeyLengthLimitMet_Success() 146public async Task ReadFormAsync_KeyLengthLimitExceeded_Throw() 161public async Task ReadFormAsync_ValueLengthLimitMet_Success() 174public async Task ReadFormAsync_ValueLengthLimitExceeded_Throw() 189public async Task ReadFormAsync_ValueLengthLimitExceededAcrossBufferBoundary_Throw() 245public async Task ReadForm_Decoding(string formData, string key, string expectedValue) 530public async Task ResetPipeWorks() 590public async Task ReadFormAsync_AccumulatesEmptyKeys()
FormReaderTests.cs (16)
14public async Task ReadFormAsync_EmptyKeyAtEndAllowed(bool bufferRequest) 26public async Task ReadFormAsync_EmptyKeyWithAdditionalEntryAllowed(bool bufferRequest) 39public async Task ReadFormAsync_EmptyValuedAtEndAllowed(bool bufferRequest) 51public async Task ReadFormAsync_EmptyValuedWithAdditionalEntryAllowed(bool bufferRequest) 64public async Task ReadFormAsync_ValueCountLimitMet_Success(bool bufferRequest) 79public async Task ReadFormAsync_ValueCountLimitExceeded_Throw(bool bufferRequest) 91public async Task ReadFormAsync_ValueCountLimitExceededSameKey_Throw(bool bufferRequest) 103public async Task ReadFormAsync_KeyLengthLimitMet_Success(bool bufferRequest) 118public async Task ReadFormAsync_KeyLengthLimitExceeded_Throw(bool bufferRequest) 130public async Task ReadFormAsync_ValueLengthLimitMet_Success(bool bufferRequest) 145public async Task ReadFormAsync_ValueLengthLimitExceeded_Throw(bool bufferRequest) 157public async Task ReadNextPair_ReadsAllPairs(bool bufferRequest) 179public async Task ReadNextPair_ReturnsNullOnEmptyStream(bool bufferRequest) 196public async Task ReadForm_Decoding(string formData, string key, string expectedValue) 207return Task.FromResult(reader.ReadForm()); 212return Task.FromResult(reader.ReadNextPair());
HttpRequestStreamReaderTest.cs (18)
42public static async Task ReadToEndAsync() 53public static async Task ReadToEndAsync_Reads_Asynchronously() 131public static async Task ReadAsync_ReadInTwoChunks() 150public static async Task ReadLine_ReadMultipleLines(Func<HttpRequestStreamReader, Task<string>> action) 172public static async Task ReadLine_ReadWithNoNewlines(Func<HttpRequestStreamReader, Task<string>> action) 189public static async Task ReadLine_MultipleContinuousLines(Func<HttpRequestStreamReader, Task<string>> action) 213public static async Task ReadLine_CarriageReturnAndLineFeedAcrossBufferBundaries(Func<HttpRequestStreamReader, Task<string>> action) 237public static async Task ReadLine_EOF(Func<HttpRequestStreamReader, Task<string>> action) 250public static async Task ReadLine_NewLineOnly(Func<HttpRequestStreamReader, Task<string>> action) 305public static async Task ReadAsync_Memory_ReadAllCharactersAtOnce() 324public static async Task ReadAsync_Memory_WithMoreDataThanInternalBufferSize() 389public static async Task StreamDisposed_ExpectObjectDisposedExceptionAsync(Func<HttpRequestStreamReader, Task> action) 471yield return new object[] { new Func<HttpRequestStreamReader, Task>(async (httpRequestStreamReader) => 475yield return new object[] { new Func<HttpRequestStreamReader, Task>(async (httpRequestStreamReader) => 484Task.FromResult(httpRequestStreamReader.ReadLine()) 519public override Task FlushAsync(CancellationToken cancellationToken) 549public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
HttpResponseStreamWriterTest.cs (36)
15public async Task DoesNotWriteBOM() 34public async Task DoesNotFlush_UnderlyingStream_OnDisposingWriter() 50public async Task DoesNotDispose_UnderlyingStream_OnDisposingWriter() 69public async Task FlushesBuffer_OnClose(int byteLength) 90public async Task FlushesBuffer_OnDispose(int byteLength) 145public async Task NoDataWritten_FlushAsync_DoesNotFlushUnderlyingStream() 164public async Task FlushesBuffer_ButNotStream_OnFlushAsync(int byteLength) 185public async Task FlushWriteThrows_DontFlushInDispose(int byteLength) 313public async Task WriteCharAsync_WritesToStream(int byteLength) 337public async Task WriteCharArrayAsync_WritesToStream(int byteLength) 360public async Task WriteReadOnlyMemoryAsync_WritesToStream(int byteLength) 379public async Task WriteReadOnlyMemoryAsync_TokenCanceled_ReturnsCanceledTask() 415public async Task WriteLineReadOnlyMemoryAsync_WritesToStream(int byteLength, int newLineLength) 435public async Task WriteLineReadOnlyMemoryAsync_TokenCanceled_ReturnsCanceledTask() 474public async Task WriteLineAsyncCharArray_WritesToStream(int charCount, int newLineLength) 496public async Task WriteLineAsyncCharArray_OnlyWritesNewLineToStream_ForNullArgument(int newLineLength) 518public async Task WriteLineAsyncCharArray_OnlyWritesNewLineToStream_ForZeroCount(int newLineLength) 542public async Task WriteLineAsyncChar_WritesToStream(int newLineLength) 581public async Task WriteLineAsyncString_WritesToStream(int charCount, int newLineLength) 603public async Task WriteLineAsyncString_OnlyWritesNewLineToStream_ForNullArgument(int newLineLength) 625public async Task WritesData_InExpectedEncoding(string data, string encodingName) 656public async Task WritesData_OfDifferentLength_InExpectedEncoding( 710public async Task HttpResponseStreamWriter_WritesDataCorrectly_ForCharactersHavingSurrogatePairs(int characterSize) 777public static async Task StreamDisposed_ExpectedObjectDisposedExceptionAsync(Func<HttpResponseStreamWriter, Task> function) 810public override Task FlushAsync(CancellationToken cancellationToken) 826public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 881yield return new object[] { new Func<HttpResponseStreamWriter, Task>(async (httpResponseStreamWriter) => 885yield return new object[] { new Func<HttpResponseStreamWriter, Task>(async (httpResponseStreamWriter) => 889yield return new object[] { new Func<HttpResponseStreamWriter, Task>(async (httpResponseStreamWriter) => 893yield return new object[] { new Func<HttpResponseStreamWriter, Task>(async (httpResponseStreamWriter) => 897yield return new object[] { new Func<HttpResponseStreamWriter, Task>(async (httpResponseStreamWriter) => 901yield return new object[] { new Func<HttpResponseStreamWriter, Task>(async (httpResponseStreamWriter) => 905yield return new object[] { new Func<HttpResponseStreamWriter, Task>(async (httpResponseStreamWriter) => 909yield return new object[] { new Func<HttpResponseStreamWriter, Task>(async (httpResponseStreamWriter) => 914yield return new object[] { new Func<HttpResponseStreamWriter, Task>(async (httpResponseStreamWriter) =>
MultipartReaderTests.cs (12)
108public async Task MultipartReader_ReadSinglePartBody_Success() 125public async Task MultipartReader_HeaderCountExceeded_Throws() 138public async Task MultipartReader_HeadersLengthExceeded_Throws() 151public async Task MultipartReader_ReadSinglePartBodyWithTrailingWhitespace_Success() 168public async Task MultipartReader_ReadSinglePartBodyWithoutLastCRLF_Success() 185public async Task MultipartReader_ReadTwoPartBody_Success() 211public async Task MultipartReader_ReadTwoPartBodyWithUnicodeFileName_Success() 237public async Task MultipartReader_ThreePartBody_Success() 282public async Task MultipartReader_TwoPartBodyIncompleteBuffer_TwoSectionsReadSuccessfullyThirdSectionThrows() 313public async Task MultipartReader_ReadInvalidUtf8Header_ReplacementCharacters() 348public async Task MultipartReader_ReadInvalidUtf8SurrogateHeader_ReplacementCharacters() 384public async Task MultipartReader_StripQuotesFromBoundary()
PagedByteBufferTest.cs (3)
122public async Task MoveToAsync_CopiesContentToStream() 146public async Task MoveToAsync_ClearsBuffers() 193public async Task MoveToAsync_ReturnsBuffers()
Microsoft.Bcl.TimeProvider (13)
System\Threading\Tasks\TimeProviderTaskExtensions.cs (13)
7/// Provide extensions methods for <see cref="Task"/> operations with <see cref="TimeProvider"/>. 49public static Task Delay(this TimeProvider timeProvider, TimeSpan delay, CancellationToken cancellationToken = default) 52return Task.Delay(delay, timeProvider, cancellationToken); 124/// Gets a <see cref="Task"/> that will complete when this <see cref="Task"/> completes, when the specified timeout expires, or when the specified <see cref="CancellationToken"/> has cancellation requested. 127/// <param name="timeout">The timeout after which the <see cref="Task"/> should be faulted with a <see cref="TimeoutException"/> if it hasn't otherwise completed.</param> 130/// <returns>The <see cref="Task"/> representing the asynchronous wait. It may or may not be the same instance as the current instance.</returns> 134public static Task WaitAsync(this Task task, TimeSpan timeout, TimeProvider timeProvider, CancellationToken cancellationToken = default) 221/// Gets a <see cref="Task"/> that will complete when this <see cref="Task"/> completes, when the specified timeout expires, or when the specified <see cref="CancellationToken"/> has cancellation requested. 224/// <param name="timeout">The timeout after which the <see cref="Task"/> should be faulted with a <see cref="TimeoutException"/> if it hasn't otherwise completed.</param> 227/// <returns>The <see cref="Task"/> representing the asynchronous wait. It may or may not be the same instance as the current instance.</returns>
Microsoft.Build (71)
AwaitExtensions.cs (7)
82internal static Task ToTask(this WaitHandle handle, int timeout = Timeout.Infinite) 158private ConcurrentQueue<Task> _queuedTasks = new ConcurrentQueue<Task>(); 163protected override System.Collections.Generic.IEnumerable<Task> GetScheduledTasks() 171protected override void QueueTask(Task task) 177Task t; 194protected override bool TryExecuteTaskInline(Task task, bool taskWasPreviouslyQueued)
BackEnd\BuildManager\BuildManager.cs (2)
1002Task projectCacheDispose = _projectCacheService.DisposeAsync().AsTask(); 1420Task.Factory.StartNew(
BackEnd\BuildManager\LegacyThreadingData.cs (1)
139internal Task GetLegacyThreadInactiveTask(int submissionId)
BackEnd\Components\Communications\NodeProviderOutOfProcBase.cs (10)
25using Task = System.Threading.Tasks.Task; 118Task[] waitForExitTasks = waitForExit && contextsToShutDown.Count > 0 ? new Task[contextsToShutDown.Count] : null; 135Task.WaitAll(waitForExitTasks); 586private Task _packetWriteDrainTask = Task.CompletedTask; 829public async Task WaitForExitAsync(ILoggingService loggingService) 835await Task.WhenAny(_packetWriteDrainTask, Task.Delay(100)); 853await Task.Delay(delay).ConfigureAwait(false);
BackEnd\Components\ProjectCache\ProjectCachePluginBase.cs (4)
22public abstract Task BeginBuildAsync( 43public abstract Task EndBuildAsync(PluginLoggerBase logger, CancellationToken cancellationToken); 66public virtual Task HandleProjectFinishedAsync( 70CancellationToken cancellationToken) => Task.CompletedTask;
BackEnd\Components\ProjectCache\ProjectCacheService.cs (12)
106Task.Run( 142Task.Run( 436Task.Run( 702public async Task HandleBuildResultAsync( 748Task[] tasks = new Task[projectCacheDescriptors.Count]; 752tasks[idx++] = Task.Run( 786await Task.WhenAll(tasks).ConfigureAwait(false); 817Task[] cleanupTasks = new Task[_projectCachePlugins.Count]; 821cleanupTasks[idx++] = Task.Run(async () => 854await Task.WhenAll(cleanupTasks).ConfigureAwait(false);
BackEnd\Components\RequestBuilder\IntrinsicTasks\CallTarget.cs (1)
91return Task.FromResult(true);
BackEnd\Components\RequestBuilder\IRequestBuilderCallback.cs (1)
38Task BlockOnTargetInProgress(int blockingRequestId, string blockingTarget, BuildResult partialBuildResult);
BackEnd\Components\RequestBuilder\RequestBuilder.cs (13)
63private Task _requestTask; 395public async Task BlockOnTargetInProgress(int blockingGlobalRequestId, string blockingTarget, BuildResult partialBuildResult = null) 652_requestTask = Task.Factory.StartNew( 671return Task.FromResult<object>(null); 689_requestTask = Task.Factory.StartNew( 701_requestTask = Task.Factory.StartNew( 769private async Task RequestThreadProc(bool setThreadParameters) 1424private readonly BlockingCollection<Task> _tasks = new BlockingCollection<Task>(); 1427protected override void QueueTask(Task task) 1433protected override bool TryExecuteTaskInline(Task task, bool taskWasPreviouslyQueued) => false; 1435protected override IEnumerable<Task> GetScheduledTasks() => _tasks; 1463foreach (Task t in _tasks.GetConsumingEnumerable())
BackEnd\Components\RequestBuilder\TargetBuilder.cs (3)
331Task IRequestBuilderCallback.BlockOnTargetInProgress(int blockingGlobalBuildRequestId, string blockingTarget, BuildResult partialBuildResult) 334return Task.FromResult(false); 401private async Task ProcessTargetStack(ITaskBuilder taskBuilder)
BackEnd\Components\RequestBuilder\TargetEntry.cs (1)
412internal async Task ExecuteTarget(ITaskBuilder taskBuilder, BuildRequestEntry requestEntry, ProjectLoggingContext projectLoggingContext, CancellationToken cancellationToken)
BackEnd\Components\Scheduler\Scheduler.cs (2)
580return Task.FromResult(0); 596return Task.FromResult(grantedCores);
BackEnd\Node\OutOfProcServerNode.cs (1)
332Task.Run(() =>
BackEnd\TaskExecutionHost\TaskExecutionHost.cs (2)
26using Task = System.Threading.Tasks.Task; 676Task.Run(async delegate
Graph\ParallelWorkSet.cs (5)
38private readonly List<Task> _tasks; 92_tasks = new List<Task>(degreeOfParallelism); 148Task.WaitAll(_tasks.ToArray()); 156private Task CreateProcessorItemTask() 158return Task.Run(
Instance\RunningObjectTable.cs (3)
34_rotTask = Task.FromResult(rot); 41Task.Run(() => 68var task = Task.Run(() =>
Instance\TaskFactories\AssemblyTaskFactory.cs (1)
223Task.Run(() => AppDomain.Unload(appDomain));
Logging\BinaryLogger\ProjectImportsCollector.cs (2)
35private Task _currentTask = Task.CompletedTask;
Microsoft.Build.CommandLine.UnitTests (33)
MSBuildServer_Tests.cs (2)
187Task t; 203t = Task.Run(() =>
NodeStatus_SizeChange_Tests.cs (4)
32public async Task EverythingFits() 40public async Task TargetIsTruncatedFirst() 48public async Task NamespaceIsTruncatedNext() 56public async Task GoesToProject()
NodeStatus_Transition_Tests.cs (5)
42public async Task NodeTargetChanges() 56public async Task NodeTargetUpdatesTime() 74public async Task NodeTargetChangesToColoredTarget() 88public async Task NodeWithColoredTargetUpdatesTime() 127private async Task VerifyReplay(string rendered)
TerminalLogger_Tests.cs (22)
289public Task PrintsBuildSummary_Succeeded() 297public Task PrintBuildSummary_SucceededWithWarnings() 308public Task PrintImmediateWarningMessage_Succeeded() 324public Task PrintImmediateMessage_Success() 335public Task PrintImmediateMessage_Skipped() 346public Task PrintRestore_Failed() 360public Task PrintRestore_SuccessWithWarnings() 374public Task PrintBuildSummary_Failed() 381public Task PrintBuildSummary_FailedWithErrors() 392public Task PrintBuildSummary_FailedWithErrorsAndWarnings() 407public Task PrintBuildSummary_2Projects_FailedWithErrorsAndWarnings() 463public Task PrintBuildSummaryQuietVerbosity_FailedWithErrors() 473public Task PrintBuildSummaryMinimalVerbosity_FailedWithErrors() 482public Task PrintBuildSummaryNormalVerbosity_FailedWithErrors() 491public Task PrintBuildSummaryDetailedVerbosity_FailedWithErrors() 501public Task PrintBuildSummaryDiagnosticVerbosity_FailedWithErrors() 510public Task PrintTestSummaryNormalVerbosity_Succeeded() 519public Task PrintTestSummaryQuietVerbosity_Succeeded() 528public Task PrintSummaryWithOverwrittenVerbosity_FailedWithErrors() 540public Task PrintSummaryWithTaskCommandLineEventArgs_Succeeded() 555public Task PrintSummaryWithoutTaskCommandLineEventArgs_Succeeded() 618public async Task DisplayNodesOverwritesWithNewTargetFramework()
Microsoft.Build.Engine.OM.UnitTests (4)
Definition\Project_Tests.cs (4)
26using Task = System.Threading.Tasks.Task; 347var tasks = new Task[500]; 351tasks[i] = Task.Factory.StartNew(delegate () { new Project(); }); // Should not throw 354Task.WaitAll(tasks);
Microsoft.Build.Engine.UnitTests (24)
BackEnd\RedirectConsoleWriter_Tests.cs (2)
17public async Task EmitConsoleMessages() 24await Task.Delay(80); // should be somehow bigger than `RedirectConsoleWriter` flush period - see its constructor
BackEnd\TargetBuilder_Tests.cs (1)
1458Task IRequestBuilderCallback.BlockOnTargetInProgress(int blockingRequestId, string blockingTarget, BuildResult partialBuildResult)
BackEnd\TargetEntry_Tests.cs (1)
945Task IRequestBuilderCallback.BlockOnTargetInProgress(int blockingRequestId, string blockingTarget, BuildResult partialBuildResult)
BackEnd\TaskBuilder_Tests.cs (1)
940Task IRequestBuilderCallback.BlockOnTargetInProgress(int blockingRequestId, string blockingTarget, BuildResult partialBuildResult)
BackEnd\TaskHost_Tests.cs (1)
1469public Task BlockOnTargetInProgress(int blockingRequestId, string blockingTarget, BuildResult partialBuildResult)
ProjectCache\ProjectCacheTests.cs (18)
25using Task = System.Threading.Tasks.Task; 202public override Task BeginBuildAsync(CacheContext context, PluginLoggerBase logger, CancellationToken cancellationToken) 204return Task.CompletedTask; 212public override Task EndBuildAsync(PluginLoggerBase logger, CancellationToken cancellationToken) 214return Task.CompletedTask; 235public Func<CacheContext, PluginLoggerBase, CancellationToken, Task>? BeginBuildImplementation { get; set; } 238public override Task BeginBuildAsync(CacheContext context, PluginLoggerBase logger, CancellationToken cancellationToken) 242: Task.CompletedTask; 252: Task.FromResult(CacheResult.IndicateNonCacheHit(CacheResultType.CacheNotApplicable)); 255public override Task EndBuildAsync(PluginLoggerBase logger, CancellationToken cancellationToken) 257return Task.CompletedTask; 279public override Task BeginBuildAsync(CacheContext context, PluginLoggerBase logger, CancellationToken cancellationToken) 285return Task.CompletedTask; 304await Task.Delay(_projectQuerySleepTime.Value, cancellationToken); 313public override Task EndBuildAsync(PluginLoggerBase logger, CancellationToken cancellationToken) 319return Task.CompletedTask; 1597return Task.FromResult(CacheResult.IndicateNonCacheHit(CacheResultType.CacheNotApplicable)); 1602return Task.FromResult(
Microsoft.Build.Tasks.Core (4)
Copy.cs (1)
572await System.Threading.Tasks.Task.Yield();
DownloadFile.cs (3)
12using Task = System.Threading.Tasks.Task; 120await Task.Delay(RetryDelayMilliseconds, cancellationToken).ConfigureAwait(false); 146private async Task DownloadAsync(Uri uri, CancellationToken cancellationToken)
Microsoft.Build.Tasks.UnitTests (9)
DownloadFile_Tests.cs (9)
17using Task = System.Threading.Tasks.Task; 46Task<bool> task = Task.Run(() => downloadFile.Execute()); 276public async Task NoRunawayLoop() 304var runaway = Task.Run(() => downloadFile.Execute()); 305await Task.Delay(TimeSpan.FromSeconds(1)); 367private readonly Func<Stream, Task> _func; 370public MockHttpContent(int length, Func<Stream, Task> func) 376protected override Task SerializeToStreamAsync(Stream stream, TransportContext context) 400return Task.FromResult(_func(request, cancellationToken));
Microsoft.Build.Utilities.UnitTests (2)
ProcessExtensions_Tests.cs (2)
17public async Task KillTree() 27await Task.Delay(500);
Microsoft.DotNet.Arcade.Sdk (1)
src\DownloadFile.cs (1)
181await Tasks.Task.Delay(RetryDelayMilliseconds).ConfigureAwait(false);
Microsoft.DotNet.Arcade.Sdk.Tests (4)
InstallDotNetToolTests.cs (4)
199public async Task InstallsInParallelWithRealMutex() 264var installationTask = Task.Run(() => task1.InvokeExecute(provider1).Should().BeTrue()); 269var skipTask = Task.Run(() => task2.InvokeExecute(provider2).Should().BeTrue()); 294await Task.WhenAll(installationTask, skipTask);
Microsoft.DotNet.Build.Tasks.Feed (18)
src\BlobFeedAction.cs (4)
81public async Task PublishToFlatContainerAsync(IEnumerable<ITaskItem> taskItems, int maxClients, 88await System.Threading.Tasks.Task.WhenAll(taskItems.Select( 95public async Task UploadAssetAsync( 178public async Task CreateContainerAsync(IBuildEngine buildEngine, bool publishFlatContainer)
src\common\AzureStorageUtils.cs (1)
76public async Task UploadBlockBlobAsync(string filePath, string blobPath, Stream stream)
src\common\GeneralUtils.cs (4)
382private static System.Threading.Tasks.Task WaitForProcessExitAsync(Process process) 384return System.Threading.Tasks.Task.Run(() => process.WaitForExit()); 455System.Threading.Tasks.Task.WaitAll(new System.Threading.Tasks.Task[] { stderrCompletion.Task, stdoutCompletion.Task }, TimeSpan.FromSeconds(5));
src\common\LatestLinksManager.cs (1)
46public async System.Threading.Tasks.Task CreateOrUpdateLatestLinksAsync(
src\common\UploadToAzure.cs (4)
83List<Task> uploadTasks = new List<Task>(); 87uploadTasks.Add(Task.Run(async () => 125await Task.WhenAll(uploadTasks);
src\ExecWithRetriesForNuGetPush.cs (1)
172Task.Delay(delay, _cancelTokenSource.Token).Wait();
src\PublishSymbolsHelper.cs (1)
16public static async System.Threading.Tasks.Task PublishAsync(
src\SleetLogger.cs (2)
28public override Task LogAsync(ILogMessage message) 30return Task.Run(() => Log(message, _logLevel));
Microsoft.DotNet.Build.Tasks.Feed.Tests (4)
GeneralTests.cs (4)
55public async Task IsFeedPublicShouldCorrectlyInterpretFeedResponseStatusCode( 76public async Task IsFeedPublicShouldRetryFailedRequests( 104public async Task CompareLocalPackageToFeedPackageShouldCorrectlyInterpretFeedResponse( 138public async Task CompareLocalPackageToFeedPackageShouldRetryFailedRequests(
Microsoft.DotNet.Build.Tasks.Installers (1)
src\ExecWithRetries.cs (1)
105Task.Delay(delay, _cancelTokenSource.Token).Wait();
Microsoft.DotNet.Build.Tasks.Packaging (4)
NuGetUtility.cs (4)
120public Task LogAsync(LogLevel level, string data) => Task.Run(() => Log(level, data)); 122public Task LogAsync(ILogMessage message) => Task.Run(() => Log(message));
Microsoft.DotNet.Deployment.Tasks.Links (6)
Microsoft.DotNet.Helix.Client (64)
generated-code\Aggregate.cs (11)
235internal async Task OnAnalysisSummaryFailed(Request req, Response res) 330internal async Task OnBuildHistoryFailed(Request req, Response res) 435internal async Task OnBuildFailed(Request req, Response res) 547internal async Task OnJobSummaryFailed(Request req, Response res) 654internal async Task OnWorkItemSummaryFailed(Request req, Response res) 796internal async Task OnAnalysisDetailFailed(Request req, Response res) 890internal async Task OnPropertiesFailed(Request req, Response res) 965internal async Task OnInvestigation_ContinueFailed(Request req, Response res) 1082internal async Task OnInvestigationFailed(Request req, Response res) 1202internal async Task OnHistoryFailed(Request req, Response res) 1283internal async Task OnMultiSourceFailed(Request req, Response res)
generated-code\Analysis.cs (4)
17Task SetReasonAsync( 49public async Task SetReasonAsync( 128internal async Task OnSetReasonFailed(Request req, Response res) 229internal async Task OnGetDetailsFailed(Request req, Response res)
generated-code\HelixApi.cs (3)
492public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) 507public override Task FlushAsync(CancellationToken cancellationToken) 522public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
generated-code\Information.cs (2)
98internal async Task OnQueueInfoFailed(Request req, Response res) 172internal async Task OnQueueInfoListFailed(Request req, Response res)
generated-code\Job.cs (11)
48Task CancelAsync( 54Task WaitAsync( 146internal async Task OnNewFailed(Request req, Response res) 245internal async Task OnListFailed(Request req, Response res) 320internal async Task OnPassFailFailed(Request req, Response res) 395internal async Task OnSummaryFailed(Request req, Response res) 470internal async Task OnDetailsFailed(Request req, Response res) 495public async Task CancelAsync( 541internal async Task OnCancelFailed(Request req, Response res) 566public async Task WaitAsync( 607internal async Task OnWaitFailed(Request req, Response res)
generated-code\Machine.cs (4)
17Task ChangeStateAsync( 45public async Task ChangeStateAsync( 104internal async Task OnChangeStateFailed(Request req, Response res) 185internal async Task OnGetMachineStatusFailed(Request req, Response res)
generated-code\ScaleSets.cs (2)
97internal async Task OnGetDetailedVMScalingHistoryFailed(Request req, Response res) 171internal async Task OnGetAggregatedVMScalingHistoryFailed(Request req, Response res)
generated-code\Storage.cs (3)
96internal async Task OnListFailed(Request req, Response res) 182internal async Task OnNewFailed(Request req, Response res) 268internal async Task OnExtendExpirationFailed(Request req, Response res)
generated-code\Telemetry.cs (18)
28Task FinishBuildWorkItemAsync( 43Task FinishXUnitWorkItemAsync( 52Task WarningAsync( 61Task ErrorAsync( 70Task LogAsync( 155internal async Task OnStartJobFailed(Request req, Response res) 245internal async Task OnStartBuildWorkItemFailed(Request req, Response res) 270public async Task FinishBuildWorkItemAsync( 337internal async Task OnFinishBuildWorkItemFailed(Request req, Response res) 427internal async Task OnStartXUnitWorkItemFailed(Request req, Response res) 452public async Task FinishXUnitWorkItemAsync( 524internal async Task OnFinishXUnitWorkItemFailed(Request req, Response res) 549public async Task WarningAsync( 621internal async Task OnWarningFailed(Request req, Response res) 646public async Task ErrorAsync( 718internal async Task OnErrorFailed(Request req, Response res) 743public async Task LogAsync( 815internal async Task OnLogFailed(Request req, Response res)
generated-code\WorkItem.cs (5)
119internal async Task OnGetFileFailed(Request req, Response res) 200internal async Task OnListFilesFailed(Request req, Response res) 276internal async Task OnConsoleLogFailed(Request req, Response res) 351internal async Task OnListFailed(Request req, Response res) 432internal async Task OnDetailsFailed(Request req, Response res)
Job.cs (1)
17for (;; await Task.Delay(pollingIntervalMs, cancellationToken).ConfigureAwait(false)) // delay every time this loop repeats
Microsoft.DotNet.Helix.JobSender (7)
JobDefinition.cs (2)
174(await Task.WhenAll(CorrelationPayloads.Select(async p => (uri: await p.Key.UploadAsync(storageContainer, log, cancellationToken), destination: p.Value)))).ToDictionary(x => x.uri, x => x.destination); 176jobList = (await Task.WhenAll(
Payloads\ArchivePayload.cs (1)
26=> Task.FromResult(
Payloads\DirectoryPayload.cs (2)
33=> Task.FromResult( 40await Task.Yield();
Payloads\EmptyPayload.cs (1)
9private readonly Task<string> _emptyStringTask = Task.FromResult("");
Payloads\UriPayload.cs (1)
18return Task.FromResult(_payloadUri.AbsoluteUri);
Microsoft.DotNet.Helix.JobSender.Tests (2)
Payloads\ArchivePayloadTests.cs (2)
14public async Task ArchivePayloadUploads() 20.Returns(Task.FromResult(new Uri("http://microsoft.com/blob")));
Microsoft.DotNet.Helix.Sdk (38)
AzureDevOpsTask.cs (5)
41protected abstract Task ExecuteCoreAsync(HttpClient client); 81protected async Task RetryAsync(Func<Task> function) 118protected async Task HandleFailedRequest(HttpRequestMessage req, HttpResponseMessage res) 222await Task.Delay(GetRetryDelay(attempt)).ConfigureAwait(false);
CancelHelixJob.cs (1)
21protected override async Task ExecuteCore(CancellationToken cancellationToken)
CheckAzurePipelinesTestResults.cs (5)
24protected override async Task ExecuteCoreAsync(HttpClient client) 42private async Task CheckTestResultsAsync(HttpClient client) 72private async Task LogErrorsForFailedRun(HttpClient client, int testRunId) 124private async Task CheckTestResultsWithFlakySupport(HttpClient client) 166private async Task ValidateExpectedTestFailuresAsync(HttpClient client)
CheckHelixJobStatus.cs (2)
25protected override Task ExecuteCore(CancellationToken cancellationToken) 51return Task.CompletedTask;
CreateFailedTestsForFailedWorkItems.cs (1)
20protected override async Task ExecuteCoreAsync(HttpClient client)
CreateXHarnessAndroidWorkItems.cs (1)
59WorkItems = Task.WhenAll(tasks).GetAwaiter().GetResult().Where(wi => wi != null).ToArray();
CreateXHarnessAppleWorkItems.cs (1)
81WorkItems = Task.WhenAll(tasks).GetAwaiter().GetResult().Where(wi => wi != null).ToArray();
CreateXUnitWorkItems.cs (3)
75private async Task ExecuteAsync() 77XUnitWorkItems = (await Task.WhenAll(XUnitProjects.Select(PrepareWorkItem))).Where(wi => wi != null).ToArray(); 88await Task.Yield();
DownloadFromResultsContainer.cs (3)
64private async Task ExecuteCore() 77await Task.WhenAll(WorkItems.Select(wi => DownloadFilesForWorkItem(wi, directory.FullName, _cancellationSource.Token))); 81private async Task DownloadFilesForWorkItem(ITaskItem workItem, string directoryPath, CancellationToken ct)
FindDotNetCliPackage.cs (1)
77private async Task FindCliPackage()
GetHelixWorkItems.cs (4)
12using Task = System.Threading.Tasks.Task; 29protected override async Task ExecuteCore(CancellationToken cancellationToken) 31WorkItems = (await Task.WhenAll(Jobs.Select(j => GetWorkItemsAsync(j, cancellationToken))).ConfigureAwait(false)).SelectMany(r => r).ToArray(); 113await Task.Delay(DelayBetweenHelixApiCallsInMs, cancellationToken);
HelixTask.cs (2)
58System.Threading.Tasks.Task.Run(() => ExecuteCore(_cancel.Token)).GetAwaiter().GetResult(); 92protected abstract System.Threading.Tasks.Task ExecuteCore(CancellationToken cancellationToken);
SendHelixJob.cs (1)
162protected override async Task ExecuteCore(CancellationToken cancellationToken)
StartAzurePipelinesTestRun.cs (1)
25protected override Task ExecuteCoreAsync(HttpClient client)
StopAzurePipelinesTestRun.cs (1)
15protected override async Task ExecuteCoreAsync(HttpClient client)
WaitForHelixJobCompletion.cs (6)
22protected override async Task ExecuteCore(CancellationToken cancellationToken) 26await Task.Delay(1000, cancellationToken); 31await Task.WhenAll(jobNames.Select(n => WaitForHelixJobAsync(n.jobName, n.queueName, n.jobCancellationToken, cancellationToken))); 34private async Task WaitForHelixJobAsync(string jobName, string queueName, string helixJobCancellationToken, CancellationToken cancellationToken) 36await Task.Yield(); 43for (; ; await Task.Delay(20000, cancellationToken).ConfigureAwait(false)) // delay every time this loop repeats
Microsoft.DotNet.Helix.Sdk.Tests (6)
CreateXHarnessAndroidWorkItemsTests.cs (1)
28_zipArchiveManager.SetReturnsDefault(Task.CompletedTask);
CreateXHarnessAppleWorkItemsTests.cs (1)
30_zipArchiveManager.SetReturnsDefault(Task.CompletedTask);
InstallDotNetToolTests.cs (4)
205public async Task InstallsInParallelWithRealMutex() 270var installationTask = Task.Run(() => task1.InvokeExecute(provider1).Should().BeTrue()); 275var skipTask = Task.Run(() => task2.InvokeExecute(provider2).Should().BeTrue()); 300await Task.WhenAll(installationTask, skipTask);
Microsoft.DotNet.Open.Api.Tools.Tests (32)
OpenApiAddFileTests.cs (5)
72public async Task OpenApi_Add_ReuseItemGroup() 126public async Task OpenApi_Add_NSwagTypeScript() 146public async Task OpenApi_Add_FromJson() 166public async Task OpenApi_Add_File_UseProjectOption() 186public async Task OpenApi_Add_MultipleTimes_OnlyOneReference()
OpenApiAddProjectTests.cs (2)
19public async Task OpenApi_Add_GlobbingOpenApi() 83public async Task OpenApi_Add_FromCsProj()
OpenApiAddURLTests.cs (11)
15public async Task OpenApi_Add_Url_WithContentDisposition() 47public async Task OpenAPI_Add_Url_NoContentDisposition() 80public async Task OpenAPI_Add_Url_NoExtension_AssumesJson() 113public async Task OpenApi_Add_Url_NoSegment() 146public async Task OpenApi_Add_Url() 178public async Task OpenApi_Add_Url_SameName_UniqueFile() 238public async Task OpenApi_Add_Url_NSwagCSharp() 270public async Task OpenApi_Add_Url_NSwagTypeScript() 302public async Task OpenApi_Add_Url_OutputFile() 334public async Task OpenApi_Add_URL_FileAlreadyExists_Fail() 418public async Task OpenAPi_Add_URL_InvalidUrl()
OpenApiRefreshTests.cs (6)
14public async Task OpenApi_Refresh_Basic() 30await Task.Delay(TimeSpan.FromSeconds(1)); 44public async Task OpenApi_Refresh_MuchShorterFile() 60await Task.Delay(TimeSpan.FromSeconds(1)); 73public async Task OpenApi_Refresh_UnchangedFile() 86await Task.Delay(TimeSpan.FromSeconds(1));
OpenApiRemoveTests.cs (4)
15public async Task OpenApi_Remove_File() 60public async Task OpenApi_Remove_ViaUrl() 100public async Task OpenApi_Remove_Project() 148public async Task OpenApi_Remove_Multiple()
OpenApiTestBase.cs (2)
145return Task.FromResult<IHttpResponseMessageWrapper>(new TestHttpResponseMessageWrapper(stream, result?.Item2)); 170Stream = Task.FromResult<Stream>(stream);
ProcessEx.cs (1)
40public Task Exited => _exited.Task;
src\Tools\Shared\TestHelpers\TestConsole.cs (1)
37public Task CancelKeyPressSubscribed => _cancelKeySubscribed.Task;
Microsoft.DotNet.RemoteExecutor (6)
Program.cs (1)
63else if (result is Task resultValueTask)
RemoteExecutor.cs (5)
217public static RemoteInvokeHandle Invoke(Func<Task> method, RemoteInvokeOptions options = null) 230public static RemoteInvokeHandle Invoke(Func<string, Task> method, string arg, 245public static RemoteInvokeHandle Invoke(Func<string, string, Task> method, string arg1, string arg2, 261public static RemoteInvokeHandle Invoke(Func<string, string, string, Task> method, string arg1, 369|| method.ReturnType == typeof(Task)
Microsoft.DotNet.RemoteExecutor.Tests (5)
RemoteExecutorTests.cs (5)
20await Task.Delay(1); 30await Task.Delay(1); 41await Task.Delay(1); 53await Task.Delay(1); 64await Task.Delay(1);
Microsoft.DotNet.SignCheck (3)
SignCheck.cs (3)
461private async Task DownloadFileAsync(Uri uri) 487private async Task DownloadFilesAsync(IEnumerable<Uri> uris) 489await Task.WhenAll(uris.Select(u => DownloadFileAsync(u)));
Microsoft.DotNet.SwaggerGenerator.MSBuild (1)
GenerateSwaggerCode.cs (1)
47private async System.Threading.Tasks.Task ExecuteAsync()
Microsoft.DotNet.VersionTools (26)
src\Automation\GitHubApi\GitHubClient.cs (6)
111public async Task PutGitHubFileAsync( 148public async Task PostGitHubPullRequestAsync( 178public async Task UpdateGitHubPullRequestAsync( 274public async Task PostCommentAsync(GitHubProject project, int issueNumber, string message) 418public Task<string> GetMyAuthorIdAsync() => Task.FromResult(Auth.User); 447private static async Task EnsureSuccessfulAsync(HttpResponseMessage response)
src\Automation\GitHubApi\IGitHubClient.cs (4)
27Task PutGitHubFileAsync( 32Task PostGitHubPullRequestAsync( 39Task UpdateGitHubPullRequestAsync( 57Task PostCommentAsync(
src\Automation\GitHubVersionsRepoUpdater.cs (2)
52public async Task UpdateBuildInfoAsync( 157await Task.Delay(RetryMillisecondsDelay);
src\Automation\LocalVersionsRepoUpdater.cs (1)
22public async Task UpdateBuildInfoFilesAsync(
src\Automation\PullRequestCreator.cs (3)
37public async Task CreateOrUpdateAsync( 58public async Task CreateOrUpdateAsync( 171private async Task PostDiscardedCommitCommentAsync(
src\Automation\VersionsRepoUpdater.cs (1)
45protected static async Task AddExistingPackages(
src\Automation\VstsApi\VstsAdapterClient.cs (5)
106public Task PutGitHubFileAsync( 114public async Task PostGitHubPullRequestAsync( 144public async Task UpdateGitHubPullRequestAsync( 252public async Task PostCommentAsync(GitHubProject project, int issueNumber, string message) 424private static async Task EnsureSuccessfulAsync(HttpResponseMessage response)
src\BuildManifest\BuildManifestClient.cs (4)
65public async Task PushNewBuildAsync( 104public async Task PushChangeAsync(BuildManifestChange change) 162var completeJoinedSemaphores = (await Task.WhenAll(joinCompleteCheckTasks)) 285bool[] remainingSemaphoreIsComplete = await Task.WhenAll(
Microsoft.DotNet.VersionTools.Tests (6)
BuildManifest\BuildManifestClientTests.cs (6)
38public async Task TestPushNewBuildAsync() 95public async Task TestPushChangeSemaphoreAsync() 161public async Task TestPushConflictingChangeAsync() 187var pushClient = client.PushChangeAsync( 195Func<Task> act = async () => { await pushClient; }; 202public async Task TestPushConflictAsync()
Microsoft.Extensions.ApiDescription.Client.Tests (17)
src\Shared\Process\ProcessEx.cs (1)
71public Task Exited => _exited.Task;
TargetTest.cs (16)
65public async Task AddsExpectedItems() 86public async Task AddsExpectedItems_WithCodeGenerator() 108public async Task AddsExpectedItems_WithMultipleFiles() 133public async Task AddsExpectedItems_WithMultipleFilesFromGenerator() 161public async Task ExecutesGeneratorTarget() 185public async Task ExecutesGeneratorTarget_WithOpenApiGenerateCodeOptions() 210public async Task ExecutesGeneratorTarget_WithOpenApiCodeDirectory() 235public async Task ExecutesGeneratorTarget_WithClassName() 262public async Task ExecutesGeneratorTarget_WithCodeGenerator() 287public async Task ExecutesGeneratorTarget_WithNamespace() 312public async Task ExecutesGeneratorTarget_WithOptions() 337public async Task ExecutesGeneratorTarget_WithOutputPath() 364public async Task ExecutesGeneratorTarget_WithMultipleFiles() 400public async Task ExecutesGeneratorTarget_WithMultipleGenerators() 435public async Task SkipsGeneratorTarget_InSubsequentBuilds() 473public async Task SkipsGeneratorTarget_WithOpenApiGenerateCodeOnBuild()
Microsoft.Extensions.Caching.Abstractions (10)
DistributedCacheExtensions.cs (3)
40public static Task SetAsync(this IDistributedCache cache, string key, byte[] value, CancellationToken token = default(CancellationToken)) 85public static Task SetStringAsync(this IDistributedCache cache, string key, string value, CancellationToken token = default(CancellationToken)) 100public static Task SetStringAsync(this IDistributedCache cache, string key, string value, DistributedCacheEntryOptions options, CancellationToken token = default(CancellationToken))
IDistributedCache.cs (7)
26/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the located value or null.</returns> 44/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 45Task SetAsync(string key, byte[] value, DistributedCacheEntryOptions options, CancellationToken token = default(CancellationToken)); 58/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 59Task RefreshAsync(string key, CancellationToken token = default(CancellationToken)); 72/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 73Task RemoveAsync(string key, CancellationToken token = default(CancellationToken));
Microsoft.Extensions.Caching.Hybrid (5)
Internal\DefaultHybridCache.StampedeStateT.cs (5)
50public Task ExecuteDirectAsync(in TState state, Func<TState, CancellationToken, ValueTask<T>> underlying, HybridCacheEntryOptions? options) 65private async Task BackgroundFetchAsync() 129static Task<CacheItem<T>> Invalid() => System.Threading.Tasks.Task.FromException<CacheItem<T>>(new InvalidOperationException("Task should not be accessed for non-shared instances")); 266var first = await System.Threading.Tasks.Task.WhenAny(stampede.Task, cancelStub.Task).ConfigureAwait(false);
Microsoft.Extensions.Caching.Hybrid.Tests (33)
BufferReleaseTests.cs (6)
28public async Task BufferGetsReleased_NoL2() 63await Task.Delay(250); 105public async Task BufferDoesNotNeedRelease_LegacyL2() // byte[] API; not pooled 149await Task.Delay(250); 164public async Task BufferGetsReleased_BufferL2() // IBufferWriter<byte> API; pooled 207await Task.Delay(250);
DistributedCacheTests.cs (4)
54public async Task SimpleBufferRoundtrip(int size) 100public async Task SimpleBufferRoundtripAsync(int size) 166public async Task ReadOnlySequenceBufferRoundtrip(int size, SequenceKind kind) 226public async Task ReadOnlySequenceBufferRoundtripAsync(int size, SequenceKind kind)
L2Tests.cs (5)
46public async Task AssertL2Operations_Immutable(bool buffers) 101public async Task AssertL2Operations_Mutable(bool buffers) 222Task IDistributedCache.RefreshAsync(string key, CancellationToken token) 236Task IDistributedCache.RemoveAsync(string key, CancellationToken token) 250Task IDistributedCache.SetAsync(string key, byte[] value, DistributedCacheEntryOptions options, CancellationToken token)
RedisTests.cs (3)
53options.ConnectionMultiplexerFactory = () => Task.FromResult(redis); 60public async Task BasicUsage(bool useBuffers) 97await Task.Delay(500); // the L2 write continues in the background; give it a chance
SampleUsage.cs (2)
138return Task.FromResult(new SomeInformation { Id = id, Name = name }); 143return Task.FromResult(new SomeInformationReuse { Id = id, Name = name });
ServiceConstructionTests.cs (2)
80public async Task BasicStatelessUsage() 93public async Task BasicStatefulUsage()
StampedeTests.cs (11)
49Task IDistributedCache.RefreshAsync(string key, CancellationToken token) => throw new NotSupportedException("Intentionally not provided"); 55Task IDistributedCache.RemoveAsync(string key, CancellationToken token) => throw new NotSupportedException("Intentionally not provided"); 59Task IDistributedCache.SetAsync(string key, byte[] value, DistributedCacheEntryOptions options, CancellationToken token) => throw new NotSupportedException("Intentionally not provided"); 69public async Task MultipleCallsShareExecution_NoCancellation(int callerCount, bool canBeCanceled) 149public async Task MultipleCallsShareExecution_EveryoneCancels(int callerCount) 192await Task.Delay(500); // cancellation happens on a worker; need to allow a moment 219public async Task MultipleCallsShareExecution_MostCancel(int callerCount, int remaining) 267await Task.Delay(500); // cancellation happens on a worker; need to allow a moment 294public async Task ImmutableTypesShareFinalTask(bool withCancelation) 320public async Task ImmutableCustomTypesShareFinalTask(bool withCancelation) 350public async Task MutableTypesNeverShareFinalTask(bool withCancelation)
Microsoft.Extensions.Caching.Memory (10)
CacheEntry.CacheEntryTokens.cs (1)
109Task.Factory.StartNew(state => InvokeCallbacks((CacheEntry)state!), cacheEntry,
CacheEntry.cs (1)
279Task.Factory.StartNew(state =>
MemoryCache.cs (1)
356Task.Factory.StartNew(state => ((MemoryCache)state!).ScanForExpiredItems(), this,
MemoryDistributedCache.cs (7)
63return Task.FromResult(Get(key)); 95public Task SetAsync(string key, byte[] value, DistributedCacheEntryOptions options, CancellationToken token = default(CancellationToken)) 102return Task.CompletedTask; 122public Task RefreshAsync(string key, CancellationToken token = default(CancellationToken)) 127return Task.CompletedTask; 147public Task RemoveAsync(string key, CancellationToken token = default(CancellationToken)) 152return Task.CompletedTask;
Microsoft.Extensions.Caching.MicroBenchmarks (6)
DistributedCacheBenchmarks.cs (5)
65options.ConnectionMultiplexerFactory = () => Task.FromResult<IConnectionMultiplexer>(multiplexer); 151pendingBlobs[i] = Task.Run(callback); 196pendingBlobs[i] = Task.Run(callback); 240pendingBlobs[i] = Task.Run(callback); 284pendingBlobs[i] = Task.Run(callback);
HybridCacheBenchmarks.cs (1)
31options.ConnectionMultiplexerFactory = () => Task.FromResult<IConnectionMultiplexer>(_multiplexer);
Microsoft.Extensions.Caching.SqlServer (10)
DatabaseOperations.cs (3)
62public async Task DeleteCacheItemAsync(string key, CancellationToken token = default(CancellationToken)) 107public Task RefreshCacheItemAsync(string key, CancellationToken token = default(CancellationToken)) 167public async Task SetCacheItemAsync(string key, ArraySegment<byte> value, DistributedCacheEntryOptions options, CancellationToken token = default(CancellationToken))
IDatabaseOperations.cs (3)
24Task RefreshCacheItemAsync(string key, CancellationToken token = default(CancellationToken)); 28Task DeleteCacheItemAsync(string key, CancellationToken token = default(CancellationToken)); 32Task SetCacheItemAsync(string key, ArraySegment<byte> value, DistributedCacheEntryOptions options, CancellationToken token = default(CancellationToken));
SqlServerCache.cs (4)
135public async Task RefreshAsync(string key, CancellationToken token = default(CancellationToken)) 157public async Task RemoveAsync(string key, CancellationToken token = default(CancellationToken)) 196public async Task SetAsync( 273Task.Run(_deleteExpiredCachedItemsDelegate);
Microsoft.Extensions.Caching.SqlServer.Tests (23)
SqlServerCacheWithDatabaseTest.cs (23)
58public async Task ReturnsNullValue_ForNonExistingCacheItem() 72public async Task SetWithAbsoluteExpirationSetInThePast_Throws() 93public async Task SetCacheItem_SucceedsFor_KeyEqualToMaximumSize() 121public async Task SetCacheItem_SucceedsFor_NullAbsoluteAndSlidingExpirationTimes() 161public async Task UpdatedDefaultSlidingExpiration_SetCacheItem_SucceedsFor_NullAbsoluteAndSlidingExpirationTimes() 202public async Task SetCacheItem_FailsFor_KeyGreaterThanMaximumSize() 226public async Task SetWithSlidingExpiration_ReturnsNullValue_ForExpiredCacheItem( 252public async Task SetWithSlidingExpiration_ExtendsExpirationTime(int accessItemAt, int expected) 281public async Task SetWithSlidingExpirationAndAbsoluteExpiration_ReturnsNullValue_ForExpiredCacheItem( 310public async Task SetWithAbsoluteExpirationRelativeToNow_ReturnsNullValue_ForExpiredCacheItem() 333public async Task SetWithAbsoluteExpiration_ReturnsNullValue_ForExpiredCacheItem() 357public async Task DoesNotThrowException_WhenOnlyAbsoluteExpirationSupplied_AbsoluteExpirationRelativeToNow() 386public async Task DoesNotThrowException_WhenOnlyAbsoluteExpirationSupplied_AbsoluteExpiration() 414public async Task SetCacheItem_UpdatesAbsoluteExpirationTime() 454public async Task SetCacheItem_WithValueLargerThan_DefaultColumnWidth() 482public async Task ExtendsExpirationTime_ForSlidingExpiration() 512public async Task GetItem_SlidingExpirationDoesNot_ExceedAbsoluteExpirationIfSet() 569public async Task DoestNotExtendsExpirationTime_ForAbsoluteExpiration() 599public async Task RefreshItem_ExtendsExpirationTime_ForSlidingExpiration() 629public async Task GetCacheItem_IsCaseSensitive() 648public async Task GetCacheItem_DoesNotTrimTrailingSpaces() 669public async Task DeletesCacheItem_OnExplicitlyCalled() 709private async Task AssertGetCacheItemFromDatabaseAsync(
Microsoft.Extensions.Caching.StackExchangeRedis (7)
RedisCache.cs (7)
185var setFields = batch.HashSetAsync(prefixedKey, fields); 200public Task SetAsync(string key, byte[] value, DistributedCacheEntryOptions options, CancellationToken token = default) 206private async Task SetImplAsync(string key, ReadOnlySequence<byte> value, DistributedCacheEntryOptions options, CancellationToken token = default) 233await Task.WhenAll( 263public async Task RefreshAsync(string key, CancellationToken token = default) 478public async Task RemoveAsync(string key, CancellationToken token = default) 538private async Task RefreshAsync(IDatabase cache, string key, DateTimeOffset? absExpr, TimeSpan sldExpr, CancellationToken token)
Microsoft.Extensions.Caching.StackExchangeRedis.Tests (24)
RedisCacheSetAndRemoveTests.cs (2)
117public async Task SetGetEmptyNonNullBufferAsync() 157public async Task SetGetNonNullStringAsync(string payload)
TimeExpirationAsyncTests.cs (22)
20static async Task ThrowsArgumentOutOfRangeAsync(Func<Task> test, string paramName, string message, object actualValue) 38public async Task AbsoluteExpirationInThePastThrows() 56public async Task AbsoluteExpirationExpires() 69await Task.Delay(TimeSpan.FromSeconds(0.5)); 77public async Task AbsoluteSubSecondExpirationExpiresImmediately() 90public async Task NegativeRelativeExpirationThrows() 106public async Task ZeroRelativeExpirationThrows() 122public async Task RelativeExpirationExpires() 135await Task.Delay(TimeSpan.FromSeconds(0.5)); 142public async Task RelativeSubSecondExpirationExpiresImmediately() 155public async Task NegativeSlidingExpirationThrows() 168public async Task ZeroSlidingExpirationThrows() 184public async Task SlidingExpirationExpiresIfNotAccessed() 195await Task.Delay(TimeSpan.FromSeconds(3.5)); 202public async Task SlidingSubSecondExpirationExpiresImmediately() 215public async Task SlidingExpirationRenewedByAccess() 228await Task.Delay(TimeSpan.FromSeconds(0.5)); 234await Task.Delay(TimeSpan.FromSeconds(3)); 240public async Task SlidingExpirationRenewedByAccessUntilAbsoluteExpiration() 256await Task.Delay(TimeSpan.FromSeconds(0.5)); 265await Task.Delay(TimeSpan.FromSeconds(0.5));
Microsoft.Extensions.Configuration.KeyPerFile.Tests (5)
KeyPerFileTests.cs (5)
230_ = Task.Run(ReloadLoop); 317public async Task RaiseChangeEventWhenReloadOnChangeIsTrue() 347public async Task RaiseChangeEventWhenDirectoryClearsReloadOnChangeIsTrue() 373public async Task RaiseChangeEventAfterStartingWithEmptyDirectoryReloadOnChangeIsTrue() 398public async Task RaiseChangeEventAfterProviderSetToNull()
Microsoft.Extensions.DependencyInjection (3)
ServiceLookup\ServiceProviderEngineScope.cs (2)
111Task.Run(() => ((IAsyncDisposable)localService).DisposeAsync().AsTask()).GetAwaiter().GetResult(); 171return new ValueTask(Task.FromException(ex));
ServiceLookup\StackGuard.cs (1)
68Task<R> task = Task.Factory.StartNew((Func<object?, R>)action, state, CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default);
Microsoft.Extensions.Diagnostics.HealthChecks (16)
DefaultHealthCheckService.cs (2)
56tasks[index++] = Task.Run(() => RunCheckAsync(registration, cancellationToken), cancellationToken); 59await Task.WhenAll(tasks).ConfigureAwait(false);
DependencyInjection\HealthChecksBuilderDelegateExtensions.cs (2)
58var instance = new DelegateHealthCheck((ct) => Task.FromResult(check())); 101var instance = new DelegateHealthCheck((ct) => Task.FromResult(check(ct)));
HealthCheckPublisherHostedService.cs (12)
62public Task StartAsync(CancellationToken cancellationToken = default) 66return Task.CompletedTask; 73return Task.CompletedTask; 76public Task StopAsync(CancellationToken cancellationToken = default) 89return Task.CompletedTask; 102return Task.CompletedTask; 144internal async Task RunAsync((TimeSpan Delay, TimeSpan Period) timerOptions) 178private async Task RunAsyncCore((TimeSpan Delay, TimeSpan Period) timerOptions, CancellationToken cancellationToken) 181await Task.Yield(); 195var tasks = new Task[publishers.Length]; 201await Task.WhenAll(tasks).ConfigureAwait(false); 204private async Task RunPublisherAsync(IHealthCheckPublisher publisher, HealthReport report, CancellationToken cancellationToken)
Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions (2)
IHealthCheckPublisher.cs (2)
36/// <returns>A <see cref="Task"/> which will complete when publishing is complete.</returns> 37Task PublishAsync(HealthReport report, CancellationToken cancellationToken);
Microsoft.Extensions.Diagnostics.HealthChecks.Tests (86)
DefaultHealthCheckServiceTest.cs (38)
34.AddCheck("Foo", new DelegateHealthCheck(_ => Task.FromResult(HealthCheckResult.Healthy()))) 35.AddCheck("Foo", new DelegateHealthCheck(_ => Task.FromResult(HealthCheckResult.Healthy()))) 36.AddCheck("Bar", new DelegateHealthCheck(_ => Task.FromResult(HealthCheckResult.Healthy()))) 37.AddCheck("Baz", new DelegateHealthCheck(_ => Task.FromResult(HealthCheckResult.Healthy()))) 38.AddCheck("Baz", new DelegateHealthCheck(_ => Task.FromResult(HealthCheckResult.Healthy()))); 54public async Task CheckAsync_RunsAllChecksAndAggregatesResultsAsync() 74b.AddAsyncCheck("HealthyCheck", _ => Task.FromResult(HealthCheckResult.Healthy(HealthyMessage, data)), healthyCheckTags); 75b.AddAsyncCheck("DegradedCheck", _ => Task.FromResult(HealthCheckResult.Degraded(DegradedMessage)), degradedCheckTags); 76b.AddAsyncCheck("UnhealthyCheck", _ => Task.FromResult(HealthCheckResult.Unhealthy(UnhealthyMessage, exception)), unhealthyCheckTags); 119public async Task CheckAsync_TagsArePresentInHealthReportEntryIfExceptionOccurs() 160public async Task CheckAsync_RunsFilteredChecksAndAggregatesResultsAsync() 177b.AddAsyncCheck("HealthyCheck", _ => Task.FromResult(HealthCheckResult.Healthy(HealthyMessage, data))); 178b.AddAsyncCheck("DegradedCheck", _ => Task.FromResult(HealthCheckResult.Degraded(DegradedMessage))); 179b.AddAsyncCheck("UnhealthyCheck", _ => Task.FromResult(HealthCheckResult.Unhealthy(UnhealthyMessage, exception))); 202public async Task CheckHealthAsync_SetsRegistrationForEachCheck() 245public async Task CheckHealthAsync_Cancellation_CanPropagate() 256await Task.Delay(10000, ct); 274public async Task CheckHealthAsync_ConvertsExceptionInHealthCheckToUnhealthyResultAsync() 283b.AddAsyncCheck("Faults", ct => Task.FromException<HealthCheckResult>(faultedException)); 284b.AddAsyncCheck("Succeeds", ct => Task.FromResult(HealthCheckResult.Healthy())); 317public async Task CheckHealthAsync_SetsUpALoggerScopeForEachCheck() 334return Task.FromResult(HealthCheckResult.Healthy()); 358public async Task CheckHealthAsync_CheckCanDependOnTransientService() 382public async Task CheckHealthAsync_CheckCanDependOnScopedService() 407public async Task CheckHealthAsync_CheckCanDependOnScopedService_per_check() 437public async Task CheckHealthAsync_CheckCanHaveScopedDisposableDependencies() 462public async Task CheckHealthAsync_CheckCanDependOnSingletonService() 486public async Task CheckHealthAsync_ChecksAreRunInParallel() 514await Task.WhenAll(output1.Task, output2.Task).TimeoutAfter(TimeSpan.FromSeconds(10)); 534public async Task CheckHealthAsync_TimeoutReturnsUnhealthy() 541await Task.Delay(2000, ct); 567await Task.Delay(1).ConfigureAwait(false); 593public async Task CheckHealthAsync_WithFailureStatus() 668return Task.FromResult(HealthCheckResult.Healthy()); 686return Task.FromResult(HealthCheckResult.Healthy()); 690return Task.FromResult(HealthCheckResult.Unhealthy("failed", e)); 704return Task.FromResult(HealthCheckResult.Healthy(data: data)); 736return Task.FromResult(HealthCheckResult.Healthy(data: new Dictionary<string, object> { { "self", this } }));
DependencyInjection\HealthChecksBuilderTest.cs (5)
23return Task.FromResult(HealthCheckResult.Healthy()); 163return Task.FromResult(HealthCheckResult.Healthy()); 186return Task.FromResult(HealthCheckResult.Unhealthy()); 208.AddAsyncCheck("Foo", () => Task.FromResult(HealthCheckResult.Healthy())); 211.AddAsyncCheck("Bar", () => Task.FromResult(HealthCheckResult.Healthy()));
DependencyInjection\ServiceCollectionExtensionsTest.cs (2)
85public Task StartAsync(CancellationToken cancellationToken) 90public Task StopAsync(CancellationToken cancellationToken)
HealthCheckPublisherHostedServiceTest.cs (41)
41public async Task StartAsync_WithoutPublishers_DoesNotStartTimer() 68public async Task StartAsync_WithPublishers_StartsTimer() 96public async Task StartAsync_WithPublishers_StartsTimer_RunsPublishers() 141public async Task StopAsync_CancelsExecution() 155var running = RunServiceAsync(service); 182public async Task RunAsync_WaitsForCompletion_Single() 198var running = RunServiceAsync(service); 236public async Task RunAsync_WaitsForCompletion_Single_RegistrationParameters() 251instance: new DelegateHealthCheck(_ => Task.FromResult(HealthCheckResult.Healthy(HealthyMessage))), 258instance: new DelegateHealthCheck(_ => Task.FromResult(HealthCheckResult.Healthy(HealthyMessage))), 270instance: new DelegateHealthCheck(_ => Task.FromResult(HealthCheckResult.Healthy(HealthyMessage))), 282instance: new DelegateHealthCheck(_ => Task.FromResult(HealthCheckResult.Healthy(HealthyMessage))), 297return Task.FromResult(HealthCheckResult.Healthy(HealthyMessage)); 310instance: new DelegateHealthCheck(_ => Task.FromResult(HealthCheckResult.Healthy(HealthyMessage))), 322instance: new DelegateHealthCheck(_ => Task.FromResult(HealthCheckResult.Healthy(HealthyMessage))), 334instance: new DelegateHealthCheck(_ => Task.FromResult(HealthCheckResult.Healthy(HealthyMessage))), 346instance: new DelegateHealthCheck(_ => Task.FromResult(HealthCheckResult.Healthy(HealthyMessage))), 358var running = RunServiceAsync(service); 362await Task.Yield(); 395public async Task RunAsync_WaitsForCompletion_Multiple() 416var running = RunServiceAsync(service); 447public async Task RunAsync_PublishersCanTimeout() 462var running = RunServiceAsync(service); 500public async Task RunAsync_CanFilterHealthChecks() 525instance: new DelegateHealthCheck(_ => Task.FromResult(HealthCheckResult.Healthy(HealthyMessage))), 532instance: new DelegateHealthCheck(_ => Task.FromResult(HealthCheckResult.Healthy(HealthyMessage))), 544instance: new DelegateHealthCheck(_ => Task.FromResult(HealthCheckResult.Healthy(HealthyMessage))), 556instance: new DelegateHealthCheck(_ => Task.FromResult(HealthCheckResult.Healthy(HealthyMessage))), 571return Task.FromResult(HealthCheckResult.Healthy(HealthyMessage)); 584instance: new DelegateHealthCheck(_ => Task.FromResult(HealthCheckResult.Healthy(HealthyMessage))), 596instance: new DelegateHealthCheck(_ => Task.FromResult(HealthCheckResult.Healthy(HealthyMessage))), 608instance: new DelegateHealthCheck(_ => Task.FromResult(HealthCheckResult.Healthy(HealthyMessage))), 620instance: new DelegateHealthCheck(_ => Task.FromResult(HealthCheckResult.Healthy(HealthyMessage))), 664public async Task RunAsync_HandlesExceptions() 706public async Task RunAsync_HandlesExceptions_Multiple() 787private Task RunServiceAsync(HealthCheckPublisherHostedService service) => service.RunAsync((TimeSpan.FromMinutes(5), TimeSpan.FromMinutes(5))); 789private static async Task AssertCanceledAsync(CancellationToken cancellationToken) 791await Assert.ThrowsAsync<TaskCanceledException>(() => Task.Delay(TimeSpan.FromSeconds(10), cancellationToken)); 807public Task Started => _started.Task; 809public Task? Wait { get; set; } 811public async Task PublishAsync(HealthReport report, CancellationToken cancellationToken)
Microsoft.Extensions.FileProviders.Physical (1)
PhysicalFilesWatcher.cs (1)
459Task.Factory.StartNew(
Microsoft.Extensions.Hosting (24)
HostingHostBuilderExtensions.cs (4)
375/// <returns>A <see cref="Task"/> that only completes when the token is triggered or shutdown is triggered.</returns> 380public static Task RunConsoleAsync(this IHostBuilder hostBuilder, CancellationToken cancellationToken = default) 391/// <returns>A <see cref="Task"/> that only completes when the token is triggered or shutdown is triggered.</returns> 396public static Task RunConsoleAsync(this IHostBuilder hostBuilder, Action<ConsoleLifetimeOptions> configureOptions, CancellationToken cancellationToken = default)
Internal\ConsoleLifetime.cs (6)
75/// <returns>A <see cref="Task"/> that represents the asynchronous registration operation.</returns> 76public Task WaitForStartAsync(CancellationToken cancellationToken) 95return Task.CompletedTask; 116/// <returns>A <see cref="Task"/> that represents a completed task.</returns> 117public Task StopAsync(CancellationToken cancellationToken) 120return Task.CompletedTask;
Internal\Host.cs (10)
72public async Task StartAsync(CancellationToken cancellationToken = default) 175private async Task TryExecuteBackgroundServiceAsync(BackgroundService backgroundService) 178Task? backgroundTask = backgroundService.ExecuteTask; 217public async Task StopAsync(CancellationToken cancellationToken = default) 308private static async Task ForeachService<T>( 314Func<T, CancellationToken, Task> operation) 321List<Task>? tasks = null; 325Task task; 353Task groupedTasks = Task.WhenAll(tasks);
Internal\NullLifetime.cs (4)
14public Task WaitForStartAsync(CancellationToken cancellationToken) 16return Task.CompletedTask; 19public Task StopAsync(CancellationToken cancellationToken) 21return Task.CompletedTask;
Microsoft.Extensions.Hosting.Abstractions (37)
BackgroundService.cs (9)
15private Task? _executeTask; 24public virtual Task? ExecuteTask => _executeTask; 31/// <returns>A <see cref="Task"/> that represents the long running operations.</returns> 33protected abstract Task ExecuteAsync(CancellationToken stoppingToken); 39/// <returns>A <see cref="Task"/> that represents the asynchronous Start operation.</returns> 40public virtual Task StartAsync(CancellationToken cancellationToken) 55return Task.CompletedTask; 62/// <returns>A <see cref="Task"/> that represents the asynchronous Stop operation.</returns> 63public virtual async Task StopAsync(CancellationToken cancellationToken)
HostingAbstractionsHostExtensions.cs (8)
31/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 32public static async Task StopAsync(this IHost host, TimeSpan timeout) 57/// Runs an application and returns a <see cref="Task"/> that only completes when the token is triggered or shutdown is triggered. 62/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 63public static async Task RunAsync(this IHost host, CancellationToken token = default) 89/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 90public static async Task WaitForShutdownAsync(this IHost host, CancellationToken token = default) 101await Task.Delay(Timeout.Infinite, applicationLifetime.ApplicationStopping).ConfigureAwait(ConfigureAwaitOptions.SuppressThrowing);
IHost.cs (4)
25/// <returns>A <see cref="Task"/> that will be completed when the <see cref="IHost"/> starts.</returns> 26Task StartAsync(CancellationToken cancellationToken = default); 32/// <returns>A <see cref="Task"/> that will be completed when the <see cref="IHost"/> stops.</returns> 33Task StopAsync(CancellationToken cancellationToken = default);
IHostedLifecycleService.cs (8)
20/// <returns>A <see cref="Task"/> that represents the asynchronous operation.</returns> 21Task StartingAsync(CancellationToken cancellationToken); 27/// <returns>A <see cref="Task"/> that represents the asynchronous operation.</returns> 28Task StartedAsync(CancellationToken cancellationToken); 34/// <returns>A <see cref="Task"/> that represents the asynchronous operation.</returns> 35Task StoppingAsync(CancellationToken cancellationToken); 41/// <returns>A <see cref="Task"/> that represents the asynchronous operation.</returns> 42Task StoppedAsync(CancellationToken cancellationToken);
IHostedService.cs (4)
18/// <returns>A <see cref="Task"/> that represents the asynchronous Start operation.</returns> 19Task StartAsync(CancellationToken cancellationToken); 25/// <returns>A <see cref="Task"/> that represents the asynchronous Stop operation.</returns> 26Task StopAsync(CancellationToken cancellationToken);
IHostLifetime.cs (4)
19/// <returns>A <see cref="Task"/>.</returns> 20Task WaitForStartAsync(CancellationToken cancellationToken); 26/// <returns>A <see cref="Task"/>.</returns> 27Task StopAsync(CancellationToken cancellationToken);
Microsoft.Extensions.Hosting.Systemd (4)
SystemdLifetime.cs (4)
59public Task StopAsync(CancellationToken cancellationToken) 61return Task.CompletedTask; 73public Task WaitForStartAsync(CancellationToken cancellationToken) 88return Task.CompletedTask;
Microsoft.Extensions.Hosting.WindowsServices (3)
WindowsServiceLifetime.cs (3)
75public Task WaitForStartAsync(CancellationToken cancellationToken) 120public async Task StopAsync(CancellationToken cancellationToken) 126await Task.Run(Stop, cancellationToken).ConfigureAwait(false);
Microsoft.Extensions.Http.Polly.Tests (31)
DependencyInjection\PollyHttpClientBuilderExtensionsTest.cs (11)
39public async Task AddPolicyHandler_Policy_AddsPolicyHandler() 74public async Task AddPolicyHandler_PolicySelector_AddsPolicyHandler() 112public async Task AddPolicyHandler_PolicySelectorWithServices_AddsPolicyHandler() 150public async Task AddPolicyHandlerFromRegistry_Name_AddsPolicyHandler() 188public async Task AddPolicyHandlerFromRegistry_Dynamic_AddsPolicyHandler() 240public async Task AddTransientHttpErrorPolicy_AddsPolicyHandler_HandlesStatusCode(HttpStatusCode statusCode) 285public async Task AddTransientHttpErrorPolicy_AddsPolicyHandler_HandlesHttpRequestException() 330public async Task AddPolicyHandlerFromRegistry_PolicySelectorWithKey_AddsPolicyHandler() 395public async Task AddPolicyHandlerFromRegistry_WithConfigureDelegate_AddsPolicyHandler() 569return Task.FromResult(new HttpResponseMessage(HttpStatusCode.Created)); 583return Task.FromResult(func(request));
PolicyHttpMessageHandlerTest.cs (20)
19public async Task SendAsync_StaticPolicy_PolicyTriggers_CanReexecuteSendAsync() 40return Task.FromResult(expected); 57public async Task SendAsync_DynamicPolicy_PolicyTriggers_CanReexecuteSendAsync() 85return Task.FromResult(expected); 103public async Task SendAsync_StaticPolicy_PolicyTriggers_CanReexecuteSendAsync_FirstResponseDisposed() 126return Task.FromResult(firstResponse); 131return Task.FromResult(expected); 151public async Task MultipleHandlers_CanReexecuteSendAsync_FirstResponseDisposed() 178return Task.FromResult(firstResponse); 183return Task.FromResult(expected); 203public async Task SendAsync_DynamicPolicy_PolicySelectorReturnsNull_ThrowsException() 226public async Task SendAsync_PolicyCancellation_CanTriggerRequestCancellation() 255return Task.FromResult(expected); 272public async Task SendAsync_NoContextSet_CreatesNewContext() 285return Task.FromResult(expected); 300public async Task SendAsync_ExistingContext_ReusesContext() 315return Task.FromResult(expected); 331public async Task SendAsync_NoContextSet_DynamicPolicySelectorThrows_CleansUpContext() 352public async Task SendAsync_NoContextSet_RequestThrows_CleansUpContext() 387await Task.Delay(1).ConfigureAwait(false);
Microsoft.Extensions.Identity.Core (169)
AuthenticatorTokenProvider.cs (1)
37return Task.FromResult(string.Empty);
DefaultUserConfirmation.cs (1)
19/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> of the confirmation operation.</returns>
IRoleClaimStore.cs (2)
34Task AddClaimAsync(TRole role, Claim claim, CancellationToken cancellationToken = default(CancellationToken)); 43Task RemoveClaimAsync(TRole role, Claim claim, CancellationToken cancellationToken = default(CancellationToken));
IRoleStore.cs (4)
62/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 63Task SetRoleNameAsync(TRole role, string? roleName, CancellationToken cancellationToken); 79/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 80Task SetNormalizedRoleNameAsync(TRole role, string? normalizedName, CancellationToken cancellationToken);
IUserAuthenticationTokenStore.cs (5)
23/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 24Task SetTokenAsync(TUser user, string loginProvider, string name, string? value, CancellationToken cancellationToken); 33/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 34Task RemoveTokenAsync(TUser user, string loginProvider, string name, CancellationToken cancellationToken); 43/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns>
IUserAuthenticatorKeyStore.cs (3)
21/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 22Task SetAuthenticatorKeyAsync(TUser user, string key, CancellationToken cancellationToken); 29/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the security stamp for the specified <paramref name="user"/>.</returns>
IUserClaimsPrincipalFactory.cs (1)
20/// <returns>The <see cref="Task"/> that represents the asynchronous creation operation, containing the created <see cref="ClaimsPrincipal"/>.</returns>
IUserClaimStore.cs (3)
34Task AddClaimsAsync(TUser user, IEnumerable<Claim> claims, CancellationToken cancellationToken); 44Task ReplaceClaimAsync(TUser user, Claim claim, Claim newClaim, CancellationToken cancellationToken); 53Task RemoveClaimsAsync(TUser user, IEnumerable<Claim> claims, CancellationToken cancellationToken);
IUserEmailStore.cs (3)
22Task SetEmailAsync(TUser user, string? email, CancellationToken cancellationToken); 51Task SetEmailConfirmedAsync(TUser user, bool confirmed, CancellationToken cancellationToken); 80Task SetNormalizedEmailAsync(TUser user, string? normalizedEmail, CancellationToken cancellationToken);
IUserLockoutStore.cs (9)
35/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 36Task SetLockoutEndDateAsync(TUser user, DateTimeOffset? lockoutEnd, CancellationToken cancellationToken); 43/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the incremented failed access count.</returns> 51/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 53Task ResetAccessFailedCountAsync(TUser user, CancellationToken cancellationToken); 60/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the failed access count.</returns> 69/// The <see cref="Task"/> that represents the asynchronous operation, true if a user can be locked out, otherwise false. 79/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 80Task SetLockoutEnabledAsync(TUser user, bool enabled, CancellationToken cancellationToken);
IUserLoginStore.cs (6)
23/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 24Task AddLoginAsync(TUser user, UserLoginInfo login, CancellationToken cancellationToken); 34/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 35Task RemoveLoginAsync(TUser user, string loginProvider, string providerKey, CancellationToken cancellationToken); 43/// The <see cref="Task"/> for the asynchronous operation, containing a list of <see cref="UserLoginInfo"/> for the specified <paramref name="user"/>, if any. 54/// The <see cref="Task"/> for the asynchronous operation, containing the user, if any which matched the specified login provider and key.
IUserPasswordStore.cs (4)
21/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 22Task SetPasswordHashAsync(TUser user, string? passwordHash, CancellationToken cancellationToken); 29/// <returns>The <see cref="Task"/> that represents the asynchronous operation, returning the password hash for the specified <paramref name="user"/>.</returns> 38/// The <see cref="Task"/> that represents the asynchronous operation, returning true if the specified <paramref name="user"/> has a password
IUserPhoneNumberStore.cs (6)
21/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 22Task SetPhoneNumberAsync(TUser user, string? phoneNumber, CancellationToken cancellationToken); 29/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the user's telephone number, if any.</returns> 38/// The <see cref="Task"/> that represents the asynchronous operation, returning true if the specified <paramref name="user"/> has a confirmed 49/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 50Task SetPhoneNumberConfirmedAsync(TUser user, bool confirmed, CancellationToken cancellationToken);
IUserRoleStore.cs (7)
22/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 23Task AddToRoleAsync(TUser user, string roleName, CancellationToken cancellationToken); 31/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 32Task RemoveFromRoleAsync(TUser user, string roleName, CancellationToken cancellationToken); 39/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing a list of role names.</returns> 49/// The <see cref="Task"/> that represents the asynchronous operation, containing a flag indicating whether the specified <paramref name="user"/> is 60/// The <see cref="Task"/> that represents the asynchronous operation, containing a list of users who are in the named role.
IUserSecurityStampStore.cs (3)
21/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 22Task SetSecurityStampAsync(TUser user, string stamp, CancellationToken cancellationToken); 29/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the security stamp for the specified <paramref name="user"/>.</returns>
IUserStore.cs (12)
21/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the identifier for the specified <paramref name="user"/>.</returns> 29/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the name for the specified <paramref name="user"/>.</returns> 38/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 39Task SetUserNameAsync(TUser user, string? userName, CancellationToken cancellationToken); 46/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the normalized user name for the specified <paramref name="user"/>.</returns> 55/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 56Task SetNormalizedUserNameAsync(TUser user, string? normalizedName, CancellationToken cancellationToken); 63/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> of the creation operation.</returns> 71/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> of the update operation.</returns> 79/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> of the delete operation.</returns> 88/// The <see cref="Task"/> that represents the asynchronous operation, containing the user matching the specified <paramref name="userId"/> if it exists. 98/// The <see cref="Task"/> that represents the asynchronous operation, containing the user matching the specified <paramref name="normalizedUserName"/> if it exists.
IUserTwoFactorRecoveryCodeStore.cs (1)
23Task ReplaceCodesAsync(TUser user, IEnumerable<string> recoveryCodes, CancellationToken cancellationToken);
IUserTwoFactorStore.cs (3)
22/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 23Task SetTwoFactorEnabledAsync(TUser user, bool enabled, CancellationToken cancellationToken); 32/// The <see cref="Task"/> that represents the asynchronous operation, containing a flag indicating whether the specified
IUserTwoFactorTokenProvider.cs (3)
21/// The <see cref="Task"/> that represents the asynchronous operation, containing the token for the specified 44/// The <see cref="Task"/> that represents the asynchronous operation, containing the a flag indicating the result 57/// The <see cref="Task"/> that represents the asynchronous operation, containing the a flag indicating if a two
IUserValidator.cs (1)
19/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> of the validation operation.</returns>
PasswordValidator.cs (1)
77Task.FromResult(errors?.Count > 0
PhoneNumberTokenProvider.cs (2)
25/// The <see cref="Task"/> that represents the asynchronous operation, containing the a flag indicating if a two 46/// The <see cref="Task"/> that represents the asynchronous operation, containing a constant modifier for the specified
RoleManager.cs (14)
153/// The <see cref="Task"/> that represents the asynchronous operation. 174/// The <see cref="Task"/> that represents the asynchronous operation. 176public virtual async Task UpdateNormalizedRoleNameAsync(TRole role) 187/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> for the update. 202/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> for the delete. 217/// The <see cref="Task"/> that represents the asynchronous operation, containing true if the role name exists, otherwise false. 243/// The <see cref="Task"/> that represents the asynchronous operation, containing the role 257/// The <see cref="Task"/> that represents the asynchronous operation, containing the name of the 272/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> 289/// The <see cref="Task"/> that represents the asynchronous operation, containing the ID of the 303/// The <see cref="Task"/> that represents the asynchronous operation, containing the role 320/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> 340/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> 358/// The <see cref="Task"/> that represents the asynchronous operation, containing the list of <see cref="Claim"/>s
TotpSecurityStampBasedTokenProvider.cs (4)
25/// The <see cref="Task"/> that represents the asynchronous operation, containing the token for the specified 55/// The <see cref="Task"/> that represents the asynchronous operation, containing the a flag indicating the result 80/// The <see cref="Task"/> that represents the asynchronous operation, containing a constant modifier for the specified 98/// The <see cref="Task"/> that represents the asynchronous operation, containing the a flag indicating if a two
UserClaimsPrincipalFactory.cs (3)
58/// <returns>The <see cref="Task"/> that represents the asynchronous creation operation, containing the created <see cref="ClaimsPrincipal"/>.</returns> 70/// <returns>The <see cref="Task"/> that represents the asynchronous creation operation, containing the created <see cref="ClaimsIdentity"/>.</returns> 135/// <returns>The <see cref="Task"/> that represents the asynchronous creation operation, containing the created <see cref="ClaimsIdentity"/>.</returns>
UserManager.cs (66)
436return id == null ? Task.FromResult<TUser?>(null) : FindByIdAsync(id); 444/// The <see cref="Task"/> that represents the asynchronous operation, containing the security 449return Task.FromResult(Guid.NewGuid().ToString()); 458/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> 485/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> 501/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> 517/// The <see cref="Task"/> that represents the asynchronous operation, containing the user matching the specified <paramref name="userId"/> if it exists. 530/// The <see cref="Task"/> that represents the asynchronous operation, containing the user matching the specified <paramref name="userName"/> if it exists. 568/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> 619/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 620public virtual async Task UpdateNormalizedUserNameAsync(TUser user) 631/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the name for the specified <paramref name="user"/>.</returns> 644/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 659/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the identifier for the specified <paramref name="user"/>.</returns> 672/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing true if 704/// The <see cref="Task"/> that represents the asynchronous operation, returning true if the specified <paramref name="user"/> has a password 723/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> 754/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> 781/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> 801/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="PasswordVerificationResult"/> 818/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the security stamp for the specified <paramref name="user"/>.</returns> 838/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> 859/// <returns>The <see cref="Task"/> that represents the asynchronous operation, 875/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> 902/// The <see cref="Task"/> for the asynchronous operation, containing the user, if any which matched the specified login provider and key. 921/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> 943/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> 968/// The <see cref="Task"/> for the asynchronous operation, containing a list of <see cref="UserLoginInfo"/> for the specified <paramref name="user"/>, if any. 984/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> 1002/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> 1023/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> 1044/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> 1062/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> 1097/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> 1121/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> 1149/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> 1191/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> 1217/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing a list of role names.</returns> 1232/// The <see cref="Task"/> that represents the asynchronous operation, containing a flag indicating whether the specified <paramref name="user"/> is 1262/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> 1321public virtual async Task UpdateNormalizedEmailAsync(TUser user) 1336/// The <see cref="Task"/> that represents the asynchronous operation, an email confirmation token. 1350/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> 1390/// The <see cref="Task"/> that represents the asynchronous operation, an email change token. 1405/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> 1429/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the user's telephone number, if any.</returns> 1444/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> 1467/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> 1492/// The <see cref="Task"/> that represents the asynchronous operation, returning true if the specified <paramref name="user"/> has a confirmed 1509/// The <see cref="Task"/> that represents the asynchronous operation, containing the telephone change number token. 1525/// The <see cref="Task"/> that represents the asynchronous operation, returning true if the <paramref name="token"/> 1546/// The <see cref="Task"/> that represents the asynchronous operation, returning true if the <paramref name="token"/> 1576/// The <see cref="Task"/> that represents result of the asynchronous operation, a token for 1611/// The <see cref="Task"/> that represents result of the asynchronous operation, a list of two 1636/// The <see cref="Task"/> that represents result of the asynchronous operation, true if the token is valid, 1663/// The <see cref="Task"/> that represents result of the asynchronous operation, a two factor authentication token 1684/// The <see cref="Task"/> that represents the asynchronous operation, true if the specified <paramref name="user "/> 1702/// The <see cref="Task"/> that represents the asynchronous operation, the <see cref="IdentityResult"/> of the operation 1721/// The <see cref="Task"/> that represents the asynchronous operation, true if the specified <paramref name="user "/> 1744/// The <see cref="Task"/> that represents the asynchronous operation, the <see cref="IdentityResult"/> of the operation 1761/// The <see cref="Task"/> that represents the asynchronous operation, true if a user can be locked out, otherwise false. 1792/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> of the operation.</returns> 1814/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> of the operation.</returns> 1838/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> of the operation.</returns> 1857/// <returns>The <see cref="Task"/> that contains the result the asynchronous operation, the current failed access count 2199private async Task UpdateSecurityStampInternal(TUser user)
UserValidator.cs (1)
39/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> of the validation operation.</returns>
Microsoft.Extensions.Identity.Stores (109)
RoleStoreBase.cs (13)
84return Task.FromResult(ConvertIdToString(role.Id)!); 98return Task.FromResult(role.Name); 107/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 108public virtual Task SetRoleNameAsync(TRole role, string? roleName, CancellationToken cancellationToken = default(CancellationToken)) 114return Task.CompletedTask; 174return Task.FromResult(role.NormalizedName); 183/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 184public virtual Task SetNormalizedRoleNameAsync(TRole role, string? normalizedName, CancellationToken cancellationToken = default(CancellationToken)) 190return Task.CompletedTask; 220/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 221public abstract Task AddClaimAsync(TRole role, Claim claim, CancellationToken cancellationToken = default(CancellationToken)); 229/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 230public abstract Task RemoveClaimAsync(TRole role, Claim claim, CancellationToken cancellationToken = default(CancellationToken));
UserStoreBase.cs (96)
115/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the identifier for the specified <paramref name="user"/>.</returns> 121return Task.FromResult(ConvertIdToString(user.Id)!); 129/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the name for the specified <paramref name="user"/>.</returns> 135return Task.FromResult(user.UserName); 144/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 145public virtual Task SetUserNameAsync(TUser user, string? userName, CancellationToken cancellationToken = default(CancellationToken)) 151return Task.CompletedTask; 159/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the normalized user name for the specified <paramref name="user"/>.</returns> 165return Task.FromResult(user.NormalizedUserName); 174/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 175public virtual Task SetNormalizedUserNameAsync(TUser user, string? normalizedName, CancellationToken cancellationToken = default(CancellationToken)) 181return Task.CompletedTask; 189/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> of the creation operation.</returns> 197/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> of the update operation.</returns> 205/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> of the update operation.</returns> 214/// The <see cref="Task"/> that represents the asynchronous operation, containing the user matching the specified <paramref name="userId"/> if it exists. 254/// The <see cref="Task"/> that represents the asynchronous operation, containing the user matching the specified <paramref name="normalizedUserName"/> if it exists. 272/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 273public virtual Task SetPasswordHashAsync(TUser user, string? passwordHash, CancellationToken cancellationToken = default(CancellationToken)) 279return Task.CompletedTask; 293return Task.FromResult(user.PasswordHash); 306return Task.FromResult(user.PasswordHash != null); 366/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 367public abstract Task AddClaimsAsync(TUser user, IEnumerable<Claim> claims, CancellationToken cancellationToken = default(CancellationToken)); 376/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 377public abstract Task ReplaceClaimAsync(TUser user, Claim claim, Claim newClaim, CancellationToken cancellationToken = default(CancellationToken)); 385/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 386public abstract Task RemoveClaimsAsync(TUser user, IEnumerable<Claim> claims, CancellationToken cancellationToken = default(CancellationToken)); 394/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 395public abstract Task AddLoginAsync(TUser user, UserLoginInfo login, CancellationToken cancellationToken = default(CancellationToken)); 404/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 405public abstract Task RemoveLoginAsync(TUser user, string loginProvider, string providerKey, CancellationToken cancellationToken = default(CancellationToken)); 413/// The <see cref="Task"/> for the asynchronous operation, containing a list of <see cref="UserLoginInfo"/> for the specified <paramref name="user"/>, if any. 424/// The <see cref="Task"/> for the asynchronous operation, containing the user, if any which matched the specified login provider and key. 454return Task.FromResult(user.EmailConfirmed); 464public virtual Task SetEmailConfirmedAsync(TUser user, bool confirmed, CancellationToken cancellationToken = default(CancellationToken)) 470return Task.CompletedTask; 480public virtual Task SetEmailAsync(TUser user, string? email, CancellationToken cancellationToken = default(CancellationToken)) 486return Task.CompletedTask; 500return Task.FromResult(user.Email); 516return Task.FromResult(user.NormalizedEmail); 526public virtual Task SetNormalizedEmailAsync(TUser user, string? normalizedEmail, CancellationToken cancellationToken = default(CancellationToken)) 532return Task.CompletedTask; 560return Task.FromResult(user.LockoutEnd); 569/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 570public virtual Task SetLockoutEndDateAsync(TUser user, DateTimeOffset? lockoutEnd, CancellationToken cancellationToken = default(CancellationToken)) 576return Task.CompletedTask; 584/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the incremented failed access count.</returns> 591return Task.FromResult(user.AccessFailedCount); 599/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 601public virtual Task ResetAccessFailedCountAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken)) 607return Task.CompletedTask; 615/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the failed access count.</returns> 621return Task.FromResult(user.AccessFailedCount); 630/// The <see cref="Task"/> that represents the asynchronous operation, true if a user can be locked out, otherwise false. 637return Task.FromResult(user.LockoutEnabled); 646/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 647public virtual Task SetLockoutEnabledAsync(TUser user, bool enabled, CancellationToken cancellationToken = default(CancellationToken)) 653return Task.CompletedTask; 662/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 663public virtual Task SetPhoneNumberAsync(TUser user, string? phoneNumber, CancellationToken cancellationToken = default(CancellationToken)) 669return Task.CompletedTask; 677/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the user's telephone number, if any.</returns> 683return Task.FromResult(user.PhoneNumber); 692/// The <see cref="Task"/> that represents the asynchronous operation, returning true if the specified <paramref name="user"/> has a confirmed 700return Task.FromResult(user.PhoneNumberConfirmed); 709/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 710public virtual Task SetPhoneNumberConfirmedAsync(TUser user, bool confirmed, CancellationToken cancellationToken = default(CancellationToken)) 716return Task.CompletedTask; 725/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 726public virtual Task SetSecurityStampAsync(TUser user, string stamp, CancellationToken cancellationToken = default(CancellationToken)) 733return Task.CompletedTask; 741/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the security stamp for the specified <paramref name="user"/>.</returns> 747return Task.FromResult(user.SecurityStamp); 757/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 758public virtual Task SetTwoFactorEnabledAsync(TUser user, bool enabled, CancellationToken cancellationToken = default(CancellationToken)) 764return Task.CompletedTask; 774/// The <see cref="Task"/> that represents the asynchronous operation, containing a flag indicating whether the specified 782return Task.FromResult(user.TwoFactorEnabled); 791/// The <see cref="Task"/> contains a list of users, if any, that contain the specified claim. 810protected abstract Task AddUserTokenAsync(TUserToken token); 817protected abstract Task RemoveUserTokenAsync(TUserToken token); 827/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 828public virtual async Task SetTokenAsync(TUser user, string loginProvider, string name, string? value, CancellationToken cancellationToken) 853/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 854public virtual async Task RemoveTokenAsync(TUser user, string loginProvider, string name, CancellationToken cancellationToken) 874/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 895/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 896public virtual Task SetAuthenticatorKeyAsync(TUser user, string key, CancellationToken cancellationToken) 904/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the security stamp for the specified <paramref name="user"/>.</returns> 952public virtual Task ReplaceCodesAsync(TUser user, IEnumerable<string> recoveryCodes, CancellationToken cancellationToken) 1036/// The <see cref="Task"/> contains a list of users, if any, that are in the specified role. 1046/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 1047public abstract Task AddToRoleAsync(TUser user, string normalizedRoleName, CancellationToken cancellationToken = default(CancellationToken)); 1055/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 1056public abstract Task RemoveFromRoleAsync(TUser user, string normalizedRoleName, CancellationToken cancellationToken = default(CancellationToken));
Microsoft.Extensions.Logging.AzureAppServices (11)
BatchingLoggerProvider.cs (7)
27private Task _outputTask; 86internal abstract Task WriteMessagesAsync(IEnumerable<LogMessage> messages, CancellationToken token); 88private async Task ProcessLogQueue() 131/// <returns>A <see cref="Task"/> which completes when the <paramref name="interval"/> has passed or the <paramref name="cancellationToken"/> has been canceled.</returns> 132protected virtual Task IntervalAsync(TimeSpan interval, CancellationToken cancellationToken) 134return Task.Delay(interval, cancellationToken); 162_outputTask = Task.Run(ProcessLogQueue);
BlobAppendReferenceWrapper.cs (1)
31public async Task AppendAsync(ArraySegment<byte> data, CancellationToken cancellationToken)
BlobLoggerProvider.cs (1)
55internal override async Task WriteMessagesAsync(IEnumerable<LogMessage> messages, CancellationToken cancellationToken)
FileLoggerProvider.cs (1)
39internal override async Task WriteMessagesAsync(IEnumerable<LogMessage> messages, CancellationToken cancellationToken)
ICloudAppendBlob.cs (1)
20Task AppendAsync(ArraySegment<byte> data, CancellationToken cancellationToken);
Microsoft.Extensions.ObjectPool.Microbenchmark (8)
DrainRefillMultiTheaded.cs (4)
16private Task[] _tasks = null!; 41_tasks = new Task[ThreadCount - 1]; 45_tasks[i] = Task.Run(() => 62Task.WaitAll(_tasks);
GetReturnMultiThreaded.cs (4)
17private Task[] _tasks = null!; 33_tasks = new Task[ThreadCount - 1]; 37_tasks[i] = Task.Run(() => 54Task.WaitAll(_tasks);
Microsoft.Extensions.SecretManager.Tools.Tests (1)
src\Tools\Shared\TestHelpers\TestConsole.cs (1)
37public Task CancelKeyPressSubscribed => _cancelKeySubscribed.Task;
Microsoft.Interop.ComInterfaceGenerator (11)
Analyzers\AddGeneratedComClassFixer.cs (3)
24private static Task AddGeneratedComClassAsync(DocumentEditor editor, SyntaxNode node) 40return Task.CompletedTask; 43protected override Func<DocumentEditor, CancellationToken, Task> CreateFixForSelectedOptions(SyntaxNode node, ImmutableDictionary<string, Option> selectedOptions)
Analyzers\AddMarshalAsToElementFixer.cs (1)
22public override async Task RegisterCodeFixesAsync(CodeFixContext context)
Analyzers\ConvertComImportToGeneratedComInterfaceFixer.cs (2)
35protected override Func<DocumentEditor, CancellationToken, Task> CreateFixForSelectedOptions(SyntaxNode node, ImmutableDictionary<string, Option> selectedOptions) 58private static async Task ConvertComImportToGeneratedComInterfaceAsync(DocumentEditor editor, SyntaxNode node, bool mayRequireAdditionalWork, bool addStringMarshalling, CancellationToken ct)
src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (4)
33protected abstract Func<DocumentEditor, CancellationToken, Task> CreateFixForSelectedOptions(SyntaxNode node, ImmutableDictionary<string, Option> selectedOptions); 99private static async Task<Solution> ApplyActionAndEnableUnsafe(Solution solution, DocumentId documentId, Func<DocumentEditor, CancellationToken, Task> documentBasedFix, CancellationToken ct) 110public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 157protected record struct ConvertToSourceGeneratedInteropFix(Func<DocumentEditor, CancellationToken, Task> ApplyFix, ImmutableDictionary<string, Option> SelectedOptions);
src\libraries\System.Runtime.InteropServices\gen\Common\FixAllContextExtensions.cs (1)
42return (await Task.WhenAll(sortedProjects.Select(context.GetAllDiagnosticsAsync)).ConfigureAwait(false)).SelectMany(diag => diag).ToImmutableArray();
Microsoft.Interop.LibraryImportGenerator (12)
Analyzers\AddDisableRuntimeMarshallingAttributeFixer.cs (2)
30public override Task RegisterCodeFixesAsync(CodeFixContext context) 44return Task.CompletedTask;
Analyzers\ConvertToLibraryImportFixer.cs (2)
124protected override Func<DocumentEditor, CancellationToken, Task> CreateFixForSelectedOptions(SyntaxNode node, ImmutableDictionary<string, Option> selectedOptions) 155private static async Task ConvertToLibraryImport(
Analyzers\CustomMarshallerAttributeFixer.cs (3)
84return CodeAction.Create(SR.AddMissingCustomTypeMarshallerMembers, ct => Task.FromResult(symbolEditor.ChangedSolution)); 96return ImmutableArray.CreateRange((await Task.WhenAll(context.Solution.Projects.Select(context.GetAllDiagnosticsAsync)).ConfigureAwait(false)).SelectMany(arr => arr)); 109public override async Task RegisterCodeFixesAsync(CodeFixContext context)
src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (4)
33protected abstract Func<DocumentEditor, CancellationToken, Task> CreateFixForSelectedOptions(SyntaxNode node, ImmutableDictionary<string, Option> selectedOptions); 99private static async Task<Solution> ApplyActionAndEnableUnsafe(Solution solution, DocumentId documentId, Func<DocumentEditor, CancellationToken, Task> documentBasedFix, CancellationToken ct) 110public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 157protected record struct ConvertToSourceGeneratedInteropFix(Func<DocumentEditor, CancellationToken, Task> ApplyFix, ImmutableDictionary<string, Option> SelectedOptions);
src\libraries\System.Runtime.InteropServices\gen\Common\FixAllContextExtensions.cs (1)
42return (await Task.WhenAll(sortedProjects.Select(context.GetAllDiagnosticsAsync)).ConfigureAwait(false)).SelectMany(diag => diag).ToImmutableArray();
Microsoft.JSInterop (15)
Infrastructure\DotNetDispatcher.cs (8)
33private static readonly ConcurrentDictionary<Type, Func<object, Task>> _cachedConvertToTaskByType = new(); 114else if (syncResult is Task task) 129var innerTask = GetTaskByType(syncResultType.GenericTypeArguments[0], syncResult); 142private static void EndInvokeDotNetAfterTask(Task task, JSRuntime jsRuntime, in DotNetInvocationInfo invocationInfo) 289/// associated <see cref="Task"/> as completed. 371private static Task GetTaskByType(Type type, object obj) 374taskConverterMethodInfo.MakeGenericMethod(t).CreateDelegate<Func<object, Task>>(), _taskConverterMethodInfo); 379private static Task CreateValueTaskConverter<[DynamicallyAccessedMembers(LinkerFlags.JsonSerialized)] T>(object result) => ((ValueTask<T>)result).AsTask();
Infrastructure\TaskGenericsUtil.cs (6)
26public static object? GetTaskResult(Task task) 43while (taskType != typeof(Task) && 47?? throw new ArgumentException($"The type '{taskType.FullName}' is not inherited from '{typeof(Task).FullName}'."); 64object? GetResult(Task task); 69public object? GetResult(Task task) => ((Task<T>)task).Result!; 74public object? GetResult(Task task)
JSRuntime.cs (1)
273protected internal virtual Task TransmitStreamAsync(long streamId, DotNetStreamReference dotNetStreamReference)
Microsoft.JSInterop.Tests (39)
Infrastructure\DotNetDispatcherTest.cs (19)
282public async Task EndInvokeJS_WithErrorString() 299public async Task EndInvokeJS_WithNullError() 575public async Task CanInvokeAsyncMethod() 594var resultTask = jsRuntime.NextInvocationTask; 614public async Task CanInvokeAsyncMethodReturningValueTask() 633var resultTask = jsRuntime.NextInvocationTask; 644public async Task CanInvokeAsyncMethodReturningNonGenericValueTask() 657var resultTask = jsRuntime.NextInvocationTask; 668public async Task CanInvokeSyncThrowingMethod() 675var resultTask = jsRuntime.NextInvocationTask; 690public async Task CanInvokeAsyncThrowingMethod() 697var resultTask = jsRuntime.NextInvocationTask; 712public async Task BeginInvoke_ThrowsWithInvalidArgsJson_WithCallId() 717var resultTask = jsRuntime.NextInvocationTask; 735var resultTask = jsRuntime.NextInvocationTask; 919await Task.Delay(50); 958await Task.CompletedTask; 1001await Task.Yield(); 1021public Task NextInvocationTask => _nextInvocationTcs.Task;
JSObjectReferenceTest.cs (1)
40public async Task JSObjectReference_Dispose_DisallowsFurtherInteropCalls()
JSRuntimeExtensionsTest.cs (8)
12public async Task InvokeAsync_WithParamsArgs() 35public async Task InvokeAsync_WithParamsArgsAndCancellationToken() 59public async Task InvokeVoidAsync_WithoutCancellationToken() 74public async Task InvokeVoidAsync_WithCancellationToken() 89public async Task InvokeAsync_WithTimeout() 113public async Task InvokeAsync_WithInfiniteTimeout() 136public async Task InvokeVoidAsync_WithTimeout() 158public async Task InvokeVoidAsync_WithInfiniteTimeout()
JSRuntimeTest.cs (9)
40public async Task InvokeAsync_CancelsAsyncTask_AfterDefaultTimeout() 70public async Task InvokeAsync_CancelsAsyncTasksWhenCancellationTokenFires() 86public async Task InvokeAsync_DoesNotStartWorkWhenCancellationHasBeenRequested() 201public Task CanCompleteAsyncCallsWithErrorsDuringDeserialization() 223async Task AssertTask() 231public Task CompletingSameAsyncCallMoreThanOnce_IgnoresSecondResultAsync() 247async Task AssertTask() 489protected internal override Task TransmitStreamAsync(long streamId, DotNetStreamReference dotNetStreamReference) 492return Task.CompletedTask;
TestJSRuntime.cs (2)
25protected internal override Task TransmitStreamAsync(long streamId, DotNetStreamReference dotNetStreamReference) 28return Task.CompletedTask;
MiddlewareAnalysisSample (1)
Startup.cs (1)
79public static Task Main(string[] args)
mscorlib (1)
src\libraries\shims\mscorlib\ref\mscorlib.cs (1)
1160[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Threading.Tasks.Task))]
Mvc.Analyzers.Test (43)
AttributesShouldNotBeAppliedToPageModelAnalyzerTest.cs (16)
17public Task NoDiagnosticsAreReturned_ForControllerBaseActions() 37public Task NoDiagnosticsAreReturned_ForControllerActions() 57public Task NoDiagnosticsAreReturned_ForPageHandlersWithNonFilterAttributes() 78public Task NoDiagnosticsAreReturned_IfFiltersAreAppliedToPageModel() 98public Task NoDiagnosticsAreReturned_IfAuthorizeAttributeIsAppliedToPageModel() 118public Task NoDiagnosticsAreReturned_IfAllowAnonymousIsAppliedToPageModel() 138public Task NoDiagnosticsAreReturned_ForNonHandlerMethodsWithAttributes() 165public Task DiagnosticsAreReturned_IfFiltersAreAppliedToPageHandlerMethod() 189public Task DiagnosticsAreReturned_IfFiltersAreAppliedToPageHandlerMethodDerivingFromCustomModel() 219public Task DiagnosticsAreReturned_IfAuthorizeAttributeIsAppliedToPageHandlerMethod() 243public Task DiagnosticsAreReturned_IfFiltersAreAppliedToPageHandlerMethodForTypeWithPageModelAttribute() 268public Task DiagnosticsAreReturned_IfAttributeIsAppliedToBaseType() 298public Task DiagnosticsAreReturned_IfRouteAttributesAreAppliedToPageHandlerMethod() 322public Task DiagnosticsAreReturned_IfAllowAnonymousIsAppliedToPageHandlerMethod() 351public Task DiagnosticsAreReturned_IfRouteAttribute_IsAppliedToPageModel() 374private static Task VerifyAnalyzerAsync(string source, params DiagnosticResult[] expected)
AvoidHtmlPartialAnalyzerTest.cs (10)
19public Task NoDiagnosticsAreReturned_ForNonUseOfHtmlPartial() 61public Task NoDiagnosticsAreReturned_ForUseOfHtmlPartialAsync() 99public Task DiagnosticsAreReturned_ForUseOfHtmlPartial() 144public Task DiagnosticsAreReturned_ForUseOfHtmlPartial_WithAdditionalParameters() 190public Task DiagnosticsAreReturned_ForUseOfHtmlPartial_InSections() 237public Task NoDiagnosticsAreReturned_ForUseOfRenderPartialAsync() 278public Task DiagnosticsAreReturned_ForUseOfRenderPartial() 322public Task DiagnosticsAreReturned_ForUseOfRenderPartial_WithAdditionalParameters() 367public Task DiagnosticsAreReturned_ForUseOfRenderPartial_InSections() 413private static Task VerifyAnalyzerAsync(string source, params DiagnosticResult[] expected)
TagHelpersInCodeBlocksAnalyzerTest.cs (10)
22public Task DiagnosticsAreReturned_ForUseOfTagHelpersInActions() 115public Task DiagnosticsAreReturned_ForUseOfTagHelpersInNonAsyncFunc() 207public Task DiagnosticsAreReturned_ForUseOfTagHelpersInVoidClassMethods() 300public Task DiagnosticsAreReturned_ForUseOfTagHelpersInVoidDelegates() 395public Task DiagnosticsAreReturned_ForUseOfTagHelpersInVoidLocalFunctions() 485public Task NoDiagnosticsAreReturned_ForUseOfTagHelpersInAsyncClassMethods() 575public Task NoDiagnosticsAreReturned_ForUseOfTagHelpersInAsyncDelegates() 667public Task NoDiagnosticsAreReturned_ForUseOfTagHelpersInAsyncLocalFunctions() 759public Task SingleDiagnosticIsReturned_ForMultipleTagHelpersInVoidMethod() 899private static Task VerifyAnalyzerAsync(string source, params DiagnosticResult[] expected)
TopLevelParameterNameAnalyzerTest.cs (7)
19public Task DiagnosticsAreReturned_ForControllerActionsWithParametersThatMatchProperties() 42public Task DiagnosticsAreReturned_ForModelBoundParameters() 69public Task DiagnosticsAreReturned_IfModelNameProviderIsUsedToModifyParameterName() 95public Task NoDiagnosticsAreReturnedForApiControllers() 116public Task NoDiagnosticsAreReturnedIfParameterIsRenamedUsingBindingAttribute() 137public Task NoDiagnosticsAreReturnedForNonActions() 587private static Task VerifyAnalyzerAsync(string source, params DiagnosticResult[] expected)
Mvc.Api.Analyzers.Test (183)
ActualApiResponseMetadataFactoryTest.cs (20)
24public async Task GetDefaultStatusCode_ReturnsValueDefinedUsingStatusCodeConstants() 38public async Task GetDefaultStatusCode_ReturnsValueDefinedUsingHttpStatusCast() 52public async Task InspectReturnExpression_ReturnsNull_IfReturnExpressionCannotBeFound() 93public async Task InspectReturnExpression_ReturnsStatusCodeFromDefaultStatusCodeAttributeOnActionResult(ReturnOperationTestVariant variant) 107public async Task InspectReturnExpression_ReturnsDefaultResponseMetadata_IfReturnedTypeIsNotActionResult(ReturnOperationTestVariant variant) 121public async Task InspectReturnExpression_ReturnsStatusCodeFromStatusCodePropertyAssignment(ReturnOperationTestVariant variant) 135public async Task InspectReturnExpression_ReturnsStatusCodeFromConstructorAssignment(ReturnOperationTestVariant variant) 149public async Task InspectReturnExpression_ReturnsStatusCodeFromHelperMethod(ReturnOperationTestVariant variant) 163public async Task InspectReturnExpression_UsesExplicitlySpecifiedStatusCode_ForActionResultWithDefaultStatusCode(ReturnOperationTestVariant variant) 177public async Task InspectReturnExpression_ReadsStatusCodeConstant(ReturnOperationTestVariant variant) 191public async Task InspectReturnExpression_DoesNotReadLocalFieldWithConstantValue(ReturnOperationTestVariant variant) 205public async Task InspectReturnExpression_FallsBackToDefaultStatusCode_WhenAppliedStatusCodeCannotBeRead(ReturnOperationTestVariant variant) 220public async Task InspectReturnExpression_SetsReturnType_WhenLiteralTypeIsSpecifiedInConstructor(ReturnOperationTestVariant variant) 234public async Task InspectReturnExpression_SetsReturnType_WhenLocalValueIsSpecifiedInConstructor(ReturnOperationTestVariant variant) 248public async Task InspectReturnExpression_SetsReturnType_WhenValueIsReturned(ReturnOperationTestVariant variant) 262public async Task InspectReturnExpression_ReturnsNullReturnType_IfValueIsNotSpecified(ReturnOperationTestVariant variant) 274public async Task TryGetActualResponseMetadata_ActionWithActionResultOfTReturningOkResult() 295public async Task TryGetActualResponseMetadata_ActionWithActionResultOfTReturningModel() 315public async Task TryGetActualResponseMetadata_ActionReturningNotFoundAndModel() 342public async Task TryGetActualResponseMetadata_ActionWithActionResultOfTReturningOkResultExpression()
AddResponseTypeAttributeCodeFixProviderIntegrationTest.cs (16)
17public Task CodeFixAddsStatusCodes() => RunTest(); 20public Task CodeFixAddsMissingStatusCodes() => RunTest(); 23public Task CodeFixAddsMissingStatusCodesAndTypes() => RunTest(); 26public Task CodeFixWithConventionAddsMissingStatusCodes() => RunTest(); 29public Task CodeFixWithConventionMethodAddsMissingStatusCodes() => RunTest(); 32public Task CodeFixAddsSuccessStatusCode() => RunTest(); 35public Task CodeFixAddsFullyQualifiedProducesResponseType() => RunTest(); 38public Task CodeFixAddsNumericLiteralForNonExistingStatusCodeConstants() => RunTest(); 41public Task CodeFixAddsResponseTypeWhenDifferentFromErrorType() => RunTest(); 44public Task CodeFixAddsStatusCodesFromMethodParameters() => RunTest(); 47public Task CodeFixAddsStatusCodesFromConstructorParameters() => RunTest(); 50public Task CodeFixAddsStatusCodesFromObjectInitializer() => RunTest(); 53public Task CodeFixWorksWhenMultipleIdenticalStatusCodesAreInError() => RunTest(); 56public Task CodeFixWorksOnExpressionBodiedMethod() => RunTest(); 59public Task CodeFixWorksWithValidationProblem() => RunTest(); 61private async Task RunTest([CallerMemberName] string testMethod = "")
ApiActionsDoNotRequireExplicitModelValidationCheckAnalyzerIntegrationTest.cs (11)
14public Task NoDiagnosticsAreReturned_ForNonApiController() 18public Task NoDiagnosticsAreReturned_ForRazorPageModels() 22public Task NoDiagnosticsAreReturned_ForApiActionsWithoutModelStateChecks() 26public Task NoDiagnosticsAreReturned_ForApiActionsReturning400FromNonModelStateIsValidBlocks() 30public Task NoDiagnosticsAreReturned_ForApiActionsReturningNot400FromNonModelStateIsValidBlock() 34public Task NoDiagnosticsAreReturned_ForApiActionsCheckingAdditionalConditions() 38public Task DiagnosticsAreReturned_ForApiActionsWithModelStateChecks() 42public Task DiagnosticsAreReturned_ForApiActionsWithModelStateChecksUsingEquality() 46public Task DiagnosticsAreReturned_ForApiActionsWithModelStateChecksWithoutBracing() 49private async Task RunNoDiagnosticsAreReturned([CallerMemberName] string testMethod = "") 62private async Task RunTest([CallerMemberName] string testMethod = "")
ApiActionsDoNotRequireExplicitModelValidationCheckCodeFixProviderTest.cs (4)
17public Task CodeFixRemovesModelStateIsInvalidBlockWithIfNotCheck() 21public Task CodeFixRemovesModelStateIsInvalidBlockWithEqualityCheck() 25public Task CodeFixRemovesIfBlockWithoutBraces() 28private async Task RunTest([CallerMemberName] string testMethod = "")
ApiControllerFactsTest.cs (6)
12public async Task IsApiControllerAction_ReturnsFalse_IfMethodReturnTypeIsInvalid() 47public async Task IsApiControllerAction_ReturnsFalse_IfContainingTypeIsNotController() 63public async Task IsApiControllerAction_ReturnsFalse_IfContainingTypeIsNotApiController() 79public async Task IsApiControllerAction_ReturnsFalse_IfContainingTypeIsNotAction() 95public async Task IsApiControllerAction_ReturnsTrue_ForValidActionMethods() 111public async Task IsApiControllerAction_ReturnsTrue_IfAttributeIsDeclaredOnAssembly()
ApiConventionAnalyzerIntegrationTest.cs (30)
16public Task NoDiagnosticsAreReturned_ForNonApiController() 20public Task NoDiagnosticsAreReturned_ForRazorPageModels() 24public Task NoDiagnosticsAreReturned_ForApiController_WithAllDocumentedStatusCodes() 28public Task NoDiagnosticsAreReturned_ForOkResultReturningAction() 32public Task NoDiagnosticsAreReturned_ForApiController_IfStatusCodesCannotBeInferred() 36public Task NoDiagnosticsAreReturned_ForReturnStatementsInLambdas() 40public Task NoDiagnosticsAreReturned_ForReturnStatementsInLocalFunctions() 44public Task NoDiagnosticsAreReturned_ForApiController_WhenMethodNeverReturns() 48public async Task DiagnosticsAreReturned_ForIncompleteActionResults() 83public async Task NoDiagnosticsAreReturned_WhenActionDoesNotCompile() 113public async Task DiagnosticsAreReturned_ForNotFoundNullActionResults() 143public async Task DiagnosticsAreReturned_ForActionsReturnedFromSwitchExpression() 175public async Task DiagnosticsAreReturned_ForActionsReturnedFromSwitchStatement() 209public Task DiagnosticsAreReturned_IfMethodWithProducesResponseTypeAttribute_ReturnsUndocumentedStatusCode() 213public Task DiagnosticsAreReturned_IfAsyncMethodWithProducesResponseTypeAttribute_ReturnsUndocumentedStatusCode() 217public Task DiagnosticsAreReturned_IfAsyncMethodReturningValueTaskWithProducesResponseTypeAttribute_ReturnsUndocumentedStatusCode() 221public Task DiagnosticsAreReturned_ForActionResultOfTReturningMethodWithoutAnyAttributes() 225public Task DiagnosticsAreReturned_ForActionResultOfTReturningMethodWithoutSomeAttributes() 229public Task DiagnosticsAreReturned_IfMethodWithConvention_ReturnsUndocumentedStatusCode() 233public Task DiagnosticsAreReturned_IfMethodWithApiConventionMethod_ReturnsUndocumentedStatusCode() 237public Task DiagnosticsAreReturned_IfMethodWithAttributeReturnsValue_WithoutDocumentation() 241public Task DiagnosticsAreReturned_IfMethodWithAttributeAsynchronouslyReturnsValue_WithoutDocumentation() 245public Task DiagnosticsAreReturned_IfMethodWithAttribute_ReturnsDerivedType() 249public Task DiagnosticsAreReturned_IfMethodWithProducesResponseTypeAttribute_DoesNotReturnDocumentedStatusCode() 253public Task DiagnosticsAreReturned_IfMethodWithConvention_DoesNotReturnDocumentedStatusCode() 257public Task DiagnosticsAreReturned_IfMethodWithProducesResponseTypeAttribute_DoesNotDocumentSuccessStatusCode() 260private async Task RunNoDiagnosticsAreReturned([CallerMemberName] string testMethod = "") 273private Task RunTest(DiagnosticDescriptor descriptor, [CallerMemberName] string testMethod = "") 276private Task RunTest(DiagnosticDescriptor descriptor, int statusCode, [CallerMemberName] string testMethod = "") 279private async Task RunTest(DiagnosticDescriptor descriptor, object[] args, [CallerMemberName] string testMethod = "")
MvcFactsTest.cs (42)
18public Task IsController_ReturnsFalseForInterfaces() => IsControllerReturnsFalse(typeof(ITestController)); 21public Task IsController_ReturnsFalseForAbstractTypes() => IsControllerReturnsFalse(typeof(AbstractController)); 24public Task IsController_ReturnsFalseForValueType() => IsControllerReturnsFalse(typeof(ValueTypeController)); 27public Task IsController_ReturnsFalseForGenericType() => IsControllerReturnsFalse(typeof(OpenGenericController<>)); 30public Task IsController_ReturnsFalseForPocoType() => IsControllerReturnsFalse(typeof(PocoType)); 33public Task IsController_ReturnsFalseForTypeDerivedFromPocoType() => IsControllerReturnsFalse(typeof(DerivedPocoType)); 36public Task IsController_ReturnsTrueForTypeDerivingFromController() => IsControllerReturnsTrue(typeof(TypeDerivingFromController)); 39public Task IsController_ReturnsTrueForTypeDerivingFromControllerBase() => IsControllerReturnsTrue(typeof(TypeDerivingFromControllerBase)); 42public Task IsController_ReturnsTrueForTypeDerivingFromController_WithoutSuffix() => IsControllerReturnsTrue(typeof(NoSuffix)); 45public Task IsController_ReturnsTrueForTypeWithSuffix_ThatIsNotDerivedFromController() => IsControllerReturnsTrue(typeof(PocoController)); 48public Task IsController_ReturnsTrueForTypeWithoutSuffix_WithControllerAttribute() => IsControllerReturnsTrue(typeof(CustomBase)); 51public Task IsController_ReturnsTrueForTypeDerivingFromCustomBaseThatHasControllerAttribute() => IsControllerReturnsTrue(typeof(ChildOfCustomBase)); 54public Task IsController_ReturnsFalseForTypeWithNonControllerAttribute() => IsControllerReturnsFalse(typeof(BaseNonController)); 57public Task IsController_ReturnsFalseForTypesDerivingFromTypeWithNonControllerAttribute() => IsControllerReturnsFalse(typeof(BasePocoNonControllerChildController)); 60public Task IsController_ReturnsFalseForTypesDerivingFromTypeWithNonControllerAttributeWithControllerAttribute() => 63private async Task IsControllerReturnsFalse(Type type) 77private async Task IsControllerReturnsTrue(Type type) 95public Task IsAction_ReturnsFalseForConstructor() => IsActionReturnsFalse(TestIsControllerActionType, ".ctor"); 98public Task IsAction_ReturnsFalseForStaticConstructor() => IsActionReturnsFalse(TestIsControllerActionType, ".cctor"); 101public Task IsAction_ReturnsFalseForPrivateMethod() => IsActionReturnsFalse(TestIsControllerActionType, "PrivateMethod"); 104public Task IsAction_ReturnsFalseForProtectedMethod() => IsActionReturnsFalse(TestIsControllerActionType, "ProtectedMethod"); 107public Task IsAction_ReturnsFalseForInternalMethod() => IsActionReturnsFalse(TestIsControllerActionType, nameof(TestIsControllerAction.InternalMethod)); 110public Task IsAction_ReturnsFalseForGenericMethod() => IsActionReturnsFalse(TestIsControllerActionType, nameof(TestIsControllerAction.GenericMethod)); 113public Task IsAction_ReturnsFalseForStaticMethod() => IsActionReturnsFalse(TestIsControllerActionType, nameof(TestIsControllerAction.StaticMethod)); 116public Task IsAction_ReturnsFalseForNonActionMethod() => IsActionReturnsFalse(TestIsControllerActionType, nameof(TestIsControllerAction.NonAction)); 119public Task IsAction_ReturnsFalseForOverriddenNonActionMethod() => IsActionReturnsFalse(TestIsControllerActionType, nameof(TestIsControllerAction.NonActionBase)); 122public Task IsAction_ReturnsFalseForDisposableDispose() => IsActionReturnsFalse(TestIsControllerActionType, nameof(TestIsControllerAction.Dispose)); 125public Task IsAction_ReturnsFalseForExplicitDisposableDispose() => IsActionReturnsFalse(typeof(ExplicitIDisposable), "System.IDisposable.Dispose"); 128public Task IsAction_ReturnsFalseForAbstractMethods() => IsActionReturnsFalse(typeof(TestIsControllerActionBase), nameof(TestIsControllerActionBase.AbstractMethod)); 131public Task IsAction_ReturnsFalseForObjectEquals() => IsActionReturnsFalse(typeof(object), nameof(object.Equals)); 134public Task IsAction_ReturnsFalseForObjectHashCode() => IsActionReturnsFalse(typeof(object), nameof(object.GetHashCode)); 137public Task IsAction_ReturnsFalseForObjectToString() => IsActionReturnsFalse(typeof(object), nameof(object.ToString)); 140public Task IsAction_ReturnsFalseForOverriddenObjectEquals() => 144public Task IsAction_ReturnsFalseForOverriddenObjectHashCode() => 147private async Task IsActionReturnsFalse(Type type, string methodName) 163public Task IsAction_ReturnsTrueForNewMethodsOfObject() => IsActionReturnsTrue(typeof(OverridesObjectMethods), nameof(OverridesObjectMethods.ToString)); 166public Task IsAction_ReturnsTrueForNotDisposableDispose() => IsActionReturnsTrue(typeof(NotDisposable), nameof(NotDisposable.Dispose)); 169public Task IsAction_ReturnsTrueForNotDisposableDisposeOnTypeWithExplicitImplementation() => 173public Task IsAction_ReturnsTrueForOrdinaryAction() => IsActionReturnsTrue(TestIsControllerActionType, nameof(TestIsControllerAction.Ordinary)); 176public Task IsAction_ReturnsTrueForOverriddenMethod() => IsActionReturnsTrue(TestIsControllerActionType, nameof(TestIsControllerAction.AbstractMethod)); 179public async Task IsAction_ReturnsTrueForNotDisposableDisposeOnTypeWithImplicitImplementation() 194private async Task IsActionReturnsTrue(Type type, string methodName)
SymbolApiConventionMatcherTest.cs (19)
270public async Task IsTypeMatch_WithAny_ReturnsTrue(Type type, Type conventionType) 285public async Task IsTypeMatch_WithAssignableFrom_ReturnsTrueForExact() 301public async Task IsTypeMatch_WithAssignableFrom_ReturnsTrueForDerived() 317public async Task IsTypeMatch_WithAssignableFrom_ReturnsFalseForBaseTypes() 333public async Task IsTypeMatch_WithAssignableFrom_ReturnsFalseForUnrelated() 349public Task IsMatch_ReturnsFalse_IfMethodNamesDoNotMatch() 360public Task IsMatch_ReturnsFalse_IMethodHasMoreParametersThanConvention() 371public Task IsMatch_ReturnsFalse_IfMethodHasFewerParametersThanConvention() 382public Task IsMatch_ReturnsFalse_IfParametersDoNotMatch() 393public Task IsMatch_ReturnsTrue_IfMethodNameAndParametersMatches() 404public Task IsMatch_ReturnsTrue_IfParamsArrayMatchesRemainingArguments() 415public Task IsMatch_WithEmpty_MatchesMethodWithNoParameters() 425private async Task RunMatchTest(string methodName, string conventionMethodName, bool expected) 443public async Task GetNameMatchBehavior_ReturnsExact_WhenNoAttributesArePresent() 461public async Task GetNameMatchBehavior_ReturnsExact_WhenNoNameMatchBehaviorAttributeIsSpecified() 479public async Task GetNameMatchBehavior_ReturnsValueFromAttributes() 497public async Task GetTypeMatchBehavior_ReturnsIsAssignableFrom_WhenNoAttributesArePresent() 516public async Task GetTypeMatchBehavior_ReturnsIsAssignableFrom_WhenNoMatchingAttributesArePresent() 535public async Task GetTypeMatchBehavior_ReturnsValueFromAttributes()
SymbolApiResponseMetadataProviderTest.cs (26)
14public async Task GetResponseMetadata_ReturnsEmptySequence_IfNoAttributesArePresent_ForGetAction() 32public async Task GetResponseMetadata_ReturnsEmptySequence_IfNoAttributesArePresent_ForPostAction() 50public async Task GetResponseMetadata_IgnoresProducesAttribute() 68public async Task GetResponseMetadata_ReturnsValueFromProducesResponseType_WhenStatusCodeIsSpecifiedInConstructor() 91public async Task GetResponseMetadata_ReturnsValueFromProducesResponseType_WhenStatusCodeIsSpecifiedInConstructorWithResponseType() 114public async Task GetResponseMetadata_ReturnsValueFromProducesResponseType_WhenStatusCodeIsSpecifiedInConstructorAndProperty() 137public async Task GetResponseMetadata_ReturnsValueFromProducesResponseType_WhenStatusCodeAndTypeIsSpecifiedInConstructorAndProperty() 160public async Task GetResponseMetadata_ReturnsValueFromCustomProducesResponseType() 182public async Task GetResponseMetadata_ReturnsValuesFromApiConventionMethodAttribute() 213public async Task GetResponseMetadata_WithProducesResponseTypeAndApiConventionMethod() 235public async Task GetResponseMetadata_IgnoresCustomResponseTypeMetadataProvider() 253public Task GetResponseMetadata_IgnoresAttributesWithIncorrectStatusCodeType() 261public Task GetResponseMetadata_IgnoresDerivedAttributesWithoutPropertyOnConstructorArguments() 268private async Task GetResponseMetadata_WorksForInvalidOrUnsupportedAttributes(string typeName, string methodName) 290public async Task GetDeclaredResponseMetadata_ApiConventionTypeAttributeOnType_Works() 312public async Task GetDeclaredResponseMetadata_ApiConventionTypeAttributeOnBaseType_Works() 334public Task GetStatusCode_ReturnsValueFromConstructor() 345public Task GetStatusCode_ReturnsValueFromProperty() 356public Task GetStatusCode_ReturnsValueFromConstructor_WhenTypeIsSpecified() 367public Task GetStatusCode_Returns200_IfTypeIsNotInteger() 378public Task GetStatusCode_ReturnsValueFromDerivedAttributes() 388private async Task GetStatusCodeTest(string actionName, int expected) 401public async Task GetErrorResponseType_ReturnsProblemDetails_IfNoAttributeIsDiscovered() 419public async Task GetErrorResponseType_ReturnsTypeDefinedAtAssembly() 437public async Task GetErrorResponseType_ReturnsTypeDefinedAtController() 455public async Task GetErrorResponseType_ReturnsTypeDefinedAtAction()
TestFiles\ActualApiResponseMetadataFactoryTest\TryGetActualResponseMetadataTests.cs (3)
13await Task.Yield(); 21await Task.Yield(); 29await Task.Yield();
TestFiles\ApiConventionAnalyzerIntegrationTest\DiagnosticsAreReturned_ForControllerWithCustomConvention.cs (2)
49public Task Update() => Task.CompletedTask;
TestFiles\ApiConventionAnalyzerIntegrationTest\DiagnosticsAreReturned_IfAsyncMethodReturningValueTaskWithProducesResponseTypeAttribute_ReturnsUndocumentedStatusCode.cs (1)
15await Task.Yield();
TestFiles\ApiConventionAnalyzerIntegrationTest\DiagnosticsAreReturned_IfAsyncMethodWithProducesResponseTypeAttribute_ReturnsUndocumentedStatusCode.cs (1)
15await Task.Yield();
TestFiles\ApiConventionAnalyzerIntegrationTest\DiagnosticsAreReturned_IfMethodWithAttributeAsynchronouslyReturnsValue_WithoutDocumentation.cs (1)
14await Task.Yield();
TestFiles\ApiConventionAnalyzerIntegrationTest\NoDiagnosticsAreReturned_ForOkResultReturningAction.cs (1)
14await Task.Yield();
NativeIISSample (1)
Startup.cs (1)
141public static Task Main(string[] args)
Negotiate.Server (1)
Program.cs (1)
13public static async Task Main(string[] args)
NegotiateAuthSample (2)
Startup.cs (2)
41return Task.CompletedTask; 55public async Task HandleRequest(HttpContext context)
netstandard (1)
netstandard.cs (1)
2117[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Threading.Tasks.Task))]
OpenIdConnectSample (4)
Program.cs (1)
8public static Task Main(string[] args)
Startup.cs (3)
327private static async Task WriteHtmlAsync(HttpResponse response, Func<HttpResponse, Task> writeContent) 337private static async Task WriteTableHeader(HttpResponse response, IEnumerable<string> columns, IEnumerable<IEnumerable<string>> data)
OutputCachingSample (2)
Gravatar.cs (1)
6public static async Task WriteGravatar(HttpContext context)
Startup.cs (1)
53await Task.Delay(1000);
PathSchemeSelection (1)
Startup.cs (1)
52=> Task.FromResult(AuthenticateResult.Success(new AuthenticationTicket(_id, "Api")));
PlaintextApp (3)
Startup.cs (3)
36public static async Task Main(string[] args) 58public static Task GetAsTask(this in ValueTask<FlushResult> valueTask) 64return Task.CompletedTask;
PortableTask (1)
Sleep.cs (1)
17Task.Delay(TimeSpan.FromSeconds(Seconds)).Wait();
PresentationBuildTasks (1)
Microsoft\Build\Tasks\Windows\MarkupCompilePass1.cs (1)
1282System.Threading.Tasks.Task.Run(() =>
PresentationFramework (1)
System\Windows\Controls\SoundPlayerAction.cs (1)
172Task.Run(() =>
ProjectCachePlugin (5)
AssemblyMockCache.cs (5)
25public override Task BeginBuildAsync(CacheContext context, PluginLoggerBase logger, CancellationToken cancellationToken) 40return Task.CompletedTask; 54return Task.FromResult(CacheResult.IndicateNonCacheHit(CacheResultType.CacheNotApplicable)); 57public override Task EndBuildAsync(PluginLoggerBase logger, CancellationToken cancellationToken) 63return Task.CompletedTask;
RazorBuildWebSite.Views (3)
Pages\Rzc\Page.cs (1)
20public async override global::System.Threading.Tasks.Task ExecuteAsync()
Views\Common\CommonView.cs (1)
20public async override global::System.Threading.Tasks.Task ExecuteAsync()
Views\Rzc\View.cs (1)
20public async override global::System.Threading.Tasks.Task ExecuteAsync()
RazorPagesWebSite (16)
CustomActionResult.cs (1)
10public Task ExecuteResultAsync(ActionContext context)
ModelHandlerTestModel.cs (6)
20await Task.CompletedTask; 25public async Task OnGetCustomer() 27await Task.CompletedTask; 31public async Task OnGetViewCustomerAsync() 33await Task.CompletedTask; 48await Task.CompletedTask;
Pages\ShortCircuitPageAtAuthFilter.cshtml.cs (2)
27public Task OnAuthorizationAsync(AuthorizationFilterContext context) 33return Task.CompletedTask;
Pages\ShortCircuitPageAtPageFilter.cshtml.cs (4)
27public Task OnPageHandlerSelectionAsync(PageHandlerSelectedContext context) 29return Task.CompletedTask; 32public Task OnPageHandlerExecutionAsync( 39return Task.CompletedTask;
Pages\TryUpdateModelPageModel.cs (1)
14public async Task OnPost()
PolymorphicModelBinder.cs (2)
11public Task BindModelAsync(ModelBindingContext bindingContext) 28return Task.CompletedTask;
RazorWebSite (5)
Services\TaskReturningService.cs (1)
10await Task.Delay(100);
Services\TestBodyTagHelperComponent.cs (2)
34public Task ProcessAsync(TagHelperContext context, TagHelperOutput output) 43return Task.FromResult(0);
Services\TestHeadTagHelperComponent.cs (2)
12public override Task ProcessAsync(TagHelperContext context, TagHelperOutput output) 19return Task.FromResult(0);
RequestDecompressionSample (1)
Startup.cs (1)
31public static Task Main(string[] args)
ResponseCachingSample (1)
Startup.cs (1)
31public static Task Main(string[] args)
ResponseCompressionSample (2)
Startup.cs (2)
54await Task.Delay(TimeSpan.FromSeconds(1)); 66public static Task Main(string[] args)
RewriteSample (1)
Startup.cs (1)
40public static Task Main(string[] args)
RoutingSandbox (5)
HelloExtension\HelloMiddleware.cs (1)
30public Task InvokeAsync(HttpContext context)
Program.cs (1)
11public static Task Main(string[] args)
UseEndpointRoutingStartup.cs (3)
75return Task.CompletedTask; 96private Task HandlerWithAttributes(HttpContext context) 102private Task Handler(HttpContext context)
RoutingWebSite (2)
HelloExtension\HelloMiddleware.cs (1)
30public Task InvokeAsync(HttpContext context)
Program.cs (1)
13public static Task Main(string[] args)
Sample (5)
Program.cs (1)
24return Task.CompletedTask;
Transformers\AddBearerSecuritySchemeTransformer.cs (1)
12public async Task TransformAsync(OpenApiDocument document, OpenApiDocumentTransformerContext context, CancellationToken cancellationToken)
Transformers\AddContactTransformer.cs (2)
11public Task TransformAsync(OpenApiDocument document, OpenApiDocumentTransformerContext context, CancellationToken cancellationToken) 18return Task.CompletedTask;
Transformers\OperationTransformers.cs (1)
26return Task.CompletedTask;
SampleStartups (6)
StartupBlockingOnStart.cs (1)
33public static async Task Main(string[] args)
StartupConfigureAddresses.cs (1)
26public static Task Main(string[] args)
StartupExternallyControlled.cs (1)
44public async Task StopAsync()
StartupFullControl.cs (1)
16public static Task Main(string[] args)
StartupHelloWorld.cs (1)
25public static Task Main(string[] args)
StartupInjection.cs (1)
23public static Task Main(string[] args)
Sandbox (3)
artifacts\obj\Sandbox\Release\net9.0\TranscodingGrpc.cs (1)
216public virtual global::System.Threading.Tasks.Task ServerStreamingGetOption(global::Transcoding.HelloRequest request, grpc::IServerStreamWriter<global::Transcoding.HelloReply2> responseStream, grpc::ServerCallContext context)
Services\GreeterService.cs (2)
32return Task.FromResult(new HelloReply { Message = $"Hello {request.Name}" }); 38return Task.FromResult(new HelloReply { Message = $"Hello {request.Name} from {request.From}" });
ServerComparison.FunctionalTests (27)
HelloWorldTest.cs (2)
35public async Task HelloWorld(TestVariant variant) 124public async Task ApplicationException(TestVariant variant)
NtlmAuthenticationTest.cs (1)
32public async Task NtlmAuthentication(TestVariant variant)
ResponseCompressionTests.cs (10)
42public Task ResponseCompression_NoCompression(TestVariant variant) 54public Task ResponseCompression_HostCompression(TestVariant variant) 66public Task ResponseCompression_AppCompression(TestVariant variant) 78public Task ResponseCompression_AppAndHostCompression(TestVariant variant) 83private async Task ResponseCompression(TestVariant variant, 84Func<HttpClient, ILogger, Task> scenario, 164private static async Task CheckNoCompressionAsync(HttpClient client, ILogger logger) 185private static Task CheckHostCompressionAsync(HttpClient client, ILogger logger) 190private static Task CheckAppCompressionAsync(HttpClient client, ILogger logger) 195private static async Task CheckCompressionAsync(HttpClient client, string url, ILogger logger)
ResponseTests.cs (14)
34public Task ResponseFormats_ContentLength(TestVariant variant) 41public Task ResponseFormats_Chunked(TestVariant variant) 48public Task ResponseFormats_ManuallyChunk(TestVariant variant) 60public Task ResponseFormats_Http10ConnectionClose(TestVariant variant) 67public Task ResponseFormats_Http11ConnectionClose(TestVariant variant) 74public Task ResponseFormats_ManuallyChunkAndClose(TestVariant variant) 79private async Task ResponseFormats(TestVariant variant, Func<HttpClient, ILogger, Task> scenario, [CallerMemberName] string testName = null) 126private static async Task CheckContentLengthAsync(HttpClient client, ILogger logger) 151private static async Task CheckHttp11ConnectionCloseAsync(HttpClient client, ILogger logger) 171private static async Task CheckHttp10ConnectionCloseAsync(HttpClient client, ILogger logger) 196private static async Task CheckChunkedAsync(HttpClient client, ILogger logger) 221private static async Task CheckManuallyChunkedAsync(HttpClient client, ILogger logger) 246private static async Task CheckManuallyChunkedAndCloseAsync(HttpClient client, ILogger logger)
ServerComparison.TestSites (1)
OneTransformPerRequest.cs (1)
29return Task.FromResult(principal);
SessionSample (1)
Startup.cs (1)
77public static Task Main(string[] args)
SignalR.Client.FunctionalTestApp (8)
EchoConnectionHandler.cs (1)
11public override async Task OnConnectedAsync(ConnectionContext connection)
Program.cs (1)
10public static Task Main(string[] args)
Startup.cs (4)
94return Task.CompletedTask; 146return Task.CompletedTask; 160return Task.CompletedTask; 286return Task.CompletedTask;
TestHub.cs (2)
50public Task InvokeWithString(string message) 55public Task SendCustomObject(CustomObject customObject)
SignalRSamples (39)
ConnectionHandlers\MessagesConnectionHandler.cs (5)
15public override async Task OnConnectedAsync(ConnectionContext connection) 58private Task Broadcast(string text) 63private Task Broadcast(byte[] payload) 65var tasks = new List<Task>(Connections.Count); 71return Task.WhenAll(tasks);
Hubs\Chat.cs (10)
10public override Task OnConnectedAsync() 16public override Task OnDisconnectedAsync(Exception exception) 22public Task Send(string name, string message) 27public Task SendToOthers(string name, string message) 32public Task SendToConnection(string connectionId, string name, string message) 37public Task SendToGroup(string groupName, string name, string message) 42public Task SendToOthersInGroup(string groupName, string name, string message) 47public async Task JoinGroup(string groupName, string name) 54public async Task LeaveGroup(string groupName, string name) 61public Task Echo(string name, string message)
Hubs\DynamicChat.cs (9)
10public override Task OnConnectedAsync() 16public override Task OnDisconnectedAsync(Exception exception) 22public Task Send(string name, string message) 27public Task SendToOthers(string name, string message) 32public Task SendToGroup(string groupName, string name, string message) 37public Task SendToOthersInGroup(string groupName, string name, string message) 42public async Task JoinGroup(string groupName, string name) 49public async Task LeaveGroup(string groupName, string name) 56public Task Echo(string name, string message)
Hubs\HubTChat.cs (10)
10public override Task OnConnectedAsync() 16public override Task OnDisconnectedAsync(Exception exception) 22public Task Send(string name, string message) 27public Task SendToOthers(string name, string message) 32public Task SendToGroup(string groupName, string name, string message) 37public Task SendToOthersInGroup(string groupName, string name, string message) 42public async Task JoinGroup(string groupName, string name) 49public async Task LeaveGroup(string groupName, string name) 56public Task Echo(string name, string message) 64Task Send(string message);
Hubs\Streaming.cs (3)
17await Task.Delay(TimeSpan.FromMilliseconds(delay)); 34Task.Run(async () => 39await Task.Delay(TimeSpan.FromMilliseconds(delay));
Hubs\UploadHub.cs (1)
67_ = Task.Run(async () =>
Program.cs (1)
12public static Task Main(string[] args)
SocialSample (6)
Startup.cs (6)
214private async Task HandleOnRemoteFailure(RemoteFailureContext context) 472return Task.FromResult<OAuthOptions>(context.RequestServices.GetRequiredService<IOptionsMonitor<GoogleOptions>>().Get(currentAuthType)); 476return Task.FromResult<OAuthOptions>(context.RequestServices.GetRequiredService<IOptionsMonitor<MicrosoftAccountOptions>>().Get(currentAuthType)); 480return Task.FromResult<OAuthOptions>(context.RequestServices.GetRequiredService<IOptionsMonitor<FacebookOptions>>().Get(currentAuthType)); 484return Task.FromResult<OAuthOptions>(context.RequestServices.GetRequiredService<IOptionsMonitor<OAuthOptions>>().Get(currentAuthType)); 490private async Task PrintRefreshedTokensAsync(HttpResponse response, JsonDocument payload, AuthenticationProperties authProperties)
SocialWeather (14)
IStreamFormatter.cs (1)
9Task WriteAsync(T value, Stream stream);
Json\JSonStreamFormatter.cs (3)
16return await Task.Run(() => _serializer.Deserialize<T>(reader)); 19public Task WriteAsync(T value, Stream stream) 24return Task.FromResult(0);
PersistentConnectionLifeTimeManager.cs (4)
41public async Task SendToAllAsync<T>(T data) 54public Task InvokeConnectionAsync(string connectionId, object data) 59public Task InvokeGroupAsync(string groupName, object data) 64public Task InvokeUserAsync(string userId, object data)
Pipe\PipeWeatherStreamFormatter.cs (1)
50public async Task WriteAsync(WeatherReport report, Stream stream)
Program.cs (1)
8public static Task Main(string[] args)
Protobuf\ProtobufWeatherStreamFormatter.cs (2)
15return Task.FromResult(new SocialWeather.WeatherReport 24public async Task WriteAsync(SocialWeather.WeatherReport weatherReport, Stream stream)
SocialWeatherConnectionHandler.cs (2)
23public override async Task OnConnectedAsync(ConnectionContext connection) 30public async Task ProcessRequests(ConnectionContext connection)
Sockets.BindTests (72)
SocketTransportFactoryTests.cs (1)
18public async Task ThrowsNotImplementedExceptionWhenBindingToUriEndPoint()
SocketTransportOptionsTests.cs (3)
24private async Task VerifySocketTransportCallsCreateBoundListenSocketAsync(EndPoint endpointToTest) 49public Task SocketTransportCallsCreateBoundListenSocketForNewEndpoints(EndPoint endpointToTest) 55public async Task SocketTransportCallsCreateBoundListenSocketForFileHandleEndpoint()
src\Servers\Kestrel\shared\test\StreamBackedTestConnection.cs (10)
42public Task SendEmptyGet() 50public Task SendEmptyGetWithUpgradeAndKeepAlive() 53public Task SendEmptyGetWithUpgrade() 56public Task SendEmptyGetAsKeepAlive() 59private Task SendEmptyGetWithConnection(string connection) 68public async Task SendAll(params string[] lines) 77public async Task Send(params string[] lines) 93public async Task Receive(params string[] lines) 129public async Task ReceiveEnd(params string[] lines) 138public async Task WaitForConnectionClose()
src\Servers\Kestrel\shared\test\TransportTestHelpers\DiagnosticMemoryPoolFactory.cs (2)
37public Task WhenAllBlocksReturned(TimeSpan span) 41return Task.WhenAll(_pools.Select(p => p.WhenAllBlocksReturnedAsync(span)));
src\Servers\Kestrel\shared\test\TransportTestHelpers\HostNameIsReachableAttribute.cs (3)
40var timeoutTask = Task.Delay(1000); 41if (await Task.WhenAny(ConnectToHost(_hostname, 80), timeoutTask) == timeoutTask)
src\Servers\Kestrel\shared\test\TransportTestHelpers\TestServer.cs (1)
146public Task StopAsync(CancellationToken token = default)
src\Servers\Kestrel\test\BindTests\AddressRegistrationTests.cs (52)
39public async Task RegisterAddresses_HostName_Success() 47public async Task RegisterAddresses_IPv4_Success(string addressInput, string testUrl) 55public async Task RegisterAddresses_IPv4Port5000Default_Success(string addressInput, string testUrl) 68public async Task RegisterAddresses_IPv4Port80_Success(string addressInput, string testUrl) 79public async Task RegisterAddresses_IPv4StaticPort_Success() 85public async Task RegisterAddresses_IPv4LocalhostStaticPort_Success() 91public async Task RegisterIPEndPoint_IPv4StaticPort_Success() 98public async Task RegisterIPEndPoint_IPv6StaticPort_Success() 106public async Task RegisterIPEndPoint_DynamicPort_Success(IPEndPoint endPoint, string testUrl) 114public async Task RegisterIPEndPoint_Port443_Success(IPEndPoint endpoint, string testUrl) 127public async Task RegisterAddresses_IPv6_Success(string addressInput, string[] testUrls) 135public async Task RegisterAddresses_IPv6Port5000Default_Success(string addressInput, string[] testUrls) 148public async Task RegisterAddresses_IPv6Port80_Success(string addressInput, string[] testUrls) 162public async Task RegisterAddresses_IPv6ScopeId_Success(string addressInput, string testUrl) 169public async Task RegisterAddresses_IPv6StaticPort_Success() 176public async Task RegisterAddresses_IPv6LocalhostStaticPort_Success() 181private async Task RegisterAddresses_Success(string addressInput, string[] testUrls, int testPort = 0) 224private Task RegisterAddresses_Success(string addressInput, string testUrl, int testPort = 0) 227private Task RegisterAddresses_StaticPort_Success(string addressInput, string[] testUrls) => 231public async Task RegisterHttpAddress_UpgradedToHttpsByConfigureEndpointDefaults() 270private async Task RunTestWithStaticPort(Func<int, Task> test) 301private Task RegisterAddresses_StaticPort_Success(string addressInput, string testUrl) 304private async Task RegisterIPEndPoint_Success(IPEndPoint endPoint, string testUrl, int testPort = 0) 343private Task RegisterIPEndPoint_StaticPort_Success(IPAddress address, string testUrl) 347public async Task ListenAnyIP_IPv4_Success() 354public async Task ListenAnyIP_IPv6_Success() 362public async Task ListenAnyIP_HostName_Success() 368private async Task ListenAnyIP_Success(string[] testUrls, int testPort = 0) 400public async Task ListenLocalhost_IPv4LocalhostStaticPort_Success() 407public async Task ListenLocalhost_IPv6LocalhostStaticPort_Success() 412private Task ListenLocalhost_StaticPort_Success(string[] testUrls) => 415private async Task ListenLocalhost_Success(string[] testUrls, int testPort = 0) 448public Task DefaultsServerAddress_BindsToIPv4() 452return Task.CompletedTask; 461public Task DefaultsServerAddress_BindsToIPv6() 465return Task.CompletedTask; 473public Task DefaultsServerAddress_BindsToIPv4WithHttp() 477return Task.CompletedTask; 487public Task DefaultsServerAddress_BindsToIPv6WithHttp() 491return Task.CompletedTask; 499private async Task RegisterDefaultServerAddresses_Success(IEnumerable<string> addresses, bool mockHttps = false) 534public async Task ThrowsWhenBindingToIPv4AddressInUse() 569public async Task ThrowsWhenBindingToIPv6AddressInUse() 604public async Task OverrideDirectConfigurationWithIServerAddressesFeature_Succeeds() 648public async Task DoesNotOverrideDirectConfigurationWithIServerAddressesFeature_IfPreferHostingUrlsFalse() 692public async Task DoesNotOverrideDirectConfigurationWithIServerAddressesFeature_IfAddressesEmpty() 742public async Task ThrowsWhenBindingLocalhostToDynamicPort() 767public async Task ThrowsForUnsupportedAddressFromHosting(string address) 790public async Task CanRebindToEndPoint() 839public async Task CanRebindToMultipleEndPoints() 895public async Task EndpointDefaultsConfig_CanSetProtocolForUrlsConfig(string input, HttpProtocols expected)
Sockets.FunctionalTests (113)
SocketTransportTests.cs (2)
25public async Task SocketTransportExposesSocketsFeature() 44return Task.CompletedTask;
src\Servers\Kestrel\shared\test\PassThroughConnectionMiddleware.cs (1)
21public Task OnConnectionAsync(ConnectionContext context)
src\Servers\Kestrel\shared\test\StreamBackedTestConnection.cs (10)
42public Task SendEmptyGet() 50public Task SendEmptyGetWithUpgradeAndKeepAlive() 53public Task SendEmptyGetWithUpgrade() 56public Task SendEmptyGetAsKeepAlive() 59private Task SendEmptyGetWithConnection(string connection) 68public async Task SendAll(params string[] lines) 77public async Task Send(params string[] lines) 93public async Task Receive(params string[] lines) 129public async Task ReceiveEnd(params string[] lines) 138public async Task WaitForConnectionClose()
src\Servers\Kestrel\shared\test\TestApp.cs (6)
14public static async Task EchoApp(HttpContext httpContext) 27public static async Task EchoAppChunked(HttpContext httpContext) 39public static Task EmptyApp(HttpContext httpContext) 41return Task.CompletedTask; 44public static async Task EchoAppPipeWriter(HttpContext httpContext) 61public static async Task EchoAppPipeWriterChunked(HttpContext httpContext)
src\Servers\Kestrel\shared\test\TransportTestHelpers\DiagnosticMemoryPoolFactory.cs (2)
37public Task WhenAllBlocksReturned(TimeSpan span) 41return Task.WhenAll(_pools.Select(p => p.WhenAllBlocksReturnedAsync(span)));
src\Servers\Kestrel\shared\test\TransportTestHelpers\HostNameIsReachableAttribute.cs (3)
40var timeoutTask = Task.Delay(1000); 41if (await Task.WhenAny(ConnectToHost(_hostname, 80), timeoutTask) == timeoutTask)
src\Servers\Kestrel\shared\test\TransportTestHelpers\TestServer.cs (1)
146public Task StopAsync(CancellationToken token = default)
src\Servers\Kestrel\test\FunctionalTests\ConnectionMiddlewareTests.cs (3)
25public async Task ThrowingSynchronousConnectionMiddlewareDoesNotCrashServer() 47await Task.Delay(5); 55public async Task DisposeAsyncAfterReplacingTransportClosesConnection()
src\Servers\Kestrel\test\FunctionalTests\Http2\HandshakeTests.cs (2)
67public async Task TlsAlpnHandshakeSelectsHttp2From1and2() 95public async Task TlsAlpnHandshakeSelectsHttp2()
src\Servers\Kestrel\test\FunctionalTests\Http2\ShutdownTests.cs (5)
50public async Task ConnectionClosedWithoutActiveRequestsOrGoAwayFIN() 113public async Task GracefulShutdownWaitsForRequestsToFinish() 153var stopTask = server.StopAsync(); 171public async Task GracefulTurnsAbortiveIfRequestsDoNotFinish() 212var stopServerTask = server.StopAsync(cts.Token).DefaultTimeout();
src\Servers\Kestrel\test\FunctionalTests\ListenHandleTests.cs (2)
32public async Task CanListenToOpenTcpSocketHandle() 36await using (var server = new TestServer(_ => Task.CompletedTask, new TestServiceContext(LoggerFactory),
src\Servers\Kestrel\test\FunctionalTests\MaxRequestBufferSizeTests.cs (10)
121public async Task LargeUpload(long? maxRequestBufferSize, bool connectionAdapter, bool expectPause) 145Func<Task> sendFunc = async () => 159var sendTask = sendFunc(); 184await Task.Delay(bytesWrittenPollingInterval); 214public async Task ServerShutsDownGracefullyWhenMaxRequestBufferSizeExceeded() 238Func<Task> sendFunc = async () => 251var ignore = sendFunc(); 274await Task.Delay(bytesWrittenPollingInterval); 385private static async Task WritePostRequestHeaders(Stream stream, int contentLength) 398private static async Task AssertStreamContains(Stream stream, string expectedSubstring)
src\Servers\Kestrel\test\FunctionalTests\RequestTests.cs (32)
66public async Task LargeUpload(long contentLength, bool checkBytes) 146public Task RemoteIPv4Address() 153public Task RemoteIPv6Address() 159public async Task DoesNotHangOnConnectionCloseRequest() 193public async Task CanHandleMultipleConcurrentRequests() 239public async Task ConnectionClosedPriorToRequestIsLoggedAsDebug() 269await using (var server = new TestServer(context => Task.CompletedTask, new TestServiceContext(LoggerFactory))) 291public async Task ConnectionResetPriorToRequestIsLoggedAsDebug() 321await using (var server = new TestServer(context => Task.CompletedTask, new TestServiceContext(LoggerFactory))) 342public async Task ConnectionClosedBetweenRequestsIsLoggedAsDebug() 366await using (var server = new TestServer(context => Task.CompletedTask, new TestServiceContext(LoggerFactory))) 401public async Task ConnectionResetBetweenRequestsIsLoggedAsDebug() 425await using (var server = new TestServer(context => Task.CompletedTask, new TestServiceContext(LoggerFactory))) 461public async Task ConnectionClosedOrResetMidRequestIsLoggedAsDebug(bool close) 530public async Task ThrowsOnReadAfterConnectionError() 584public async Task RequestAbortedTokenFiredOnClientFIN() 623public async Task RequestAbortedTokenUnchangedOnAbort() 670public async Task AbortingTheConnection(bool fin) 688return Task.CompletedTask; 718public async Task ConnectionClosedTokenFiresOnClientFIN(string listenOptionsName) 731return Task.CompletedTask; 753public async Task ConnectionClosedTokenFiresOnServerFIN(string listenOptionsName) 763return Task.CompletedTask; 789public async Task ConnectionClosedTokenFiresOnServerAbort(string listenOptionsName) 801return Task.CompletedTask; 830public async Task RequestsCanBeAbortedMidRead(string listenOptionsName) 859var readTask = request.Body.CopyToAsync(Stream.Null); 923public async Task ServerCanAbortConnectionAfterUnobservedClose(string listenOptionsName, bool fin) 1013var ignore = connection.Stream.WriteAsync(scratchBuffer, 0, scratchBuffer.Length); 1030public async Task AppCanHandleClientAbortingConnectionMidRequest(string listenOptionsName) 1079private async Task TestRemoteIPAddress(string registerAddress, string requestAddress, string expectAddress) 1125private static async Task AssertStreamContains(Stream stream, string expectedSubstring)
src\Servers\Kestrel\test\FunctionalTests\ResponseTests.cs (31)
50public async Task LargeDownload() 108public async Task IgnoreNullHeaderValues(string headerName, StringValues headerValue, string expectedValue) 155public async Task WriteAfterConnectionCloseNoops(ListenOptions listenOptions) 198public async Task ThrowsOnWriteWithRequestAbortedTokenAfterRequestIsAborted(ListenOptions listenOptions) 261public async Task WritingToConnectionAfterUnobservedCloseTriggersRequestAbortedToken(ListenOptions listenOptions) 310await Task.Delay(10); 335var ignore = connection.Stream.WriteAsync(scratchBuffer, 0, scratchBuffer.Length); 352public async Task AppCanHandleClientAbortingConnectionMidResponse(ListenOptions listenOptions) 373await Task.Delay(10); 423public async Task ClientAbortingConnectionImmediatelyIsNotLoggedHigherThanDebug(ListenOptions listenOptions) 431await using (var server = new TestServer(context => Task.CompletedTask, testServiceContext, listenOptions)) 461public async Task ConnectionClosedWhenResponseDoesNotSatisfyMinimumDataRate(bool fin) 510async Task App(HttpContext context) 524await Task.Yield(); 593public async Task HttpsConnectionClosedWhenResponseDoesNotSatisfyMinimumDataRate(bool fin) 712public async Task ConnectionClosedWhenBothRequestAndResponseExperienceBackPressure(bool fin) 760async Task App(HttpContext context) 803var sendTask = Task.Run(async () => 808await Task.Delay(10); 833public async Task ConnectionNotClosedWhenClientSatisfiesMinimumDataRateGivenLargeResponseChunks() 860async Task App(HttpContext context) 909public async Task ConnectionNotClosedWhenClientSatisfiesMinimumDataRateGivenLargeResponseHeaders() 937async Task App(HttpContext context) 994public async Task ClientCanReceiveFullConnectionCloseResponseWithoutErrorAtALowDataRate() 1021async Task App(HttpContext context) 1068private async Task AssertStreamAborted(Stream stream, int totalBytes) 1095private async Task AssertBytesReceivedAtTargetRate(Stream stream, int expectedBytes, int targetBytesPerSecond) 1113await Task.Delay(expectedTimeElapsed - timeElapsed); 1118private async Task AssertStreamCompletedAtTargetRate(Stream stream, long expectedBytes, int targetBytesPerSecond) 1134await Task.Delay(expectedTimeElapsed - timeElapsed);
src\Servers\Kestrel\test\FunctionalTests\UnixDomainSocketsTests.cs (3)
36public async Task TestUnixDomainSocket() 46async Task EchoServer(ConnectionContext connection) 134public async Task TestUnixDomainSocketWithUrl()
StaticFileSample (1)
Startup.cs (1)
24public static Task Main(string[] args)
StatusCodePagesSample (2)
Startup.cs (2)
52await Task.FromResult(0); 107public static Task Main(string[] args)
System.ComponentModel.EventBasedAsync (1)
System\ComponentModel\BackgroundWorker.cs (1)
128Task.Factory.StartNew(
System.Console (6)
System\IO\SyncTextReader.cs (6)
96return Task.FromResult(ReadLine()); 108return Task.FromResult(ReadToEnd()); 114Task.FromCanceled<string>(cancellationToken) : 115Task.FromResult(ReadToEnd()); 127return Task.FromResult(ReadBlock(buffer, index, count)); 139return Task.FromResult(Read(buffer, index, count));
System.Data.Common (76)
src\libraries\Common\src\System\Data\Common\AdapterUtil.cs (2)
23internal static Task<bool> TrueTask => _trueTask ??= Task.FromResult(true); 26internal static Task<bool> FalseTask => _falseTask ??= Task.FromResult(false);
System\Data\Common\AdapterUtil.Common.cs (1)
22internal static Task<T> CreatedTaskWithCancellation<T>() => Task.FromCanceled<T>(new CancellationToken(true));
System\Data\Common\DbBatch.cs (1)
60public abstract Task PrepareAsync(CancellationToken cancellationToken = default);
System\Data\Common\DbCommand.cs (10)
137return Task.FromResult(ExecuteNonQuery()); 141return Task.FromException<int>(e); 178return Task.FromResult<DbDataReader>(ExecuteReader(behavior)); 182return Task.FromException<DbDataReader>(e); 210return Task.FromResult<object?>(ExecuteScalar()); 214return Task.FromException<object?>(e); 227public virtual Task PrepareAsync(CancellationToken cancellationToken = default) 231return Task.FromCanceled(cancellationToken); 237return Task.CompletedTask; 241return Task.FromException(e);
System\Data\Common\DbConnection.cs (21)
92public virtual Task CloseAsync() 97return Task.CompletedTask; 101return Task.FromException(e); 113public virtual Task ChangeDatabaseAsync(string databaseName, CancellationToken cancellationToken = default) 117return Task.FromCanceled(cancellationToken); 123return Task.CompletedTask; 127return Task.FromException(e); 233return Task.FromCanceled<DataTable>(cancellationToken); 238return Task.FromResult(GetSchema()); 242return Task.FromException<DataTable>(e); 265return Task.FromCanceled<DataTable>(cancellationToken); 270return Task.FromResult(GetSchema(collectionName)); 274return Task.FromException<DataTable>(e); 297return Task.FromCanceled<DataTable>(cancellationToken); 302return Task.FromResult(GetSchema(collectionName, restrictionValues)); 306return Task.FromException<DataTable>(e); 322public Task OpenAsync() => OpenAsync(CancellationToken.None); 324public virtual Task OpenAsync(CancellationToken cancellationToken) 328return Task.FromCanceled(cancellationToken); 335return Task.CompletedTask; 339return Task.FromException(e);
System\Data\Common\DbDataReader.cs (14)
36public virtual Task CloseAsync() 41return Task.CompletedTask; 45return Task.FromException(e); 107return Task.FromCanceled<DataTable?>(cancellationToken); 112return Task.FromResult(GetSchemaTable()); 116return Task.FromException<DataTable?>(e); 137return Task.FromCanceled<ReadOnlyCollection<DbColumn>>(cancellationToken); 142return Task.FromResult(this.GetColumnSchema()); 146return Task.FromException<ReadOnlyCollection<DbColumn>>(e); 260return Task.FromResult<T>(GetFieldValue<T>(ordinal)); 264return Task.FromException<T>(e); 289return Task.FromException<bool>(e); 314return Task.FromException<bool>(e); 335return Task.FromException<bool>(e);
System\Data\Common\DbDataSource.cs (4)
337public override Task PrepareAsync(CancellationToken cancellationToken = default) 338=> Task.FromException(ExceptionBuilder.NotSupportedOnDataSourceCommand()); 566public override Task PrepareAsync(CancellationToken cancellationToken = default) 567=> Task.FromException(ExceptionBuilder.NotSupportedOnDataSourceCommand());
System\Data\Common\DbTransaction.cs (23)
23public virtual Task CommitAsync(CancellationToken cancellationToken = default) 27return Task.FromCanceled(cancellationToken); 33return Task.CompletedTask; 37return Task.FromException(e); 53public virtual Task RollbackAsync(CancellationToken cancellationToken = default) 57return Task.FromCanceled(cancellationToken); 63return Task.CompletedTask; 67return Task.FromException(e); 93/// <returns>A <see cref="Task " /> representing the asynchronous operation.</returns> 94public virtual Task SaveAsync(string savepointName, CancellationToken cancellationToken = default) 98return Task.FromCanceled(cancellationToken); 104return Task.CompletedTask; 108return Task.FromException(e); 119/// <returns>A <see cref="Task " /> representing the asynchronous operation.</returns> 120public virtual Task RollbackAsync(string savepointName, CancellationToken cancellationToken = default) 124return Task.FromCanceled(cancellationToken); 130return Task.CompletedTask; 134return Task.FromException(e); 146/// <returns>A <see cref="Task " /> representing the asynchronous operation.</returns> 147public virtual Task ReleaseAsync(string savepointName, CancellationToken cancellationToken = default) 151return Task.FromCanceled(cancellationToken); 157return Task.CompletedTask; 161return Task.FromException(e);
System.Diagnostics.Process (12)
System\Diagnostics\AsyncStreamReader.cs (5)
36private Task? _readToBufferTask; 89private async Task ReadBufferAsync() 91await Task.CompletedTask.ConfigureAwait(ConfigureAwaitOptions.ForceYielding); 256internal Task EOF => _readToBufferTask ?? Task.CompletedTask;
System\Diagnostics\Process.cs (2)
1466public async Task WaitForExitAsync(CancellationToken cancellationToken = default) 1563async Task WaitUntilOutputEOF(CancellationToken cancellationToken)
System\Diagnostics\ProcessWaitState.Unix.cs (5)
205private Task _waitInProgress = Task.CompletedTask; 422Task? waitTask; 504private async Task WaitForExitAsync(CancellationToken cancellationToken) 537await Task.Delay(pollingIntervalMs, cancellationToken).ConfigureAwait(ConfigureAwaitOptions.SuppressThrowing);
System.Formats.Tar (51)
System\Formats\Tar\SubReadStream.cs (4)
138return Task.FromCanceled<int>(cancellationToken); 180public override Task FlushAsync(CancellationToken cancellationToken) => 181cancellationToken.IsCancellationRequested ? Task.FromCanceled(cancellationToken) : 182Task.CompletedTask;
System\Formats\Tar\TarEntry.cs (10)
224public Task ExtractToFileAsync(string destinationFileName, bool overwrite, CancellationToken cancellationToken = default) 228return Task.FromCanceled(cancellationToken); 233return Task.FromException(new InvalidOperationException(SR.Format(SR.TarEntryTypeNotSupportedForExtracting, EntryType))); 306internal Task ExtractRelativeToDirectoryAsync(string destinationDirectoryPath, bool overwrite, SortedDictionary<string, UnixFileMode>? pendingModes, Stack<(string, DateTimeOffset)> directoryModificationTimes, CancellationToken cancellationToken) 310return Task.FromCanceled(cancellationToken); 319return Task.CompletedTask; 406private Task ExtractToFileInternalAsync(string filePath, string? linkTargetPath, bool overwrite, CancellationToken cancellationToken) 410return Task.FromCanceled(cancellationToken); 421return Task.CompletedTask; 534private async Task ExtractAsRegularFileAsync(string destinationFileName, CancellationToken cancellationToken)
System\Formats\Tar\TarFile.cs (19)
66public static Task CreateFromDirectoryAsync(string sourceDirectoryName, Stream destination, bool includeBaseDirectory, CancellationToken cancellationToken = default) 70return Task.FromCanceled(cancellationToken); 77return Task.FromException(new ArgumentException(SR.IO_NotSupported_UnwritableStream, nameof(destination))); 82return Task.FromException(new DirectoryNotFoundException(SR.Format(SR.IO_PathNotFound_Path, sourceDirectoryName))); 133public static Task CreateFromDirectoryAsync(string sourceDirectoryName, string destinationFileName, bool includeBaseDirectory, CancellationToken cancellationToken = default) 137return Task.FromCanceled(cancellationToken); 148return Task.FromException(new DirectoryNotFoundException(SR.Format(SR.IO_PathNotFound_Path, sourceDirectoryName))); 212public static Task ExtractToDirectoryAsync(Stream source, string destinationDirectoryName, bool overwriteFiles, CancellationToken cancellationToken = default) 216return Task.FromCanceled(cancellationToken); 223return Task.FromException(new ArgumentException(SR.IO_NotSupported_UnreadableStream, nameof(source))); 228return Task.FromException(new DirectoryNotFoundException(SR.Format(SR.IO_PathNotFound_Path, destinationDirectoryName))); 297public static Task ExtractToDirectoryAsync(string sourceFileName, string destinationDirectoryName, bool overwriteFiles, CancellationToken cancellationToken = default) 301return Task.FromCanceled(cancellationToken); 313return Task.FromException(new FileNotFoundException(SR.Format(SR.IO_FileNotFound_FileName, sourceFileName))); 318return Task.FromException(new DirectoryNotFoundException(SR.Format(SR.IO_PathNotFound_Path, destinationDirectoryName))); 356private static async Task CreateFromDirectoryInternalAsync(string sourceDirectoryName, string destinationFileName, bool includeBaseDirectory, CancellationToken cancellationToken) 379private static async Task CreateFromDirectoryInternalAsync(string sourceDirectoryName, Stream destination, bool includeBaseDirectory, bool leaveOpen, CancellationToken cancellationToken) 475private static async Task ExtractToDirectoryInternalAsync(string sourceFileName, string destinationDirectoryFullPath, bool overwriteFiles, CancellationToken cancellationToken) 497private static async Task ExtractToDirectoryInternalAsync(Stream source, string destinationDirectoryFullPath, bool overwriteFiles, bool leaveOpen, CancellationToken cancellationToken)
System\Formats\Tar\TarHeader.Read.cs (1)
243private async Task ProcessDataBlockAsync(Stream archiveStream, bool copyData, CancellationToken cancellationToken)
System\Formats\Tar\TarHeader.Write.cs (10)
45private async Task WriteWithSeekableDataStreamAsync(TarEntryFormat format, Stream archiveStream, Memory<byte> buffer, CancellationToken cancellationToken) 110private async Task WriteWithUnseekableDataStreamAsync(TarEntryFormat format, Stream destinationStream, Memory<byte> buffer, bool shouldAdvanceToEnd, CancellationToken cancellationToken) 189internal Task WriteAsPaxGlobalExtendedAttributesAsync(Stream archiveStream, Memory<byte> buffer, int globalExtendedAttributesEntryNumber, CancellationToken cancellationToken) 193return Task.FromCanceled<int>(cancellationToken); 221internal Task WriteAsV7Async(Stream archiveStream, Memory<byte> buffer, CancellationToken cancellationToken) 248internal Task WriteAsUstarAsync(Stream archiveStream, Memory<byte> buffer, CancellationToken cancellationToken) 306internal async Task WriteAsPaxAsync(Stream archiveStream, Memory<byte> buffer, CancellationToken cancellationToken) 385internal async Task WriteAsGnuAsync(Stream archiveStream, Memory<byte> buffer, CancellationToken cancellationToken) 457private Task WriteAsPaxExtendedAttributesAsync(Stream archiveStream, Memory<byte> buffer, Dictionary<string, string> extendedAttributes, bool isGea, int globalExtendedAttributesEntryNumber, CancellationToken cancellationToken) 806private async Task WriteDataAsync(Stream archiveStream, Stream dataStream, CancellationToken cancellationToken)
System\Formats\Tar\TarWriter.cs (7)
152public Task WriteEntryAsync(string fileName, string? entryName, CancellationToken cancellationToken = default) 156return Task.FromCanceled(cancellationToken); 173private async Task ReadFileFromDiskAndWriteToArchiveStreamAsEntryAsync(string fullPath, string entryName, CancellationToken cancellationToken) 264public Task WriteEntryAsync(TarEntry entry, CancellationToken cancellationToken = default) 268return Task.FromCanceled(cancellationToken); 318private async Task WriteEntryAsyncInternal(TarEntry entry, CancellationToken cancellationToken) 326Task task = entry.Format switch
System.IO.Compression (28)
System\IO\Compression\DeflateManaged\DeflateManagedStream.cs (3)
77public override Task FlushAsync(CancellationToken cancellationToken) 81Task.FromCanceled(cancellationToken) : 82Task.CompletedTask;
System\IO\Compression\DeflateZLib\DeflateStream.cs (11)
169public override Task FlushAsync(CancellationToken cancellationToken) 175return Task.FromCanceled(cancellationToken); 178Task.CompletedTask : 181async Task Core(CancellationToken cancellationToken) 775public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 854public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) 865return Task.FromCanceled<int>(cancellationToken); 896public async Task CopyFromSourceToDestinationAsync() 967public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 973return Task.CompletedTask; 979return Task.FromException(new InvalidDataException(SR.GenericInvalidData));
System\IO\Compression\GZipStream.cs (3)
209public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 231public override Task FlushAsync(CancellationToken cancellationToken) 237public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken)
System\IO\Compression\PositionPreservingWriteOnlyStreamWrapper.cs (2)
58public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 83public override Task FlushAsync(CancellationToken cancellationToken) => _stream.FlushAsync(cancellationToken);
System\IO\Compression\ZipArchiveEntry.cs (2)
1277public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 1314public override Task FlushAsync(CancellationToken cancellationToken)
System\IO\Compression\ZipCustomStreams.cs (4)
174public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 198public override Task FlushAsync(CancellationToken cancellationToken) 547public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 587public override Task FlushAsync(CancellationToken cancellationToken)
System\IO\Compression\ZLibStream.cs (3)
77public override Task FlushAsync(CancellationToken cancellationToken) 200public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 238public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken)
System.IO.Compression.Brotli (10)
System\IO\Compression\dec\BrotliStream.Decompress.cs (2)
118/// <para>If the operation is canceled before it completes, the returned task contains the <see cref="System.Threading.Tasks.TaskStatus.Canceled" /> value for the <see cref="System.Threading.Tasks.Task.Status" /> property.</para></remarks> 131/// <para>If the operation is canceled before it completes, the returned task contains the <see cref="System.Threading.Tasks.TaskStatus.Canceled" /> value for the <see cref="System.Threading.Tasks.Task.Status" /> property.</para></remarks>
System\IO\Compression\enc\BrotliStream.Compress.cs (8)
113/// <para>If the operation is canceled before it completes, the returned task contains the <see cref="System.Threading.Tasks.TaskStatus.Canceled" /> value for the <see cref="System.Threading.Tasks.Task.Status" /> property.</para></remarks> 114public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 126/// <para>If the operation is canceled before it completes, the returned task contains the <see cref="System.Threading.Tasks.TaskStatus.Canceled" /> value for the <see cref="System.Threading.Tasks.Task.Status" /> property.</para></remarks> 197/// <remarks>If the operation is canceled before it completes, the returned task contains the <see cref="System.Threading.Tasks.TaskStatus.Canceled" /> value for the <see cref="System.Threading.Tasks.Task.Status" /> property.</remarks> 198public override Task FlushAsync(CancellationToken cancellationToken) 204return Task.FromCanceled(cancellationToken); 206return _mode != CompressionMode.Compress ? Task.CompletedTask : FlushAsyncCore(cancellationToken); 209private async Task FlushAsyncCore(CancellationToken cancellationToken)
System.IO.Hashing (2)
System\IO\Hashing\NonCryptographicHashAlgorithm.cs (2)
143public Task AppendAsync(Stream stream, CancellationToken cancellationToken = default) 153private async Task AppendAsyncCore(Stream stream, CancellationToken cancellationToken)
System.IO.IsolatedStorage (2)
System\IO\IsolatedStorage\IsolatedStorageFileStream.cs (2)
236public override Task FlushAsync(CancellationToken cancellationToken) 288public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
System.IO.Pipelines (23)
System\IO\Pipelines\Pipe.cs (4)
367return new ValueTask<FlushResult>(Task.FromCanceled<FlushResult>(cancellationToken)); 694return new ValueTask<ReadResult>(Task.FromCanceled<ReadResult>(token)); 753return new ValueTask<ReadResult>(Task.FromCanceled<ReadResult>(token)); 1069return new ValueTask<FlushResult>(Task.FromCanceled<FlushResult>(cancellationToken));
System\IO\Pipelines\PipeReader.cs (6)
138return new ValueTask(Task.FromException(ex)); 178public virtual Task CopyToAsync(PipeWriter destination, CancellationToken cancellationToken = default) 187return Task.FromCanceled(cancellationToken); 200public virtual Task CopyToAsync(Stream destination, CancellationToken cancellationToken = default) 209return Task.FromCanceled(cancellationToken); 233private async Task CopyToAsyncCore<TStream>(TStream destination, Func<TStream, ReadOnlyMemory<byte>, CancellationToken, ValueTask<FlushResult>> writeAsync, CancellationToken cancellationToken)
System\IO\Pipelines\PipeReaderStream.cs (1)
151public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken)
System\IO\Pipelines\PipeWriter.cs (2)
31return new ValueTask(Task.FromException(ex)); 123protected internal virtual async Task CopyFromAsync(Stream source, CancellationToken cancellationToken = default)
System\IO\Pipelines\PipeWriterStream.cs (5)
72public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 93public override Task FlushAsync(CancellationToken cancellationToken) 100private static Task GetFlushResultAsTask(ValueTask<FlushResult> valueTask) 110return Task.CompletedTask; 113static async Task AwaitTask(ValueTask<FlushResult> valueTask)
System\IO\Pipelines\StreamPipeExtensions.cs (2)
17public static Task CopyToAsync(this Stream source, PipeWriter destination, CancellationToken cancellationToken = default) 30return Task.FromCanceled(cancellationToken);
System\IO\Pipelines\StreamPipeReader.cs (3)
218return new ValueTask<ReadResult>(Task.FromCanceled<ReadResult>(cancellationToken)); 311public override async Task CopyToAsync(PipeWriter destination, CancellationToken cancellationToken = default) 382public override async Task CopyToAsync(Stream destination, CancellationToken cancellationToken = default)
System.IO.Pipes (20)
System\IO\Pipes\NamedPipeClientStream.cs (7)
164public Task ConnectAsync() 171public Task ConnectAsync(int timeout) 176public Task ConnectAsync(CancellationToken cancellationToken) 181public Task ConnectAsync(int timeout, CancellationToken cancellationToken) 189return Task.FromCanceled(cancellationToken); 194return Task.Factory.StartNew(static state => 201public Task ConnectAsync(TimeSpan timeout, CancellationToken cancellationToken = default) =>
System\IO\Pipes\NamedPipeServerStream.cs (1)
157public Task WaitForConnectionAsync()
System\IO\Pipes\NamedPipeServerStream.Unix.cs (3)
68public Task WaitForConnectionAsync(CancellationToken cancellationToken) 77Task.FromCanceled(cancellationToken) : 80async Task WaitForConnectionAsyncCore()
System\IO\Pipes\PipeStream.cs (3)
132public override Task FlushAsync(CancellationToken cancellationToken) 137return Task.CompletedTask; 141return Task.FromException(ex);
System\IO\Pipes\PipeStream.Unix.cs (6)
68return Task.FromCanceled<int>(cancellationToken); 76return Task.FromResult(0); 134public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 144return Task.FromCanceled<int>(cancellationToken); 151return Task.CompletedTask; 315private async Task WriteAsyncCore(ReadOnlyMemory<byte> source, CancellationToken cancellationToken)
System.Linq.Expressions (1)
System\Linq\Expressions\StackGuard.cs (1)
68Task<R> task = Task.Factory.StartNew(action!, state, CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default);
System.Linq.Parallel (15)
System\Linq\Parallel\Scheduling\OrderPreservingPipeliningSpoolingTask.cs (1)
171Task rootTask = new Task(
System\Linq\Parallel\Scheduling\OrderPreservingSpoolingTask.cs (1)
87Task rootTask = new Task(
System\Linq\Parallel\Scheduling\QueryTask.cs (4)
60internal Task RunSynchronously(TaskScheduler taskScheduler) 64Task task = new Task(s_runTaskSynchronouslyDelegate, this, TaskCreationOptions.AttachedToParent); 79internal Task RunAsynchronously(TaskScheduler taskScheduler) 84return Task.Factory.StartNew(s_baseWorkDelegate, this, CancellationToken.None, TaskCreationOptions.AttachedToParent | TaskCreationOptions.PreferFairness, taskScheduler);
System\Linq\Parallel\Scheduling\QueryTaskGroupState.cs (2)
24private Task? _rootTask; // The task under which all query tasks root. 71internal void QueryBegin(Task rootTask)
System\Linq\Parallel\Scheduling\SpoolingTask.cs (3)
40Task rootTask = new Task( 98Task rootTask = new Task( 139Task rootTask = new Task(
System\Linq\Parallel\Utils\PLINQETWProvider.cs (4)
90int taskId = Task.CurrentId ?? 0; 119int taskId = Task.CurrentId ?? 0; 149int taskId = Task.CurrentId ?? 0; 180int taskId = Task.CurrentId ?? 0;
System.Memory.Data (6)
src\libraries\Common\src\System\IO\ReadOnlyMemoryStream.cs (6)
131Task.FromCanceled<int>(cancellationToken) : 132Task.FromResult(ReadBuffer(new Span<byte>(buffer, offset, count))); 166public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) 178return Task.CompletedTask; 185public override Task FlushAsync(CancellationToken cancellationToken) => Task.CompletedTask;
System.Net.Http (191)
src\libraries\Common\src\System\IO\DelegatingStream.cs (3)
130public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) 144public override Task FlushAsync(CancellationToken cancellationToken) 169public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
src\libraries\Common\src\System\IO\ReadOnlyMemoryStream.cs (6)
131Task.FromCanceled<int>(cancellationToken) : 132Task.FromResult(ReadBuffer(new Span<byte>(buffer, offset, count))); 166public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) 178return Task.CompletedTask; 185public override Task FlushAsync(CancellationToken cancellationToken) => Task.CompletedTask;
System\Net\Http\ByteArrayContent.cs (4)
43protected override Task SerializeToStreamAsync(Stream stream, TransportContext? context) => 46protected override Task SerializeToStreamAsync(Stream stream, TransportContext? context, CancellationToken cancellationToken) => 52private protected Task SerializeToStreamAsyncCore(Stream stream, CancellationToken cancellationToken) => 65Task.FromResult<Stream>(CreateMemoryStreamForByteArray());
System\Net\Http\EmptyContent.cs (6)
22protected override Task SerializeToStreamAsync(Stream stream, TransportContext? context) => 23Task.CompletedTask; 25protected override Task SerializeToStreamAsync(Stream stream, TransportContext? context, CancellationToken cancellationToken) => 26cancellationToken.IsCancellationRequested ? Task.FromCanceled(cancellationToken) : 33Task.FromResult<Stream>(EmptyReadStream.Instance); 36cancellationToken.IsCancellationRequested ? Task.FromCanceled<Stream>(cancellationToken) :
System\Net\Http\EmptyReadStream.cs (1)
28public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken)
System\Net\Http\FormUrlEncodedContent.cs (1)
89protected override Task SerializeToStreamAsync(Stream stream, TransportContext? context, CancellationToken cancellationToken) =>
System\Net\Http\HttpBaseStream.cs (5)
69public sealed override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 77public override Task FlushAsync(CancellationToken cancellationToken) => NopAsync(cancellationToken); 79protected static Task NopAsync(CancellationToken cancellationToken) => 80cancellationToken.IsCancellationRequested ? Task.FromCanceled(cancellationToken) : 81Task.CompletedTask;
System\Net\Http\HttpContent.cs (29)
285Task.FromResult<Stream>(new MemoryStream(buffer.Array!, buffer.Offset, buffer.Count, writable: false)) : 297Task<Stream> ts = Task.FromResult((Stream)_contentReadStream); 331protected abstract Task SerializeToStreamAsync(Stream stream, TransportContext? context); 341protected virtual Task SerializeToStreamAsync(Stream stream, TransportContext? context, CancellationToken cancellationToken) => 373public Task CopyToAsync(Stream stream) => 376public Task CopyToAsync(Stream stream, CancellationToken cancellationToken) => 379public Task CopyToAsync(Stream stream, TransportContext? context) => 382public Task CopyToAsync(Stream stream, TransportContext? context, CancellationToken cancellationToken) 392return Task.FromException(GetStreamCopyException(e)); 395static async Task WaitAsync(ValueTask copyTask) 415Task task = SerializeToStreamAsync(stream, context, cancellationToken); 470public Task LoadIntoBufferAsync() => 476public Task LoadIntoBufferAsync(long maxBufferSize) => 479internal Task LoadIntoBufferAsync(CancellationToken cancellationToken) => 482internal Task LoadIntoBufferAsync(long maxBufferSize, CancellationToken cancellationToken) 489return Task.CompletedTask; 495return Task.FromException(error!); 500Task task = SerializeToStreamAsync(tempBuffer, null, cancellationToken); 506return Task.FromException(GetStreamCopyException(e)); 511private async Task LoadIntoBufferAsyncCore(Task serializeToStreamTask, MemoryStream tempBuffer) 692private void CheckTaskNotNull(Task task) 831private static async Task<TResult> WaitAndReturnAsync<TState, TResult>(Task waitTask, TState state, Func<TState, TResult> returnFunc) 873public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 896public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) 1023public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 1026return Task.CompletedTask; 1050public override Task FlushAsync(CancellationToken cancellationToken) => Task.CompletedTask;
System\Net\Http\MultipartContent.cs (6)
191protected override Task SerializeToStreamAsync(Stream stream, TransportContext? context) => 194protected override Task SerializeToStreamAsync(Stream stream, TransportContext? context, CancellationToken cancellationToken) => 200private protected async Task SerializeToStreamAsyncCore(Stream stream, TransportContext? context, CancellationToken cancellationToken) 629public override Task FlushAsync(CancellationToken cancellationToken) => Task.CompletedTask; 634public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) { throw new NotSupportedException(); }
System\Net\Http\MultipartFormDataContent.cs (1)
66protected override Task SerializeToStreamAsync(Stream stream, TransportContext? context, CancellationToken cancellationToken) =>
System\Net\Http\ReadOnlyMemoryContent.cs (3)
22protected override Task SerializeToStreamAsync(Stream stream, TransportContext? context) => 25protected override Task SerializeToStreamAsync(Stream stream, TransportContext? context, CancellationToken cancellationToken) => 38Task.FromResult<Stream>(new ReadOnlyMemoryStream(_content));
System\Net\Http\SocketsHttpHandler\ChunkedEncodingReadStream.cs (4)
244public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) 249cancellationToken.IsCancellationRequested ? Task.FromCanceled(cancellationToken) : 250_connection == null ? Task.CompletedTask : 254private async Task CopyToAsyncCore(Stream destination, CancellationToken cancellationToken)
System\Net\Http\SocketsHttpHandler\ChunkedEncodingWriteStream.cs (2)
76public override Task FinishAsync(bool async) 89return Task.CompletedTask;
System\Net\Http\SocketsHttpHandler\ConnectionCloseReadStream.cs (7)
90public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) 96return Task.FromCanceled(cancellationToken); 103return Task.CompletedTask; 106Task copyTask = connection.CopyToUntilEofAsync(destination, async: true, bufferSize, cancellationToken); 110return Task.CompletedTask; 116private async Task CompleteCopyToAsync(Task copyTask, HttpConnection connection, CancellationToken cancellationToken)
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.cs (1)
965Task.Factory.StartNew(static s => ((List<HttpConnectionBase>)s!).ForEach(c => c.Dispose()), toDispose,
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.Http1.cs (2)
215private async Task InjectNewHttp11ConnectionAsync(RequestQueue<HttpConnection>.QueueItem queueItem) 221await Task.CompletedTask.ConfigureAwait(ConfigureAwaitOptions.ForceYielding);
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.Http2.cs (4)
172private async Task InjectNewHttp2ConnectionAsync(RequestQueue<Http2Connection?>.QueueItem queueItem) 178await Task.CompletedTask.ConfigureAwait(ConfigureAwaitOptions.ForceYielding); 290private async Task HandleHttp11Downgrade(HttpRequestMessage request, Stream stream, TransportContext? transportContext, IPEndPoint? remoteEndPoint, CancellationToken cancellationToken) 504async Task DisableHttp2ConnectionAsync(Http2Connection connection)
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.Http3.cs (2)
419_ = Task.Delay(AltSvcBlocklistTimeoutInMilliseconds, altSvcBlocklistTimerCt) 431_ = Task.Delay(AltSvcBlocklistTimeoutInMilliseconds, altSvcBlocklistTimerCt)
System\Net\Http\SocketsHttpHandler\ContentLengthReadStream.cs (7)
119public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) 125return Task.FromCanceled(cancellationToken); 131return Task.CompletedTask; 134Task copyTask = _connection.CopyToContentLengthAsync(destination, async: true, _contentBytesRemaining, bufferSize, cancellationToken); 138return Task.CompletedTask; 144private async Task CompleteCopyToAsync(Task copyTask, CancellationToken cancellationToken)
System\Net\Http\SocketsHttpHandler\ContentLengthWriteStream.cs (3)
50public override Task FinishAsync(bool async) 54return Task.FromException(new HttpRequestException(SR.Format(SR.net_http_request_content_length_mismatch, BytesWritten, _contentLength))); 58return Task.CompletedTask;
System\Net\Http\SocketsHttpHandler\DecompressionHandler.cs (5)
143protected override Task SerializeToStreamAsync(Stream stream, TransportContext? context) => 146protected override async Task SerializeToStreamAsync(Stream stream, TransportContext? context, CancellationToken cancellationToken) 289public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) 293async Task Core(Stream destination, int bufferSize, CancellationToken cancellationToken) 401public override async Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken)
System\Net\Http\SocketsHttpHandler\Http2Connection.cs (18)
349return Task.FromResult(false); 354return Task.FromResult(true); 377private async Task FlushOutgoingBytesAsync() 469private async Task ProcessIncomingFramesAsync() 1124internal Task FlushAsync(CancellationToken cancellationToken) => 1172private Task PerformWriteAsync<T>(int writeBytes, T state, Func<T, Memory<byte>, bool> writeAction, CancellationToken cancellationToken = default) 1180return Task.FromException(GetRequestAbortedException(_abortException)); 1187return Task.FromException(new ObjectDisposedException(nameof(Http2Connection))); 1193private async Task ProcessOutgoingFramesAsync() 1274private Task SendSettingsAckAsync() => 1286private Task SendPingAsync(long pingContent, bool isAck = false) => 1300private Task SendRstStreamAsync(int streamId, Http2ProtocolErrorCode errorCode) => 1693private async Task SendStreamDataAsync(int streamId, ReadOnlyMemory<byte> buffer, bool finalFlush, CancellationToken cancellationToken) 1740private Task SendEndStreamAsync(int streamId) => 1750private Task SendWindowUpdateAsync(int streamId, int amount) 2010Task requestBodyTask = http2Stream.SendRequestBodyAsync(requestBodyCancellationToken); 2013Task responseHeadersTask = http2Stream.ReadResponseHeadersAsync(cancellationToken); 2026await Task.WhenAny(requestBodyTask, responseHeadersTask).ConfigureAwait(false) == requestBodyTask ||
System\Net\Http\SocketsHttpHandler\Http2Stream.cs (11)
176public async Task SendRequestBodyAsync(CancellationToken cancellationToken) 1050public async Task ReadResponseHeadersAsync(CancellationToken cancellationToken) 1222public async Task CopyToAsync(HttpResponseMessage responseMessage, Stream destination, int bufferSize, CancellationToken cancellationToken) 1529public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) => Task.FromException(new NotSupportedException(SR.net_http_content_writeonly_stream)); 1629public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) 1634http2Stream is null ? Task.FromException<int>(ExceptionDispatchInfo.SetCurrentStackTrace(new ObjectDisposedException(nameof(Http2ReadStream)))) : 1635cancellationToken.IsCancellationRequested ? Task.FromCanceled<int>(cancellationToken) : 1652public override Task FlushAsync(CancellationToken cancellationToken) 1656return Task.FromCanceled(cancellationToken); 1663return Task.CompletedTask;
System\Net\Http\SocketsHttpHandler\Http2StreamWindowManager.cs (2)
81Task sendWindowUpdateTask = connection.SendWindowUpdateAsync(stream.StreamId, windowUpdateIncrement); 130Task sendWindowUpdateTask = connection.SendWindowUpdateAsync(stream.StreamId, windowUpdateIncrement);
System\Net\Http\SocketsHttpHandler\Http3Connection.cs (6)
26private Task? _connectionClosedTask; 36private Task _sendSettingsTask; 379private async Task SendSettingsAsync() 428private async Task AcceptStreamsAsync() 473private async Task ProcessServerStreamAsync(QuicStream stream) 612private async Task ProcessServerControlStreamAsync(QuicStream stream, ArrayBuffer buffer)
System\Net\Http\SocketsHttpHandler\Http3RequestStream.cs (8)
161Task sendRequestTask; 168sendRequestTask = Task.CompletedTask; 173Task readResponseTask = ReadResponseAsync(_requestBodyCancellationSource.Token); 181await Task.WhenAny(sendRequestTask, readResponseTask).ConfigureAwait(false) == sendRequestTask || 330private async Task ReadResponseAsync(CancellationToken cancellationToken) 360private async Task SendContentAsync(HttpContent content, CancellationToken cancellationToken) 1471public override Task FlushAsync(CancellationToken cancellationToken) 1477return Task.FromException(new ObjectDisposedException(nameof(Http3WriteStream)));
System\Net\Http\SocketsHttpHandler\HttpConnection.cs (7)
505Task? sendRequestContentTask = null; 725Task sendTask = sendRequestContentTask; 956private async Task SendRequestContentWithExpect100ContinueAsync( 1839private Task CopyToUntilEofAsync(Stream destination, bool async, int bufferSize, CancellationToken cancellationToken) 1854return Task.CompletedTask; 1857private async Task CopyToUntilEofWithExistingBufferedDataAsync(Stream destination, bool async, int bufferSize, CancellationToken cancellationToken) 1875private async Task CopyToContentLengthAsync(Stream destination, bool async, ulong length, int bufferSize, CancellationToken cancellationToken)
System\Net\Http\SocketsHttpHandler\HttpConnectionBase.cs (2)
190internal void LogExceptions(Task task) 205static void LogFaulted(HttpConnectionBase connection, Task task)
System\Net\Http\SocketsHttpHandler\HttpConnectionResponseContent.cs (4)
48protected sealed override Task SerializeToStreamAsync(Stream stream, TransportContext? context) => 51protected sealed override Task SerializeToStreamAsync(Stream stream, TransportContext? context, CancellationToken cancellationToken) 56async Task Impl(Stream stream, CancellationToken cancellationToken) 76Task.FromResult<Stream>(ConsumeStream());
System\Net\Http\SocketsHttpHandler\HttpContentReadStream.cs (1)
72private async Task DrainOnDisposeAsync()
System\Net\Http\SocketsHttpHandler\HttpContentWriteStream.cs (3)
26public sealed override Task FlushAsync(CancellationToken ignored) 38public sealed override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) => throw new NotSupportedException(); 40public abstract Task FinishAsync(bool async);
System\Net\Http\SocketsHttpHandler\RawConnectionStream.cs (11)
92public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) 98return Task.FromCanceled(cancellationToken); 105return Task.CompletedTask; 108Task copyTask = connection.CopyToUntilEofAsync(destination, async: true, bufferSize, cancellationToken); 112return Task.CompletedTask; 118private async Task CompleteCopyToAsync(Task copyTask, HttpConnection connection, CancellationToken cancellationToken) 190public override Task FlushAsync(CancellationToken cancellationToken) 194return Task.FromCanceled(cancellationToken); 200return Task.CompletedTask; 209private static async Task WaitWithConnectionCancellationAsync(ValueTask task, HttpConnection connection, CancellationToken cancellationToken)
System\Net\Http\SocketsHttpHandler\SocketsHttpHandler.cs (2)
597return Task.FromCanceled<HttpResponseMessage>(cancellationToken); 605return Task.FromException<HttpResponseMessage>(error);
System\Net\Http\StreamContent.cs (7)
56protected override Task SerializeToStreamAsync(Stream stream, TransportContext? context) => 59protected override Task SerializeToStreamAsync(Stream stream, TransportContext? context, CancellationToken cancellationToken) => 65private Task SerializeToStreamAsyncCore(Stream stream, CancellationToken cancellationToken) 110return Task.FromResult<Stream>(new ReadOnlyStream(_content)); 157public override Task FlushAsync(CancellationToken cancellationToken) => Task.CompletedTask; 177public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) =>
System\Net\Http\StreamToStreamCopy.cs (6)
50public static Task CopyAsync(Stream source, Stream destination, int bufferSize, bool disposeSource, CancellationToken cancellationToken = default(CancellationToken)) 58Task copyTask = bufferSize == 0 ? 71return Task.CompletedTask; 80static async Task DisposeSourceAsync(Task copyTask, Stream source) 91return Task.FromException(e);
System\Net\Http\StringContent.cs (1)
81protected override Task SerializeToStreamAsync(Stream stream, TransportContext? context, CancellationToken cancellationToken) =>
System.Net.Http.Json (5)
System\Net\Http\Json\JsonContent.cs (3)
96protected override Task SerializeToStreamAsync(Stream stream, TransportContext? context) 105private Task SerializeToStreamAsyncCore(Stream targetStream, CancellationToken cancellationToken) 114private async Task SerializeToStreamAsyncTranscoding(Stream targetStream, bool async, Encoding targetEncoding, CancellationToken cancellationToken)
System\Net\Http\Json\JsonContent.netcoreapp.cs (1)
26protected override Task SerializeToStreamAsync(Stream stream, TransportContext? context, CancellationToken cancellationToken)
System\Net\Http\Json\LengthLimitReadStream.cs (1)
86public override Task FlushAsync(CancellationToken cancellationToken) => _innerStream.FlushAsync(cancellationToken);
System.Net.HttpListener (11)
src\libraries\Common\src\System\Net\LazyAsyncResult.cs (1)
368Task.Factory.StartNew(
System\Net\HttpListener.cs (1)
292return Task.Factory.FromAsync(
System\Net\HttpListenerRequest.cs (1)
256return Task.Factory.FromAsync(
System\Net\HttpRequestStream.cs (2)
40public override Task FlushAsync(CancellationToken cancellationToken) => Task.CompletedTask;
System\Net\HttpResponseStream.cs (2)
20public override Task FlushAsync(CancellationToken cancellationToken) => Task.CompletedTask;
System\Net\Managed\HttpResponseStream.Managed.cs (3)
92internal async Task WriteWebSocketHandshakeHeadersAsync() 157internal Task InternalWriteAsync(byte[] buffer, int offset, int count) => 160private async Task InternalWriteIgnoreErrorsAsync(byte[] buffer, int offset, int count)
System\Net\Managed\HttpStreamAsyncResult.cs (1)
75Task.Run(() => _callback(this));
System.Net.Mail (19)
src\libraries\Common\src\System\Net\LazyAsyncResult.cs (1)
368Task.Factory.StartNew(
src\libraries\Common\src\System\Net\TlsStream.cs (1)
66public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
System\Net\Base64Stream.cs (3)
164public override async Task FlushAsync(CancellationToken cancellationToken) 260public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 265async Task WriteAsyncCore(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
System\Net\BufferedReadStream.cs (1)
80return Task.FromResult<int>(read);
System\Net\DelegatedStream.cs (2)
126public override Task FlushAsync(CancellationToken cancellationToken) 179public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
System\Net\Mail\SmtpClient.cs (5)
712public Task SendMailAsync(string from, string recipients, string? subject, string? body) 718public Task SendMailAsync(MailMessage message) 723public Task SendMailAsync(string from, string recipients, string? subject, string? body, CancellationToken cancellationToken) 729public Task SendMailAsync(MailMessage message, CancellationToken cancellationToken) 733return Task.FromCanceled(cancellationToken);
System\Net\Mime\QEncodedStream.cs (3)
197public override async Task FlushAsync(CancellationToken cancellationToken) 236public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 241async Task WriteAsyncCore(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
System\Net\Mime\QuotedPrintableStream.cs (3)
312public override async Task FlushAsync(CancellationToken cancellationToken) 351public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 356async Task WriteAsyncCore(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
System.Net.NameResolution (19)
System\Net\Dns.cs (18)
489private static Task GetHostEntryOrAddressesCoreAsync(string hostName, bool justReturnParsedIp, bool throwOnIIPAny, bool justAddresses, AddressFamily family, CancellationToken cancellationToken) 495return justAddresses ? (Task) 496Task.FromCanceled<IPAddress[]>(cancellationToken) : 497Task.FromCanceled<IPHostEntry>(cancellationToken); 513return justAddresses ? (Task) 514Task.FromResult(family == AddressFamily.Unspecified || ipAddress.AddressFamily == family ? new[] { ipAddress } : Array.Empty<IPAddress>()) : 515Task.FromResult(CreateHostEntryForAddress(ipAddress)); 532Task? t; 583Task? task = NameResolutionPal.GetAddrInfoAsync(hostName, justAddresses, addressFamily, cancellationToken); 594static async Task<T> CompleteAsync(Task task, string hostName, long startingTimestamp) 641private static readonly Dictionary<object, Task> s_tasks = new Dictionary<object, Task>(); 663s_tasks.TryGetValue(key, out Task? prevTask); 664prevTask ??= Task.CompletedTask; 683((ICollection<KeyValuePair<object, Task>>)s_tasks).Remove(new KeyValuePair<object, Task>(key!, task!)); 696((ICollection<KeyValuePair<object, Task>>)s_tasks).Remove(new KeyValuePair<object, Task>(key!, task));
System\Net\NameResolutionPal.Unix.cs (1)
19internal static Task? GetAddrInfoAsync(string hostName, bool justAddresses, AddressFamily family, CancellationToken cancellationToken) =>
System.Net.NetworkInformation (3)
System\Net\NetworkInformation\NetworkAddressChange.Unix.cs (2)
183private static async Task ReadEventsAsync(Socket socket) 185await Task.CompletedTask.ConfigureAwait(ConfigureAwaitOptions.ForceYielding);
System\Net\NetworkInformation\UnixIPGlobalProperties.cs (1)
56return Task.Factory.StartNew(s => ((UnixIPGlobalProperties)s!).GetUnicastAddresses(), this,
System.Net.Quic (15)
System\Net\Quic\Internal\ResettableValueTaskSource.cs (4)
123/// Gets a <see cref="Task"/> that will transition to a completed state with the last transition of this source, i.e. into <see cref="State.Completed"/>. 125/// <returns>The <see cref="Task"/> that will transition to a completed state with the last transition of this source.</returns> 126public Task GetFinalTask(object? keepAlive) 309public Task GetTask(object? keepAlive)
System\Net\Quic\QuicConnection.SslConnectionOptions.cs (1)
121await Task.CompletedTask.ConfigureAwait(ConfigureAwaitOptions.ForceYielding);
System\Net\Quic\QuicListener.cs (1)
215await Task.CompletedTask.ConfigureAwait(ConfigureAwaitOptions.ForceYielding);
System\Net\Quic\QuicStream.cs (6)
46/// <description>A <see cref="Task"/> that will get completed when the stream writing side has been closed (gracefully or abortively).</description> 50/// <description>A <see cref="Task"/> that will get completed when the stream reading side has been closed (gracefully or abortively).</description> 134/// A <see cref="Task"/> that will get completed once reading side has been closed. 139public Task ReadsClosed => _receiveTcs.GetFinalTask(this); 142/// A <see cref="Task"/> that will get completed once writing side has been closed. 148public Task WritesClosed => _sendTcs.GetFinalTask(this);
System\Net\Quic\QuicStream.Stream.cs (3)
201public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken = default) 214public override Task FlushAsync(CancellationToken cancellationToken = default) 216=> Task.CompletedTask;
System.Net.Requests (21)
src\libraries\Common\src\System\Net\LazyAsyncResult.cs (1)
368Task.Factory.StartNew(
src\libraries\Common\src\System\Net\TlsStream.cs (1)
66public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
System\Net\FileWebRequest.cs (6)
158Task<Stream> t = Task.Factory.StartNew<Stream>(s => ((FileWebRequest)s!).CreateWriteStream(), 166return Task.Factory.StartNew<Stream>(s => 219Task<WebResponse> t = Task.Factory.StartNew(s => ((FileWebRequest)s!).CreateResponse(), 227return Task.Factory.StartNew(s => 434public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 448public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken)
System\Net\HttpWebRequest.cs (1)
1229Task.FromResult(_httpClient.Send(_sendRequestMessage, completionOption, _sendRequestCts.Token));
System\Net\NetworkStreamWrapper.cs (2)
203public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 218public override Task FlushAsync(CancellationToken cancellationToken)
System\Net\RequestBufferingStream.cs (4)
27public override Task FlushAsync(CancellationToken cancellationToken) 32Task.FromCanceled(cancellationToken) : 33Task.CompletedTask; 78public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
System\Net\RequestStream.cs (2)
54public override Task FlushAsync(CancellationToken cancellationToken) 102public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
System\Net\RequestStreamContent.cs (2)
14protected override Task SerializeToStreamAsync(Stream stream, TransportContext? context) 18protected override async Task SerializeToStreamAsync(Stream stream, TransportContext? context, CancellationToken cancellationToken)
System\Net\WebRequest.cs (2)
519await Task.CompletedTask.ConfigureAwait(ConfigureAwaitOptions.ForceYielding); 530await Task.CompletedTask.ConfigureAwait(ConfigureAwaitOptions.ForceYielding);
System.Net.Security (54)
src\libraries\Common\src\System\Net\Http\X509ResourceClient.cs (5)
66await ((Task)task).ConfigureAwait(ConfigureAwaitOptions.SuppressThrowing); 173Task sendTask = (Task)sendAsyncMethod.Invoke(httpClient, new object[] { requestMessage, cancellationToken })!; 217Task sendTask = (Task)sendAsyncMethod.Invoke(httpClient, new object[] { requestMessage, cancellationToken })!;
System\Net\Security\NegotiateStream.cs (17)
180public virtual Task AuthenticateAsClientAsync() => 183public virtual Task AuthenticateAsClientAsync(NetworkCredential credential, string targetName) => 186public virtual Task AuthenticateAsClientAsync( 192public virtual Task AuthenticateAsClientAsync(NetworkCredential credential, ChannelBinding? binding, string targetName) => 195public virtual Task AuthenticateAsClientAsync( 203public virtual Task AuthenticateAsServerAsync() => 206public virtual Task AuthenticateAsServerAsync(ExtendedProtectionPolicy? policy) => 209public virtual Task AuthenticateAsServerAsync(NetworkCredential credential, ProtectionLevel requiredProtectionLevel, TokenImpersonationLevel requiredImpersonationLevel) => 212public virtual Task AuthenticateAsServerAsync( 296public override Task FlushAsync(CancellationToken cancellationToken) => 477/// <returns>A <see cref="Task"/> that represents the asynchronous read operation.</returns> 478public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 503private async Task WriteAsync<TIOAdapter>(ReadOnlyMemory<byte> buffer, CancellationToken cancellationToken) 721private async Task AuthenticateAsync<TIOAdapter>(CancellationToken cancellationToken) 750private async Task SendBlobAsync<TIOAdapter>(byte[]? message, CancellationToken cancellationToken) 859private async Task ReceiveBlobAsync<TIOAdapter>(CancellationToken cancellationToken) 919private async Task SendAuthResetSignalAndThrowAsync<TIOAdapter>(byte[] message, Exception exception, CancellationToken cancellationToken)
System\Net\Security\ReadWriteAdapter.cs (8)
15static abstract Task FlushAsync(Stream stream, CancellationToken cancellationToken); 16static abstract Task WaitAsync(TaskCompletionSource<bool> waiter); 30public static Task FlushAsync(Stream stream, CancellationToken cancellationToken) => stream.FlushAsync(cancellationToken); 32public static Task WaitAsync(TaskCompletionSource<bool> waiter) => waiter.Task; 49public static Task FlushAsync(Stream stream, CancellationToken cancellationToken) 52return Task.CompletedTask; 55public static Task WaitAsync(TaskCompletionSource<bool> waiter) 58return Task.CompletedTask;
System\Net\Security\SslStream.cs (14)
374public virtual Task AuthenticateAsClientAsync(string targetHost) => AuthenticateAsClientAsync(targetHost, null, false); 376public virtual Task AuthenticateAsClientAsync(string targetHost, X509CertificateCollection? clientCertificates, bool checkCertificateRevocation) => AuthenticateAsClientAsync(targetHost, clientCertificates, SecurityProtocol.SystemDefaultSecurityProtocols, checkCertificateRevocation); 378public virtual Task AuthenticateAsClientAsync(string targetHost, X509CertificateCollection? clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation) 392public Task AuthenticateAsClientAsync(SslClientAuthenticationOptions sslClientAuthenticationOptions, CancellationToken cancellationToken = default) 401public virtual Task AuthenticateAsServerAsync(X509Certificate serverCertificate) => 404public virtual Task AuthenticateAsServerAsync(X509Certificate serverCertificate, bool clientCertificateRequired, bool checkCertificateRevocation) 417public virtual Task AuthenticateAsServerAsync(X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation) 431public Task AuthenticateAsServerAsync(SslServerAuthenticationOptions sslServerAuthenticationOptions, CancellationToken cancellationToken = default) 438public Task AuthenticateAsServerAsync(ServerOptionsSelectionCallback optionsCallback, object? state, CancellationToken cancellationToken = default) 445public virtual Task ShutdownAsync() 456return Task.CompletedTask; 680public override Task FlushAsync(CancellationToken cancellationToken) => InnerStream.FlushAsync(cancellationToken); 685public virtual Task NegotiateClientCertificateAsync(CancellationToken cancellationToken = default) 860public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
System\Net\Security\SslStream.IO.cs (8)
105private Task ProcessAuthenticationAsync(bool isAsync = false, CancellationToken cancellationToken = default) 121private async Task ProcessAuthenticationWithTelemetryAsync(bool isAsync, CancellationToken cancellationToken) 128Task task = isAsync ? 150private async Task ReplyOnReAuthenticationAsync<TIOAdapter>(byte[]? buffer, CancellationToken cancellationToken) 165private async Task RenegotiateAsync<TIOAdapter>(CancellationToken cancellationToken) 254private async Task ForceAuthenticationAsync<TIOAdapter>(bool receiveFirst, byte[]? reAuthenticationData, CancellationToken cancellationToken) 614Task waiterTask = TIOAdapter.WaitAsync(waiter); 643async ValueTask WaitAndWriteAsync(ReadOnlyMemory<byte> buffer, Task waitTask, CancellationToken cancellationToken)
System\Net\Security\SslStreamCertificateContext.Linux.cs (1)
263return Task.FromResult<byte[]?>(null);
System\Net\StreamFramer.cs (1)
69public async Task WriteMessageAsync<TAdapter>(Stream stream, byte[] message, CancellationToken cancellationToken)
System.Net.Sockets (23)
System\Net\Sockets\NetworkStream.cs (3)
598public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 647public override Task FlushAsync(CancellationToken cancellationToken) 649return Task.CompletedTask;
System\Net\Sockets\Socket.cs (2)
2504((Task)ti).ConfigureAwait(ConfigureAwaitOptions.SuppressThrowing).GetAwaiter().GetResult(); 3881private static SocketError GetSocketErrorFromFaultedTask(Task t)
System\Net\Sockets\Socket.Tasks.cs (6)
78public Task ConnectAsync(EndPoint remoteEP) => ConnectAsync(remoteEP, default).AsTask(); 135public Task ConnectAsync(IPAddress address, int port) => ConnectAsync(new IPEndPoint(address, port)); 152public Task ConnectAsync(IPAddress[] addresses, int port) => ConnectAsync(addresses, port, CancellationToken.None).AsTask(); 229public Task ConnectAsync(string host, int port) => ConnectAsync(host, port, default).AsTask(); 879t = Task.FromResult(fromNetworkStream & !isReceive ? 0 : saea.BytesTransferred); 883t = Task.FromException<int>(GetException(saea.SocketError, wrapExceptionsInIOExceptions: fromNetworkStream));
System\Net\Sockets\SocketAsyncEventArgs.cs (1)
678async Task Core(MultiConnectSocketAsyncEventArgs internalArgs, Task<IPAddress[]> addressesTask, int port, SocketType socketType, ProtocolType protocolType, CancellationToken cancellationToken)
System\Net\Sockets\SocketPal.Unix.cs (1)
1923public static async Task SendPacketsAsync(
System\Net\Sockets\SocketTaskExtensions.cs (4)
22public static Task ConnectAsync(this Socket socket, EndPoint remoteEP) => 28public static Task ConnectAsync(this Socket socket, IPAddress address, int port) => 34public static Task ConnectAsync(this Socket socket, IPAddress[] addresses, int port) => 40public static Task ConnectAsync(this Socket socket, string host, int port) =>
System\Net\Sockets\TCPClient.cs (6)
174public Task ConnectAsync(IPAddress address, int port) => 177public Task ConnectAsync(string host, int port) => 180public Task ConnectAsync(IPAddress[] addresses, int port) => 188public Task ConnectAsync(IPEndPoint remoteEP) => 191private async Task CompleteConnectAsync(Task task)
System.Net.WebClient (12)
src\libraries\Common\src\System\IO\ChunkedMemoryStream.cs (5)
63public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 67return Task.FromCanceled(cancellationToken); 71return Task.CompletedTask; 113public override Task FlushAsync(CancellationToken cancellationToken) => Task.CompletedTask;
src\libraries\Common\src\System\IO\DelegatingStream.cs (3)
130public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) 144public override Task FlushAsync(CancellationToken cancellationToken) 169public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
src\libraries\Common\src\System\Threading\Tasks\RendezvousAwaitable.cs (2)
113Task.Run(c); 131Task.Run(continuation);
System\Net\WebClient.cs (2)
1672public Task DownloadFileTaskAsync(string address, string fileName) => 1675public Task DownloadFileTaskAsync(Uri address, string fileName)
System.Net.WebSockets (20)
System\Net\WebSockets\AsyncMutex.cs (5)
52public Task EnterAsync(CancellationToken cancellationToken) 58cancellationToken.IsCancellationRequested ? Task.FromCanceled(cancellationToken) : 59Interlocked.Decrement(ref _gate) >= 0 ? Task.CompletedTask : 66Task Contended(CancellationToken cancellationToken) 87return Task.CompletedTask;
System\Net\WebSockets\ManagedWebSocket.cs (12)
231Task lockTask = mutex.EnterAsync(CancellationToken.None); 257public override Task SendAsync(ArraySegment<byte> buffer, WebSocketMessageType messageType, bool endOfMessage, CancellationToken cancellationToken) 291return new ValueTask(Task.FromException(exc)); 330return Task.FromException<WebSocketReceiveResult>(exc); 348public override Task CloseAsync(WebSocketCloseStatus closeStatus, string? statusDescription, CancellationToken cancellationToken) 358return Task.FromException(exc); 364public override Task CloseOutputAsync(WebSocketCloseStatus closeStatus, string? statusDescription, CancellationToken cancellationToken) 370private async Task CloseOutputAsyncCore(WebSocketCloseStatus closeStatus, string? statusDescription, CancellationToken cancellationToken) 419Task lockTask = _sendMutex.EnterAsync(cancellationToken); 469return new ValueTask(Task.FromException( 509private async ValueTask SendFrameFallbackAsync(MessageOpcode opcode, bool endOfMessage, bool disableCompression, ReadOnlyMemory<byte> payloadBuffer, Task lockTask, CancellationToken cancellationToken) 1267private async Task CloseAsyncPrivate(WebSocketCloseStatus closeStatus, string? statusDescription, CancellationToken cancellationToken)
System\Net\WebSockets\WebSocket.cs (3)
21public abstract Task CloseAsync(WebSocketCloseStatus closeStatus, 24public abstract Task CloseOutputAsync(WebSocketCloseStatus closeStatus, 30public abstract Task SendAsync(ArraySegment<byte> buffer,
System.Net.WebSockets.Client (7)
System\Net\WebSockets\ClientWebSocket.cs (6)
82public Task ConnectAsync(Uri uri, CancellationToken cancellationToken) 94public Task ConnectAsync(Uri uri, HttpMessageInvoker? invoker, CancellationToken cancellationToken) 124private async Task ConnectAsyncCore(Uri uri, HttpMessageInvoker? invoker, CancellationToken cancellationToken) 145public override Task SendAsync(ArraySegment<byte> buffer, WebSocketMessageType messageType, bool endOfMessage, CancellationToken cancellationToken) => 160public override Task CloseAsync(WebSocketCloseStatus closeStatus, string? statusDescription, CancellationToken cancellationToken) => 163public override Task CloseOutputAsync(WebSocketCloseStatus closeStatus, string? statusDescription, CancellationToken cancellationToken) =>
System\Net\WebSockets\WebSocketHandle.Managed.cs (1)
49public async Task ConnectAsync(Uri uri, HttpMessageInvoker? invoker, CancellationToken cancellationToken, ClientWebSocketOptions options)
System.Private.CoreLib (1535)
src\libraries\Common\src\System\Threading\Tasks\TaskToAsyncResult.cs (14)
9/// Provides methods for using <see cref="Task"/> to implement the Asynchronous Programming Model 19/// <summary>Creates a new <see cref="IAsyncResult"/> from the specified <see cref="Task"/>, optionally invoking <paramref name="callback"/> when the task has completed.</summary> 20/// <param name="task">The <see cref="Task"/> to be wrapped in an <see cref="IAsyncResult"/>.</param> 30/// implementing all of the core asynchronous logic via <see cref="Task"/>s and then easily implementing Begin/End methods around that functionality. 32public static IAsyncResult Begin(Task task, AsyncCallback? callback, object? state) 46/// <summary>Waits for the <see cref="Task"/> wrapped by the <see cref="IAsyncResult"/> returned by <see cref="Begin"/> to complete.</summary> 50/// <remarks>This will propagate any exception stored in the wrapped <see cref="Task"/>.</remarks> 64/// <summary>Extracts the underlying <see cref="Task"/> from an <see cref="IAsyncResult"/> created by <see cref="Begin"/>.</summary> 66/// <returns>The <see cref="Task"/> wrapped by the <see cref="IAsyncResult"/>.</returns> 69public static Task Unwrap(IAsyncResult asyncResult) 80if ((asyncResult as TaskAsyncResult)?._task is not Task task) 117/// <summary>Provides a simple <see cref="IAsyncResult"/> that wraps a <see cref="Task"/>.</summary> 126internal readonly Task _task; 134internal TaskAsyncResult(Task task, object? state, AsyncCallback? callback)
src\libraries\System.Private.CoreLib\src\System\CodeDom\Compiler\IndentedTextWriter.cs (29)
58public override Task FlushAsync() => _writer.FlushAsync(); 65/// <returns>A <see cref="Task"/> representing the asynchronous flush operation.</returns> 66public override Task FlushAsync(CancellationToken cancellationToken) => 67cancellationToken.IsCancellationRequested ? Task.FromCanceled(cancellationToken) : 86/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns> 87protected virtual async Task OutputTabsAsync() 193/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns> 194public override async Task WriteAsync(char value) 208/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns> 209public override async Task WriteAsync(char[] buffer, int index, int count) 220/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns> 221public override async Task WriteAsync(string? value) 233/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns> 234public override async Task WriteAsync(ReadOnlyMemory<char> buffer, CancellationToken cancellationToken = default) 246/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns> 247public override async Task WriteAsync(StringBuilder? value, CancellationToken cancellationToken = default) 262/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns> 263public Task WriteLineNoTabsAsync(string? s) 387public override async Task WriteLineAsync() 399/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns> 400public override async Task WriteLineAsync(char value) 414/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns> 415public override async Task WriteLineAsync(char[] buffer, int index, int count) 427/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns> 428public override async Task WriteLineAsync(string? value) 441/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns> 442public override async Task WriteLineAsync(ReadOnlyMemory<char> buffer, CancellationToken cancellationToken = default) 455/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns> 456public override async Task WriteLineAsync(StringBuilder? value, CancellationToken cancellationToken = default)
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventPipeEventDispatcher.cs (4)
30private Task? m_dispatchTask; 138Task? previousDispatchTask = m_dispatchTask; 139m_dispatchTask = Task.Factory.StartNew(() => DispatchEventsToEventListeners(sessionID, syncTimeUtc, syncTimeQPC, timeQPCFrequency, previousDispatchTask, m_dispatchTaskCancellationSource.Token), CancellationToken.None, TaskCreationOptions.LongRunning, TaskScheduler.Default); 158private unsafe void DispatchEventsToEventListeners(ulong sessionID, DateTime syncTimeUtc, long syncTimeQPC, long timeQPCFrequency, Task? previousDispatchTask, CancellationToken token)
src\libraries\System.Private.CoreLib\src\System\IO\BufferedStream.cs (14)
303public override Task FlushAsync(CancellationToken cancellationToken) 306return Task.FromCanceled<int>(cancellationToken); 313private async Task FlushAsyncInternal(CancellationToken cancellationToken) 579return Task.FromCanceled<int>(cancellationToken); 589Task semaphoreLockTask = sem.WaitAsync(cancellationToken); 612: Task.FromException<int>(error); 640Task semaphoreLockTask = sem.WaitAsync(cancellationToken); 672Memory<byte> buffer, CancellationToken cancellationToken, int bytesAlreadySatisfied, Task semaphoreLockTask) 997public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 1017Task semaphoreLockTask = sem.WaitAsync(cancellationToken); 1056ReadOnlyMemory<byte> buffer, CancellationToken cancellationToken, Task semaphoreLockTask) 1270public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) 1277Task.FromCanceled<int>(cancellationToken) : 1281private async Task CopyToAsyncCore(Stream destination, int bufferSize, CancellationToken cancellationToken)
src\libraries\System.Private.CoreLib\src\System\IO\File.cs (25)
731public static Task AppendAllBytesAsync(string path, byte[] bytes, CancellationToken cancellationToken = default(CancellationToken)) 737? Task.FromCanceled(cancellationToken) 740static async Task Core(string path, byte[] bytes, CancellationToken cancellationToken) 922? Task.FromCanceled<string>(cancellationToken) 959public static Task WriteAllTextAsync(string path, string? contents, CancellationToken cancellationToken = default(CancellationToken)) 962public static Task WriteAllTextAsync(string path, string? contents, Encoding encoding, CancellationToken cancellationToken = default(CancellationToken)) 968return Task.FromCanceled(cancellationToken); 978return Task.FromCanceled<byte[]>(cancellationToken); 989return Task.FromException<byte[]>(ExceptionDispatchInfo.SetCurrentStackTrace(new IOException(SR.IO_FileTooLong2GB))); 1063public static Task WriteAllBytesAsync(string path, byte[] bytes, CancellationToken cancellationToken = default(CancellationToken)) 1069? Task.FromCanceled(cancellationToken) 1072static async Task Core(string path, byte[] bytes, CancellationToken cancellationToken) 1087? Task.FromCanceled<string[]>(cancellationToken) 1111public static Task WriteAllLinesAsync(string path, IEnumerable<string> contents, CancellationToken cancellationToken = default(CancellationToken)) 1114public static Task WriteAllLinesAsync(string path, IEnumerable<string> contents, Encoding encoding, CancellationToken cancellationToken = default(CancellationToken)) => 1117private static Task WriteAllLinesAsync(string path, IEnumerable<string> contents, Encoding encoding, bool append, CancellationToken cancellationToken) 1123return Task.FromCanceled(cancellationToken); 1135return Task.FromException(e); 1141private static async Task InternalWriteAllLinesAsync(StreamWriter writer, IEnumerable<string> contents, CancellationToken cancellationToken) 1157public static Task AppendAllTextAsync(string path, string? contents, CancellationToken cancellationToken = default(CancellationToken)) 1160public static Task AppendAllTextAsync(string path, string? contents, Encoding encoding, CancellationToken cancellationToken = default(CancellationToken)) 1166return Task.FromCanceled(cancellationToken); 1172public static Task AppendAllLinesAsync(string path, IEnumerable<string> contents, CancellationToken cancellationToken = default(CancellationToken)) 1175public static Task AppendAllLinesAsync(string path, IEnumerable<string> contents, Encoding encoding, CancellationToken cancellationToken = default(CancellationToken)) => 1326private static async Task WriteToFileAsync(string path, FileMode mode, string? contents, Encoding encoding, CancellationToken cancellationToken)
src\libraries\System.Private.CoreLib\src\System\IO\FileStream.cs (9)
264public override Task FlushAsync(CancellationToken cancellationToken) 268return Task.FromCanceled(cancellationToken); 293return Task.FromCanceled<int>(cancellationToken); 336public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 342return Task.FromCanceled(cancellationToken); 539public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) 612internal Task BaseFlushAsync(CancellationToken cancellationToken) 625internal Task BaseWriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 634internal Task BaseCopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken)
src\libraries\System.Private.CoreLib\src\System\IO\MemoryStream.cs (19)
163public override Task FlushAsync(CancellationToken cancellationToken) 166return Task.FromCanceled(cancellationToken); 171return Task.CompletedTask; 175return Task.FromException(ex); 373return Task.FromCanceled<int>(cancellationToken); 382return Task.FromCanceled<int>(oce); 386return Task.FromException<int>(exception); 418return new ValueTask<int>(Task.FromCanceled<int>(oce)); 466public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) 482return Task.FromCanceled(cancellationToken); 493return Task.CompletedTask; 503return Task.CompletedTask; 507return Task.FromException(ex); 662public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 668return Task.FromCanceled(cancellationToken); 673return Task.CompletedTask; 677return Task.FromCanceled(oce); 681return Task.FromException(exception); 708return new ValueTask(Task.FromCanceled(oce));
src\libraries\System.Private.CoreLib\src\System\IO\Strategies\BufferedFileStreamStrategy.cs (11)
311Task semaphoreLockTask = semaphore.WaitAsync(cancellationToken); 391private async ValueTask<int> ReadAsyncSlowPath(Task semaphoreLockTask, Memory<byte> buffer, CancellationToken cancellationToken) 582public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 611Task semaphoreLockTask = semaphore.WaitAsync(cancellationToken); 674private async ValueTask WriteAsyncSlowPath(Task semaphoreLockTask, ReadOnlyMemory<byte> source, CancellationToken cancellationToken) 783public override Task FlushAsync(CancellationToken cancellationToken) 787return Task.FromCanceled<int>(cancellationToken); 795private async Task FlushAsyncInternal(CancellationToken cancellationToken) 832public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) 838Task.FromCanceled<int>(cancellationToken) : 842private async Task CopyToAsyncCore(Stream destination, int bufferSize, CancellationToken cancellationToken)
src\libraries\System.Private.CoreLib\src\System\IO\Strategies\DerivedFileStreamStrategy.cs (3)
125public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 141public override Task FlushAsync(CancellationToken cancellationToken) 147public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken)
src\libraries\System.Private.CoreLib\src\System\IO\Strategies\OSFileStreamStrategy.cs (3)
135public sealed override Task FlushAsync(CancellationToken cancellationToken) => Task.CompletedTask; // no buffering = nothing to flush 254public sealed override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) =>
src\libraries\System.Private.CoreLib\src\System\IO\Stream.cs (34)
79public Task CopyToAsync(Stream destination) => CopyToAsync(destination, GetCopyBufferSize()); 81public Task CopyToAsync(Stream destination, int bufferSize) => CopyToAsync(destination, bufferSize, CancellationToken.None); 83public Task CopyToAsync(Stream destination, CancellationToken cancellationToken) => CopyToAsync(destination, GetCopyBufferSize(), cancellationToken); 85public virtual Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) 100static async Task Core(Stream source, Stream destination, int bufferSize, CancellationToken cancellationToken) 189public Task FlushAsync() => FlushAsync(CancellationToken.None); 191public virtual Task FlushAsync(CancellationToken cancellationToken) => 192Task.Factory.StartNew( 218Task? semaphoreTask = null; 237var thisTask = Task.InternalCurrent as ReadWriteTask; 305Task.FromCanceled<int>(cancellationToken) : 484internal Task BeginWriteInternal( 500Task? semaphoreTask = null; 519var thisTask = Task.InternalCurrent as ReadWriteTask; 556private static void RunReadWriteTaskWhenReady(Task asyncWaiter, ReadWriteTask readWriteTask) 703void ITaskCompletionAction.Invoke(Task completingTask) 729public Task WriteAsync(byte[] buffer, int offset, int count) => WriteAsync(buffer, offset, count, CancellationToken.None); 731public virtual Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) => 735Task.FromCanceled(cancellationToken) : 750private static async Task FinishWriteAsync(Task writeTask, byte[] localBuffer) 762private Task BeginEndWriteAsync(byte[] buffer, int offset, int count) 1024public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) => 1026Task.FromCanceled(cancellationToken) : 1027Task.CompletedTask; 1036public override Task FlushAsync(CancellationToken cancellationToken) => 1038Task.FromCanceled(cancellationToken) : 1039Task.CompletedTask; 1048TaskToAsyncResult.Begin(Task.CompletedTask, callback, state); 1059Task.FromCanceled<int>(cancellationToken) : 1060Task.FromResult(0); 1073public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) => 1075Task.FromCanceled(cancellationToken) : 1076Task.CompletedTask;
src\libraries\System.Private.CoreLib\src\System\IO\StreamReader.cs (8)
76private Task _asyncReadTask = Task.CompletedTask; 1429public override Task<int> ReadAsync(char[] buffer, int index, int count) => Task.FromResult(0); 1438public override Task<int> ReadBlockAsync(char[] buffer, int index, int count) => Task.FromResult(0); 1445public override Task<string?> ReadLineAsync() => Task.FromResult<string?>(null); 1452public override Task<string> ReadToEndAsync() => Task.FromResult(""); 1455cancellationToken.IsCancellationRequested ? Task.FromCanceled<string>(cancellationToken) : Task.FromResult("");
src\libraries\System.Private.CoreLib\src\System\IO\StreamWriter.cs (59)
48private Task _asyncWriteTask = Task.CompletedTask; 656public override Task WriteAsync(char value) 670Task task = WriteAsyncInternal(value, appendNewLine: false); 676private async Task WriteAsyncInternal(char value, bool appendNewLine) 704public override Task WriteAsync(string? value) 720Task task = WriteAsyncInternal(value.AsMemory(), appendNewLine: false, default); 727return Task.CompletedTask; 731public override Task WriteAsync(char[] buffer, int index, int count) 754Task task = WriteAsyncInternal(new ReadOnlyMemory<char>(buffer, index, count), appendNewLine: false, cancellationToken: default); 760public override Task WriteAsync(ReadOnlyMemory<char> buffer, CancellationToken cancellationToken = default) 773return Task.FromCanceled(cancellationToken); 776Task task = WriteAsyncInternal(buffer, appendNewLine: false, cancellationToken: cancellationToken); 781private async Task WriteAsyncInternal(ReadOnlyMemory<char> source, bool appendNewLine, CancellationToken cancellationToken) 818public override Task WriteLineAsync() 832Task task = WriteAsyncInternal(ReadOnlyMemory<char>.Empty, appendNewLine: true, cancellationToken: default); 838public override Task WriteLineAsync(char value) 852Task task = WriteAsyncInternal(value, appendNewLine: true); 858public override Task WriteLineAsync(string? value) 877Task task = WriteAsyncInternal(value.AsMemory(), appendNewLine: true, default); 883public override Task WriteLineAsync(char[] buffer, int index, int count) 906Task task = WriteAsyncInternal(new ReadOnlyMemory<char>(buffer, index, count), appendNewLine: true, cancellationToken: default); 912public override Task WriteLineAsync(ReadOnlyMemory<char> buffer, CancellationToken cancellationToken = default) 924return Task.FromCanceled(cancellationToken); 927Task task = WriteAsyncInternal(buffer, appendNewLine: true, cancellationToken: cancellationToken); 933public override Task FlushAsync() 947/// <returns>A <see cref="Task"/> that represents the asynchronous flush operation.</returns> 948public override Task FlushAsync(CancellationToken cancellationToken) 954return Task.FromCanceled(cancellationToken); 965private Task FlushAsyncInternal(bool flushStream, bool flushEncoder, CancellationToken cancellationToken = default) 969return Task.FromCanceled(cancellationToken); 975return Task.CompletedTask; 980async Task Core(bool flushStream, bool flushEncoder, CancellationToken cancellationToken) 1034public override Task FlushAsync() => Task.CompletedTask; 1035public override Task FlushAsync(CancellationToken cancellationToken) => Task.CompletedTask; 1055public override Task WriteAsync(char value) => Task.CompletedTask; 1056public override Task WriteAsync(string? value) => Task.CompletedTask; 1057public override Task WriteAsync(StringBuilder? value, CancellationToken cancellationToken = default) => Task.CompletedTask; 1058public override Task WriteAsync(char[] buffer, int index, int count) => Task.CompletedTask; 1059public override Task WriteAsync(ReadOnlyMemory<char> buffer, CancellationToken cancellationToken = default) => Task.CompletedTask; 1080public override Task WriteLineAsync(char value) => Task.CompletedTask; 1081public override Task WriteLineAsync(string? value) => Task.CompletedTask; 1082public override Task WriteLineAsync(StringBuilder? value, CancellationToken cancellationToken = default) => Task.CompletedTask; 1083public override Task WriteLineAsync(char[] buffer, int index, int count) => Task.CompletedTask; 1084public override Task WriteLineAsync(ReadOnlyMemory<char> buffer, CancellationToken cancellationToken = default) => Task.CompletedTask; 1085public override Task WriteLineAsync() => Task.CompletedTask;
src\libraries\System.Private.CoreLib\src\System\IO\StringReader.cs (6)
216return Task.FromResult(ReadLine()); 254return Task.FromResult(ReadToEnd()); 284? Task.FromCanceled<string>(cancellationToken) 285: Task.FromResult(ReadToEnd()); 298return Task.FromResult(ReadBlock(buffer, index, count)); 316return Task.FromResult(Read(buffer, index, count));
src\libraries\System.Private.CoreLib\src\System\IO\StringWriter.cs (26)
198public override Task WriteAsync(char value) 201return Task.CompletedTask; 204public override Task WriteAsync(string? value) 207return Task.CompletedTask; 210public override Task WriteAsync(char[] buffer, int index, int count) 213return Task.CompletedTask; 216public override Task WriteAsync(ReadOnlyMemory<char> buffer, CancellationToken cancellationToken = default) 220return Task.FromCanceled(cancellationToken); 224return Task.CompletedTask; 227public override Task WriteAsync(StringBuilder? value, CancellationToken cancellationToken = default) 238return Task.FromCanceled(cancellationToken); 247return Task.CompletedTask; 250public override Task WriteLineAsync(char value) 253return Task.CompletedTask; 256public override Task WriteLineAsync(string? value) 259return Task.CompletedTask; 262public override Task WriteLineAsync(StringBuilder? value, CancellationToken cancellationToken = default) 273return Task.FromCanceled(cancellationToken); 283return Task.CompletedTask; 286public override Task WriteLineAsync(char[] buffer, int index, int count) 289return Task.CompletedTask; 292public override Task WriteLineAsync(ReadOnlyMemory<char> buffer, CancellationToken cancellationToken = default) 296return Task.FromCanceled(cancellationToken); 300return Task.CompletedTask; 303public override Task FlushAsync() 305return Task.CompletedTask;
src\libraries\System.Private.CoreLib\src\System\IO\TextReader.cs (6)
376public override Task<string?> ReadLineAsync() => Task.FromResult(ReadLine()); 383public override Task<string> ReadToEndAsync() => Task.FromResult(ReadToEnd()); 387=> cancellationToken.IsCancellationRequested ? Task.FromCanceled<string>(cancellationToken) : Task.FromResult(ReadToEnd()); 399return Task.FromResult(ReadBlock(buffer, index, count)); 412return Task.FromResult(Read(buffer, index, count));
src\libraries\System.Private.CoreLib\src\System\IO\TextWriter.CreateBroadcasting.cs (13)
103public override async Task FlushAsync() 111public override async Task FlushAsync(CancellationToken cancellationToken) 447public override async Task WriteAsync(char value) 455public override async Task WriteAsync(string? value) 463public override async Task WriteAsync(StringBuilder? value, CancellationToken cancellationToken = default) 471public override async Task WriteAsync(char[] buffer, int index, int count) 479public override async Task WriteAsync(ReadOnlyMemory<char> buffer, CancellationToken cancellationToken = default) 487public override async Task WriteLineAsync(char value) 495public override async Task WriteLineAsync(string? value) 503public override async Task WriteLineAsync(StringBuilder? value, CancellationToken cancellationToken = default) 511public override async Task WriteLineAsync(char[] buffer, int index, int count) 519public override async Task WriteLineAsync(ReadOnlyMemory<char> buffer, CancellationToken cancellationToken = default) 527public override async Task WriteLineAsync()
src\libraries\System.Private.CoreLib\src\System\IO\TextWriter.cs (91)
538public virtual Task WriteAsync(char value) => 539Task.Factory.StartNew(static state => 545public virtual Task WriteAsync(string? value) => 546Task.Factory.StartNew(static state => 558public virtual Task WriteAsync(StringBuilder? value, CancellationToken cancellationToken = default) 561cancellationToken.IsCancellationRequested ? Task.FromCanceled(cancellationToken) : 562value == null ? Task.CompletedTask : 565async Task WriteAsyncCore(StringBuilder sb, CancellationToken ct) 574public Task WriteAsync(char[]? buffer) 578return Task.CompletedTask; 584public virtual Task WriteAsync(char[] buffer, int index, int count) => 585Task.Factory.StartNew(static state => 591public virtual Task WriteAsync(ReadOnlyMemory<char> buffer, CancellationToken cancellationToken = default) => 592cancellationToken.IsCancellationRequested ? Task.FromCanceled(cancellationToken) : 595Task.Factory.StartNew(static state => 601public virtual Task WriteLineAsync(char value) => 602Task.Factory.StartNew(static state => 608public virtual Task WriteLineAsync(string? value) => 609Task.Factory.StartNew(static state => 621public virtual Task WriteLineAsync(StringBuilder? value, CancellationToken cancellationToken = default) 624cancellationToken.IsCancellationRequested ? Task.FromCanceled(cancellationToken) : 628async Task WriteLineAsyncCore(StringBuilder sb, CancellationToken ct) 638public Task WriteLineAsync(char[]? buffer) 648public virtual Task WriteLineAsync(char[] buffer, int index, int count) => 649Task.Factory.StartNew(static state => 655public virtual Task WriteLineAsync(ReadOnlyMemory<char> buffer, CancellationToken cancellationToken = default) => 656cancellationToken.IsCancellationRequested ? Task.FromCanceled(cancellationToken) : 659Task.Factory.StartNew(static state => 665public virtual Task WriteLineAsync() 670public virtual Task FlushAsync() 672return Task.Factory.StartNew(static state => ((TextWriter)state!).Flush(), this, 681/// <returns>A <see cref="Task"/> that represents the asynchronous flush operation.</returns> 684public virtual Task FlushAsync(CancellationToken cancellationToken) => 685cancellationToken.IsCancellationRequested ? Task.FromCanceled(cancellationToken) : 701public override Task FlushAsync() => Task.CompletedTask; 702public override Task FlushAsync(CancellationToken cancellationToken) => Task.CompletedTask; 724public override Task WriteAsync(char value) => Task.CompletedTask; 725public override Task WriteAsync(string? value) => Task.CompletedTask; 726public override Task WriteAsync(StringBuilder? value, CancellationToken cancellationToken = default) => Task.CompletedTask; 727public override Task WriteAsync(char[] buffer, int index, int count) => Task.CompletedTask; 728public override Task WriteAsync(ReadOnlyMemory<char> buffer, CancellationToken cancellationToken = default) => Task.CompletedTask; 750public override Task WriteLineAsync(char value) => Task.CompletedTask; 751public override Task WriteLineAsync(string? value) => Task.CompletedTask; 752public override Task WriteLineAsync(StringBuilder? value, CancellationToken cancellationToken = default) => Task.CompletedTask; 753public override Task WriteLineAsync(char[] buffer, int index, int count) => Task.CompletedTask; 754public override Task WriteLineAsync(ReadOnlyMemory<char> buffer, CancellationToken cancellationToken = default) => Task.CompletedTask; 755public override Task WriteLineAsync() => Task.CompletedTask; 936public override Task WriteAsync(char value) 939return Task.CompletedTask; 943public override Task WriteAsync(string? value) 946return Task.CompletedTask; 950public override Task WriteAsync(StringBuilder? value, CancellationToken cancellationToken = default) 954return Task.FromCanceled(cancellationToken); 958return Task.CompletedTask; 962public override Task WriteAsync(char[] buffer, int index, int count) 965return Task.CompletedTask; 969public override Task WriteAsync(ReadOnlyMemory<char> buffer, CancellationToken cancellationToken = default) 973return Task.FromCanceled(cancellationToken); 977return Task.CompletedTask; 981public override Task WriteLineAsync(ReadOnlyMemory<char> buffer, CancellationToken cancellationToken = default) 985return Task.FromCanceled(cancellationToken); 989return Task.CompletedTask; 993public override Task WriteLineAsync(char value) 996return Task.CompletedTask; 1000public override Task WriteLineAsync() 1003return Task.CompletedTask; 1007public override Task WriteLineAsync(string? value) 1010return Task.CompletedTask; 1014public override Task WriteLineAsync(StringBuilder? value, CancellationToken cancellationToken = default) 1018return Task.FromCanceled(cancellationToken); 1022return Task.CompletedTask; 1026public override Task WriteLineAsync(char[] buffer, int index, int count) 1029return Task.CompletedTask; 1033public override Task FlushAsync() 1036return Task.CompletedTask; 1040public override Task FlushAsync(CancellationToken cancellationToken) 1044return Task.FromCanceled(cancellationToken); 1048return Task.CompletedTask;
src\libraries\System.Private.CoreLib\src\System\IO\UnmanagedMemoryStream.cs (10)
233public override Task FlushAsync(CancellationToken cancellationToken) 236return Task.FromCanceled(cancellationToken); 241return Task.CompletedTask; 245return Task.FromException(ex); 426return Task.FromCanceled<int>(cancellationToken); 436return Task.FromException<int>(ex); 698public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 703return Task.FromCanceled(cancellationToken); 708return Task.CompletedTask; 713return Task.FromException(ex);
src\libraries\System.Private.CoreLib\src\System\IO\UnmanagedMemoryStreamWrapper.cs (3)
131public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) 153public override Task FlushAsync(CancellationToken cancellationToken) 170public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncIteratorMethodBuilder.cs (1)
58m_task = Task.s_cachedCompleted;
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncMethodBuilderCore.cs (10)
57public static void SetStateMachine(IAsyncStateMachine stateMachine, Task? task) 106internal static void LogTraceOperationBegin(Task t, Type stateMachineType) 111internal static Action CreateContinuationWrapper(Action continuation, Action<Action, Task> invokeAction, Task innerTask) => 125internal static Task? TryGetContinuationTask(Action continuation) => 128continuation.Target as Task; // The continuation targets a task directly, such as with AsyncStateMachineBox 140private readonly Action<Action, Task> _invokeAction; // This wrapper is an action that wraps another action, this is that Action. 142internal readonly Task _innerTask; // If the continuation is logically going to invoke a task, this is that task (may be null) 144internal ContinuationWrapper(Action continuation, Action<Action, Task> invokeAction, Task innerTask)
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncTaskMethodBuilder.cs (7)
10/// Provides a builder for asynchronous methods that return <see cref="Threading.Tasks.Task"/>. 69/// <summary>Gets the <see cref="Threading.Tasks.Task"/> for this builder.</summary> 70/// <returns>The <see cref="Threading.Tasks.Task"/> representing the builder's asynchronous operation.</returns> 72public Task Task 91/// Completes the <see cref="Threading.Tasks.Task"/> in the 102m_task = Task.s_cachedCompleted; 112/// Completes the <see cref="Threading.Tasks.Task"/> in the
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncTaskMethodBuilderT.cs (6)
68Threading.Tasks.Task.ThrowAsync(e, targetContext: null); 131Threading.Tasks.Task.ThrowAsync(e, targetContext: null); 143Threading.Tasks.Task.ThrowAsync(e, targetContext: null); 237if (Threading.Tasks.Task.s_asyncDebuggingEnabled) 239Threading.Tasks.Task.AddToActiveTasks(box); 473m_task = Threading.Tasks.Task.FromResult(result);
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncVoidMethodBuilder.cs (4)
130Task.ThrowAsync(exception, targetContext: context); 142Task.ThrowAsync(exception, targetContext: null); 161Task.ThrowAsync(exc, targetContext: null); 166private Task Task => _builder.Task;
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\ConfiguredValueTaskAwaitable.cs (13)
16/// <summary>The wrapped <see cref="Task"/>.</summary> 55Debug.Assert(obj == null || obj is Task || obj is IValueTaskSource); 57if (obj is Task t) 69Task.CompletedTask.ConfigureAwait(_value._continueOnCapturedContext).GetAwaiter().OnCompleted(continuation); 77Debug.Assert(obj == null || obj is Task || obj is IValueTaskSource); 79if (obj is Task t) 90Task.CompletedTask.ConfigureAwait(_value._continueOnCapturedContext).GetAwaiter().UnsafeOnCompleted(continuation); 97Debug.Assert(obj == null || obj is Task || obj is IValueTaskSource); 99if (obj is Task t) 110TaskAwaiter.UnsafeOnCompletedInternal(Task.CompletedTask, box, _value._continueOnCapturedContext); 174Task.CompletedTask.ConfigureAwait(_value._continueOnCapturedContext).GetAwaiter().OnCompleted(continuation); 195Task.CompletedTask.ConfigureAwait(_value._continueOnCapturedContext).GetAwaiter().UnsafeOnCompleted(continuation); 215TaskAwaiter.UnsafeOnCompletedInternal(Task.CompletedTask, box, _value._continueOnCapturedContext);
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\PoolingAsyncValueTaskMethodBuilderT.cs (1)
122Threading.Tasks.Task.ThrowAsync(e, targetContext: null);
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\TaskAwaiter.cs (39)
19/// <summary>Provides an awaiter for awaiting a <see cref="Task"/>.</summary> 26internal readonly Task m_task; 29/// <param name="task">The <see cref="Task"/> to be awaited.</param> 30internal TaskAwaiter(Task task) 41/// <summary>Schedules the continuation onto the <see cref="Task"/> associated with this <see cref="TaskAwaiter"/>.</summary> 51/// <summary>Schedules the continuation onto the <see cref="Task"/> associated with this <see cref="TaskAwaiter"/>.</summary> 61/// <summary>Ends the await on the completed <see cref="Task"/>.</summary> 79internal static void ValidateEnd(Task task, ConfigureAwaitOptions options = ConfigureAwaitOptions.None) 98private static void HandleNonSuccessAndDebuggerNotification(Task task, ConfigureAwaitOptions options) 127private static void ThrowForNonSuccess(Task task) 166/// <summary>Schedules the continuation onto the <see cref="Task"/> associated with this <see cref="TaskAwaiter"/>.</summary> 174internal static void OnCompletedInternal(Task task, Action continuation, bool continueOnCapturedContext, bool flowExecutionContext) 180if (TplEventSource.Log.IsEnabled() || Task.s_asyncDebuggingEnabled) 189/// <summary>Schedules the continuation onto the <see cref="Task"/> associated with this <see cref="TaskAwaiter"/>.</summary> 193internal static void UnsafeOnCompletedInternal(Task task, IAsyncStateMachineBox stateMachineBox, bool continueOnCapturedContext) 199if (TplEventSource.Log.IsEnabled() || Task.s_asyncDebuggingEnabled) 215private static Action OutputWaitEtwEvents(Task task, Action continuation) 220if (Task.s_asyncDebuggingEnabled) 222Task.AddToActiveTasks(task); 230Task? currentTaskAtBegin = Task.InternalCurrent; 233Task? continuationTask = AsyncMethodBuilderCore.TryGetContinuationTask(continuation); 248if (Task.s_asyncDebuggingEnabled) 250Task.RemoveFromActiveTasks(innerTask); 260Task? currentTaskAtEnd = Task.InternalCurrent; 307/// <summary>Schedules the continuation onto the <see cref="Task"/> associated with this <see cref="TaskAwaiter"/>.</summary> 317/// <summary>Schedules the continuation onto the <see cref="Task"/> associated with this <see cref="TaskAwaiter"/>.</summary> 354/// <summary>Provides an awaitable object that allows for configured awaits on <see cref="Task"/>.</summary> 362/// <param name="task">The awaitable <see cref="Task"/>.</param> 364internal ConfiguredTaskAwaitable(Task task, ConfigureAwaitOptions options) 385internal readonly Task m_task; 390/// <param name="task">The <see cref="Task"/> to await.</param> 392internal ConfiguredTaskAwaiter(Task task, ConfigureAwaitOptions options) 405/// <summary>Schedules the continuation onto the <see cref="Task"/> associated with this <see cref="TaskAwaiter"/>.</summary> 415/// <summary>Schedules the continuation onto the <see cref="Task"/> associated with this <see cref="TaskAwaiter"/>.</summary> 425/// <summary>Ends the await on the completed <see cref="Task"/>.</summary> 487/// <summary>Schedules the continuation onto the <see cref="Task"/> associated with this <see cref="TaskAwaiter"/>.</summary> 497/// <summary>Schedules the continuation onto the <see cref="Task"/> associated with this <see cref="TaskAwaiter"/>.</summary>
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\ValueTaskAwaiter.cs (12)
50Debug.Assert(obj == null || obj is Task || obj is IValueTaskSource); 52if (obj is Task t) 62Task.CompletedTask.GetAwaiter().OnCompleted(continuation); 70Debug.Assert(obj == null || obj is Task || obj is IValueTaskSource); 72if (obj is Task t) 82Task.CompletedTask.GetAwaiter().UnsafeOnCompleted(continuation); 89Debug.Assert(obj == null || obj is Task || obj is IValueTaskSource); 91if (obj is Task t) 101TaskAwaiter.UnsafeOnCompletedInternal(Task.CompletedTask, box, continueOnCapturedContext: true); 144Task.CompletedTask.GetAwaiter().OnCompleted(continuation); 164Task.CompletedTask.GetAwaiter().UnsafeOnCompleted(continuation); 183TaskAwaiter.UnsafeOnCompletedInternal(Task.CompletedTask, box, continueOnCapturedContext: true);
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\YieldAwaitable.cs (6)
110Task.Factory.StartNew(continuation, default, TaskCreationOptions.PreferFairness, scheduler); 143Task.Factory.StartNew(static s => ((IAsyncStateMachineBox)s!).MoveNext(), box, default, TaskCreationOptions.PreferFairness, scheduler); 154int continuationId = Task.NewId(); 155Task? currentTask = Task.InternalCurrent; 178}, Task.FromResult(continuationId)); // pass the ID in a task to avoid a closure\
src\libraries\System.Private.CoreLib\src\System\Text\TranscodingStream.cs (2)
280public override Task FlushAsync(CancellationToken cancellationToken) 536public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
src\libraries\System.Private.CoreLib\src\System\Threading\CancellationTokenSource.cs (6)
288/// with the returned <see cref="Task"/> representing their eventual completion. 301public Task CancelAsync() 305return Task.FromException(new ObjectDisposedException(GetType().FullName, SR.CancellationTokenSource_Disposed)); 339return Task.Factory.StartNew(s => 350return Task.CompletedTask; 1159await Task.CompletedTask.ConfigureAwait(ConfigureAwaitOptions.ForceYielding);
src\libraries\System.Private.CoreLib\src\System\Threading\SemaphoreSlim.cs (7)
480public Task WaitAsync() 496public Task WaitAsync(CancellationToken cancellationToken) 610return Task.FromCanceled<bool>(cancellationToken); 619return Task.FromResult(true); 624return Task.FromResult(false); 703await ((Task)asyncWaiter.WaitAsync(TimeSpan.FromMilliseconds(millisecondsTimeout), cancellationToken)).ConfigureAwait(ConfigureAwaitOptions.SuppressThrowing); 710await Task.CompletedTask.ConfigureAwait(ConfigureAwaitOptions.ForceYielding);
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\CachedCompletedInt32Task.cs (1)
33return _task = Task.FromResult(result);
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\ConcurrentExclusiveSchedulerPair.cs (23)
143/// <summary>Gets a <see cref="Task"/> that will complete when the scheduler has completed processing.</summary> 144public Task Completion => EnsureCompletionStateInitialized(); 228private void FaultWithTask(Task faultedTask) 284Task? processingTask = null; 303FaultWithTask(processingTask ?? Task.FromException(e)); 330FaultWithTask(processingTask ?? Task.FromException(e)); 378if (!m_exclusiveTaskScheduler.m_tasks.TryDequeue(out Task? exclusiveTask)) break; 425if (!m_concurrentTaskScheduler.m_tasks.TryDequeue(out Task? concurrentTask)) break; 516internal readonly IProducerConsumerQueue<Task> m_tasks; 536(IProducerConsumerQueue<Task>)new SingleProducerSingleConsumerQueue<Task>() : 537(IProducerConsumerQueue<Task>)new MultiProducerMultiConsumerQueue<Task>(); 545protected internal override void QueueTask(Task task) 561internal void ExecuteTask(Task task) 571protected override bool TryExecuteTaskInline(Task task, bool taskWasPreviouslyQueued) 623private bool TryExecuteTaskInlineOnTargetScheduler(Task task) 637var tuple = (TupleSlim<ConcurrentExclusiveTaskScheduler, Task>)s!; 639}, new TupleSlim<ConcurrentExclusiveTaskScheduler, Task>(this, task)); 656protected override IEnumerable<Task> GetScheduledTasks() { return m_tasks; } 678public IEnumerable<Task> ScheduledTasks => m_taskScheduler.m_tasks; 701public IEnumerable<Task> ScheduledExclusive => m_pair.m_exclusiveTaskScheduler.m_tasks; 703public IEnumerable<Task> ScheduledConcurrent => m_pair.m_concurrentTaskScheduler.m_tasks;
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\ConfigureAwaitOptions.cs (10)
12/// <see cref="Task.ConfigureAwait(ConfigureAwaitOptions)"/> with a <see cref="None"/> argument behaves 13/// identically to using <see cref="Task.ConfigureAwait(bool)"/> with a <see langword="false"/> argument. 24/// <see cref="Task.ConfigureAwait(ConfigureAwaitOptions)"/> with a <see cref="ContinueOnCapturedContext"/> argument 25/// behaves identically to using <see cref="Task.ConfigureAwait(bool)"/> with a <see langword="true"/> argument. 30/// Avoids throwing an exception at the completion of awaiting a <see cref="Task"/> that ends 34/// This option is supported only for <see cref="Task.ConfigureAwait(ConfigureAwaitOptions)"/>, 37/// cast to the base <see cref="Task"/> type in order to use its <see cref="Task.ConfigureAwait(ConfigureAwaitOptions)"/>. 42/// Forces an await on an already completed <see cref="Task"/> to behave as if the <see cref="Task"/>
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Future.cs (45)
48/// <see cref="Task.Start()">Start</see> 53/// <see cref="Task.Dispose()">Dispose</see>, are thread-safe 286internal Task(Func<TResult> valueSelector, Task? parent, CancellationToken cancellationToken, 302internal Task(Delegate valueSelector, object? state, Task? parent, CancellationToken cancellationToken, 310internal static Task<TResult> StartNew(Task? parent, Func<TResult> function, CancellationToken cancellationToken, 330internal static Task<TResult> StartNew(Task? parent, Func<object?, TResult> function, object? state, CancellationToken cancellationToken, 521/// <summary>Configures an awaiter used to await this <see cref="Task"/>.</summary> 551/// <param name="timeout">The timeout after which the <see cref="Task"/> should be faulted with a <see cref="TimeoutException"/> if it hasn't otherwise completed.</param> 559/// <param name="timeout">The timeout after which the <see cref="Task"/> should be faulted with a <see cref="TimeoutException"/> if it hasn't otherwise completed.</param> 569/// <param name="timeout">The timeout after which the <see cref="Task"/> should be faulted with a <see cref="TimeoutException"/> if it hasn't otherwise completed.</param> 578/// <param name="timeout">The timeout after which the <see cref="Task"/> should be faulted with a <see cref="TimeoutException"/> if it hasn't otherwise completed.</param> 620/// <returns>A new continuation <see cref="Task"/>.</returns> 622/// The returned <see cref="Task"/> will not be scheduled for execution until the current task has 629public Task ContinueWith(Action<Task<TResult>> continuationAction) 643/// <returns>A new continuation <see cref="Task"/>.</returns> 645/// The returned <see cref="Task"/> will not be scheduled for execution until the current task has 652public Task ContinueWith(Action<Task<TResult>> continuationAction, CancellationToken cancellationToken) 668/// <returns>A new continuation <see cref="Task"/>.</returns> 670/// The returned <see cref="Task"/> will not be scheduled for execution until the current task has 680public Task ContinueWith(Action<Task<TResult>> continuationAction, TaskScheduler scheduler) 699/// <returns>A new continuation <see cref="Task"/>.</returns> 701/// The returned <see cref="Task"/> will not be scheduled for execution until the current task has 713public Task ContinueWith(Action<Task<TResult>> continuationAction, TaskContinuationOptions continuationOptions) 737/// <returns>A new continuation <see cref="Task"/>.</returns> 739/// The returned <see cref="Task"/> will not be scheduled for execution until the current task has 753public Task ContinueWith(Action<Task<TResult>> continuationAction, CancellationToken cancellationToken, 760internal Task ContinueWith(Action<Task<TResult>> continuationAction, TaskScheduler scheduler, CancellationToken cancellationToken, 778Task continuationTask = new ContinuationTaskFromResultTask<TResult>( 801/// <returns>A new continuation <see cref="Task"/>.</returns> 803/// The returned <see cref="Task"/> will not be scheduled for execution until the current task has 810public Task ContinueWith(Action<Task<TResult>, object?> continuationAction, object? state) 825/// <returns>A new continuation <see cref="Task"/>.</returns> 827/// The returned <see cref="Task"/> will not be scheduled for execution until the current task has 834public Task ContinueWith(Action<Task<TResult>, object?> continuationAction, object? state, CancellationToken cancellationToken) 851/// <returns>A new continuation <see cref="Task"/>.</returns> 853/// The returned <see cref="Task"/> will not be scheduled for execution until the current task has 863public Task ContinueWith(Action<Task<TResult>, object?> continuationAction, object? state, TaskScheduler scheduler) 883/// <returns>A new continuation <see cref="Task"/>.</returns> 885/// The returned <see cref="Task"/> will not be scheduled for execution until the current task has 897public Task ContinueWith(Action<Task<TResult>, object?> continuationAction, object? state, TaskContinuationOptions continuationOptions) 922/// <returns>A new continuation <see cref="Task"/>.</returns> 924/// The returned <see cref="Task"/> will not be scheduled for execution until the current task has 938public Task ContinueWith(Action<Task<TResult>, object?> continuationAction, object? state, CancellationToken cancellationToken, 945internal Task ContinueWith(Action<Task<TResult>, object?> continuationAction, object? state, TaskScheduler scheduler, CancellationToken cancellationToken, 963Task continuationTask = new ContinuationTaskFromResultTask<TResult>(
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\FutureFactory.cs (82)
41private TaskScheduler GetDefaultScheduler(Task? currTask) 252/// <see cref="Task.Start()">Start</see> to schedule it for execution. 258Task? currTask = Task.InternalCurrent; 279/// <see cref="Task.Start()">Start</see> to schedule it for execution. 285Task? currTask = Task.InternalCurrent; 308/// <see cref="Task.Start()">Start</see> to schedule it for execution. 314Task? currTask = Task.InternalCurrent; 348/// <see cref="Task.Start()">Start</see> to schedule it for execution. 355Task.InternalCurrentIfAttached(creationOptions), function, cancellationToken, 373/// <see cref="Task.Start()">Start</see> to schedule it for execution. 379Task? currTask = Task.InternalCurrent; 402/// <see cref="Task.Start()">Start</see> to schedule it for execution. 408Task? currTask = Task.InternalCurrent; 433/// <see cref="Task.Start()">Start</see> to schedule it for execution. 439Task? currTask = Task.InternalCurrent; 475/// <see cref="Task.Start()">Start</see> to schedule it for execution. 481return Task<TResult>.StartNew(Task.InternalCurrentIfAttached(creationOptions), function, state, cancellationToken, 531if (Task.s_asyncDebuggingEnabled) 532Task.RemoveFromActiveTasks(promise); 653if (Task.s_asyncDebuggingEnabled) 654Task.AddToActiveTasks(promise); 659Task t = new Task(new Action<object>(delegate 669if (Task.s_asyncDebuggingEnabled) 670Task.AddToActiveTasks(t); 770if (Task.s_asyncDebuggingEnabled) 771Task.AddToActiveTasks(promise); 792if (Task.s_asyncDebuggingEnabled) 793Task.RemoveFromActiveTasks(promise); 887if (Task.s_asyncDebuggingEnabled) 888Task.AddToActiveTasks(promise); 909if (Task.s_asyncDebuggingEnabled) 910Task.RemoveFromActiveTasks(promise); 1012if (Task.s_asyncDebuggingEnabled) 1013Task.AddToActiveTasks(promise); 1034if (Task.s_asyncDebuggingEnabled) 1035Task.RemoveFromActiveTasks(promise); 1145if (Task.s_asyncDebuggingEnabled) 1146Task.AddToActiveTasks(promise); 1167if (Task.s_asyncDebuggingEnabled) 1168Task.RemoveFromActiveTasks(promise); 1324Task.CreationOptionsFromContinuationOptions(continuationOptions, out TaskCreationOptions tco, out _); 1348public Task<TResult> ContinueWhenAll(Task[] tasks, Func<Task[], TResult> continuationFunction) 1376public Task<TResult> ContinueWhenAll(Task[] tasks, Func<Task[], TResult> continuationFunction, CancellationToken cancellationToken) 1410public Task<TResult> ContinueWhenAll(Task[] tasks, Func<Task[], TResult> continuationFunction, TaskContinuationOptions continuationOptions) 1431/// cref="Task">Task</see>.</param> 1454public Task<TResult> ContinueWhenAll(Task[] tasks, Func<Task[], TResult> continuationFunction, 1648internal static Task<TResult> ContinueWhenAllImpl(Task[] tasks, 1649Func<Task[], TResult>? continuationFunction, Action<Task[]>? continuationAction, 1659Task[] tasksCopy = TaskFactory.CheckMultiContinuationTasksAndCopy(tasks); 1670Task<Task[]> starter = TaskFactory.CommonCWAllLogic(tasksCopy); 1679Debug.Assert(state is Func<Task[], TResult>); 1680return ((Func<Task[], TResult>)state)(completedTasks.Result); 1691Debug.Assert(state is Action<Task[]>); 1692((Action<Task[]>)state)(completedTasks.Result); return default!; 1718public Task<TResult> ContinueWhenAny(Task[] tasks, Func<Task, TResult> continuationFunction) 1746public Task<TResult> ContinueWhenAny(Task[] tasks, Func<Task, TResult> continuationFunction, CancellationToken cancellationToken) 1780public Task<TResult> ContinueWhenAny(Task[] tasks, Func<Task, TResult> continuationFunction, TaskContinuationOptions continuationOptions) 1801/// cref="Task">Task</see>.</param> 1824public Task<TResult> ContinueWhenAny(Task[] tasks, Func<Task, TResult> continuationFunction, 1970internal static Task<TResult> ContinueWhenAnyImpl(Task[] tasks, 1971Func<Task, TResult>? continuationFunction, Action<Task>? continuationAction, 1983Task<Task> starter = TaskFactory.CommonCWAnyLogic(tasks); 1999Debug.Assert(state is Func<Task, TResult>); 2000return ((Func<Task, TResult>)state)(completedTask.Result); 2010Debug.Assert(state is Action<Task>); 2011((Action<Task>)state)(completedTask.Result);
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Sources\ManualResetValueTaskSourceCore.cs (1)
311Task.Factory.StartNew(continuation, state, CancellationToken.None, TaskCreationOptions.DenyChildAttach, scheduler);
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs (436)
25/// Represents the current stage in the lifecycle of a <see cref="Task"/>. 71/// <see cref="Task"/> instances may be created in a variety of ways. The most common approach is by 74/// purposes. For example, to create a <see cref="Task"/> that runs an action, the factory's StartNew 85/// The <see cref="Task"/> class also provides constructors that initialize the Task but that do not 92/// All members of <see cref="Task"/>, except for <see cref="Dispose()"/>, are thread-safe 117internal static Task? t_currentTask; // The currently executing task. 132private Task? ParentForDebugger => m_contingentProperties?.m_parent; // Private property used by a debugger to access this Task's parent 181private static Dictionary<int, Task>? s_currentActiveTasks; 185internal static bool AddToActiveTasks(Task task) 189Dictionary<int, Task> activeTasks = 191Interlocked.CompareExchange(ref s_currentActiveTasks, new Dictionary<int, Task>(), null) ?? 203internal static void RemoveFromActiveTasks(Task task) 205Dictionary<int, Task>? activeTasks = s_currentActiveTasks; 246internal volatile List<Task>? m_exceptionalChildren; 248internal Task? m_parent; 340Task? parent = InternalCurrent; 351/// Initializes a new <see cref="Task"/> with the specified action. 361/// Initializes a new <see cref="Task"/> with the specified action and <see cref="Threading.CancellationToken">CancellationToken</see>. 376/// Initializes a new <see cref="Task"/> with the specified action and creation options. 396/// Initializes a new <see cref="Task"/> with the specified action and creation options. 420/// Initializes a new <see cref="Task"/> with the specified action and state. 433/// Initializes a new <see cref="Task"/> with the specified action, state, and options. 450/// Initializes a new <see cref="Task"/> with the specified action, state, and options. 471/// Initializes a new <see cref="Task"/> with the specified action, state, and options. 505internal Task(Delegate action, object? state, Task? parent, CancellationToken cancellationToken, 584Task? parent = props.m_parent; 607private void AssignCancellationToken(CancellationToken cancellationToken, Task? antecedent, TaskContinuation? continuation) 635ctr = cancellationToken.UnsafeRegister(static t => ((Task)t!).InternalCancel(), this); 646var tuple = (TupleSlim<Task, Task, TaskContinuation>)t!; 648Task targetTask = tuple.Item1; 649Task antecedentTask = tuple.Item2; 653}, new TupleSlim<Task, Task, TaskContinuation>(this, antecedent, continuation)); 664Task? parent = m_contingentProperties?.m_parent; 776internal static bool AnyTaskRequiresNotifyDebuggerOfWaitCompletion(Task?[] tasks) 779foreach (Task? task in tasks) 856Task? currentTask = InternalCurrent; 857Task? parentTask = m_contingentProperties?.m_parent; 903/// Starts the <see cref="Task"/>, scheduling it for execution to the current <see 911/// The <see cref="Task"/> is not in a valid state to be started. It may have already been started, 921/// Starts the <see cref="Task"/>, scheduling it for execution to the specified <see 936/// The <see cref="Task"/> is not in a valid state to be started. It may have already been started, 977/// Runs the <see cref="Task"/> synchronously on the current <see 996/// The <see cref="Task"/> is not in a valid state to be started. It may have already been started, 1006/// Runs the <see cref="Task"/> synchronously on the <see 1021/// The <see cref="Task"/> is not in a valid state to be started. It may have already been started, 1141internal static Task InternalStartNew( 1142Task? creatingTask, Delegate action, object? state, CancellationToken cancellationToken, TaskScheduler scheduler, 1153Task t = new Task(action, state, creatingTask, cancellationToken, options, internalOptions | InternalTaskOptions.QueuedByRuntime, scheduler); 1160/// Gets a unique ID for a <see cref="Task">Task</see> or task continuation instance. 1184/// Gets a unique ID for this <see cref="Task">Task</see> instance. 1205/// Returns the unique ID of the currently executing <see cref="Task">Task</see>. 1211Task? currentTask = InternalCurrent; 1220/// Gets the <see cref="Task">Task</see> instance currently executing, or 1223internal static Task? InternalCurrent => t_currentTask; 1231internal static Task? InternalCurrentIfAttached(TaskCreationOptions creationOptions) 1238/// cref="Task">Task</see> to end prematurely. If the <see 1239/// cref="Task">Task</see> completed successfully or has not yet thrown any 1294/// Gets whether this <see cref="Task">Task</see> instance has completed 1298/// A <see cref="Task">Task</see> will complete in Canceled state either if its <see cref="CancellationToken">CancellationToken</see> 1362/// Gets whether this <see cref="Task"/> threw an OperationCanceledException while its CancellationToken was signaled. 1367/// Gets whether this <see cref="Task">Task</see> has completed. 1421/// The <see cref="Task"/> has been disposed. 1439/// Gets the state object supplied when the <see cref="Task">Task</see> was created, 1456/// Provides access to factory methods for creating <see cref="Task"/> and <see cref="Task{TResult}"/> instances. 1470public static Task CompletedTask => s_cachedCompleted; 1515/// Gets whether the <see cref="Task"/> completed due to an unhandled exception. 1564/// Disposes the <see cref="Task"/>, releasing all of its unmanaged resources. 1567/// Unlike most of the members of <see cref="Task"/>, this method is not thread-safe. 1568/// Also, <see cref="Dispose()"/> may only be called on a <see cref="Task"/> that is in one of 1574/// The exception that is thrown if the <see cref="Task"/> is not in 1586/// Disposes the <see cref="Task"/>, releasing all of its unmanaged resources. 1593/// Unlike most of the members of <see cref="Task"/>, this method is not thread-safe. 1944Task? parent = m_contingentProperties?.m_parent; 2027List<Task>? exceptionalChildren = props.m_exceptionalChildren; 2139Task? parent = m_contingentProperties?.m_parent; 2151internal void ProcessChildCompletion(Task childTask) 2166Interlocked.CompareExchange(ref props.m_exceptionalChildren, new List<Task>(), null); 2173List<Task>? tmp = props.m_exceptionalChildren; 2204List<Task>? exceptionalChildren = props.m_exceptionalChildren; 2212foreach (Task task in exceptionalChildren) 2301private void ExecuteWithThreadLocal(ref Task? currentTaskSlot, Thread? threadPoolThread = null) 2304Task? previousTask = currentTaskSlot; 2382Debug.Assert(obj is Task); 2384Unsafe.As<Task>(obj).InnerInvoke(); 2438/// <summary>Gets an awaiter used to await this <see cref="Task"/>.</summary> 2445/// <summary>Configures an awaiter used to await this <see cref="Task"/>.</summary> 2455/// <summary>Configures an awaiter used to await this <see cref="Task"/>.</summary> 2472/// Sets a continuation onto the <see cref="Task"/>. 2476/// <param name="continuationAction">The action to invoke when the <see cref="Task"/> has completed.</param> 2545/// Sets a continuation onto the <see cref="Task"/>. 2549/// <param name="stateMachineBox">The action to invoke when the <see cref="Task"/> has completed.</param> 2615/// Waits for the <see cref="Task"/> to complete execution. 2618/// The <see cref="Task"/> was canceled -or- an exception was thrown during 2619/// the execution of the <see cref="Task"/>. 2634/// Waits for the <see cref="Task"/> to complete execution. 2641/// true if the <see cref="Task"/> completed execution within the allotted time; otherwise, false. 2644/// The <see cref="Task"/> was canceled -or- an exception was thrown during the execution of the <see 2645/// cref="Task"/>. 2655/// Waits for the <see cref="Task"/> to complete execution. 2662/// true if the <see cref="Task"/> completed execution within the allotted time; otherwise, false. 2665/// The <see cref="Task"/> was canceled -or- an exception was thrown during the execution of the <see 2666/// cref="Task"/>. 2689/// Waits for the <see cref="Task"/> to complete execution. 2698/// The <see cref="Task"/> was canceled -or- an exception was thrown during the execution of the <see 2699/// cref="Task"/>. 2707/// Waits for the <see cref="Task"/> to complete execution. 2712/// <returns>true if the <see cref="Task"/> completed execution within the allotted time; otherwise, 2720/// The <see cref="Task"/> was canceled -or- an exception was thrown during the execution of the <see 2721/// cref="Task"/>. 2729/// Waits for the <see cref="Task"/> to complete execution. 2739/// true if the <see cref="Task"/> completed execution within the allotted time; otherwise, false. 2742/// The <see cref="Task"/> was canceled -or- an exception was thrown during the execution of the <see 2743/// cref="Task"/>. 2790/// <summary>Gets a <see cref="Task"/> that will complete when this <see cref="Task"/> completes or when the specified <see cref="CancellationToken"/> has cancellation requested.</summary> 2792/// <returns>The <see cref="Task"/> representing the asynchronous wait. It may or may not be the same instance as the current instance.</returns> 2793public Task WaitAsync(CancellationToken cancellationToken) => WaitAsync(Timeout.UnsignedInfinite, TimeProvider.System, cancellationToken); 2795/// <summary>Gets a <see cref="Task"/> that will complete when this <see cref="Task"/> completes or when the specified timeout expires.</summary> 2796/// <param name="timeout">The timeout after which the <see cref="Task"/> should be faulted with a <see cref="TimeoutException"/> if it hasn't otherwise completed.</param> 2797/// <returns>The <see cref="Task"/> representing the asynchronous wait. It may or may not be the same instance as the current instance.</returns> 2798public Task WaitAsync(TimeSpan timeout) => WaitAsync(ValidateTimeout(timeout, ExceptionArgument.timeout), TimeProvider.System, default); 2800/// <summary>Gets a <see cref="Task"/> that will complete when this <see cref="Task"/> completes or when the specified timeout expires.</summary> 2801/// <param name="timeout">The timeout after which the <see cref="Task"/> should be faulted with a <see cref="TimeoutException"/> if it hasn't otherwise completed.</param> 2803/// <returns>The <see cref="Task"/> representing the asynchronous wait. It may or may not be the same instance as the current instance.</returns> 2805public Task WaitAsync(TimeSpan timeout, TimeProvider timeProvider) 2811/// <summary>Gets a <see cref="Task"/> that will complete when this <see cref="Task"/> completes, when the specified timeout expires, or when the specified <see cref="CancellationToken"/> has cancellation requested.</summary> 2812/// <param name="timeout">The timeout after which the <see cref="Task"/> should be faulted with a <see cref="TimeoutException"/> if it hasn't otherwise completed.</param> 2814/// <returns>The <see cref="Task"/> representing the asynchronous wait. It may or may not be the same instance as the current instance.</returns> 2815public Task WaitAsync(TimeSpan timeout, CancellationToken cancellationToken) => 2818/// <summary>Gets a <see cref="Task"/> that will complete when this <see cref="Task"/> completes, when the specified timeout expires, or when the specified <see cref="CancellationToken"/> has cancellation requested.</summary> 2819/// <param name="timeout">The timeout after which the <see cref="Task"/> should be faulted with a <see cref="TimeoutException"/> if it hasn't otherwise completed.</param> 2822/// <returns>The <see cref="Task"/> representing the asynchronous wait. It may or may not be the same instance as the current instance.</returns> 2824public Task WaitAsync(TimeSpan timeout, TimeProvider timeProvider, CancellationToken cancellationToken) 2830private Task WaitAsync(uint millisecondsTimeout, TimeProvider timeProvider, CancellationToken cancellationToken) 2854private readonly Task _task; 2860internal CancellationPromise(Task source, uint millisecondsDelay, TimeProvider timeProvider, CancellationToken token) 2915void ITaskCompletionAction.Invoke(Task completingTask) 2981Task? currentTask = InternalCurrent; 3012Task? currentTask = InternalCurrent; 3041public void Invoke(Task completingTask) { Set(); } 3143/// Cancels the <see cref="Task"/>. 3605/// Creates a continuation that executes when the target <see cref="Task"/> completes. 3608/// An action to run when the <see cref="Task"/> completes. When run, the delegate will be 3611/// <returns>A new continuation <see cref="Task"/>.</returns> 3613/// The returned <see cref="Task"/> will not be scheduled for execution until the current task has 3620public Task ContinueWith(Action<Task> continuationAction) 3626/// Creates a continuation that executes when the target <see cref="Task"/> completes. 3629/// An action to run when the <see cref="Task"/> completes. When run, the delegate will be 3633/// <returns>A new continuation <see cref="Task"/>.</returns> 3635/// The returned <see cref="Task"/> will not be scheduled for execution until the current task has 3642public Task ContinueWith(Action<Task> continuationAction, CancellationToken cancellationToken) 3648/// Creates a continuation that executes when the target <see cref="Task"/> completes. 3651/// An action to run when the <see cref="Task"/> completes. When run, the delegate will be 3657/// <returns>A new continuation <see cref="Task"/>.</returns> 3659/// The returned <see cref="Task"/> will not be scheduled for execution until the current task has 3669public Task ContinueWith(Action<Task> continuationAction, TaskScheduler scheduler) 3675/// Creates a continuation that executes when the target <see cref="Task"/> completes. 3678/// An action to run when the <see cref="Task"/> completes. When run, the delegate will be 3688/// <returns>A new continuation <see cref="Task"/>.</returns> 3690/// The returned <see cref="Task"/> will not be scheduled for execution until the current task has 3702public Task ContinueWith(Action<Task> continuationAction, TaskContinuationOptions continuationOptions) 3708/// Creates a continuation that executes when the target <see cref="Task"/> completes. 3711/// An action to run when the <see cref="Task"/> completes. When run, the delegate will be 3726/// <returns>A new continuation <see cref="Task"/>.</returns> 3728/// The returned <see cref="Task"/> will not be scheduled for execution until the current task has 3742public Task ContinueWith(Action<Task> continuationAction, CancellationToken cancellationToken, 3749private Task ContinueWith(Action<Task> continuationAction, TaskScheduler scheduler, 3766Task continuationTask = new ContinuationTaskFromTask( 3782/// Creates a continuation that executes when the target <see cref="Task"/> completes. 3785/// An action to run when the <see cref="Task"/> completes. When run, the delegate will be 3789/// <returns>A new continuation <see cref="Task"/>.</returns> 3791/// The returned <see cref="Task"/> will not be scheduled for execution until the current task has 3798public Task ContinueWith(Action<Task, object?> continuationAction, object? state) 3804/// Creates a continuation that executes when the target <see cref="Task"/> completes. 3807/// An action to run when the <see cref="Task"/> completes. When run, the delegate will be 3812/// <returns>A new continuation <see cref="Task"/>.</returns> 3814/// The returned <see cref="Task"/> will not be scheduled for execution until the current task has 3821public Task ContinueWith(Action<Task, object?> continuationAction, object? state, CancellationToken cancellationToken) 3827/// Creates a continuation that executes when the target <see cref="Task"/> completes. 3830/// An action to run when the <see cref="Task"/> completes. When run, the delegate will be 3837/// <returns>A new continuation <see cref="Task"/>.</returns> 3839/// The returned <see cref="Task"/> will not be scheduled for execution until the current task has 3849public Task ContinueWith(Action<Task, object?> continuationAction, object? state, TaskScheduler scheduler) 3855/// Creates a continuation that executes when the target <see cref="Task"/> completes. 3858/// An action to run when the <see cref="Task"/> completes. When run, the delegate will be 3869/// <returns>A new continuation <see cref="Task"/>.</returns> 3871/// The returned <see cref="Task"/> will not be scheduled for execution until the current task has 3883public Task ContinueWith(Action<Task, object?> continuationAction, object? state, TaskContinuationOptions continuationOptions) 3889/// Creates a continuation that executes when the target <see cref="Task"/> completes. 3892/// An action to run when the <see cref="Task"/> completes. When run, the delegate will be 3908/// <returns>A new continuation <see cref="Task"/>.</returns> 3910/// The returned <see cref="Task"/> will not be scheduled for execution until the current task has 3924public Task ContinueWith(Action<Task, object?> continuationAction, object? state, CancellationToken cancellationToken, 3931private Task ContinueWith(Action<Task, object?> continuationAction, object? state, TaskScheduler scheduler, 3948Task continuationTask = new ContinuationTaskFromTask( 3965/// Creates a continuation that executes when the target <see cref="Task"/> completes. 3971/// A function to run when the <see cref="Task"/> completes. When run, the delegate will be 3983public Task<TResult> ContinueWith<TResult>(Func<Task, TResult> continuationFunction) 3990/// Creates a continuation that executes when the target <see cref="Task"/> completes. 3996/// A function to run when the <see cref="Task"/> completes. When run, the delegate will be 4012public Task<TResult> ContinueWith<TResult>(Func<Task, TResult> continuationFunction, CancellationToken cancellationToken) 4018/// Creates a continuation that executes when the target <see cref="Task"/> completes. 4024/// A function to run when the <see cref="Task"/> completes. When run, the delegate will be 4042public Task<TResult> ContinueWith<TResult>(Func<Task, TResult> continuationFunction, TaskScheduler scheduler) 4048/// Creates a continuation that executes when the target <see cref="Task"/> completes. 4054/// A function to run when the <see cref="Task"/> completes. When run, the delegate will be 4078public Task<TResult> ContinueWith<TResult>(Func<Task, TResult> continuationFunction, TaskContinuationOptions continuationOptions) 4084/// Creates a continuation that executes when the target <see cref="Task"/> completes. 4090/// A function to run when the <see cref="Task"/> completes. When run, the delegate will be 4124public Task<TResult> ContinueWith<TResult>(Func<Task, TResult> continuationFunction, CancellationToken cancellationToken, 4131private Task<TResult> ContinueWith<TResult>(Func<Task, TResult> continuationFunction, TaskScheduler scheduler, 4164/// Creates a continuation that executes when the target <see cref="Task"/> completes. 4170/// A function to run when the <see cref="Task"/> completes. When run, the delegate will be 4183public Task<TResult> ContinueWith<TResult>(Func<Task, object?, TResult> continuationFunction, object? state) 4190/// Creates a continuation that executes when the target <see cref="Task"/> completes. 4196/// A function to run when the <see cref="Task"/> completes. When run, the delegate will be 4213public Task<TResult> ContinueWith<TResult>(Func<Task, object?, TResult> continuationFunction, object? state, CancellationToken cancellationToken) 4219/// Creates a continuation that executes when the target <see cref="Task"/> completes. 4225/// A function to run when the <see cref="Task"/> completes. When run, the delegate will be 4244public Task<TResult> ContinueWith<TResult>(Func<Task, object?, TResult> continuationFunction, object? state, TaskScheduler scheduler) 4250/// Creates a continuation that executes when the target <see cref="Task"/> completes. 4256/// A function to run when the <see cref="Task"/> completes. When run, the delegate will be 4281public Task<TResult> ContinueWith<TResult>(Func<Task, object?, TResult> continuationFunction, object? state, TaskContinuationOptions continuationOptions) 4287/// Creates a continuation that executes when the target <see cref="Task"/> completes. 4293/// A function to run when the <see cref="Task"/> completes. When run, the delegate will be 4328public Task<TResult> ContinueWith<TResult>(Func<Task, object?, TResult> continuationFunction, object? state, CancellationToken cancellationToken, 4335private Task<TResult> ContinueWith<TResult>(Func<Task, object?, TResult> continuationFunction, object? state, TaskScheduler scheduler, 4428internal void ContinueWithCore(Task continuationTask, 4665/// Waits for all of the provided <see cref="Task"/> objects to complete execution. 4668/// An array of <see cref="Task"/> instances on which to wait. 4677/// At least one of the <see cref="Task"/> instances was canceled -or- an exception was thrown during 4678/// the execution of at least one of the <see cref="Task"/> instances. 4682public static void WaitAll(params Task[] tasks) 4694/// Waits for all of the provided <see cref="Task"/> objects to complete execution. 4697/// An array of <see cref="Task"/> instances on which to wait. 4703/// At least one of the <see cref="Task"/> instances was canceled -or- an exception was thrown during 4704/// the execution of at least one of the <see cref="Task"/> instances. 4707public static void WaitAll(/*params*/ ReadOnlySpan<Task> tasks) 4714/// Waits for all of the provided <see cref="Task"/> objects to complete execution. 4717/// true if all of the <see cref="Task"/> instances completed execution within the allotted time; 4721/// An array of <see cref="Task"/> instances on which to wait. 4734/// At least one of the <see cref="Task"/> instances was canceled -or- an exception was thrown during 4735/// the execution of at least one of the <see cref="Task"/> instances. 4744public static bool WaitAll(Task[] tasks, TimeSpan timeout) 4761/// Waits for all of the provided <see cref="Task"/> objects to complete execution. 4764/// true if all of the <see cref="Task"/> instances completed execution within the allotted time; 4770/// <param name="tasks">An array of <see cref="Task"/> instances on which to wait. 4779/// At least one of the <see cref="Task"/> instances was canceled -or- an exception was thrown during 4780/// the execution of at least one of the <see cref="Task"/> instances. 4788public static bool WaitAll(Task[] tasks, int millisecondsTimeout) 4799/// Waits for all of the provided <see cref="Task"/> objects to complete execution. 4802/// An array of <see cref="Task"/> instances on which to wait. 4814/// At least one of the <see cref="Task"/> instances was canceled -or- an exception was thrown during 4815/// the execution of at least one of the <see cref="Task"/> instances. 4822public static void WaitAll(Task[] tasks, CancellationToken cancellationToken) 4833/// Waits for all of the provided <see cref="Task"/> objects to complete execution. 4836/// true if all of the <see cref="Task"/> instances completed execution within the allotted time; 4840/// An array of <see cref="Task"/> instances on which to wait. 4856/// At least one of the <see cref="Task"/> instances was canceled -or- an exception was thrown during 4857/// the execution of at least one of the <see cref="Task"/> instances. 4868public static bool WaitAll(Task[] tasks, int millisecondsTimeout, CancellationToken cancellationToken) 4878/// <summary>Waits for all of the provided <see cref="Task"/> objects to complete execution unless the wait is cancelled.</summary> 4883/// <exception cref="ObjectDisposedException">One or more of the <see cref="Task"/> objects in tasks has been disposed.</exception> 4886/// At least one of the <see cref="Task"/> instances was canceled. If a task was canceled, the <see cref="AggregateException"/> 4890public static void WaitAll(IEnumerable<Task> tasks, CancellationToken cancellationToken = default) 4897ReadOnlySpan<Task> span = 4898tasks is List<Task> list ? CollectionsMarshal.AsSpan(list) : 4899tasks is Task[] array ? array : 4900CollectionsMarshal.AsSpan(new List<Task>(tasks)); 4908private static bool WaitAllCore(ReadOnlySpan<Task> tasks, int millisecondsTimeout, CancellationToken cancellationToken) 4924List<Task>? waitedOnTaskList = null; 4925List<Task>? notificationTasks = null; 4935Task task = tasks[i]; 4979foreach (Task task in waitedOnTaskList) 4996foreach (Task task in notificationTasks) 5013foreach (Task task in tasks) AddExceptionsForCompletedTask(ref exceptions, task); 5038private static bool WaitAllBlockingCore(List<Task> tasks, int millisecondsTimeout, CancellationToken cancellationToken) 5047foreach (Task task in tasks) 5057foreach (Task task in tasks) 5091public void Invoke(Task completingTask) 5105internal static void AddExceptionsForCompletedTask(ref List<Exception>? exceptions, Task t) 5121/// Waits for any of the provided <see cref="Task"/> objects to complete execution. 5124/// An array of <see cref="Task"/> instances on which to wait. 5134public static int WaitAny(params Task[] tasks) 5142/// Waits for any of the provided <see cref="Task"/> objects to complete execution. 5145/// An array of <see cref="Task"/> instances on which to wait. 5167public static int WaitAny(Task[] tasks, TimeSpan timeout) 5179/// Waits for any of the provided <see cref="Task"/> objects to complete execution. 5182/// An array of <see cref="Task"/> instances on which to wait. 5200public static int WaitAny(Task[] tasks, CancellationToken cancellationToken) 5206/// Waits for any of the provided <see cref="Task"/> objects to complete execution. 5209/// An array of <see cref="Task"/> instances on which to wait. 5230public static int WaitAny(Task[] tasks, int millisecondsTimeout) 5236/// Waits for any of the provided <see cref="Task"/> objects to complete execution. 5239/// An array of <see cref="Task"/> instances on which to wait. 5266public static int WaitAny(Task[] tasks, int millisecondsTimeout, CancellationToken cancellationToken) => 5271private static int WaitAnyCore(Task[] tasks, int millisecondsTimeout, CancellationToken cancellationToken) 5291Task task = tasks[taskIndex]; 5308Task<Task> firstCompleted = TaskFactory.CommonCWAnyLogic(tasks, isSyncBlocking: true); 5395public static Task FromException(Exception exception) 5399var task = new Task(); 5419/// <summary>Creates a <see cref="Task"/> that's completed due to cancellation with the specified token.</summary> 5422public static Task FromCanceled(CancellationToken cancellationToken) 5440/// <summary>Creates a <see cref="Task"/> that's completed due to cancellation with the specified exception.</summary> 5443internal static Task FromCanceled(OperationCanceledException exception) 5447var task = new Task(); 5479public static Task Run(Action action) 5497public static Task Run(Action action, CancellationToken cancellationToken) 5544public static Task Run(Func<Task?> function) 5562public static Task Run(Func<Task?> function, CancellationToken cancellationToken) 5571Task<Task?> task1 = Task<Task?>.Factory.StartNew(function, cancellationToken, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default); 5639public static Task Delay(TimeSpan delay) => Delay(delay, TimeProvider.System, default); 5648public static Task Delay(TimeSpan delay, TimeProvider timeProvider) => Delay(delay, timeProvider, default); 5668public static Task Delay(TimeSpan delay, CancellationToken cancellationToken) => 5679public static Task Delay(TimeSpan delay, TimeProvider timeProvider, CancellationToken cancellationToken) 5696public static Task Delay(int millisecondsDelay) => Delay(millisecondsDelay, default); 5716public static Task Delay(int millisecondsDelay, CancellationToken cancellationToken) 5727private static Task Delay(uint millisecondsDelay, TimeProvider timeProvider, CancellationToken cancellationToken) => 5883public static Task WhenAll(IEnumerable<Task> tasks) 5890if (tasks is ICollection<Task> taskCollection) 5892if (tasks is Task[] taskArray) 5894return WhenAll((ReadOnlySpan<Task>)taskArray); 5897if (tasks is List<Task> taskList) 5902taskArray = new Task[taskCollection.Count]; 5904return WhenAll((ReadOnlySpan<Task>)taskArray); 5908var taskList = new List<Task>(); 5909foreach (Task task in tasks) 5944public static Task WhenAll(params Task[] tasks) 5951return WhenAll((ReadOnlySpan<Task>)tasks); 5976public static Task WhenAll(/*params*/ ReadOnlySpan<Task> tasks) => 5985internal WhenAllPromise(ReadOnlySpan<Task> tasks) 5996foreach (Task task in tasks) 6016foreach (Task task in tasks) 6029public void Invoke(Task? completedTask) 6053if (failedOrCanceled is List<Task> list) 6063Debug.Assert(failedOrCanceled is Task, $"Expected Task, got {failedOrCanceled}"); 6064Task first = (Task)failedOrCanceled; 6065failedOrCanceled = Interlocked.CompareExchange(ref m_stateObject, new List<Task> { first, completedTask }, first); 6072Debug.Assert(failedOrCanceled is List<Task>); 6101Task? canceledTask = null; 6103void HandleTask(Task task) 6118if (failedOrCanceled is List<Task> list) 6120foreach (Task task in list) 6127Debug.Assert(failedOrCanceled is Task); 6128HandleTask((Task)failedOrCanceled); 6358public void Invoke(Task ignored) 6369Task? canceledTask = null; 6455public static Task<Task> WhenAny(params Task[] tasks) 6459return WhenAnyCore((ReadOnlySpan<Task>)tasks); 6474public static Task<Task> WhenAny(/*params*/ ReadOnlySpan<Task> tasks) => 6489private static Task<TTask> WhenAnyCore<TTask>(ReadOnlySpan<TTask> tasks) where TTask : Task 6527public static Task<Task> WhenAny(Task task1, Task task2) => 6528WhenAny<Task>(task1, task2); 6541private static Task<TTask> WhenAny<TTask>(TTask task1, TTask task2) where TTask : Task 6558private sealed class TwoTaskWhenAnyPromise<TTask> : Task<TTask>, ITaskCompletionAction where TTask : Task 6593public void Invoke(Task completingTask) 6595Task? task1; 6598Task? task2 = _task2; 6647public static Task<Task> WhenAny(IEnumerable<Task> tasks) => 6648WhenAny<Task>(tasks); 6662private static Task<TTask> WhenAny<TTask>(IEnumerable<TTask> tasks) where TTask : Task 6804public static IAsyncEnumerable<Task> WhenEach(params Task[] tasks) 6807return WhenEach((ReadOnlySpan<Task>)tasks); 6810/// <inheritdoc cref="WhenEach(Task[])"/> 6811public static IAsyncEnumerable<Task> WhenEach(ReadOnlySpan<Task> tasks) => // TODO https://github.com/dotnet/runtime/issues/77873: Add params 6812WhenEachState.Iterate<Task>(WhenEachState.Create(tasks)); 6814/// <inheritdoc cref="WhenEach(Task[])"/> 6815public static IAsyncEnumerable<Task> WhenEach(IEnumerable<Task> tasks) => 6816WhenEachState.Iterate<Task>(WhenEachState.Create(tasks)); 6818/// <inheritdoc cref="WhenEach(Task[])"/> 6825/// <inheritdoc cref="WhenEach(Task[])"/> 6827WhenEachState.Iterate<Task<TResult>>(WhenEachState.Create(ReadOnlySpan<Task>.CastUp(tasks))); 6829/// <inheritdoc cref="WhenEach(Task[])"/> 6834private sealed class WhenEachState : Queue<Task>, IValueTaskSource, ITaskCompletionAction 6850void ITaskCompletionAction.Invoke(Task completingTask) 6874public static WhenEachState? Create(ReadOnlySpan<Task> tasks) 6881foreach (Task task in tasks) 6896/// <inheritdoc cref="Create(ReadOnlySpan{Task})"/> 6897public static WhenEachState? Create(IEnumerable<Task> tasks) 6903IEnumerator<Task> e = tasks.GetEnumerator(); 6909Task task = e.Current; 6925public static async IAsyncEnumerable<T> Iterate<T>(WhenEachState? waiter, [EnumeratorCancellation] CancellationToken cancellationToken = default) where T : Task 6942Task? next; 6979internal static Task<TResult> CreateUnwrapPromise<TResult>(Task outerTask, bool lookForOce) 7009if (continuationObject is Task continuationTask) 7020return new Delegate[] { new Action<Task>(singleCompletionAction.Invoke) }; 7047private static Task? GetActiveTaskFromId(int taskId) 7049Task? task = null; 7058private readonly Task m_completingTask; 7060internal CompletionActionInvoker(ITaskCompletionAction action, Task completingTask) 7075private readonly Task m_task; 7077public SystemThreadingTasks_TaskDebugView(Task task) 7291void Invoke(Task completingTask); 7321public UnwrapPromise(Task outerTask, bool lookForOce) 7347public void Invoke(Task completingTask) 7367private void InvokeCore(Task completingTask) 7387private void InvokeCoreAsync(Task completingTask) 7396var tuple = (TupleSlim<UnwrapPromise<TResult>, Task>)state!; 7398}, new TupleSlim<UnwrapPromise<TResult>, Task>(this, completingTask)); 7403private void ProcessCompletedOuterTask(Task task) 7424taskOfTaskOfTResult.Result : ((Task<Task>)task).Result); 7433private bool TrySetFromTask(Task task, bool lookForOce) 7480private void ProcessInnerTask(Task? task)
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskAsyncEnumerableExtensions.cs (1)
9/// <summary>Provides a set of static methods for configuring <see cref="Task"/>-related behaviors on asynchronous enumerables and disposables.</summary>
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskAsyncEnumerableExtensions.ToBlockingEnumerable.cs (1)
11/// <summary>Provides a set of static methods for configuring <see cref="Task"/>-related behaviors on asynchronous enumerables and disposables.</summary>
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskCanceledException.cs (4)
26private readonly Task? _canceledTask; // The task which has been canceled. 69/// with a reference to the <see cref="Tasks.Task"/> that has been canceled. 72public TaskCanceledException(Task? task) : 98public Task? Task => _canceledTask;
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskCompletionSource.cs (39)
9/// Represents the producer side of a <see cref="Tasks.Task"/> unbound to a 10/// delegate, providing access to the consumer side through the <see cref="Tasks.Task"/> property. 14/// It is often the case that a <see cref="Tasks.Task"/> is desired to 31private readonly Task _task; 38/// The <see cref="Tasks.Task"/> created by this instance and accessible through its <see cref="Task"/> property 41/// <param name="creationOptions">The options to use when creating the underlying <see cref="Tasks.Task"/>.</param> 53/// <see cref="Tasks.Task"/>'s AsyncState.</param> 60/// <param name="creationOptions">The options to use when creating the underlying <see cref="Tasks.Task"/>.</param> 61/// <param name="state">The state to use as the underlying <see cref="Tasks.Task"/>'s AsyncState.</param> 67/// Gets the <see cref="Tasks.Task"/> created 76public Task Task => _task; 78/// <summary>Transitions the underlying <see cref="Tasks.Task"/> into the <see cref="TaskStatus.Faulted"/> state.</summary> 79/// <param name="exception">The exception to bind to this <see cref="Tasks.Task"/>.</param> 82/// The underlying <see cref="Tasks.Task"/> is already in one of the three final states: 95/// <summary>Transitions the underlying <see cref="Tasks.Task"/> into the <see cref="TaskStatus.Faulted"/> state.</summary> 96/// <param name="exceptions">The collection of exceptions to bind to this <see cref="Tasks.Task"/>.</param> 100/// The underlying <see cref="Tasks.Task"/> is already in one of the three final states: 114/// Attempts to transition the underlying <see cref="Tasks.Task"/> into the <see cref="TaskStatus.Faulted"/> state. 116/// <param name="exception">The exception to bind to this <see cref="Tasks.Task"/>.</param> 119/// This operation will return false if the <see cref="Tasks.Task"/> is already in one of the three final states: 142/// Attempts to transition the underlying <see cref="Tasks.Task"/> into the <see cref="TaskStatus.Faulted"/> state. 144/// <param name="exceptions">The collection of exceptions to bind to this <see cref="Tasks.Task"/>.</param> 147/// This operation will return false if the <see cref="Tasks.Task"/> is already in one of the three final states: 188/// Transitions the underlying <see cref="Tasks.Task"/> into the <see cref="TaskStatus.RanToCompletion"/> state. 191/// The underlying <see cref="Tasks.Task"/> is already in one of the three final states: 205/// Attempts to transition the underlying <see cref="Tasks.Task"/> into the <see cref="TaskStatus.RanToCompletion"/> state. 209/// This operation will return false if the <see cref="Tasks.Task"/> is already in one of the three final states: 226/// Transitions the underlying <see cref="Tasks.Task"/> into the <see cref="TaskStatus.Canceled"/> state. 229/// The underlying <see cref="Tasks.Task"/> is already in one of the three final states: 237/// Transitions the underlying <see cref="Tasks.Task"/> into the <see cref="TaskStatus.Canceled"/> state 240/// <param name="cancellationToken">The cancellation token with which to cancel the <see cref="Tasks.Task"/>.</param> 242/// The underlying <see cref="Tasks.Task"/> is already in one of the three final states: 256/// Attempts to transition the underlying <see cref="Tasks.Task"/> into the <see cref="TaskStatus.Canceled"/> state. 260/// This operation will return false if the <see cref="Tasks.Task"/> is already in one of the three final states: 268/// Attempts to transition the underlying <see cref="Tasks.Task"/> into the <see cref="TaskStatus.Canceled"/> state. 270/// <param name="cancellationToken">The cancellation token with which to cancel the <see cref="Tasks.Task"/>.</param> 273/// This operation will return false if the <see cref="Tasks.Task"/> is already in one of the three final states: 303public void SetFromTask(Task completedTask) 322public bool TrySetFromTask(Task completedTask)
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskContinuation.cs (49)
12private Task? m_antecedent; 15Task antecedent, Delegate action, object? state, TaskCreationOptions creationOptions, InternalTaskOptions internalOptions) : 18Debug.Assert(action is Action<Task> || action is Action<Task, object?>, 30Task? antecedent = m_antecedent; 40if (m_action is Action<Task> action) 46if (m_action is Action<Task, object?> actionWithState) 58private Task? m_antecedent; 61Task antecedent, Delegate function, object? state, TaskCreationOptions creationOptions, InternalTaskOptions internalOptions) : 64Debug.Assert(function is Func<Task, TResult> || function is Func<Task, object?, TResult>, 76Task? antecedent = m_antecedent; 86if (m_action is Func<Task, TResult> func) 92if (m_action is Func<Task, object?, TResult> funcWithState) 207internal abstract void Run(Task completedTask, bool canInlineContinuationTask); 214protected static void InlineIfPossibleOrElseQueue(Task task, bool needsProtection) 229task.m_stateFlags |= (int)Task.TaskStateFlags.Started; 262internal Task? m_task; 272internal ContinueWithTaskContinuation(Task task, TaskContinuationOptions options, TaskScheduler scheduler) 282if (Task.s_asyncDebuggingEnabled) 283Task.AddToActiveTasks(m_task); 289internal override void Run(Task completedTask, bool canInlineContinuationTask) 294Task? continuationTask = m_task; 341Task.ContingentProperties? cp = continuationTask.m_contingentProperties; // no need to volatile read, as we only care about the token, which is only assignable at construction 392internal sealed override void Run(Task task, bool canInlineContinuationTask) 398RunCallback(GetInvokeActionCallback(), m_action, ref Task.t_currentTask); 406m_continuationId = Task.NewId(); 409RunCallback(GetPostActionCallback(), this, ref Task.t_currentTask); 473internal sealed override void Run(Task ignored, bool canInlineContinuationTask) 493Task task = CreateTask(static state => 501Task.ThrowAsync(exception, targetContext: null); 547protected Task CreateTask(Action<object?> action, object? state, TaskScheduler scheduler) 563internal override void Run(Task task, bool canInlineContinuationTask) 572RunCallback(GetInvokeActionCallback(), m_action, ref Task.t_currentTask); // any exceptions from m_action will be handled by s_callbackRunAction 579m_continuationId = Task.NewId(); 681protected void RunCallback(ContextCallback callback, object? state, ref Task? currentTask) 684Debug.Assert(currentTask == Task.t_currentTask); 688Task? prevCurrentTask = currentTask; 707Task.ThrowAsync(exception, targetContext: null); 729ref Task? currentTask = ref Task.t_currentTask; 730Task? prevCurrentTask = currentTask; 747Task.ThrowAsync(exception, targetContext: null); 765ref Task? currentTask = ref Task.t_currentTask; 766Task? prevCurrentTask = currentTask; 799Task.ThrowAsync(exception, targetContext: null); 810internal static void UnsafeScheduleAction(Action action, Task? task) 817atc.m_continuationId = Task.NewId();
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskExceptionHolder.cs (2)
30private readonly Task m_task; 45internal TaskExceptionHolder(Task task)
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskExtensions.cs (9)
6/// <summary>Provides a set of static methods for working with specific kinds of <see cref="Task"/> instances.</summary> 9/// <summary>Creates a proxy <see cref="Task"/> that represents the asynchronous operation of a <see cref="Task{Task}"/>.</summary> 11/// <returns>A <see cref="Task"/> that represents the asynchronous operation of the provided <see cref="Task{Task}"/>.</returns> 12public static Task Unwrap(this Task<Task> task) 20!task.IsCompletedSuccessfully ? Task.CreateUnwrapPromise<VoidTaskResult>(task, lookForOce: false) : 22Task.FromCanceled(new CancellationToken(true)); 36!task.IsCompletedSuccessfully ? Task.CreateUnwrapPromise<TResult>(task, lookForOce: false) : 38Task.FromCanceled<TResult>(new CancellationToken(true));
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskFactory.cs (238)
21/// <see cref="Task">Tasks</see>. 31/// <see cref="Task.Factory">Task.Factory</see> property. 45private TaskScheduler GetDefaultScheduler(Task? currTask) 263/// Creates and starts a <see cref="Task">Task</see>. 266/// <returns>The started <see cref="Task">Task</see>.</returns> 272/// <see cref="Task.Start()">Start</see> to schedule it for execution. However, 276public Task StartNew(Action action) 278Task? currTask = Task.InternalCurrent; 279return Task.InternalStartNew(currTask, action, null, m_defaultCancellationToken, GetDefaultScheduler(currTask), 284/// Creates and starts a <see cref="Task">Task</see>. 288/// <returns>The started <see cref="Task">Task</see>.</returns> 297/// <see cref="Task.Start()">Start</see> to schedule it for execution. However, 301public Task StartNew(Action action, CancellationToken cancellationToken) 303Task? currTask = Task.InternalCurrent; 304return Task.InternalStartNew(currTask, action, null, cancellationToken, GetDefaultScheduler(currTask), 309/// Creates and starts a <see cref="Task">Task</see>. 314/// <see cref="Task">Task.</see></param> 315/// <returns>The started <see cref="Task">Task</see>.</returns> 325/// <see cref="Task.Start()">Start</see> to schedule it for execution. 329public Task StartNew(Action action, TaskCreationOptions creationOptions) 331Task? currTask = Task.InternalCurrent; 332return Task.InternalStartNew(currTask, action, null, m_defaultCancellationToken, GetDefaultScheduler(currTask), creationOptions, 337/// Creates and starts a <see cref="Task">Task</see>. 340/// <param name="cancellationToken">The <see cref="CancellationToken"/> that will be assigned to the new <see cref="Task"/></param> 343/// <see cref="Task">Task.</see></param> 347/// cref="Task">Task</see>.</param> 348/// <returns>The started <see cref="Task">Task</see>.</returns> 364/// <see cref="Task.Start()">Start</see> to schedule it for execution. 368public Task StartNew(Action action, CancellationToken cancellationToken, TaskCreationOptions creationOptions, TaskScheduler scheduler) 370return Task.InternalStartNew( 371Task.InternalCurrentIfAttached(creationOptions), action, null, cancellationToken, scheduler, creationOptions, 377/// Creates and starts a <see cref="Task">Task</see>. 382/// <returns>The started <see cref="Task">Task</see>.</returns> 389/// <see cref="Task.Start()">Start</see> to schedule it for execution. 393public Task StartNew(Action<object?> action, object? state) 395Task? currTask = Task.InternalCurrent; 396return Task.InternalStartNew(currTask, action, state, m_defaultCancellationToken, GetDefaultScheduler(currTask), 402/// Creates and starts a <see cref="Task">Task</see>. 407/// <param name="cancellationToken">The <see cref="CancellationToken"/> that will be assigned to the new <see cref="Task"/></param> 408/// <returns>The started <see cref="Task">Task</see>.</returns> 418/// <see cref="Task.Start()">Start</see> to schedule it for execution. 422public Task StartNew(Action<object?> action, object? state, CancellationToken cancellationToken) 424Task? currTask = Task.InternalCurrent; 425return Task.InternalStartNew(currTask, action, state, cancellationToken, GetDefaultScheduler(currTask), 430/// Creates and starts a <see cref="Task">Task</see>. 437/// <see cref="Task">Task.</see></param> 438/// <returns>The started <see cref="Task">Task</see>.</returns> 448/// <see cref="Task.Start()">Start</see> to schedule it for execution. 452public Task StartNew(Action<object?> action, object? state, TaskCreationOptions creationOptions) 454Task? currTask = Task.InternalCurrent; 455return Task.InternalStartNew(currTask, action, state, m_defaultCancellationToken, GetDefaultScheduler(currTask), 460/// Creates and starts a <see cref="Task">Task</see>. 468/// <see cref="Task">Task.</see></param> 472/// cref="Task">Task</see>.</param> 473/// <returns>The started <see cref="Task">Task</see>.</returns> 489/// <see cref="Task.Start()">Start</see> to schedule it for execution. 493public Task StartNew(Action<object?> action, object? state, CancellationToken cancellationToken, 496return Task.InternalStartNew( 497Task.InternalCurrentIfAttached(creationOptions), action, state, cancellationToken, scheduler, 516/// <see cref="Task.Start()">Start</see> to schedule it for execution. 522Task? currTask = Task.InternalCurrent; 536/// <param name="cancellationToken">The <see cref="CancellationToken"/> that will be assigned to the new <see cref="Task"/></param> 547/// <see cref="Task.Start()">Start</see> to schedule it for execution. 553Task? currTask = Task.InternalCurrent; 579/// <see cref="Task.Start()">Start</see> to schedule it for execution. 585Task? currTask = Task.InternalCurrent; 622/// <see cref="Task.Start()">Start</see> to schedule it for execution. 629Task.InternalCurrentIfAttached(creationOptions), function, cancellationToken, 650/// <see cref="Task.Start()">Start</see> to schedule it for execution. 656Task? currTask = Task.InternalCurrent; 672/// <param name="cancellationToken">The <see cref="CancellationToken"/> that will be assigned to the new <see cref="Task"/></param> 683/// <see cref="Task.Start()">Start</see> to schedule it for execution. 689Task? currTask = Task.InternalCurrent; 717/// <see cref="Task.Start()">Start</see> to schedule it for execution. 723Task? currTask = Task.InternalCurrent; 762/// <see cref="Task.Start()">Start</see> to schedule it for execution. 770Task.InternalCurrentIfAttached(creationOptions), function, state, cancellationToken, 779/// Creates a <see cref="Task">Task</see> that executes an end method action 790/// <returns>A <see cref="Task">Task</see> that represents the asynchronous 792public Task FromAsync( 800/// Creates a <see cref="Task">Task</see> that executes an end method action 808/// created <see cref="Task">Task</see>.</param> 816/// <returns>A <see cref="Task">Task</see> that represents the asynchronous 818public Task FromAsync( 827/// Creates a <see cref="Task">Task</see> that executes an end method action 837/// created <see cref="Task">Task</see>.</param> 847/// <returns>A <see cref="Task">Task</see> that represents the asynchronous 849public Task FromAsync( 859/// Creates a <see cref="Task">Task</see> that represents a pair of begin 870/// <returns>The created <see cref="Task">Task</see> that represents the 875public Task FromAsync( 884/// Creates a <see cref="Task">Task</see> that represents a pair of begin 890/// created <see cref="Task">Task</see>.</param> 900/// <returns>The created <see cref="Task">Task</see> that represents the 905public Task FromAsync( 913/// Creates a <see cref="Task">Task</see> that represents a pair of begin 929/// <returns>The created <see cref="Task">Task</see> that represents the 934public Task FromAsync<TArg1>( 944/// Creates a <see cref="Task">Task</see> that represents a pair of begin 955/// created <see cref="Task">Task</see>.</param> 965/// <returns>The created <see cref="Task">Task</see> that represents the 970public Task FromAsync<TArg1>( 979/// Creates a <see cref="Task">Task</see> that represents a pair of begin 999/// <returns>The created <see cref="Task">Task</see> that represents the 1004public Task FromAsync<TArg1, TArg2>( 1013/// Creates a <see cref="Task">Task</see> that represents a pair of begin 1028/// created <see cref="Task">Task</see>.</param> 1038/// <returns>The created <see cref="Task">Task</see> that represents the 1043public Task FromAsync<TArg1, TArg2>( 1052/// Creates a <see cref="Task">Task</see> that represents a pair of begin 1076/// <returns>The created <see cref="Task">Task</see> that represents the 1081public Task FromAsync<TArg1, TArg2, TArg3>( 1090/// Creates a <see cref="Task">Task</see> that represents a pair of begin 1109/// created <see cref="Task">Task</see>.</param> 1119/// <returns>The created <see cref="Task">Task</see> that represents the 1124public Task FromAsync<TArg1, TArg2, TArg3>( 1547private sealed class CompleteOnCountdownPromise : Task<Task[]>, ITaskCompletionAction 1549private readonly Task[] _tasks; 1552internal CompleteOnCountdownPromise(Task[] tasksCopy) 1565public void Invoke(Task completingTask) 1596internal static Task<Task[]> CommonCWAllLogic(Task[] tasksCopy) 1635public void Invoke(Task completingTask) 1683/// Creates a continuation <see cref="Task">Task</see> 1689/// <returns>The new continuation <see cref="Task">Task</see>.</returns> 1698public Task ContinueWhenAll(Task[] tasks, Action<Task[]> continuationAction) 1706/// Creates a continuation <see cref="Task">Task</see> 1714/// <returns>The new continuation <see cref="Task">Task</see>.</returns> 1726public Task ContinueWhenAll(Task[] tasks, Action<Task[]> continuationAction, CancellationToken cancellationToken) 1734/// Creates a continuation <see cref="Task">Task</see> 1742/// the created continuation <see cref="Task">Task</see>.</param> 1743/// <returns>The new continuation <see cref="Task">Task</see>.</returns> 1760public Task ContinueWhenAll(Task[] tasks, Action<Task[]> continuationAction, TaskContinuationOptions continuationOptions) 1768/// Creates a continuation <see cref="Task">Task</see> 1778/// the created continuation <see cref="Task">Task</see>.</param> 1781/// cref="Task">Task</see>.</param> 1782/// <returns>The new continuation <see cref="Task">Task</see>.</returns> 1804public Task ContinueWhenAll(Task[] tasks, Action<Task[]> continuationAction, CancellationToken cancellationToken, 1813/// Creates a continuation <see cref="Task">Task</see> 1820/// <returns>The new continuation <see cref="Task">Task</see>.</returns> 1829public Task ContinueWhenAll<TAntecedentResult>(Task<TAntecedentResult>[] tasks, Action<Task<TAntecedentResult>[]> continuationAction) 1838/// Creates a continuation <see cref="Task">Task</see> 1847/// <returns>The new continuation <see cref="Task">Task</see>.</returns> 1859public Task ContinueWhenAll<TAntecedentResult>(Task<TAntecedentResult>[] tasks, Action<Task<TAntecedentResult>[]> continuationAction, 1868/// Creates a continuation <see cref="Task">Task</see> 1877/// the created continuation <see cref="Task">Task</see>.</param> 1878/// <returns>The new continuation <see cref="Task">Task</see>.</returns> 1895public Task ContinueWhenAll<TAntecedentResult>(Task<TAntecedentResult>[] tasks, Action<Task<TAntecedentResult>[]> continuationAction, 1904/// Creates a continuation <see cref="Task">Task</see> 1915/// the created continuation <see cref="Task">Task</see>.</param> 1918/// cref="Task">Task</see>.</param> 1919/// <returns>The new continuation <see cref="Task">Task</see>.</returns> 1941public Task ContinueWhenAll<TAntecedentResult>(Task<TAntecedentResult>[] tasks, Action<Task<TAntecedentResult>[]> continuationAction, 1950/// Creates a continuation <see cref="Task">Task</see> 1969public Task<TResult> ContinueWhenAll<TResult>(Task[] tasks, Func<Task[], TResult> continuationFunction) 1978/// Creates a continuation <see cref="Task">Task</see> 2002public Task<TResult> ContinueWhenAll<TResult>(Task[] tasks, Func<Task[], TResult> continuationFunction, CancellationToken cancellationToken) 2040public Task<TResult> ContinueWhenAll<TResult>(Task[] tasks, Func<Task[], TResult> continuationFunction, TaskContinuationOptions continuationOptions) 2088public Task<TResult> ContinueWhenAll<TResult>(Task[] tasks, Func<Task[], TResult> continuationFunction, CancellationToken cancellationToken, 2264internal sealed class CompleteOnInvokePromise<TTask> : Task<TTask>, ITaskCompletionAction where TTask : Task 2290public void Invoke(Task completingTask) 2336internal static Task<TTask> CommonCWAnyLogic<TTask>(IList<TTask> tasks, bool isSyncBlocking = false) where TTask : Task 2349Task task = tasks[i]; 2393internal static void CommonCWAnyLogicCleanup(Task<Task> continuation) 2397((CompleteOnInvokePromise<Task>)continuation).Invoke(null!); 2401/// Creates a continuation <see cref="Task">Task</see> 2407/// <returns>The new continuation <see cref="Task">Task</see>.</returns> 2416public Task ContinueWhenAny(Task[] tasks, Action<Task> continuationAction) 2424/// Creates a continuation <see cref="Task">Task</see> 2432/// <returns>The new continuation <see cref="Task">Task</see>.</returns> 2444public Task ContinueWhenAny(Task[] tasks, Action<Task> continuationAction, CancellationToken cancellationToken) 2452/// Creates a continuation <see cref="Task">Task</see> 2460/// the created continuation <see cref="Task">Task</see>.</param> 2461/// <returns>The new continuation <see cref="Task">Task</see>.</returns> 2478public Task ContinueWhenAny(Task[] tasks, Action<Task> continuationAction, TaskContinuationOptions continuationOptions) 2486/// Creates a continuation <see cref="Task">Task</see> 2496/// the created continuation <see cref="Task">Task</see>.</param> 2499/// cref="Task">Task</see>.</param> 2500/// <returns>The new continuation <see cref="Task">Task</see>.</returns> 2522public Task ContinueWhenAny(Task[] tasks, Action<Task> continuationAction, CancellationToken cancellationToken, 2551public Task<TResult> ContinueWhenAny<TResult>(Task[] tasks, Func<Task, TResult> continuationFunction) 2583public Task<TResult> ContinueWhenAny<TResult>(Task[] tasks, Func<Task, TResult> continuationFunction, CancellationToken cancellationToken) 2621public Task<TResult> ContinueWhenAny<TResult>(Task[] tasks, Func<Task, TResult> continuationFunction, TaskContinuationOptions continuationOptions) 2669public Task<TResult> ContinueWhenAny<TResult>(Task[] tasks, Func<Task, TResult> continuationFunction, CancellationToken cancellationToken, 2831/// Creates a continuation <see cref="Task">Task</see> 2838/// <returns>The new continuation <see cref="Task"/>.</returns> 2847public Task ContinueWhenAny<TAntecedentResult>(Task<TAntecedentResult>[] tasks, Action<Task<TAntecedentResult>> continuationAction) 2855/// Creates a continuation <see cref="Task">Task</see> 2864/// <returns>The new continuation <see cref="Task"/>.</returns> 2876public Task ContinueWhenAny<TAntecedentResult>(Task<TAntecedentResult>[] tasks, Action<Task<TAntecedentResult>> continuationAction, 2885/// Creates a continuation <see cref="Task">Task</see> 2894/// the created continuation <see cref="Task">Task</see>.</param> 2895/// <returns>The new continuation <see cref="Task"/>.</returns> 2912public Task ContinueWhenAny<TAntecedentResult>(Task<TAntecedentResult>[] tasks, Action<Task<TAntecedentResult>> continuationAction, 2921/// Creates a continuation <see cref="Task">Task</see> 2932/// the created continuation <see cref="Task">Task</see>.</param> 2936/// <returns>The new continuation <see cref="Task"/>.</returns> 2958public Task ContinueWhenAny<TAntecedentResult>(Task<TAntecedentResult>[] tasks, Action<Task<TAntecedentResult>> continuationAction, 2968internal static Task[] CheckMultiContinuationTasksAndCopy(Task[] tasks) 2975Task[] tasksCopy = new Task[tasks.Length];
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskScheduler.cs (35)
42/// Queues a <see cref="Task">Task</see> to the scheduler. 57/// <param name="task">The <see cref="Task">Task</see> to be queued.</param> 59protected internal abstract void QueueTask(Task task); 62/// Determines whether the provided <see cref="Task">Task</see> 90/// <param name="task">The <see cref="Task">Task</see> to be 101protected abstract bool TryExecuteTaskInline(Task task, bool taskWasPreviouslyQueued); 104/// Generates an enumerable of <see cref="Task">Task</see> instances 144protected abstract IEnumerable<Task>? GetScheduledTasks(); 165internal bool TryRunInline(Task task, bool taskWasPreviouslyQueued) 203/// Attempts to dequeue a <see cref="Task">Task</see> that was previously queued to 206/// <param name="task">The <see cref="Task">Task</see> to be dequeued.</param> 209protected internal virtual bool TryDequeue(Task task) 230internal void InternalQueueTask(Task task) 319Task? currentTask = Task.InternalCurrent; 331/// All <see cref="Task">Task</see> instances queued to 378/// Attempts to execute the provided <see cref="Task">Task</see> 383/// Scheduler implementations are provided with <see cref="Task">Task</see> 397/// A <see cref="Task">Task</see> object to be executed.</param> 404protected bool TryExecuteTask(Task task) 420/// Occurs when a faulted <see cref="Task"/>'s unobserved exception is about to trigger exception escalation 443/// Provides an array of all queued <see cref="Task">Task</see> instances 451/// <returns>An array of <see cref="Task">Task</see> instances.</returns> 455internal Task[]? GetScheduledTasksForDebugger() 459IEnumerable<Task>? activeTasksSource = GetScheduledTasks(); 465if (!(activeTasksSource is Task[] activeTasksArray)) 467activeTasksArray = (new List<Task>(activeTasksSource)).ToArray(); 471foreach (Task t in activeTasksArray) 533public IEnumerable<Task>? ScheduledTasks => m_taskScheduler.GetScheduledTasks(); 563protected internal override void QueueTask(Task task) 576protected override bool TryExecuteTaskInline(Task task, bool taskWasPreviouslyQueued) 588protected override IEnumerable<Task>? GetScheduledTasks() 605Debug.Assert(s is Task); 606((Task)s).ExecuteEntry(); // with double-execute check because SC could be buggy 611/// Provides data for the event that is raised when a faulted <see cref="Task"/>'s
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\ThreadPoolTaskScheduler.cs (8)
34Debug.Assert(s is Task); 35((Task)s).ExecuteEntryUnsafe(threadPoolThread: null); 42protected internal override void QueueTask(Task task) 69protected override bool TryExecuteTaskInline(Task task, bool taskWasPreviouslyQueued) 88protected internal override bool TryDequeue(Task task) 94protected override IEnumerable<Task> GetScheduledTasks() 99private static IEnumerable<Task> FilterTasksFromWorkItems(IEnumerable<object> tpwItems) 103if (tpwi is Task t)
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\ValueTask.cs (41)
31/// <see cref="ValueTask"/> instances are meant to be directly awaited. To do more complicated operations with them, a <see cref="Task"/> 44/// <see cref="ValueTask"/> wraps a <code>T</code> or a <see cref="Task"/>, it may not work if the <see cref="ValueTask"/> 59private static volatile Task? s_canceledTask; 61/// <summary>null if representing a successful synchronous completion, otherwise a <see cref="Task"/> or a <see cref="IValueTaskSource"/>.</summary> 71/// <summary>Initialize the <see cref="ValueTask"/> with a <see cref="Task"/> that represents the operation.</summary> 74public ValueTask(Task task) 126new ValueTask(Task.FromCanceled(cancellationToken)); 132new ValueTask<TResult>(Task.FromCanceled<TResult>(cancellationToken)); 138new ValueTask(Task.FromException(exception)); 144new ValueTask<TResult>(Task.FromException<TResult>(exception)); 166/// Gets a <see cref="Task"/> object to represent this ValueTask. 172public Task AsTask() 175Debug.Assert(obj == null || obj is Task || obj is IValueTaskSource); 177obj == null ? Task.CompletedTask : 178obj as Task ?? 185/// <summary>Creates a <see cref="Task"/> to represent the <see cref="IValueTaskSource"/>.</summary> 190private Task GetTaskForValueTaskSource(IValueTaskSource t) 200return Task.CompletedTask; 213var task = new Task(); 219return s_canceledTask ??= Task.FromCanceled(new CancellationToken(canceled: true)); 223return Task.FromException(exc); 231/// <summary>Type used to create a <see cref="Task"/> to represent a <see cref="IValueTaskSource"/>.</summary> 301Debug.Assert(obj == null || obj is Task || obj is IValueTaskSource); 308if (obj is Task t) 324Debug.Assert(obj == null || obj is Task || obj is IValueTaskSource); 331if (obj is Task t) 346Debug.Assert(obj == null || obj is Task || obj is IValueTaskSource); 353if (obj is Task t) 365/// this will always return false. If it's backed by a <see cref="Task"/>, it'll return the 366/// value of the task's <see cref="Task.IsCanceled"/> property. 373Debug.Assert(obj == null || obj is Task || obj is IValueTaskSource); 380if (obj is Task t) 394Debug.Assert(obj == null || obj is Task || obj is IValueTaskSource); 398if (obj is Task t) 416Debug.Assert(valueTask._obj is null or Task or IValueTaskSource, "If the ValueTask<>'s backing object is an IValueTaskSource<TResult>, it must also be IValueTaskSource."); 579return Task.FromResult(_result!); 607return Task.FromResult(t.GetResult(_token)); 626return s_canceledTask ??= Task.FromCanceled<TResult>(new CancellationToken(true)); 630return Task.FromException<TResult>(exc); 771/// this will always return false. If it's backed by a <see cref="Task"/>, it'll return the 772/// value of the task's <see cref="Task.IsCanceled"/> property.
src\libraries\System.Private.CoreLib\src\System\Threading\ThreadPoolWorkQueue.cs (4)
596Debug.Assert((callback is IThreadPoolWorkItem) ^ (callback is Task)); 620Debug.Assert((workItem is IThreadPoolWorkItem) ^ (workItem is Task)); 1005if (workItem is Task task) 1595if (callBack is Task)
src\libraries\System.Private.CoreLib\src\System\Threading\Timer.cs (5)
650notifyWhenNoCallbacksRunning is Task); 657var t = new Task((object?)null, TaskCreationOptions.RunContinuationsAsynchronously, true); 663return new ValueTask((Task)notifyWhenNoCallbacksRunning); 699Debug.Assert(toSignal is WaitHandle || toSignal is Task); 707((Task)toSignal).TrySetResult();
System.Private.DataContractSerialization (74)
System\Xml\XmlBaseWriter.cs (17)
75public override Task FlushAsync() 364protected override Task WriteEndAttributeAsync() 375private async Task WriteEndAttributeAsyncImpl() 545private async Task StartElementAndWriteStartElementAsync(string? prefix, string localName, string? namespaceUri) 591public override Task WriteStartElementAsync(string? prefix, string localName, string? namespaceUri) 630public override Task WriteEndElementAsync() 641private async Task WriteEndElementAsyncImpl() 702private Task FlushElementAsync() 704return _writeState == WriteState.Element ? AutoCompleteAsync(WriteState.Content) : Task.CompletedTask; 723protected async Task StartContentAsync() 782private async Task AutoCompleteAsync(WriteState writeState) 797private Task EndStartElementAsync() 1512public override Task WriteBase64Async(byte[] buffer, int offset, int count) 1522private async Task WriteBase64AsyncImpl(byte[] buffer, int offset, int count) 1738private Task FlushBase64Async() 1740return _trailByteCount > 0 ? FlushTrailBytesAsync() : Task.CompletedTask; 1759private async Task FlushTrailBytesAsync()
System\Xml\XmlDictionaryAsyncCheckWriter.cs (29)
18private Task? _lastTask; 43private Task SetLastTask(Task task) 91public override Task FlushAsync() 109public override Task WriteAttributesAsync(XmlReader reader, bool defattr) 121public override Task WriteBase64Async(byte[] buffer, int index, int count) 133public override Task WriteBinHexAsync(byte[] buffer, int index, int count) 145public override Task WriteCDataAsync(string? text) 157public override Task WriteCharEntityAsync(char ch) 169public override Task WriteCharsAsync(char[] buffer, int index, int count) 181public override Task WriteCommentAsync(string? text) 193public override Task WriteDocTypeAsync(string name, string? pubid, string? sysid, string? subset) 211public override Task WriteEndDocumentAsync() 223public override Task WriteEndElementAsync() 235public override Task WriteEntityRefAsync(string name) 247public override Task WriteFullEndElementAsync() 259public override Task WriteNameAsync(string name) 271public override Task WriteNmTokenAsync(string name) 283public override Task WriteNodeAsync(XmlReader reader, bool defattr) 295public override Task WriteProcessingInstructionAsync(string name, string? text) 307public override Task WriteQualifiedNameAsync(string localName, string? ns) 325public override Task WriteRawAsync(string data) 331public override Task WriteRawAsync(char[] buffer, int index, int count) 355public override Task WriteStartDocumentAsync() 361public override Task WriteStartDocumentAsync(bool standalone) 373public override Task WriteStartElementAsync(string? prefix, string localName, string? ns) 385public override Task WriteStringAsync(string? text) 397public override Task WriteSurrogateCharEntityAsync(char lowChar, char highChar) 463public override Task WriteWhitespaceAsync(string? ws)
System\Xml\XmlDictionaryWriter.cs (4)
77public override Task WriteBase64Async(byte[] buffer, int index, int count) 80return Task.CompletedTask; 217public virtual Task WriteValueAsync(IStreamProvider value) 220return Task.CompletedTask;
System\Xml\XmlNodeWriter.cs (6)
22public virtual Task FlushAsync() 31public virtual Task WriteStartElementAsync(string? prefix, string localName) 41public virtual Task WriteEndStartElementAsync(bool isEmpty) 46public virtual Task WriteEndElementAsync(string? prefix, string localName) 67public virtual Task WriteEndAttributeAsync() 95public virtual Task WriteBase64TextAsync(byte[] trailBuffer, int trailCount, byte[] buffer, int offset, int count)
System\Xml\XmlStreamNodeWriter.cs (12)
134protected Task WriteByteAsync(byte b) 143return Task.CompletedTask; 147private async Task FlushBufferAndWriteByteAsync(byte b) 159protected Task WriteByteAsync(char ch) 179protected Task WriteBytesAsync(byte b1, byte b2) 189return Task.CompletedTask; 193private async Task FlushAndWriteBytesAsync(byte b1, byte b2) 206protected Task WriteBytesAsync(char ch1, char ch2) 404protected virtual Task FlushBufferAsync() 408var task = OutputStream.WriteAsync(_buffer, 0, _offset); 413return Task.CompletedTask; 422public override async Task FlushAsync()
System\Xml\XmlUTF8TextWriter.cs (6)
174public override async Task WriteStartElementAsync(string? prefix, string localName) 216public override async Task WriteEndStartElementAsync(bool isEmpty) 240public override async Task WriteEndElementAsync(string? prefix, string localName) 338public override async Task WriteEndAttributeAsync() 639public override async Task WriteBase64TextAsync(byte[] trailBytes, int trailByteCount, byte[] buffer, int offset, int count) 668private async Task InternalWriteBase64TextAsync(byte[] buffer, int offset, int count)
System.Private.Xml (538)
System\Xml\AsyncHelper.cs (19)
10public static readonly Task<bool> DoneTaskTrue = Task.FromResult(true); 12public static readonly Task<bool> DoneTaskFalse = Task.FromResult(false); 14public static readonly Task<int> DoneTaskZero = Task.FromResult(0); 16public static bool IsSuccess(this Task task) 21public static Task CallVoidFuncWhenFinishAsync<TArg>(this Task task, Action<TArg> func, TArg arg) 26return Task.CompletedTask; 34private static async Task CallVoidFuncWhenFinishCoreAsync<TArg>(this Task task, Action<TArg> func, TArg arg) 40public static Task<bool> ReturnTrueTaskWhenFinishAsync(this Task task) 47private static async Task<bool> ReturnTrueTaskWhenFinishCoreAsync(this Task task) 53public static Task CallTaskFuncWhenFinishAsync<TArg>(this Task task, Func<TArg, Task> func, TArg arg) 60private static async Task CallTaskFuncWhenFinishCoreAsync<TArg>(Task task, Func<TArg, Task> func, TArg arg) 66public static Task<bool> CallBoolTaskFuncWhenFinishAsync<TArg>(this Task task, Func<TArg, Task<bool>> func, TArg arg) 73private static async Task<bool> CallBoolTaskFuncWhenFinishCoreAsync<TArg>(this Task task, Func<TArg, Task<bool>> func, TArg arg)
System\Xml\Base64EncoderAsync.cs (6)
12internal abstract Task WriteCharsAsync(char[] chars, int index, int count); 14internal Task EncodeAsync(byte[] buffer, int index, int count) 23async Task Core(byte[] buffer, int index, int count) 76internal async Task FlushAsync() 89internal override Task WriteCharsAsync(char[] chars, int index, int count) 97internal override Task WriteCharsAsync(char[] chars, int index, int count)
System\Xml\BinHexEncoderAsync.cs (2)
10internal static Task EncodeAsync(byte[] buffer, int index, int count, XmlWriter writer) 19static async Task Core(byte[] buffer, int index, int count, XmlWriter writer)
System\Xml\Core\IDtdParserAdapterAsync.cs (2)
17Task ParsePIAsync(StringBuilder? sb); 18Task ParseCommentAsync(StringBuilder? sb);
System\Xml\Core\ReadContentAsBinaryHelperAsync.cs (1)
189internal async Task FinishAsync()
System\Xml\Core\XmlAsyncCheckReader.cs (4)
14private Task _lastTask = Task.CompletedTask; 843public override Task SkipAsync() 846var task = _coreReader.SkipAsync();
System\Xml\Core\XmlAsyncCheckWriter.cs (60)
12private Task _lastTask = Task.CompletedTask; 347public override Task WriteStartDocumentAsync() 350var task = _coreWriter.WriteStartDocumentAsync(); 355public override Task WriteStartDocumentAsync(bool standalone) 358var task = _coreWriter.WriteStartDocumentAsync(standalone); 363public override Task WriteEndDocumentAsync() 366var task = _coreWriter.WriteEndDocumentAsync(); 371public override Task WriteDocTypeAsync(string name, string? pubid, string? sysid, string? subset) 374var task = _coreWriter.WriteDocTypeAsync(name, pubid, sysid, subset); 379public override Task WriteStartElementAsync(string? prefix, string localName, string? ns) 382var task = _coreWriter.WriteStartElementAsync(prefix, localName, ns); 387public override Task WriteEndElementAsync() 390var task = _coreWriter.WriteEndElementAsync(); 395public override Task WriteFullEndElementAsync() 398var task = _coreWriter.WriteFullEndElementAsync(); 403protected internal override Task WriteStartAttributeAsync(string? prefix, string localName, string? ns) 406var task = _coreWriter.WriteStartAttributeAsync(prefix, localName, ns); 411protected internal override Task WriteEndAttributeAsync() 414var task = _coreWriter.WriteEndAttributeAsync(); 419public override Task WriteCDataAsync(string? text) 422var task = _coreWriter.WriteCDataAsync(text); 427public override Task WriteCommentAsync(string? text) 430var task = _coreWriter.WriteCommentAsync(text); 435public override Task WriteProcessingInstructionAsync(string name, string? text) 438var task = _coreWriter.WriteProcessingInstructionAsync(name, text); 443public override Task WriteEntityRefAsync(string name) 446var task = _coreWriter.WriteEntityRefAsync(name); 451public override Task WriteCharEntityAsync(char ch) 454var task = _coreWriter.WriteCharEntityAsync(ch); 459public override Task WriteWhitespaceAsync(string? ws) 462var task = _coreWriter.WriteWhitespaceAsync(ws); 467public override Task WriteStringAsync(string? text) 470var task = _coreWriter.WriteStringAsync(text); 475public override Task WriteSurrogateCharEntityAsync(char lowChar, char highChar) 478var task = _coreWriter.WriteSurrogateCharEntityAsync(lowChar, highChar); 483public override Task WriteCharsAsync(char[] buffer, int index, int count) 486var task = _coreWriter.WriteCharsAsync(buffer, index, count); 491public override Task WriteRawAsync(char[] buffer, int index, int count) 494var task = _coreWriter.WriteRawAsync(buffer, index, count); 499public override Task WriteRawAsync(string data) 502var task = _coreWriter.WriteRawAsync(data); 507public override Task WriteBase64Async(byte[] buffer, int index, int count) 510var task = _coreWriter.WriteBase64Async(buffer, index, count); 515public override Task WriteBinHexAsync(byte[] buffer, int index, int count) 518var task = _coreWriter.WriteBinHexAsync(buffer, index, count); 523public override Task FlushAsync() 526var task = _coreWriter.FlushAsync(); 531public override Task WriteNmTokenAsync(string name) 534var task = _coreWriter.WriteNmTokenAsync(name); 539public override Task WriteNameAsync(string name) 542var task = _coreWriter.WriteNameAsync(name); 547public override Task WriteQualifiedNameAsync(string localName, string? ns) 550var task = _coreWriter.WriteQualifiedNameAsync(localName, ns); 555public override Task WriteAttributesAsync(XmlReader reader, bool defattr) 558var task = _coreWriter.WriteAttributesAsync(reader, defattr); 563public override Task WriteNodeAsync(XmlReader reader, bool defattr) 566var task = _coreWriter.WriteNodeAsync(reader, defattr); 571public override Task WriteNodeAsync(XPathNavigator navigator, bool defattr) 574var task = _coreWriter.WriteNodeAsync(navigator, defattr);
System\Xml\Core\XmlCharCheckingReaderAsync.cs (2)
315return Task.FromResult(0); 369return Task.FromResult(0);
System\Xml\Core\XmlCharCheckingWriterAsync.cs (14)
19public override Task WriteDocTypeAsync(string name, string? pubid, string? sysid, string? subset) 58public override Task WriteStartElementAsync(string? prefix, string localName, string? ns) 74protected internal override Task WriteStartAttributeAsync(string? prefix, string localName, string? ns) 91public override async Task WriteCDataAsync(string? text) 116public override Task WriteCommentAsync(string? text) 133public override Task WriteProcessingInstructionAsync(string name, string? text) 156public override Task WriteEntityRefAsync(string name) 165public override Task WriteWhitespaceAsync(string? ws) 187public override Task WriteStringAsync(string? text) 205public override Task WriteSurrogateCharEntityAsync(char lowChar, char highChar) 210public override Task WriteCharsAsync(char[] buffer, int index, int count) 235public override Task WriteNmTokenAsync(string name) 245public override Task WriteNameAsync(string name) 254public override Task WriteQualifiedNameAsync(string localName, string? ns)
System\Xml\Core\XmlEncodedRawTextWriterAsync.cs (69)
33internal override async Task WriteXmlDeclarationAsync(XmlStandalone standalone) 63internal override Task WriteXmlDeclarationAsync(string xmldecl) 72return Task.CompletedTask; 132public override async Task WriteDocTypeAsync(string name, string? pubid, string? sysid, string? subset) 174public override Task WriteStartElementAsync(string? prefix, string localName, string? ns) 182Task task; 202internal override Task WriteEndElementAsync(string prefix, string localName, string ns) 233return Task.CompletedTask; 237internal override Task WriteFullEndElementAsync(string prefix, string localName, string ns) 259protected internal override Task WriteStartAttributeAsync(string? prefix, string localName, string? ns) 271Task task; 291protected internal override Task WriteEndAttributeAsync() 301return Task.CompletedTask; 304internal override async Task WriteNamespaceDeclarationAsync(string prefix, string namespaceName) 314internal override async Task WriteStartNamespaceDeclarationAsync(string prefix) 343internal override Task WriteEndNamespaceDeclarationAsync() 354return Task.CompletedTask; 359public override async Task WriteCDataAsync(string? text) 397public override async Task WriteCommentAsync(string? text) 417public override async Task WriteProcessingInstructionAsync(string name, string? text) 440public override async Task WriteEntityRefAsync(string name) 460public override async Task WriteCharEntityAsync(char ch) 489public override Task WriteWhitespaceAsync(string? ws) 508public override Task WriteStringAsync(string? text) 526public override async Task WriteSurrogateCharEntityAsync(char lowChar, char highChar) 545public override Task WriteCharsAsync(char[] buffer, int index, int count) 567public override async Task WriteRawAsync(char[] buffer, int index, int count) 583public override async Task WriteRawAsync(string data) 596public override async Task FlushAsync() 616protected virtual async Task FlushBufferAsync() 678private async Task EncodeCharsAsync(int startOffset, int endOffset, bool writeAllToStream) 705private Task FlushEncoderAsync() 719return Task.CompletedTask; 875protected async Task WriteAttributeTextBlockAsync(char[] chars, int index, int count) 892protected Task WriteAttributeTextBlockAsync(string text) 906return Task.CompletedTask; 909private async Task _WriteAttributeTextBlockAsync(string text, int curIndex, int leftCount) 1086protected async Task WriteElementTextBlockAsync(char[] chars, int index, int count) 1111protected Task WriteElementTextBlockAsync(string text) 1130return Task.CompletedTask; 1133private async Task _WriteElementTextBlockAsync(bool newLine, string text, int curIndex, int leftCount) 1249protected Task RawTextAsync(string text) 1254Task.CompletedTask; 1257protected Task RawTextAsync(string text1, string? text2 = null, string? text3 = null, string? text4 = null) 1310return Task.CompletedTask; 1313private async Task _RawTextAsync( 1485protected async Task WriteRawWithCharCheckingAsync(char[] chars, int index, int count) 1509protected async Task WriteRawWithCharCheckingAsync(string text) 1687protected async Task WriteCommentOrPiAsync(string text, int stopChar) 1871protected async Task WriteCDataSectionAsync(string text) 1908public override async Task WriteDocTypeAsync(string name, string? pubid, string? sysid, string? subset) 1919public override async Task WriteStartElementAsync(string? prefix, string localName, string? ns) 1935internal override async Task WriteEndElementAsync(string prefix, string localName, string ns) 1953internal override async Task WriteFullEndElementAsync(string prefix, string localName, string ns) 1972protected internal override async Task WriteStartAttributeAsync(string? prefix, string localName, string? ns) 1985internal override async Task WriteStartNamespaceDeclarationAsync(string prefix) 1997public override Task WriteCDataAsync(string? text) 2004public override async Task WriteCommentAsync(string? text) 2015public override async Task WriteProcessingInstructionAsync(string target, string? text) 2026public override Task WriteEntityRefAsync(string name) 2033public override Task WriteCharEntityAsync(char ch) 2040public override Task WriteSurrogateCharEntityAsync(char lowChar, char highChar) 2047public override Task WriteWhitespaceAsync(string? ws) 2054public override Task WriteStringAsync(string? text) 2061public override Task WriteCharsAsync(char[] buffer, int index, int count) 2068public override Task WriteRawAsync(char[] buffer, int index, int count) 2075public override Task WriteRawAsync(string data) 2082public override Task WriteBase64Async(byte[] buffer, int index, int count) 2090private async Task WriteIndentAsync()
System\Xml\Core\XmlRawWriterAsync.cs (32)
46public override Task WriteStartDocumentAsync() 51public override Task WriteStartDocumentAsync(bool standalone) 56public override Task WriteEndDocumentAsync() 61public override Task WriteDocTypeAsync(string name, string? pubid, string? sysid, string? subset) 63return Task.CompletedTask; 67public override Task WriteEndElementAsync() 73public override Task WriteFullEndElementAsync() 79public override Task WriteBase64Async(byte[] buffer, int index, int count) 88public override Task WriteNmTokenAsync(string name) 94public override Task WriteNameAsync(string name) 100public override Task WriteQualifiedNameAsync(string localName, string? ns) 106public override Task WriteCDataAsync(string? text) 112public override Task WriteCharEntityAsync(char ch) 118public override Task WriteSurrogateCharEntityAsync(char lowChar, char highChar) 124public override Task WriteWhitespaceAsync(string? ws) 130public override Task WriteCharsAsync(char[] buffer, int index, int count) 136public override Task WriteRawAsync(char[] buffer, int index, int count) 142public override Task WriteRawAsync(string data) 148public override Task WriteAttributesAsync(XmlReader reader, bool defattr) 153public override Task WriteNodeAsync(XmlReader reader, bool defattr) 158public override Task WriteNodeAsync(System.Xml.XPath.XPathNavigator navigator, bool defattr) 168internal virtual Task WriteXmlDeclarationAsync(XmlStandalone standalone) 170return Task.CompletedTask; 172internal virtual Task WriteXmlDeclarationAsync(string xmldecl) 174return Task.CompletedTask; 181internal virtual Task WriteEndElementAsync(string prefix, string localName, string ns) 186internal virtual Task WriteFullEndElementAsync(string prefix, string localName, string ns) 191internal virtual async Task WriteQualifiedNameAsync(string prefix, string localName, string? ns) 204internal virtual Task WriteNamespaceDeclarationAsync(string prefix, string ns) 209internal virtual Task WriteStartNamespaceDeclarationAsync(string prefix) 214internal virtual Task WriteEndNamespaceDeclarationAsync() 220internal virtual Task WriteEndBase64Async()
System\Xml\Core\XmlReaderAsync.cs (3)
118public virtual Task SkipAsync() 120return ReadState != ReadState.Interactive ? Task.CompletedTask : SkipSubtreeAsync(); 211private async Task WriteNodeAsync(XmlTextWriter xtw, bool defattr)
System\Xml\Core\XmlSubtreeReaderAsync.cs (3)
20return Task.FromResult(_curNode.value); 101public override async Task SkipAsync() 532return Task.FromResult(copyCount);
System\Xml\Core\XmlTextReaderImplAsync.cs (57)
37return Task.FromResult(_curNode.StringValue); 57private Task FinishInitAsync() 70return Task.CompletedTask; 75private async Task FinishInitUriStringAsync() 114private async Task FinishInitStreamAsync() 138private async Task FinishInitTextReaderAsync() 240return Task.FromResult(ParseFragmentAttribute()); 307public override async Task SkipAsync() 743internal async Task DtdParserProxy_ParsePIAsync(StringBuilder? sb) 759internal async Task DtdParserProxy_ParseCommentAsync(StringBuilder? sb) 860private Task InitStreamInputAsync(Uri baseUri, Stream stream, Encoding? encoding) 866private async Task InitStreamInputAsync(Uri? baseUri, string baseUriStr, Stream stream, byte[]? bytes, int byteCount, Encoding? encoding) 975private Task ProcessDtdFromParserContextAsync(XmlParserContext context) 995return Task.CompletedTask; 999private Task SwitchEncodingAsync(Encoding newEncoding) 1010return Task.CompletedTask; 1013private Task SwitchEncodingToUTF8Async() 1856private Task ParseElementAsync() 1926private Task ParseElementAsync_ContinueWithSetElement(Task<(int, int)> task) 1941private async Task _ParseElementAsync_ContinueWithSetElement(Task<(int, int)> task) 1949private Task ParseElementAsync_SetElement(int colonPos, int pos) 2001private Task ParseElementAsync_NoAttributes() 2047return Task.CompletedTask; 2050private async Task ParseElementAsync_ReadData(int pos) 2060private Task ParseEndElementAsync() 2075private async Task _ParseEndElmentAsync() 2081private async Task ParseEndElmentAsync_PrepareData() 2098private Task ParseEndElementAsync_CheckNameAndParse() 2138private Task ParseEndElementAsync_Finish(int nameLen, NodeData startTagNode, LineInfo endTagLineInfo) 2140Task task = ParseEndElementAsync_CheckEndTag(nameLen, startTagNode, endTagLineInfo); 2162private async Task ParseEndElementAsync_Finish(Task task, int nameLen, NodeData startTagNode, LineInfo endTagLineInfo) 2181private Task ParseEndElementAsync_CheckEndTag(int nameLen, NodeData startTagNode, LineInfo endTagLineInfo) 2193return Task.CompletedTask; 2242return Task.CompletedTask; 2267return Task.CompletedTask; 2270private async Task ParseEndElementAsync_ReadData() 2280private async Task ThrowTagMismatchAsync(NodeData startTag) 2305private async Task ParseAttributesAsync() 2603private async Task ParseAttributeValueSlowAsync(int curPos, char quoteChar, NodeData attr) 3164private readonly Task<(int, int, int, bool)> _parseText_dummyTask = Task.FromResult((0, 0, 0, false)); 3527private async Task FinishPartialValueAsync() 3560private async Task FinishOtherValueIteratorAsync() 3607private async Task SkipPartialTextValueAsync() 3623private Task FinishReadValueChunkAsync() 3638return Task.CompletedTask; 3642private async Task FinishReadContentAsBinaryAsync() 3663private async Task FinishReadElementContentAsBinaryAsync() 3716private async Task ParseEntityReferenceAsync() 4189private Task ParseCDataAsync() 4195private async Task ParseCDataOrCommentAsync(XmlNodeType type) 4467private async Task ParseDtdAsync() 4482private async Task SkipDtdAsync() 4591private Task SkipPublicOrSystemIdLiteralAsync() 4604private async Task SkipUntilAsync(char stopChar, bool recognizeLiterals) 5100private async Task PushExternalEntityOrSubsetAsync(string? publicId, string? systemId, Uri? baseUri, string? entityName) 5253private async Task ParseDtdFromParserContextAsync()
System\Xml\Core\XmlTextReaderImplHelpersAsync.cs (2)
40Task IDtdParserAdapter.ParsePIAsync(StringBuilder? sb) 45Task IDtdParserAdapter.ParseCommentAsync(StringBuilder? sb)
System\Xml\Core\XmlUtf8RawTextWriterAsync.cs (66)
33internal override async Task WriteXmlDeclarationAsync(XmlStandalone standalone) 62internal override Task WriteXmlDeclarationAsync(string xmldecl) 71return Task.CompletedTask; 110public override async Task WriteDocTypeAsync(string name, string? pubid, string? sysid, string? subset) 150public override Task WriteStartElementAsync(string? prefix, string localName, string? ns) 156Task task; 176internal override Task WriteEndElementAsync(string prefix, string localName, string ns) 205return Task.CompletedTask; 209internal override Task WriteFullEndElementAsync(string prefix, string localName, string ns) 229protected internal override Task WriteStartAttributeAsync(string? prefix, string localName, string? ns) 239Task task; 259protected internal override Task WriteEndAttributeAsync() 267return Task.CompletedTask; 270internal override async Task WriteNamespaceDeclarationAsync(string prefix, string namespaceName) 280internal override async Task WriteStartNamespaceDeclarationAsync(string prefix) 305internal override Task WriteEndNamespaceDeclarationAsync() 314return Task.CompletedTask; 319public override async Task WriteCDataAsync(string? text) 355public override async Task WriteCommentAsync(string? text) 373public override async Task WriteProcessingInstructionAsync(string name, string? text) 394public override async Task WriteEntityRefAsync(string name) 412public override async Task WriteCharEntityAsync(char ch) 439public override Task WriteWhitespaceAsync(string? ws) 456public override Task WriteStringAsync(string? text) 472public override async Task WriteSurrogateCharEntityAsync(char lowChar, char highChar) 489public override Task WriteCharsAsync(char[] buffer, int index, int count) 509public override async Task WriteRawAsync(char[] buffer, int index, int count) 523public override async Task WriteRawAsync(string data) 534public override async Task FlushAsync() 549protected virtual async Task FlushBufferAsync() 745protected async Task WriteAttributeTextBlockAsync(char[] chars, int index, int count) 762protected Task WriteAttributeTextBlockAsync(string text) 776return Task.CompletedTask; 779private async Task _WriteAttributeTextBlockAsync(string text, int curIndex, int leftCount) 955protected async Task WriteElementTextBlockAsync(char[] chars, int index, int count) 980protected Task WriteElementTextBlockAsync(string text) 999return Task.CompletedTask; 1002private async Task _WriteElementTextBlockAsync(bool newLine, string text, int curIndex, int leftCount) 1117protected Task RawTextAsync(string text) 1122Task.CompletedTask; 1125protected Task RawTextAsync(string text1, string? text2 = null, string? text3 = null, string? text4 = null) 1178return Task.CompletedTask; 1181private async Task _RawTextAsync( 1352protected async Task WriteRawWithCharCheckingAsync(char[] chars, int index, int count) 1376protected async Task WriteRawWithCharCheckingAsync(string text) 1553protected async Task WriteCommentOrPiAsync(string text, int stopChar) 1736protected async Task WriteCDataSectionAsync(string text) 1773public override async Task WriteDocTypeAsync(string name, string? pubid, string? sysid, string? subset) 1784public override async Task WriteStartElementAsync(string? prefix, string localName, string? ns) 1800internal override async Task WriteEndElementAsync(string prefix, string localName, string ns) 1818internal override async Task WriteFullEndElementAsync(string prefix, string localName, string ns) 1837protected internal override async Task WriteStartAttributeAsync(string? prefix, string localName, string? ns) 1850internal override async Task WriteStartNamespaceDeclarationAsync(string prefix) 1862public override Task WriteCDataAsync(string? text) 1869public override async Task WriteCommentAsync(string? text) 1880public override async Task WriteProcessingInstructionAsync(string target, string? text) 1891public override Task WriteEntityRefAsync(string name) 1898public override Task WriteCharEntityAsync(char ch) 1905public override Task WriteSurrogateCharEntityAsync(char lowChar, char highChar) 1912public override Task WriteWhitespaceAsync(string? ws) 1919public override Task WriteStringAsync(string? text) 1926public override Task WriteCharsAsync(char[] buffer, int index, int count) 1933public override Task WriteRawAsync(char[] buffer, int index, int count) 1940public override Task WriteRawAsync(string data) 1947public override Task WriteBase64Async(byte[] buffer, int index, int count) 1955private async Task WriteIndentAsync()
System\Xml\Core\XmlValidatingReaderImplAsync.cs (2)
173private async Task ParseDtdFromParserContextAsync() 191private async Task ResolveEntityInternallyAsync()
System\Xml\Core\XmlWellFormedWriterAsync.cs (84)
21public override Task WriteStartDocumentAsync() 26public override Task WriteStartDocumentAsync(bool standalone) 31public override async Task WriteEndDocumentAsync() 59public override async Task WriteDocTypeAsync(string name, string? pubid, string? sysid, string? subset) 125private Task TryReturnTask(Task task) 129return Task.CompletedTask; 137private async Task _TryReturnTask(Task task) 151private Task SequenceRun<TArg>(Task task, Func<TArg, Task> nextTaskFun, TArg arg) 163private async Task _SequenceRun<TArg>(Task task, Func<TArg, Task> nextTaskFun, TArg arg) 177public override Task WriteStartElementAsync(string? prefix, string localName, string? ns) 185Task task = AdvanceStateAsync(Token.StartElement); 202private Task WriteStartElementAsync_NoAdvanceState(string? prefix, string localName, string? ns) 241Task task = _writer.WriteStartElementAsync(prefix, localName, ns); 250return Task.CompletedTask; 259private async Task WriteStartElementAsync_NoAdvanceState(Task task, string? prefix, string localName, string? ns) 302private async Task WriteStartElementAsync_FinishWrite(Task t, string prefix, string localName, string ns) 316public override Task WriteEndElementAsync() 320Task task = AdvanceStateAsync(Token.EndElement); 331private Task WriteEndElementAsync_NoAdvanceState() 340Task task; 360private Task WriteEndElementAsync_FinishWrite() 392return Task.CompletedTask; 395public override Task WriteFullEndElementAsync() 399Task task = AdvanceStateAsync(Token.EndElement); 410private Task WriteFullEndElementAsync_NoAdvanceState() 419Task task; 439protected internal override Task WriteStartAttributeAsync(string? prefix, string localName, string? namespaceName) 458Task task = AdvanceStateAsync(Token.StartAttribute); 475private Task WriteStartAttributeAsync_NoAdvanceState(string? prefix, string localName, string? namespaceName) 585return Task.CompletedTask; 594private async Task WriteStartAttributeAsync_NoAdvanceState(Task task, string? prefix, string localName, string? namespaceName) 609protected internal override Task WriteEndAttributeAsync() 613Task task = AdvanceStateAsync(Token.EndAttribute); 623private Task WriteEndAttributeAsync_NoAdvance() 643private async Task WriteEndAttributeAsync_SepcialAtt() 753public override async Task WriteCDataAsync(string? text) 769public override async Task WriteCommentAsync(string? text) 785public override async Task WriteProcessingInstructionAsync(string name, string? text) 830public override async Task WriteEntityRefAsync(string name) 855public override async Task WriteCharEntityAsync(char ch) 881public override async Task WriteSurrogateCharEntityAsync(char lowChar, char highChar) 907public override async Task WriteWhitespaceAsync(string? ws) 935public override Task WriteStringAsync(string? text) 941return Task.CompletedTask; 944Task task = AdvanceStateAsync(Token.Text); 962private Task WriteStringAsync_NoAdvanceState(string text) 969return Task.CompletedTask; 983private async Task WriteStringAsync_NoAdvanceState(Task task, string text) 997public override async Task WriteCharsAsync(char[] buffer, int index, int count) 1023public override async Task WriteRawAsync(char[] buffer, int index, int count) 1049public override async Task WriteRawAsync(string data) 1075public override Task WriteBase64Async(byte[] buffer, int index, int count) 1084Task task = AdvanceStateAsync(Token.Base64); 1102private async Task WriteBase64Async_NoAdvanceState(Task task, byte[] buffer, int index, int count) 1116public override async Task FlushAsync() 1129public override async Task WriteQualifiedNameAsync(string localName, string? ns) 1174public override async Task WriteBinHexAsync(byte[] buffer, int index, int count) 1192private async Task WriteStartDocumentImplAsync(XmlStandalone standalone) 1229private Task AdvanceStateAsync_ReturnWhenFinish(Task task, State newState) 1234return Task.CompletedTask; 1242private async Task _AdvanceStateAsync_ReturnWhenFinish(Task task, State newState) 1248private Task AdvanceStateAsync_ContinueWhenFinish(Task task, State newState, Token token) 1261private async Task _AdvanceStateAsync_ContinueWhenFinish(Task task, State newState, Token token) 1269private Task AdvanceStateAsync(Token token) 1286Task task; 1374return Task.CompletedTask; 1378private async Task StartElementContentAsync_WithNS() 1392private Task StartElementContentAsync() 1401return Task.CompletedTask;
System\Xml\Core\XmlWellFormedWriterHelpersAsync.cs (4)
16internal Task WriteEndElementAsync(XmlRawWriter rawWriter) 21internal Task WriteFullEndElementAsync(XmlRawWriter rawWriter) 29internal async Task WriteDeclAsync(XmlWriter writer, XmlRawWriter? rawWriter) 54internal async Task ReplayAsync(XmlWriter writer)
System\Xml\Core\XmlWrappingReaderAsync.cs (1)
25public override Task SkipAsync()
System\Xml\Core\XmlWrappingWriterAsync.cs (22)
15public override Task WriteStartDocumentAsync() 20public override Task WriteStartDocumentAsync(bool standalone) 25public override Task WriteEndDocumentAsync() 30public override Task WriteDocTypeAsync(string name, string? pubid, string? sysid, string? subset) 35public override Task WriteStartElementAsync(string? prefix, string localName, string? ns) 40public override Task WriteEndElementAsync() 45public override Task WriteFullEndElementAsync() 50protected internal override Task WriteStartAttributeAsync(string? prefix, string localName, string? ns) 55protected internal override Task WriteEndAttributeAsync() 60public override Task WriteCDataAsync(string? text) 65public override Task WriteCommentAsync(string? text) 70public override Task WriteProcessingInstructionAsync(string name, string? text) 75public override Task WriteEntityRefAsync(string name) 80public override Task WriteCharEntityAsync(char ch) 85public override Task WriteWhitespaceAsync(string? ws) 90public override Task WriteStringAsync(string? text) 95public override Task WriteSurrogateCharEntityAsync(char lowChar, char highChar) 100public override Task WriteCharsAsync(char[] buffer, int index, int count) 105public override Task WriteRawAsync(char[] buffer, int index, int count) 110public override Task WriteRawAsync(string data) 115public override Task WriteBase64Async(byte[] buffer, int index, int count) 120public override Task FlushAsync()
System\Xml\Core\XmlWriterAsync.cs (39)
18public virtual Task WriteStartDocumentAsync() 25public virtual Task WriteStartDocumentAsync(bool standalone) 32public virtual Task WriteEndDocumentAsync() 39public virtual Task WriteDocTypeAsync(string name, string? pubid, string? sysid, string? subset) 46public virtual Task WriteStartElementAsync(string? prefix, string localName, string? ns) 53public virtual Task WriteEndElementAsync() 60public virtual Task WriteFullEndElementAsync() 66public Task WriteAttributeStringAsync(string? prefix, string localName, string? ns, string? value) 68Task task = WriteStartAttributeAsync(prefix, localName, ns); 77private async Task WriteAttributeStringAsyncHelper(Task task, string? value) 86protected internal virtual Task WriteStartAttributeAsync(string? prefix, string localName, string? ns) 93protected internal virtual Task WriteEndAttributeAsync() 100public virtual Task WriteCDataAsync(string? text) 107public virtual Task WriteCommentAsync(string? text) 114public virtual Task WriteProcessingInstructionAsync(string name, string? text) 121public virtual Task WriteEntityRefAsync(string name) 128public virtual Task WriteCharEntityAsync(char ch) 135public virtual Task WriteWhitespaceAsync(string? ws) 142public virtual Task WriteStringAsync(string? text) 149public virtual Task WriteSurrogateCharEntityAsync(char lowChar, char highChar) 156public virtual Task WriteCharsAsync(char[] buffer, int index, int count) 163public virtual Task WriteRawAsync(char[] buffer, int index, int count) 170public virtual Task WriteRawAsync(string data) 177public virtual Task WriteBase64Async(byte[] buffer, int index, int count) 183public virtual Task WriteBinHexAsync(byte[] buffer, int index, int count) 190public virtual Task FlushAsync() 199public virtual Task WriteNmTokenAsync(string name) 207public virtual Task WriteNameAsync(string name) 213public virtual async Task WriteQualifiedNameAsync(string localName, string? ns) 231public virtual Task WriteAttributesAsync(XmlReader reader, bool defattr) 236async Task Core(XmlReader reader, bool defattr) 280public virtual Task WriteNodeAsync(XmlReader reader, bool defattr) 296internal async Task WriteNodeAsync_CallSyncReader(XmlReader reader, bool defattr) 358internal async Task WriteNodeAsync_CallAsyncReader(XmlReader reader, bool defattr) 419public virtual Task WriteNodeAsync(XPathNavigator navigator, bool defattr) 424async Task Core(XPathNavigator navigator, bool defattr) 545public async Task WriteElementStringAsync(string? prefix, string localName, string? ns, string value) 557private async Task WriteLocalNamespacesAsync(XPathNavigator nsNav)
System\Xml\Core\XsdCachingReaderAsync.cs (4)
22return Task.FromResult(_cachedNode!.OriginalStringValue!); 26return Task.FromResult(_cachedNode!.RawValue); 105public override async Task SkipAsync() 134internal Task SetToReplayModeAsync()
System\Xml\Core\XsdValidatingReaderAsync.cs (13)
25return Task.FromResult(_cachedNode.RawValue); 266private Task<bool> ReadAsync_ReadAhead(Task task) 279private async Task<bool> _ReadAsync_ReadAhead(Task task) 316Task task = ProcessReaderEventAsync(); 346public override async Task SkipAsync() 490private Task ProcessReaderEventAsync() 497return Task.CompletedTask; 535return Task.CompletedTask; 537static async Task ValidateWhitespace(Task<string> t, XmlSchemaValidator validator) => validator.ValidateWhitespace(await t.ConfigureAwait(false)); 539static async Task ValidateText(Task<string> t, XmlSchemaValidator validator) => validator.ValidateText(await t.ConfigureAwait(false)); 542private async Task ProcessElementEventAsync() 628private async Task ProcessEndElementEventAsync() 651private async Task ProcessInlineSchemaAsync()
System\Xml\Resolvers\XmlPreloadedResolverAsync.cs (2)
35return Task.FromResult<object>(data.AsStream()); 39return Task.FromResult<object>(data.AsTextReader());
System\Xml\Schema\DtdParserAsync.cs (22)
42private async Task ParseAsync(bool saveInternalSubset) 70private async Task ParseInDocumentDtdAsync(bool saveInternalSubset) 119private async Task ParseFreeFloatingDtdAsync() 134private Task ParseInternalSubsetAsync() 140private async Task ParseExternalSubsetAsync() 168private async Task ParseSubsetAsync() 288private async Task ParseAttlistDeclAsync() 396private async Task ParseAttlistTypeAsync(SchemaAttDef attrDef, SchemaElementDecl elementDecl, bool ignoreErrors) 525private async Task ParseAttlistDefaultAsync(SchemaAttDef attrDef, bool ignoreErrors) 572private async Task ParseElementDeclAsync() 659private async Task ParseElementOnlyContentAsync(ParticleContentValidator pcv, int startParenEntityId) 749private async Task ParseHowManyAsync(ParticleContentValidator pcv) 767private async Task ParseElementMixedContentAsync(ParticleContentValidator pcv, int startParenEntityId) 838private async Task ParseEntityDeclAsync() 935private async Task ParseNotationDeclAsync() 986private async Task ParseCommentAsync() 1016private async Task ParsePIAsync() 1032private async Task ParseCondSectionAsync() 2380private Task ScanNameAsync() 2385private Task ScanQNameAsync() 2390private async Task ScanQNameAsync(bool isQName) 2476private async Task ScanNmtokenAsync()
System\Xml\Schema\ParserAsync.cs (1)
16public async Task StartParsingAsync(XmlReader reader, string? targetNamespace)
System\Xml\XmlDownloadManager.cs (1)
32return Task.FromResult<Stream>(new FileStream(fileUri.LocalPath, FileMode.Open, FileAccess.Read, FileShare.Read, 1, useAsync: true));
System\Xml\XmlResolver.FileSystemResolver.cs (1)
46return Task.FromResult<object>(new FileStream(absoluteUri.LocalPath, FileMode.Open, FileAccess.Read, FileShare.Read, 1, useAsync: true));
System.Private.Xml.Linq (37)
System\Xml\Linq\XCData.cs (2)
67public override Task WriteToAsync(XmlWriter writer, CancellationToken cancellationToken) 72return Task.FromCanceled(cancellationToken);
System\Xml\Linq\XComment.cs (2)
108public override Task WriteToAsync(XmlWriter writer, CancellationToken cancellationToken) 113return Task.FromCanceled(cancellationToken);
System\Xml\Linq\XContainer.cs (4)
852internal async Task ReadContentFromAsync(XmlReader r, CancellationToken cancellationToken) 864internal async Task ReadContentFromAsync(XmlReader r, LoadOptions o, CancellationToken cancellationToken) 1318internal async Task WriteContentToAsync(XmlWriter writer, CancellationToken cancellationToken) 1328Task tWrite;
System\Xml\Linq\XDocument.cs (8)
458return Task.FromCanceled<XDocument>(cancellationToken); 619public async Task SaveAsync(Stream stream, SaveOptions options, CancellationToken cancellationToken) 704public async Task SaveAsync(TextWriter textWriter, SaveOptions options, CancellationToken cancellationToken) 751public Task SaveAsync(XmlWriter writer, CancellationToken cancellationToken) 825public override Task WriteToAsync(XmlWriter writer, CancellationToken cancellationToken) 830return Task.FromCanceled(cancellationToken); 834private async Task WriteToAsyncInternal(XmlWriter writer, CancellationToken cancellationToken) 836Task tStart;
System\Xml\Linq\XDocumentType.cs (2)
160public override Task WriteToAsync(XmlWriter writer, CancellationToken cancellationToken) 165return Task.FromCanceled(cancellationToken);
System\Xml\Linq\XElement.cs (9)
840return Task.FromCanceled<XElement>(cancellationToken); 1080public async Task SaveAsync(Stream stream, SaveOptions options, CancellationToken cancellationToken) 1142public async Task SaveAsync(TextWriter textWriter, SaveOptions options, CancellationToken cancellationToken) 1177public Task SaveAsync(XmlWriter writer, CancellationToken cancellationToken) 1182return Task.FromCanceled(cancellationToken); 1186private async Task SaveAsyncInternal(XmlWriter writer, CancellationToken cancellationToken) 1315public override Task WriteToAsync(XmlWriter writer, CancellationToken cancellationToken) 1320return Task.FromCanceled(cancellationToken); 2027private async Task ReadElementFromAsync(XmlReader r, LoadOptions o, CancellationToken cancellationTokentoken)
System\Xml\Linq\XLinq.cs (4)
250public async Task WriteElementAsync(XElement e, CancellationToken cancellationToken) 350private async Task WriteEndElementAsync(CancellationToken cancellationToken) 363private async Task WriteFullEndElementAsync(CancellationToken cancellationToken) 389private async Task WriteStartElementAsync(XElement e, CancellationToken cancellationToken)
System\Xml\Linq\XNode.cs (2)
469return Task.FromCanceled<XNode>(cancellationToken); 620public abstract Task WriteToAsync(XmlWriter writer, CancellationToken cancellationToken);
System\Xml\Linq\XProcessingInstruction.cs (2)
134public override Task WriteToAsync(XmlWriter writer, CancellationToken cancellationToken) 139return Task.FromCanceled(cancellationToken);
System\Xml\Linq\XText.cs (2)
106public override Task WriteToAsync(XmlWriter writer, CancellationToken cancellationToken) 111return Task.FromCanceled(cancellationToken);
System.Runtime (1)
artifacts\obj\System.Runtime\Debug\net9.0\System.Runtime.Forwards.cs (1)
788[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Threading.Tasks.Task))]
System.Runtime.InteropServices.JavaScript (2)
artifacts\obj\System.Runtime.InteropServices.JavaScript\Debug\net9.0\System.Runtime.InteropServices.JavaScript.notsupported.cs (2)
278public void ToManaged(out System.Threading.Tasks.Task? value) { throw new System.PlatformNotSupportedException(System.SR.SystemRuntimeInteropServicesJavaScript_PlatformNotSupported); } 279public void ToJS(System.Threading.Tasks.Task? value) { throw new System.PlatformNotSupportedException(System.SR.SystemRuntimeInteropServicesJavaScript_PlatformNotSupported); }
System.Security.Cryptography (11)
src\libraries\Common\src\System\Net\Http\X509ResourceClient.cs (5)
66await ((Task)task).ConfigureAwait(ConfigureAwaitOptions.SuppressThrowing); 173Task sendTask = (Task)sendAsyncMethod.Invoke(httpClient, new object[] { requestMessage, cancellationToken })!; 217Task sendTask = (Task)sendAsyncMethod.Invoke(httpClient, new object[] { requestMessage, cancellationToken })!;
System\Security\Cryptography\CryptoStream.cs (6)
192public override Task FlushAsync(CancellationToken cancellationToken) 202Task.FromCanceled(cancellationToken) : 203!_canWrite ? Task.CompletedTask : 456public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 713public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) 719private async Task CopyToAsyncInternal(Stream destination, int bufferSize, CancellationToken cancellationToken)
System.Security.Cryptography.Cose (4)
System\Security\Cryptography\Cose\CoseMessage.cs (1)
454internal static async Task AppendToBeSignedAsync(
System\Security\Cryptography\Cose\CoseMultiSignMessage.cs (3)
471private static async Task WriteSignatureAsync( 839public Task AddSignatureForDetachedAsync(Stream detachedContent, CoseSigner signer, ReadOnlyMemory<byte> associatedData = default, CancellationToken cancellationToken = default) 854private async Task AddSignatureCoreAsync(Stream content, CoseSigner signer, ReadOnlyMemory<byte> associatedData, CancellationToken cancellationToken)
System.Security.Principal.Windows (2)
artifacts\obj\System.Security.Principal.Windows\Debug\net9.0\System.Security.Principal.Windows.notsupported.cs (2)
269public static System.Threading.Tasks.Task RunImpersonatedAsync(Microsoft.Win32.SafeHandles.SafeAccessTokenHandle safeAccessTokenHandle, System.Func<System.Threading.Tasks.Task> func) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_Principal); }
System.Text.Json (22)
System\Text\Json\Nodes\JsonNode.Parse.cs (1)
141/// A <see cref="Task"/> to produce a <see cref="JsonNode"/> representation of the JSON value.
System\Text\Json\Serialization\JsonSerializer.Write.Pipe.cs (5)
27public static Task SerializeAsync<TValue>( 64public static Task SerializeAsync<TValue>( 93public static Task SerializeAsync( 132public static Task SerializeAsync( 176public static Task SerializeAsync(
System\Text\Json\Serialization\JsonSerializer.Write.Stream.cs (5)
41public static Task SerializeAsync<TValue>( 107public static Task SerializeAsync( 171public static Task SerializeAsync<TValue>( 232public static Task SerializeAsync( 300public static Task SerializeAsync(
System\Text\Json\Serialization\Metadata\JsonTypeInfo.cs (3)
993internal abstract Task SerializeAsObjectAsync<TSerializationContext>(TSerializationContext serializationContext, object? rootValue, CancellationToken cancellationToken) 995internal abstract Task SerializeAsObjectAsync(Stream utf8Json, object? rootValue, CancellationToken cancellationToken); 996internal abstract Task SerializeAsObjectAsync(PipeWriter utf8Json, object? rootValue, CancellationToken cancellationToken);
System\Text\Json\Serialization\Metadata\JsonTypeInfoOfT.WriteHelpers.cs (6)
62internal Task SerializeAsync(Stream utf8Json, 70internal Task SerializeAsync(PipeWriter utf8Json, 79private async Task SerializeAsync<TSerializationContext>( 300internal sealed override Task SerializeAsObjectAsync<TSerializationContext>(TSerializationContext serializationContext, object? rootValue, CancellationToken cancellationToken) 303internal sealed override Task SerializeAsObjectAsync(Stream utf8Json, object? rootValue, CancellationToken cancellationToken) 306internal sealed override Task SerializeAsObjectAsync(PipeWriter utf8Json, object? rootValue, CancellationToken cancellationToken)
System\Text\Json\Serialization\WriteStack.cs (1)
78public Task? PendingTask;
System\Text\Json\Writer\Utf8JsonWriter.cs (1)
412public async Task FlushAsync(CancellationToken cancellationToken = default)
System.Text.RegularExpressions (11)
System\Threading\StackHelper.cs (11)
39Task.Run(() => action(arg1)) 50Task.Run(() => action(arg1, arg2)) 63Task.Run(() => action(arg1, arg2, arg3)) 78Task.Run(() => action(arg1, arg2, arg3, arg4)) 95Task.Run(() => action(arg1, arg2, arg3, arg4, arg5)) 114Task.Run(() => action(arg1, arg2, arg3, arg4, arg5, arg6)) 122Task.Run(() => func()) 132Task.Run(() => func(arg1)) 144Task.Run(() => func(arg1, arg2)) 158Task.Run(() => func(arg1, arg2, arg3)) 174Task.Run(() => func(arg1, arg2, arg3, arg4))
System.Text.RegularExpressions.Generator (12)
src\libraries\System.Text.RegularExpressions\src\System\Threading\StackHelper.cs (11)
39Task.Run(() => action(arg1)) 50Task.Run(() => action(arg1, arg2)) 63Task.Run(() => action(arg1, arg2, arg3)) 78Task.Run(() => action(arg1, arg2, arg3, arg4)) 95Task.Run(() => action(arg1, arg2, arg3, arg4, arg5)) 114Task.Run(() => action(arg1, arg2, arg3, arg4, arg5, arg6)) 122Task.Run(() => func()) 132Task.Run(() => func(arg1)) 144Task.Run(() => func(arg1, arg2)) 158Task.Run(() => func(arg1, arg2, arg3)) 174Task.Run(() => func(arg1, arg2, arg3, arg4))
UpgradeToGeneratedRegexCodeFixer.cs (1)
42public override async Task RegisterCodeFixesAsync(CodeFixContext context)
System.Threading.Channels (38)
System\Threading\Channels\AsyncOperation.cs (2)
292Task.Factory.StartNew(continuation, state, CancellationToken.None, TaskCreationOptions.DenyChildAttach, ts); 418Task.Factory.StartNew(static s => ((AsyncOperation<TResult>)s!).SetCompletionAndInvokeContinuation(), this,
System\Threading\Channels\BoundedChannel.cs (8)
73public override Task Completion => _parent._completion.Task; 141return new ValueTask<T>(Task.FromCanceled<T>(cancellationToken)); 191return new ValueTask<bool>(Task.FromCanceled<bool>(cancellationToken)); 209new ValueTask<bool>(Task.FromException<bool>(parent._doneWriting)) : 480return new ValueTask<bool>(Task.FromCanceled<bool>(cancellationToken)); 492new ValueTask<bool>(Task.FromException<bool>(parent._doneWriting)) : 528return new ValueTask(Task.FromCanceled(cancellationToken)); 546return new ValueTask(Task.FromException(ChannelUtilities.CreateInvalidCompletionException(parent._doneWriting)));
System\Threading\Channels\ChannelReader.cs (4)
18/// Gets a <see cref="Task"/> that completes when no more data will ever 21public virtual Task Completion => ChannelUtilities.s_neverCompletingTask; 62return new ValueTask<T>(Task.FromCanceled<T>(cancellationToken)); 74return new ValueTask<T>(Task.FromException<T>(exc));
System\Threading\Channels\ChannelUtilities.cs (6)
16internal static readonly Task<bool> s_trueTask = Task.FromResult(result: true); 18internal static readonly Task<bool> s_falseTask = Task.FromResult(result: false); 20internal static readonly Task s_neverCompletingTask = new TaskCompletionSource<bool>().Task; 62error == s_doneWritingSentinel ? Task.FromException<T>(CreateInvalidCompletionException()) : 63error is OperationCanceledException oce ? Task.FromCanceled<T>(oce.CancellationToken.IsCancellationRequested ? oce.CancellationToken : new CancellationToken(true)) : 64Task.FromException<T>(CreateInvalidCompletionException(error));
System\Threading\Channels\ChannelWriter.cs (2)
44cancellationToken.IsCancellationRequested ? new ValueTask(Task.FromCanceled<T>(cancellationToken)) : 50return new ValueTask(Task.FromException(e));
System\Threading\Channels\SingleConsumerUnboundedChannel.cs (8)
66public override Task Completion => _parent._completion.Task; 74return new ValueTask<T>(Task.FromCanceled<T>(cancellationToken)); 145return new ValueTask<bool>(Task.FromCanceled<bool>(cancellationToken)); 167new ValueTask<bool>(Task.FromException<bool>(parent._doneWriting)) : 344cancellationToken.IsCancellationRequested ? new ValueTask<bool>(Task.FromCanceled<bool>(cancellationToken)) : 346doneWriting != ChannelUtilities.s_doneWritingSentinel ? new ValueTask<bool>(Task.FromException<bool>(doneWriting)) : 353cancellationToken.IsCancellationRequested ? new ValueTask(Task.FromCanceled(cancellationToken)) : 355new ValueTask(Task.FromException(ChannelUtilities.CreateInvalidCompletionException(_parent._doneWriting)));
System\Threading\Channels\UnboundedChannel.cs (8)
57public override Task Completion => _parent._completion.Task; 69return new ValueTask<T>(Task.FromCanceled<T>(cancellationToken)); 182return new ValueTask<bool>(Task.FromCanceled<bool>(cancellationToken)); 206new ValueTask<bool>(Task.FromException<bool>(parent._doneWriting)) : 343cancellationToken.IsCancellationRequested ? new ValueTask<bool>(Task.FromCanceled<bool>(cancellationToken)) : 345doneWriting != ChannelUtilities.s_doneWritingSentinel ? new ValueTask<bool>(Task.FromException<bool>(doneWriting)) : 350cancellationToken.IsCancellationRequested ? new ValueTask(Task.FromCanceled(cancellationToken)) : 352new ValueTask(Task.FromException(ChannelUtilities.CreateInvalidCompletionException(_parent._doneWriting)));
System.Threading.RateLimiting (6)
System\Threading\RateLimiting\DefaultPartitionedRateLimiter.cs (3)
30private readonly Task _timerTask; 52private async Task RunTimer() 207private async Task Heartbeat()
System\Threading\RateLimiting\PartitionedRateLimiter.T.cs (1)
68return new ValueTask<RateLimitLease>(Task.FromCanceled<RateLimitLease>(cancellationToken));
System\Threading\RateLimiting\RateLimiter.cs (1)
73return new ValueTask<RateLimitLease>(Task.FromCanceled<RateLimitLease>(cancellationToken));
System\Threading\RateLimiting\TimerAwaitable.cs (1)
98Task.Run(continuation);
System.Threading.Tasks (1)
System.Threading.Tasks.cs (1)
24[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Threading.Tasks.Task))]
System.Threading.Tasks.Dataflow (122)
Base\DataflowBlock.cs (26)
196Task IDataflowBlock.Completion { get { return _source.Completion; } } 535System.Threading.Tasks.Task.Factory.StartNew( 549System.Threading.Tasks.Task.Factory.StartNew( 733Task IDataflowBlock.Completion { get { return Task; } } 1026return Task.FromResult<TOutput>(fastCheckedItem); 1323System.Threading.Tasks.Task.Factory.StartNew(static state => 1334System.Threading.Tasks.Task.Factory.StartNew(static state => 1355System.Threading.Tasks.Task.Factory.StartNew(state => 1390Task IDataflowBlock.Completion { get { throw new NotSupportedException(SR.NotSupported_MemberNotNeeded); } } 1518Task IDataflowBlock.Completion => throw new NotSupportedException(SR.NotSupported_MemberNotNeeded); 1598public Task Completion { get { return _source.Completion; } } 1968task = Task.Factory.StartNew(ChooseTarget<T>.s_processBranchFunction, 1999var boxedCompleted = new StrongBox<Task>(); 2019Task.Factory.ContinueWhenAll(branchTasks, tasks => 2081StrongBox<Task> boxedCompleted, CancellationTokenSource cts, 2159private readonly StrongBox<Task> _completed; 2164internal ChooseTarget(StrongBox<Task> completed, CancellationToken cancellationToken) 2216Task IDataflowBlock.Completion { get { throw new NotSupportedException(SR.NotSupported_MemberNotNeeded); } } 2293Task? sourceCompletionTask = Common.GetPotentiallyNotSupportedCompletionTask(_source); 2311Task? sourceCompletionTask = Common.GetPotentiallyNotSupportedCompletionTask(_source); 2465Target = new ActionBlock<TOutput>((Func<TOutput, Task>)ProcessItemAsync, DataflowBlock._nonGreedyExecutionOptions); 2477Task? sourceCompletionTask = Common.GetPotentiallyNotSupportedCompletionTask(Observable._source); 2492private Task ProcessItemAsync(TOutput item) 2528Task<bool[]> allSendAsyncTasksConsolidated = Task.WhenAll(_tempSendAsyncTaskList); 2694private Task? _completion; 2721Task IDataflowBlock.Completion
Base\IDataflowBlock.cs (1)
21Task Completion { get; }
Blocks\ActionBlock.cs (7)
51public ActionBlock(Func<TInput, Task> action) : 60public ActionBlock(Func<TInput, Task> action, ExecutionDataflowBlockOptions dataflowBlockOptions) : 111var asyncAction = action as Func<TInput, Task>; 157private void ProcessMessageWithTask(Func<TInput, Task> action, KeyValuePair<TInput, long> messageWithId) 163Task? task = null; 202private void AsyncCompleteProcessMessageWithTask(Task completed) 257public Task Completion
Blocks\BatchBlock.cs (8)
142public Task Completion { get { return _source.Completion; } } 216public Task? TaskForInputProcessing { get { return _targetDebuggingInformation.TaskForInputProcessing; } } 218public Task? TaskForOutputProcessing { get { return _sourceDebuggingInformation.TaskForOutputProcessing; } } 284internal Task? TaskForInputProcessing; 473internal Task Completion { get { return _completionTask.Task; } } 525Task.Factory.StartNew(thisTargetCore => 657Task.Factory.StartNew(exc => Complete(exception: (Exception)exc!, dropPendingMessages: true, releaseReservedMessages: true, revertProcessingState: true), 1182public Task? TaskForInputProcessing { get { return _target._nonGreedyState?.TaskForInputProcessing; } }
Blocks\BatchedJoinBlock.cs (5)
144public Task Completion { get { return _source.Completion; } } 250public Task? TaskForOutputProcessing { get { return _sourceDebuggingInformation.TaskForOutputProcessing; } } 399public Task Completion { get { return _source.Completion; } } 510public Task? TaskForOutputProcessing { get { return _sourceDebuggingInformation.TaskForOutputProcessing; } } 633Task IDataflowBlock.Completion { get { throw new NotSupportedException(SR.NotSupported_MemberNotNeeded); } }
Blocks\BroadcastBlock.cs (12)
163public Task Completion { get { return _source.Completion; } } 276Task.Factory.StartNew(exc => CompleteCore(exception: (Exception)exc!, storeExceptionEvenIfAlreadyCompleting: true, revertProcessingState: true), 287Debug.Assert(_boundingState.TaskForInputProcessing.Id == Task.CurrentId, 333Debug.Assert(_boundingState.TaskForInputProcessing.Id == Task.CurrentId, 388Task.Factory.StartNew(static state => 477public Task? TaskForOutputProcessing { get { return _sourceDebuggingInformation.TaskForOutputProcessing; } } 534private Task? _taskForOutputProcessing; 646Task.Factory.StartNew(static state => 860Task.Factory.StartNew(static state => 952Task.Factory.StartNew(static thisSourceCore => ((BroadcastingSourceCore<TOutput>)thisSourceCore!).CompleteBlockOncePossible(), 1186internal Task Completion { get { return _completionTask.Task; } } 1222public Task? TaskForOutputProcessing { get { return _source._taskForOutputProcessing; } }
Blocks\BufferBlock.cs (7)
201public Task Completion { get { return _source.Completion; } } 277Task.Factory.StartNew(exc => CompleteCore(exception: (Exception)exc!, storeExceptionEvenIfAlreadyCompleting: true, revertProcessingState: true), 289Debug.Assert(_boundingState.TaskForInputProcessing.Id == Task.CurrentId, 335Debug.Assert(_boundingState.TaskForInputProcessing.Id == Task.CurrentId, 391Task.Factory.StartNew(static state => 462public Task? TaskForInputProcessing { get { return _bufferBlock._boundingState?.TaskForInputProcessing; } } 464public Task? TaskForOutputProcessing { get { return _sourceDebuggingInformation.TaskForOutputProcessing; } }
Blocks\JoinBlock.cs (12)
86Task.Factory.ContinueWhenAll( 131public Task Completion { get { return _source.Completion; } } 222public Task? TaskForInputProcessing { get { return _joinBlock._sharedResources._taskForInputProcessing; } } 224public Task? TaskForOutputProcessing { get { return _sourceDebuggingInformation.TaskForOutputProcessing; } } 311Task.Factory.ContinueWhenAll( 356public Task Completion { get { return _source.Completion; } } 452public Task? TaskForInputProcessing { get { return _joinBlock._sharedResources._taskForInputProcessing; } } 454public Task? TaskForOutputProcessing { get { return _sourceDebuggingInformation.TaskForOutputProcessing; } } 948public Task Completion { get { throw new NotSupportedException(SR.NotSupported_MemberNotNeeded); } } 950internal Task CompletionTaskInternal { get { return _completionTask.Task; } } 1075internal Task? _taskForInputProcessing; 1346Task.Factory.StartNew(static state =>
Blocks\TransformBlock.cs (2)
362public Task Completion { get { return _source.Completion; } } 439public Task? TaskForOutputProcessing { get { return _sourceDebuggingInformation.TaskForOutputProcessing; } }
Blocks\TransformManyBlock.cs (2)
568public Task Completion { get { return _source.Completion; } } 645public Task? TaskForOutputProcessing { get { return _sourceDebuggingInformation.TaskForOutputProcessing; } }
Blocks\TransformManyBlock.IAsyncEnumerable.cs (5)
39Task t = ProcessMessageAsync(transform, messageWithId); 57private async Task ProcessMessageAsync(Func<TInput, IAsyncEnumerable<TOutput>> transformFunction, KeyValuePair<TInput, long> messageWithId) 91private async Task StoreOutputItemsAsync( 120private async Task StoreOutputItemsReorderedAsync(long id, IAsyncEnumerable<TOutput>? item) 196private async Task StoreOutputItemsNonReorderedWithIterationAsync(IAsyncEnumerable<TOutput> outputItems)
Blocks\WriteOnceBlock.cs (3)
123var taskForOutputProcessing = new Task(static state => ((WriteOnceBlock<T>)state!).OfferToTargetsAndCompleteBlock(), this, 140Task.Factory.StartNew(static state => 344public Task Completion { get { return CompletionTaskSource.Task; } }
Internal\Common.cs (9)
106Task? t = Common.GetPotentiallyNotSupportedCompletionTask(block); 176CancellationToken cancellationToken, Task completionTask, Action<object?, CancellationToken> completeAction, object completeState) 384internal static Task? GetPotentiallyNotSupportedCompletionTask(IDataflowBlock block) 452internal static Exception? StartTaskSafe(Task task, TaskScheduler scheduler) 470private static Exception? StartTaskSafeCore(Task task, TaskScheduler scheduler) 546internal static void PropagateCompletion(Task sourceCompletionTask, IDataflowBlock target, Action<Exception>? exceptionHandler) 569private static void PropagateCompletionAsContinuation(Task sourceCompletionTask, IDataflowBlock target) 580internal static void PropagateCompletionOnceCompleted(Task sourceCompletionTask, IDataflowBlock target) 675internal Task? TaskForInputProcessing;
Internal\DataflowEtwProvider.cs (2)
92IDataflowBlock block, Task task, TaskLaunchedReason reason, int availableMessages) 133Task? completionTask = Common.GetPotentiallyNotSupportedCompletionTask(block);
Internal\SourceCore.cs (8)
79private Task? _taskForOutputProcessing; // protected by ValueLock 278internal Task Completion { get { return _completionTask.Task; } } 519Task.Factory.StartNew(static state => 782Task.Factory.StartNew(static state => 800Debug.Assert(_taskForOutputProcessing != null && _taskForOutputProcessing.Id == Task.CurrentId, 858Debug.Assert(_taskForOutputProcessing != null && _taskForOutputProcessing.Id == Task.CurrentId, 925Task.Factory.StartNew(static state => ((SourceCore<TOutput>)state!).CompleteBlockOncePossible(), 1011internal Task? TaskForOutputProcessing { get { return _source._taskForOutputProcessing; } }
Internal\SpscTargetCore.cs (7)
66private volatile Task? _activeConsumer; 166var newConsumer = new Task( 194_activeConsumer != null && _activeConsumer.Id == Task.CurrentId, 255Task? previousConsumer = Interlocked.Exchange<Task?>(ref _activeConsumer, null); 256Debug.Assert(previousConsumer != null && previousConsumer.Id == Task.CurrentId, 355internal Task Completion { get { return CompletionSource.Task; } }
Internal\TargetCore.cs (4)
241internal Task Completion { get { return _completionSource.Task; } } 372var taskForInputProcessing = new Task(static thisTargetCore => ((TargetCore<TInput>)thisTargetCore!).ProcessMessagesLoopCore(), this, 388Task.Factory.StartNew(exc => Complete(exception: (Exception)exc!, dropPendingMessages: true, storeExceptionEvenIfAlreadyCompleting: true, 745Task.Factory.StartNew(static state => ((TargetCore<TInput>)state!).CompleteBlockOncePossible(),
Internal\TargetRegistry.cs (2)
197Task owningSourceCompletion = _owningSource.Completion; 346Task IDataflowBlock.Completion { get { return _owningSource.Completion; } }
System.Threading.Tasks.Parallel (45)
System\Threading\Tasks\Parallel.cs (14)
221ParallelEtwProvider.Log.ParallelInvokeBegin(TaskScheduler.Current.Id, Task.CurrentId ?? 0, 332Task[] tasks = new Task[actionsCopy.Length]; 340tasks[i] = Task.Factory.StartNew(actionsCopy[i], parallelOptions.CancellationToken, TaskCreationOptions.None, 352Task.WaitAll(tasks); 367ParallelEtwProvider.Log.ParallelInvokeEnd(TaskScheduler.Current.Id, Task.CurrentId ?? 0, forkJoinContextID); 973ParallelEtwProvider.Log.ParallelLoopBegin(TaskScheduler.Current.Id, Task.CurrentId ?? 0, 1010ParallelEtwProvider.Log.ParallelFork(TaskScheduler.Current.Id, Task.CurrentId ?? 0, forkJoinContextID); 1110ParallelEtwProvider.Log.ParallelJoin(TaskScheduler.Current.Id, Task.CurrentId ?? 0, forkJoinContextID); 1155ParallelEtwProvider.Log.ParallelLoopEnd(TaskScheduler.Current.Id, Task.CurrentId ?? 0, forkJoinContextID, long.CreateTruncating(nTotalIterations)); 2540ParallelEtwProvider.Log.ParallelLoopBegin(TaskScheduler.Current.Id, Task.CurrentId ?? 0, 2601ParallelEtwProvider.Log.ParallelFork(TaskScheduler.Current.Id, Task.CurrentId ?? 0, forkJoinContextID); 2747ParallelEtwProvider.Log.ParallelJoin(TaskScheduler.Current.Id, Task.CurrentId ?? 0, forkJoinContextID); 2795ParallelEtwProvider.Log.ParallelLoopEnd(TaskScheduler.Current.Id, Task.CurrentId ?? 0, forkJoinContextID, 0);
System\Threading\Tasks\Parallel.ForEachAsync.cs (29)
20public static Task ForAsync<T>(T fromInclusive, T toExclusive, Func<T, CancellationToken, ValueTask> body) 38public static Task ForAsync<T>(T fromInclusive, T toExclusive, CancellationToken cancellationToken, Func<T, CancellationToken, ValueTask> body) 56public static Task ForAsync<T>(T fromInclusive, T toExclusive, ParallelOptions parallelOptions, Func<T, CancellationToken, ValueTask> body) 77private static Task ForAsync<T>(T fromInclusive, T toExclusive, int dop, TaskScheduler scheduler, CancellationToken cancellationToken, Func<T, CancellationToken, ValueTask> body) 87return Task.FromCanceled(cancellationToken); 92return Task.CompletedTask; 120Func<object, Task> taskBody = static async o => 211return Task.FromException(e); 222public static Task ForEachAsync<TSource>(IEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask> body) 238public static Task ForEachAsync<TSource>(IEnumerable<TSource> source, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 253public static Task ForEachAsync<TSource>(IEnumerable<TSource> source, ParallelOptions parallelOptions, Func<TSource, CancellationToken, ValueTask> body) 271private static Task ForEachAsync<TSource>(IEnumerable<TSource> source, int dop, TaskScheduler scheduler, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 280return Task.FromCanceled(cancellationToken); 284Func<object, Task> taskBody = static async o => 366return Task.FromException(e); 377public static Task ForEachAsync<TSource>(IAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask> body) 393public static Task ForEachAsync<TSource>(IAsyncEnumerable<TSource> source, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 408public static Task ForEachAsync<TSource>(IAsyncEnumerable<TSource> source, ParallelOptions parallelOptions, Func<TSource, CancellationToken, ValueTask> body) 426private static Task ForEachAsync<TSource>(IAsyncEnumerable<TSource> source, int dop, TaskScheduler scheduler, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 435return Task.FromCanceled(cancellationToken); 439Func<object, Task> taskBody = static async o => 521return Task.FromException(e); 543private readonly Func<object, Task> _taskBody; 564protected ForEachAsyncState(Func<object, Task> taskBody, bool needsLock, int dop, TaskScheduler scheduler, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 605Task.Factory.StartNew(_taskBody!, this, default(CancellationToken), TaskCreationOptions.DenyChildAttach, _scheduler); 615public Task AcquireLock() 715IEnumerable<TSource> source, Func<object, Task> taskBody, 737IAsyncEnumerable<TSource> source, Func<object, Task> taskBody, 760T fromExclusive, T toExclusive, Func<object, Task> taskBody,
System\Threading\Tasks\TaskReplicator.cs (2)
30protected volatile Task? _pendingTask; // the most recently queued Task for this replica, or null if we're done. 58Task? pendingTask;
System.Windows.Presentation (3)
System\Windows\Threading\TaskExtensions.cs (3)
17public static bool IsDispatcherOperationTask(this Task @this) 25public static DispatcherOperationStatus DispatcherOperationWait(this Task @this) 33public static DispatcherOperationStatus DispatcherOperationWait(this Task @this, TimeSpan timeout)
SystemdTestApp (1)
Startup.cs (1)
39public static Task Main(string[] args)
TagHelpersWebSite (6)
TagHelpers\AutoLinkerTagHelper.cs (1)
12public override async Task ProcessAsync(TagHelperContext context, TagHelperOutput output)
TagHelpers\CustomEncoderTagHelper.cs (1)
14public override async Task ProcessAsync(TagHelperContext context, TagHelperOutput output)
TagHelpers\DefaultEncoderTagHelper.cs (1)
15public override async Task ProcessAsync(TagHelperContext context, TagHelperOutput output)
TagHelpers\NullEncoderTagHelper.cs (1)
13public override async Task ProcessAsync(TagHelperContext context, TagHelperOutput output)
TagHelpers\TagCloudViewComponentTagHelper.cs (2)
44public async Task ProcessAsync(TagHelperContext context, TagHelperOutput output) 76return Task.FromResult(GetTags(count));
Templates.Blazor.Tests (36)
BlazorWasmTemplateTest.cs (14)
28public async Task BlazorWasmStandaloneTemplate_Works(BrowserKind browserKind) 64public async Task BlazorWasmHostedTemplate_Works(BrowserKind browserKind) 94private static async Task AssertCompressionFormat(AspNetProcess aspNetProcess, string expectedEncoding) 112public async Task BlazorWasmStandalonePwaTemplate_Works(BrowserKind browserKind) 147public async Task BlazorWasmHostedPwaTemplate_Works(BrowserKind browserKind) 286public Task BlazorWasmHostedTemplate_AzureActiveDirectoryTemplate_Works(TemplateInstance instance) 289protected async Task BuildAndRunTest(string appName, Project project, BrowserKind browserKind, bool usesAuth = false) 312private static async Task TestBasicNavigation(string appName, IPage page, bool usesAuth = false, bool skipFetchData = false) 322await Task.WhenAll( 329await Task.WhenAll( 335await Task.WhenAll( 339await Task.WhenAll( 352await Task.WhenAll( 357await Task.WhenAll(
src\ProjectTemplates\Shared\AspNetProcess.cs (7)
106public async Task VisitInBrowserAsync(IPage page) 112public async Task AssertPagesOk(IEnumerable<Page> pages) 124public async Task AssertPagesNotFound(IEnumerable<string> urls) 132public async Task ContainsLinks(Page page) 241public Task AssertOk(string requestUrl) 244public Task AssertNotFound(string requestUrl) 253public async Task AssertStatusCode(string requestUrl, HttpStatusCode statusCode, string acceptContentType = null)
src\ProjectTemplates\Shared\ProcessLock.cs (1)
25public async Task WaitAsync(TimeSpan? timeout = null)
src\ProjectTemplates\Shared\Project.cs (9)
62internal async Task RunDotNetNewAsync( 130internal async Task RunDotNetPublishAsync(IDictionary<string, string> packageOptions = null, string additionalArgs = null, bool noRestore = true) 155internal async Task RunDotNetBuildAsync(IDictionary<string, string> packageOptions = null, string additionalArgs = null, bool errorOnBuildWarning = true) 209internal async Task RunDotNetEfCreateMigrationAsync(string migrationName) 229internal async Task RunDotNetEfUpdateDatabaseAsync() 294public async Task VerifyLaunchSettings(string[] expectedLaunchProfileNames) 349public async Task VerifyHasProperty(string propertyName, string expectedValue) 410internal async Task RunDotNetNewRawAsync(string arguments) 468public async Task WaitAsync()
src\ProjectTemplates\Shared\TemplatePackageInstaller.cs (4)
48public static async Task EnsureTemplatingEngineInitializedAsync(ITestOutputHelper output) 76private static async Task InstallTemplatePackages(ITestOutputHelper output) 118private static async Task VerifyCanFindTemplate(ITestOutputHelper output, string templateName) 127private static async Task VerifyCannotFindTemplateAsync(ITestOutputHelper output, string templateName)
src\Shared\Process\ProcessEx.cs (1)
71public Task Exited => _exited.Task;
Templates.Blazor.WebAssembly.Auth.Tests (43)
BlazorWasmTemplateAuthTest.cs (8)
28public async Task BlazorWasmStandaloneTemplate_IndividualAuth_CreateBuildPublish() 39public async Task BlazorWasmStandaloneTemplate_NoHttps_IndividualAuth_CreateBuildPublish() 98public Task BlazorWasmHostedTemplate_AzureActiveDirectoryTemplate_IndividualB2C_Works(TemplateInstance instance) 103public Task BlazorWasmHostedTemplate_AzureActiveDirectoryTemplate_IndividualB2C_NoHttps_Works(TemplateInstance instance) 108public Task BlazorWasmHostedTemplate_AzureActiveDirectoryTemplate_SingleOrg_Works(TemplateInstance instance) 113public Task BlazorWasmHostedTemplate_AzureActiveDirectoryTemplate_SingleOrg_NoHttps_Works(TemplateInstance instance) 118public Task BlazorWasmHostedTemplate_AzureActiveDirectoryTemplate_SingleOrg_ProgramMain_Works(TemplateInstance instance) 123public Task BlazorWasmHostedTemplate_AzureActiveDirectoryTemplate_SingleOrg_NoHttps_ProgramMain_Works(TemplateInstance instance)
src\ProjectTemplates\Shared\AspNetProcess.cs (7)
106public async Task VisitInBrowserAsync(IPage page) 112public async Task AssertPagesOk(IEnumerable<Page> pages) 124public async Task AssertPagesNotFound(IEnumerable<string> urls) 132public async Task ContainsLinks(Page page) 241public Task AssertOk(string requestUrl) 244public Task AssertNotFound(string requestUrl) 253public async Task AssertStatusCode(string requestUrl, HttpStatusCode statusCode, string acceptContentType = null)
src\ProjectTemplates\Shared\ProcessLock.cs (1)
25public async Task WaitAsync(TimeSpan? timeout = null)
src\ProjectTemplates\Shared\Project.cs (9)
62internal async Task RunDotNetNewAsync( 130internal async Task RunDotNetPublishAsync(IDictionary<string, string> packageOptions = null, string additionalArgs = null, bool noRestore = true) 155internal async Task RunDotNetBuildAsync(IDictionary<string, string> packageOptions = null, string additionalArgs = null, bool errorOnBuildWarning = true) 209internal async Task RunDotNetEfCreateMigrationAsync(string migrationName) 229internal async Task RunDotNetEfUpdateDatabaseAsync() 294public async Task VerifyLaunchSettings(string[] expectedLaunchProfileNames) 349public async Task VerifyHasProperty(string propertyName, string expectedValue) 410internal async Task RunDotNetNewRawAsync(string arguments) 468public async Task WaitAsync()
src\ProjectTemplates\Shared\TemplatePackageInstaller.cs (4)
48public static async Task EnsureTemplatingEngineInitializedAsync(ITestOutputHelper output) 76private static async Task InstallTemplatePackages(ITestOutputHelper output) 118private static async Task VerifyCanFindTemplate(ITestOutputHelper output, string templateName) 127private static async Task VerifyCannotFindTemplateAsync(ITestOutputHelper output, string templateName)
src\Shared\E2ETesting\BrowserFixture.cs (5)
64public async Task DisposeAsync() 76private async Task DeleteBrowserUserProfileDirectoriesAsync() 97await Task.Delay(2000); 120public Task InitializeAsync() => Task.CompletedTask;
src\Shared\E2ETesting\BrowserTestBase.cs (5)
52public Task DisposeAsync() 54return Task.CompletedTask; 57public virtual Task InitializeAsync() 62public virtual Task InitializeAsync(string isolationContext) 66return Task.CompletedTask;
src\Shared\E2ETesting\SauceConnectServer.cs (3)
61public static async Task StartAsync(ITestOutputHelper output) 78private static async Task InitializeInstance(ITestOutputHelper output) 156await Task.Delay(1000);
src\Shared\Process\ProcessEx.cs (1)
71public Task Exited => _exited.Task;
Templates.Blazor.WebAssembly.Tests (43)
BlazorWasmTemplateTest.cs (8)
28public async Task BlazorWasmStandaloneTemplateCanCreateBuildPublish() 38public async Task BlazorWasmStandaloneTemplateEmptyCanCreateBuildPublish() 48public async Task BlazorWasmStandaloneTemplateNoHttpsCanCreateBuildPublish() 58public async Task BlazorWasmStandaloneTemplateNoHttpsEmptyCanCreateBuildPublish() 68public Task BlazorWasmStandalonePwaTemplateCanCreateBuildPublish() 72public Task BlazorWasmStandalonePwaEmptyTemplateCanCreateBuildPublish() 76public Task BlazorWasmStandalonePwaTemplateNoHttpsCanCreateBuildPublish() 80public Task BlazorWasmStandalonePwaEmptyTemplateNoHttpsCanCreateBuildPublish()
src\ProjectTemplates\Shared\AspNetProcess.cs (7)
106public async Task VisitInBrowserAsync(IPage page) 112public async Task AssertPagesOk(IEnumerable<Page> pages) 124public async Task AssertPagesNotFound(IEnumerable<string> urls) 132public async Task ContainsLinks(Page page) 241public Task AssertOk(string requestUrl) 244public Task AssertNotFound(string requestUrl) 253public async Task AssertStatusCode(string requestUrl, HttpStatusCode statusCode, string acceptContentType = null)
src\ProjectTemplates\Shared\ProcessLock.cs (1)
25public async Task WaitAsync(TimeSpan? timeout = null)
src\ProjectTemplates\Shared\Project.cs (9)
62internal async Task RunDotNetNewAsync( 130internal async Task RunDotNetPublishAsync(IDictionary<string, string> packageOptions = null, string additionalArgs = null, bool noRestore = true) 155internal async Task RunDotNetBuildAsync(IDictionary<string, string> packageOptions = null, string additionalArgs = null, bool errorOnBuildWarning = true) 209internal async Task RunDotNetEfCreateMigrationAsync(string migrationName) 229internal async Task RunDotNetEfUpdateDatabaseAsync() 294public async Task VerifyLaunchSettings(string[] expectedLaunchProfileNames) 349public async Task VerifyHasProperty(string propertyName, string expectedValue) 410internal async Task RunDotNetNewRawAsync(string arguments) 468public async Task WaitAsync()
src\ProjectTemplates\Shared\TemplatePackageInstaller.cs (4)
48public static async Task EnsureTemplatingEngineInitializedAsync(ITestOutputHelper output) 76private static async Task InstallTemplatePackages(ITestOutputHelper output) 118private static async Task VerifyCanFindTemplate(ITestOutputHelper output, string templateName) 127private static async Task VerifyCannotFindTemplateAsync(ITestOutputHelper output, string templateName)
src\Shared\E2ETesting\BrowserFixture.cs (5)
64public async Task DisposeAsync() 76private async Task DeleteBrowserUserProfileDirectoriesAsync() 97await Task.Delay(2000); 120public Task InitializeAsync() => Task.CompletedTask;
src\Shared\E2ETesting\BrowserTestBase.cs (5)
52public Task DisposeAsync() 54return Task.CompletedTask; 57public virtual Task InitializeAsync() 62public virtual Task InitializeAsync(string isolationContext) 66return Task.CompletedTask;
src\Shared\E2ETesting\SauceConnectServer.cs (3)
61public static async Task StartAsync(ITestOutputHelper output) 78private static async Task InitializeInstance(ITestOutputHelper output) 156await Task.Delay(1000);
src\Shared\Process\ProcessEx.cs (1)
71public Task Exited => _exited.Task;
Templates.Mvc.Tests (84)
BlazorTemplateTest.cs (6)
37public Task BlazorWebTemplate_NoAuth(string[] args) => BlazorWebTemplate_Core(args); 42public Task BlazorWebTemplate_IndividualAuth(string[] args) => BlazorWebTemplate_Core([ArgConstants.IndividualAuth, ..args]); 49public Task BlazorWebTemplate_IndividualAuth_LocalDb(bool useProgramMain) => useProgramMain 53private async Task BlazorWebTemplate_Core(string[] args) 99async Task VerifyProcessAsync(AspNetProcess process) 193private async Task WorkAroundNonNullableRenderModeAsync(Project project)
MvcTemplateTest.cs (15)
33public async Task MvcTemplate_NoAuthFSharp() => await MvcTemplateCore(languageOverride: "F#"); 36public async Task MvcTemplate_NoAuthNoHttpsFSharp() => await MvcTemplateCore(languageOverride: "F#", args: new[] { ArgConstants.NoHttps } ); 40public async Task MvcTemplate_NoAuthCSharp() => await MvcTemplateCore(languageOverride: null); 44public async Task MvcTemplate_NoAuthNoHttpsCSharp() => await MvcTemplateCore(languageOverride: null, new[] { ArgConstants.NoHttps }); 48public async Task MvcTemplate_ProgramMainNoAuthCSharp() => await MvcTemplateCore(languageOverride: null, new[] { ArgConstants.UseProgramMain }); 52public async Task MvcTemplate_ProgramMainNoAuthNoHttpsCSharp() => await MvcTemplateCore(languageOverride: null, new[] { ArgConstants.UseProgramMain, ArgConstants.NoHttps }); 54private async Task MvcTemplateCore(string languageOverride, string[] args = null) 136public Task MvcTemplate_IndividualAuth_LocalDb(bool useProgramMain, bool noHttps) => MvcTemplate_IndividualAuth_Core(useLocalDB: true, useProgramMain, noHttps); 144public Task MvcTemplate_IndividualAuth(bool useProgramMain, bool noHttps) => MvcTemplate_IndividualAuth_Core(useLocalDB: false, useProgramMain, noHttps); 146private async Task MvcTemplate_IndividualAuth_Core(bool useLocalDB, bool useProgramMain, bool noHttps) 272public async Task MvcTemplate_SingleFileExe() 321public Task MvcTemplate_IdentityWeb_IndividualB2C_BuildsAndPublishes(string auth, string[] args) => MvcTemplateBuildsAndPublishes(auth: auth, args: args); 329public Task MvcTemplate_IdentityWeb_IndividualB2C_NoHttps_BuildsAndPublishes(string auth, string[] args) => MvcTemplateBuildsAndPublishes(auth: auth, args: args); 339public Task MvcTemplate_IdentityWeb_SingleOrg_BuildsAndPublishes(string auth, string[] args) => MvcTemplateBuildsAndPublishes(auth: auth, args: args); 349public Task MvcTemplate_IdentityWeb_SingleOrg_NoHttps_BuildsAndPublishes(string auth, string[] args) => MvcTemplateBuildsAndPublishes(auth: auth, args: args);
RazorPagesTemplateTest.cs (7)
43public async Task RazorPagesTemplate_NoAuth(bool useProgramMain, bool noHttps) 126public Task RazorPagesTemplate_IndividualAuth_LocalDb(bool useProgramMain, bool noHttps) => RazorPagesTemplate_IndividualAuth_Core(useLocalDB: true, useProgramMain, noHttps); 134public Task RazorPagesTemplate_IndividualAuth(bool useProgramMain, bool noHttps) => RazorPagesTemplate_IndividualAuth_Core(useLocalDB: false, useProgramMain, noHttps); 136private async Task RazorPagesTemplate_IndividualAuth_Core(bool useLocalDB, bool useProgramMain, bool noHttps) 269public Task RazorPagesTemplate_IdentityWeb_IndividualB2C_BuildsAndPublishes(string auth, string[] args) => BuildAndPublishRazorPagesTemplateIdentityWeb(auth: auth, args: args); 280public Task RazorPagesTemplate_IdentityWeb_SingleOrg_BuildsAndPublishes(string auth, string[] args) => BuildAndPublishRazorPagesTemplateIdentityWeb(auth: auth, args: args); 287public Task RazorPagesTemplate_IdentityWeb_SingleOrg_CallsGraph_BuildsAndPublishes(string auth, string[] args) => BuildAndPublishRazorPagesTemplateIdentityWeb(auth: auth, args: args);
src\ProjectTemplates\Shared\AspNetProcess.cs (7)
106public async Task VisitInBrowserAsync(IPage page) 112public async Task AssertPagesOk(IEnumerable<Page> pages) 124public async Task AssertPagesNotFound(IEnumerable<string> urls) 132public async Task ContainsLinks(Page page) 241public Task AssertOk(string requestUrl) 244public Task AssertNotFound(string requestUrl) 253public async Task AssertStatusCode(string requestUrl, HttpStatusCode statusCode, string acceptContentType = null)
src\ProjectTemplates\Shared\ProcessLock.cs (1)
25public async Task WaitAsync(TimeSpan? timeout = null)
src\ProjectTemplates\Shared\Project.cs (9)
62internal async Task RunDotNetNewAsync( 130internal async Task RunDotNetPublishAsync(IDictionary<string, string> packageOptions = null, string additionalArgs = null, bool noRestore = true) 155internal async Task RunDotNetBuildAsync(IDictionary<string, string> packageOptions = null, string additionalArgs = null, bool errorOnBuildWarning = true) 209internal async Task RunDotNetEfCreateMigrationAsync(string migrationName) 229internal async Task RunDotNetEfUpdateDatabaseAsync() 294public async Task VerifyLaunchSettings(string[] expectedLaunchProfileNames) 349public async Task VerifyHasProperty(string propertyName, string expectedValue) 410internal async Task RunDotNetNewRawAsync(string arguments) 468public async Task WaitAsync()
src\ProjectTemplates\Shared\TemplatePackageInstaller.cs (4)
48public static async Task EnsureTemplatingEngineInitializedAsync(ITestOutputHelper output) 76private static async Task InstallTemplatePackages(ITestOutputHelper output) 118private static async Task VerifyCanFindTemplate(ITestOutputHelper output, string templateName) 127private static async Task VerifyCannotFindTemplateAsync(ITestOutputHelper output, string templateName)
src\Shared\E2ETesting\BrowserFixture.cs (5)
64public async Task DisposeAsync() 76private async Task DeleteBrowserUserProfileDirectoriesAsync() 97await Task.Delay(2000); 120public Task InitializeAsync() => Task.CompletedTask;
src\Shared\E2ETesting\BrowserTestBase.cs (5)
52public Task DisposeAsync() 54return Task.CompletedTask; 57public virtual Task InitializeAsync() 62public virtual Task InitializeAsync(string isolationContext) 66return Task.CompletedTask;
src\Shared\E2ETesting\SauceConnectServer.cs (3)
61public static async Task StartAsync(ITestOutputHelper output) 78private static async Task InitializeInstance(ITestOutputHelper output) 156await Task.Delay(1000);
src\Shared\Process\ProcessEx.cs (1)
71public Task Exited => _exited.Task;
WebApiTemplateTest.cs (21)
43public Task WebApiTemplateCSharp_IdentityWeb_IndividualB2C_BuildsAndPublishes(string auth, string[] args) => PublishAndBuildWebApiTemplate(languageOverride: null, auth: auth, args: args); 51public Task WebApiTemplateCSharp_IdentityWeb_IndividualB2C_NoHttps_BuildsAndPublishes(string auth, string[] args) => PublishAndBuildWebApiTemplate(languageOverride: null, auth: auth, args: args); 59public Task WebApiTemplateCSharp_IdentityWeb_IndividualB2C_ProgramMain_BuildsAndPublishes(string auth, string[] args) => PublishAndBuildWebApiTemplate(languageOverride: null, auth: auth, args: args); 67public Task WebApiTemplateCSharp_IdentityWeb_IndividualB2C_ProgramMain_NoHttps_BuildsAndPublishes(string auth, string[] args) => PublishAndBuildWebApiTemplate(languageOverride: null, auth: auth, args: args); 77public Task WebApiTemplateCSharp_IdentityWeb_SingleOrg_BuildsAndPublishes(string auth, string[] args) => PublishAndBuildWebApiTemplate(languageOverride: null, auth: auth, args: args); 87public Task WebApiTemplateCSharp_IdentityWeb_SingleOrg_NoHttps_BuildsAndPublishes(string auth, string[] args) => PublishAndBuildWebApiTemplate(languageOverride: null, auth: auth, args: args); 97public Task WebApiTemplateCSharp_IdentityWeb_SingleOrg_ProgramMain_BuildsAndPublishes(string auth, string[] args) => PublishAndBuildWebApiTemplate(languageOverride: null, auth: auth, args: args); 108public Task WebApiTemplateCSharp_IdentityWeb_SingleOrg_ProgramMain_NoHttps_BuildsAndPublishes(string auth, string[] args) => PublishAndBuildWebApiTemplate(languageOverride: null, auth: auth, args: args); 111public Task WebApiTemplateFSharp() => WebApiTemplateCore(languageOverride: "F#"); 114public Task WebApiTemplateNoHttpsFSharp() => WebApiTemplateCore(languageOverride: "F#", args: new[] { ArgConstants.NoHttps }); 118public Task WebApiTemplateCSharp() => WebApiTemplateCore(languageOverride: null); 122public Task WebApiTemplateNoHttpsCSharp() => WebApiTemplateCore(languageOverride: null, new[] { ArgConstants.NoHttps }); 126public Task WebApiTemplateProgramMainCSharp() => WebApiTemplateCore(languageOverride: null, args: new[] { ArgConstants.UseProgramMain }); 130public Task WebApiTemplateProgramMainNoHttpsCSharp() => WebApiTemplateCore(languageOverride: null, args: new[] { ArgConstants.UseProgramMain, ArgConstants.NoHttps }); 134public Task WebApiTemplateControllersCSharp() => WebApiTemplateCore(languageOverride: null, args: new[] { ArgConstants.UseControllers }); 138public Task WebApiTemplateControllersNoHttpsCSharp() => WebApiTemplateCore(languageOverride: null, args: new[] { ArgConstants.UseControllers, ArgConstants.NoHttps }); 142public Task WebApiTemplateProgramMainControllersCSharp() => WebApiTemplateCore(languageOverride: null, args: new[] { ArgConstants.UseProgramMain, ArgConstants.UseControllers }); 146public Task WebApiTemplateProgramMainControllersNoHttpsCSharp() => WebApiTemplateCore(languageOverride: null, args: new[] { ArgConstants.UseProgramMain, ArgConstants.UseControllers, ArgConstants.NoHttps }); 154public async Task WebApiTemplateCSharp_WithoutOpenAPI(bool useProgramMain, bool useControllers) 183public async Task WebApiTemplateCSharpNoHttps_WithoutOpenAPI(bool useProgramMain, bool useControllers) 246private async Task WebApiTemplateCore(string languageOverride, string[] args = null)
Templates.Tests (60)
BaselineTest.cs (1)
73public async Task Template_Produces_The_Right_Set_Of_FilesAsync(string arguments, string[] expectedFiles)
EmptyWebTemplateTest.cs (7)
36public async Task EmptyWebTemplateCSharp() 43public async Task EmptyWebTemplateNoHttpsCSharp() 50public async Task EmptyWebTemplateProgramMainCSharp() 57public async Task EmptyWebTemplateProgramMainNoHttpsCSharp() 63public async Task EmptyWebTemplateFSharp() 69public async Task EmptyWebTemplateNoHttpsFSharp() 74private async Task EmtpyTemplateCore(string languageOverride, string[] args = null)
GrpcTemplateTest.cs (5)
40public async Task GrpcTemplate() 48public async Task GrpcTemplateNativeAot() 56public async Task GrpcTemplateProgramMain() 64public async Task GrpcTemplateProgramMainNativeAot() 69private async Task GrpcTemplateCore(string[] args = null)
IdentityUIPackageTest.cs (2)
102public async Task IdentityUIPackage_WorksWithDifferentOptions() 150private async Task ValidatePublishedFiles(AspNetProcess aspNetProcess, string[] expectedContentFiles)
ItemTemplateTests\BlazorServerTests.cs (1)
26public async Task BlazorServerItemTemplate()
RazorClassLibraryTemplateTest.cs (2)
34public async Task RazorClassLibraryTemplate_WithViews_Async() 51public async Task RazorClassLibraryTemplateAsync()
src\ProjectTemplates\Shared\AspNetProcess.cs (7)
106public async Task VisitInBrowserAsync(IPage page) 112public async Task AssertPagesOk(IEnumerable<Page> pages) 124public async Task AssertPagesNotFound(IEnumerable<string> urls) 132public async Task ContainsLinks(Page page) 241public Task AssertOk(string requestUrl) 244public Task AssertNotFound(string requestUrl) 253public async Task AssertStatusCode(string requestUrl, HttpStatusCode statusCode, string acceptContentType = null)
src\ProjectTemplates\Shared\ProcessLock.cs (1)
25public async Task WaitAsync(TimeSpan? timeout = null)
src\ProjectTemplates\Shared\Project.cs (9)
62internal async Task RunDotNetNewAsync( 130internal async Task RunDotNetPublishAsync(IDictionary<string, string> packageOptions = null, string additionalArgs = null, bool noRestore = true) 155internal async Task RunDotNetBuildAsync(IDictionary<string, string> packageOptions = null, string additionalArgs = null, bool errorOnBuildWarning = true) 209internal async Task RunDotNetEfCreateMigrationAsync(string migrationName) 229internal async Task RunDotNetEfUpdateDatabaseAsync() 294public async Task VerifyLaunchSettings(string[] expectedLaunchProfileNames) 349public async Task VerifyHasProperty(string propertyName, string expectedValue) 410internal async Task RunDotNetNewRawAsync(string arguments) 468public async Task WaitAsync()
src\ProjectTemplates\Shared\TemplatePackageInstaller.cs (4)
48public static async Task EnsureTemplatingEngineInitializedAsync(ITestOutputHelper output) 76private static async Task InstallTemplatePackages(ITestOutputHelper output) 118private static async Task VerifyCanFindTemplate(ITestOutputHelper output, string templateName) 127private static async Task VerifyCannotFindTemplateAsync(ITestOutputHelper output, string templateName)
src\Shared\E2ETesting\BrowserFixture.cs (5)
64public async Task DisposeAsync() 76private async Task DeleteBrowserUserProfileDirectoriesAsync() 97await Task.Delay(2000); 120public Task InitializeAsync() => Task.CompletedTask;
src\Shared\E2ETesting\BrowserTestBase.cs (5)
52public Task DisposeAsync() 54return Task.CompletedTask; 57public virtual Task InitializeAsync() 62public virtual Task InitializeAsync(string isolationContext) 66return Task.CompletedTask;
src\Shared\E2ETesting\SauceConnectServer.cs (3)
61public static async Task StartAsync(ITestOutputHelper output) 78private static async Task InitializeInstance(ITestOutputHelper output) 156await Task.Delay(1000);
src\Shared\Process\ProcessEx.cs (1)
71public Task Exited => _exited.Task;
WebApiNativeAotTemplateTest.cs (4)
35public async Task WebApiNativeAotTemplateCSharp() 42public async Task WebApiNativeAotTemplateProgramMainCSharp() 47private async Task WebApiNativeAotTemplateCore(string languageOverride, string[] args = null) 93private async Task AssertEndpoints(AspNetProcess aspNetProcess)
WorkerTemplateTest.cs (3)
35public async Task WorkerTemplateAsync(string language, string[] args) 44public async Task WorkerTemplateNativeAotAsync(string language) 49private async Task WorkerTemplateCoreAsync(string language, string[] args)
TestContentPackage (1)
Services\AsyncOperationService.cs (1)
12public Task Start(string id)
Wasm.Performance.ConsoleHost (10)
ConsoleHostRenderer.cs (3)
27protected override Task UpdateDisplayAsync(in RenderBatch renderBatch) 31return Task.CompletedTask; 38public new Task RenderRootComponentAsync(int componentId)
NullDispatcher.cs (5)
15public override Task InvokeAsync(Action workItem) 18return Task.CompletedTask; 21public override Task InvokeAsync(Func<Task> workItem) 25=> Task.FromResult(workItem());
Scenarios\ComponentRenderingScenarioBase.cs (1)
49protected abstract Task ExecuteAsync(ConsoleHostRenderer renderer, int numCycles);
Scenarios\GridScenario.cs (1)
20protected override async Task ExecuteAsync(ConsoleHostRenderer renderer, int numCycles)
Wasm.Performance.Driver (4)
Program.cs (1)
294Task.Run(() =>
Selenium.cs (3)
50await Task.Delay(1000, cancellationToken); 99_ = Task.Run(async () => 103await Task.Delay(TimeSpan.FromSeconds(3));
Wasm.Performance.TestApp (1)
Program.cs (1)
10public static async Task Main(string[] args)
WebSocketSample (6)
Program.cs (6)
25private static async Task RunWebSockets(string url) 32var sending = Task.Run(async () => 44var receiving = Receiving(ws); 46await Task.WhenAll(sending, receiving); 49private static async Task Receiving(ClientWebSocket ws)
WebTransportInteractiveSampleApp (3)
Program.cs (3)
93static async Task handleUnidirectionalStream(IWebTransportSession session, ConnectionContext stream) 113static async Task handleBidirectionalStream(IWebTransportSession session, ConnectionContext stream) 140static async Task ApplySpecialCommands(IWebTransportSession session, string message)
WelcomePageSample (1)
Startup.cs (1)
13public static Task Main(string[] args)
WsFedSample (4)
Program.cs (1)
12public static Task Main(string[] args)
Startup.cs (3)
129private static async Task WriteHtmlAsync(HttpResponse response, Func<HttpResponse, Task> writeContent) 139private static async Task WriteTableHeader(HttpResponse response, IEnumerable<string> columns, IEnumerable<IEnumerable<string>> data)
xunit.console (2)
ConsoleRunner.cs (2)
284var tasks = project.Assemblies.Select(assembly => Task.Run(() => ExecuteAssembly(consoleLock, assembly, serialize, needsXml, parallelizeTestCollections, maxThreadCount, diagnosticMessages, noColor, appDomains, failSkips, stopOnFail, project.Filters, internalDiagnosticMessages))); 285var results = Task.WhenAll(tasks).GetAwaiter().GetResult();
Xunit.NetCore.Extensions (4)
AssemblyFixtureSupport\XunitTestAssemblyRunnerWithAssemblyFixture.cs (2)
29protected override async Task AfterTestAssemblyStartingAsync() 52protected override Task BeforeTestAssemblyFinishedAsync()
AssemblyFixtureSupport\XunitTestClassRunnerWithAssemblyFixture.cs (2)
31protected override async Task AfterTestClassStartingAsync() 44protected override Task BeforeTestClassFinishedAsync()