2778 references to FromResult
ApiExplorerWebSite (7)
aspire (9)
Aspire.Azure.AI.OpenAI.Tests (2)
Aspire.Cli.Tests (82)
TestServices\TestDotNetCliRunner.cs (15)
29? Task.FromResult(AddPackageAsyncCallback(projectFilePath, packageName, packageVersion, nugetSource, options, cancellationToken))
36? Task.FromResult(BuildAsyncCallback(projectFilePath, options, cancellationToken))
43? Task.FromResult(CheckHttpCertificateAsyncCallback(options, cancellationToken))
44: Task.FromResult(0); // Return success if not overridden.
52? Task.FromResult(GetAppHostInformationAsyncCallback(projectFile, options, cancellationToken))
53: Task.FromResult<(int, bool, string?)>((0, true, informationalVersion));
59? Task.FromResult(GetNuGetConfigPathsAsyncCallback(workingDirectory, options, cancellationToken))
60: Task.FromResult((0, GetGlobalNuGetPaths())); // If not overridden, return success with no config paths which will blow up.
75? Task.FromResult(GetProjectItemsAndPropertiesAsyncCallback(projectFile, items, properties, options, cancellationToken))
82? Task.FromResult(InstallTemplateAsyncCallback(packageName, version, nugetSource, force, options, cancellationToken))
83: Task.FromResult<(int, string?)>((0, version)); // If not overridden, just return success for the version specified.
89? Task.FromResult(NewProjectAsyncCallback(templateName, name, outputPath, options, cancellationToken))
90: Task.FromResult(0); // If not overridden, just return success.
103? Task.FromResult(SearchPackagesAsyncCallback(workingDirectory, query, prerelease, take, skip, nugetConfigFile, options, cancellationToken))
110? Task.FromResult(TrustHttpCertificateAsyncCallback(options, cancellationToken))
Aspire.Dashboard (12)
Aspire.Dashboard.Components.Tests (16)
Aspire.Dashboard.Tests (17)
Aspire.Hosting (9)
Aspire.Hosting.Azure.AIFoundry (2)
Aspire.Hosting.Azure.EventHubs (2)
Aspire.Hosting.Azure.ServiceBus (2)
Aspire.Hosting.Azure.Tests (19)
Aspire.Hosting.GitHub.Models.Tests (1)
Aspire.Hosting.Kafka.Tests (1)
Aspire.Hosting.MySql.Tests (1)
Aspire.Hosting.NodeJs.Tests (1)
Aspire.Hosting.OpenAI.Tests (1)
Aspire.Hosting.PostgreSQL.Tests (1)
Aspire.Hosting.RabbitMQ.Tests (1)
Aspire.Hosting.Testing (1)
Aspire.Hosting.Tests (22)
Aspire.Hosting.Valkey.Tests (1)
Aspire.OpenAI.Tests (2)
Aspire.Playground.Tests (1)
Aspire.RabbitMQ.Client (1)
Aspire.StackExchange.Redis.DistributedCaching (2)
Aspire.StackExchange.Redis.OutputCaching (2)
BasicTestApp (13)
InteropTest\JavaScriptInterop.cs (9)
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 });
BasicWebSite (13)
Binding.Http.IntegrationTests (2)
Binding.ReliableSession.IntegrationTests (5)
BlazorServerApp (1)
BlazorUnitedApp (1)
CatalogDb (4)
ClaimsTransformation (1)
CookieSessionSample (3)
csc (3)
CustomAuthorizationFailureResponse (1)
CustomPolicyProvider (1)
DatabaseErrorPageSample (1)
dotnet-openapi (2)
dotnet-svcutil-lib (35)
dotnet-svcutil-lib.Tests (1)
FormatterWebSite (4)
GenerateDocumentationAndConfigFiles (12)
HealthChecksSample (3)
HostedBlazorWebassemblyApp.Server (1)
Identity.DefaultUI.WebSite (50)
IdentitySample.DefaultUI (1)
IdentitySample.Mvc (4)
IdentitySample.PasskeyConformance (11)
IdentitySample.PasskeyUI (11)
IIS.FunctionalTests (2)
IIS.LongTests (2)
IIS.NewHandler.FunctionalTests (2)
IIS.NewShim.FunctionalTests (2)
IIS.ShadowCopy.Tests (2)
IISExpress.FunctionalTests (2)
InMemory.FunctionalTests (2)
InProcessWebSite (9)
IntegrationTestsWebsite (1)
InteropWebsite (1)
Metrics (12)
Metrics.Legacy (12)
Microsoft.Analyzers.Extra.Tests (2)
Microsoft.Arcade.Common (2)
Microsoft.Arcade.Test.Common (2)
Microsoft.AspNetCore.Antiforgery.Test (7)
Microsoft.AspNetCore.App.Analyzers (6)
Microsoft.AspNetCore.App.Analyzers.Test (1)
Microsoft.AspNetCore.App.CodeFixes (6)
Microsoft.AspNetCore.Authentication (3)
Microsoft.AspNetCore.Authentication.Certificate (1)
Microsoft.AspNetCore.Authentication.Cookies (1)
Microsoft.AspNetCore.Authentication.Core (6)
Microsoft.AspNetCore.Authentication.Core.Test (27)
Microsoft.AspNetCore.Authentication.JwtBearer (1)
Microsoft.AspNetCore.Authentication.Negotiate (1)
Microsoft.AspNetCore.Authentication.OAuth (1)
Microsoft.AspNetCore.Authentication.OpenIdConnect (1)
Microsoft.AspNetCore.Authentication.Test (199)
AuthenticationMiddlewareTests.cs (13)
65.Returns(Task.FromResult(AuthenticateResult.Success(new AuthenticationTicket(new ClaimsPrincipal(), "custom"))));
68.Returns(Task.FromResult(new AuthenticationScheme("custom", "custom", typeof(JwtBearerHandler))));
88.Returns(Task.FromResult(AuthenticateResult.Fail("not authenticated")));
91.Returns(Task.FromResult(new AuthenticationScheme("custom", "custom", typeof(JwtBearerHandler))));
108.Returns(Task.FromResult(AuthenticateResult.Success(new AuthenticationTicket(new ClaimsPrincipal(), "custom"))));
111.Returns(Task.FromResult(new AuthenticationScheme("custom", "custom", typeof(JwtBearerHandler))));
134.Returns(Task.FromResult(AuthenticateResult.Success(new AuthenticationTicket(new ClaimsPrincipal(), "custom"))));
137.Returns(Task.FromResult(new AuthenticationScheme("custom", "custom", typeof(JwtBearerHandler))));
268return Task.FromResult(true);
274return Task.FromResult(0);
315return Task.FromResult(0);
350return Task.FromResult(false);
356return Task.FromResult(0);
Microsoft.AspNetCore.Authentication.Twitter (1)
Microsoft.AspNetCore.Authentication.WsFederation (1)
Microsoft.AspNetCore.Authorization (7)
Microsoft.AspNetCore.Authorization.Test (25)
Microsoft.AspNetCore.Components (5)
Microsoft.AspNetCore.Components.Analyzers (1)
Microsoft.AspNetCore.Components.Authorization.Tests (11)
Microsoft.AspNetCore.Components.Endpoints (2)
Microsoft.AspNetCore.Components.SdkAnalyzers (1)
Microsoft.AspNetCore.Components.Server (5)
Microsoft.AspNetCore.Components.Server.Tests (9)
Microsoft.AspNetCore.Components.Tests (10)
Microsoft.AspNetCore.Components.WebAssembly (5)
Microsoft.AspNetCore.Components.WebView (1)
Microsoft.AspNetCore.Components.WebView.Photino (1)
Microsoft.AspNetCore.ConcurrencyLimiter.Tests (1)
Microsoft.AspNetCore.CookiePolicy.Test (5)
Microsoft.AspNetCore.Cors (3)
Microsoft.AspNetCore.Cors.Test (9)
Microsoft.AspNetCore.Diagnostics.HealthChecks.Tests (14)
HealthCheckMiddlewareTests.cs (14)
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!")));
270.AddAsyncCheck("Foo", () => Task.FromResult(HealthCheckResult.Healthy("A-ok!")))
272.AddAsyncCheck("Baz", () => Task.FromResult(HealthCheckResult.Healthy("A-ok!")));
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!")));
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!")));
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!")));
Microsoft.AspNetCore.Diagnostics.Tests (2)
Microsoft.AspNetCore.Grpc.JsonTranscoding.Tests (42)
Microsoft.AspNetCore.Grpc.Swagger.Tests (5)
Microsoft.AspNetCore.HeaderPropagation.Tests (2)
Microsoft.AspNetCore.Http (2)
Microsoft.AspNetCore.Http.Abstractions.Tests (5)
Microsoft.AspNetCore.Http.Connections (2)
Microsoft.AspNetCore.Http.Connections.Client (2)
Microsoft.AspNetCore.Http.Connections.Tests (4)
Microsoft.AspNetCore.Http.Extensions.Tests (12)
Microsoft.AspNetCore.Http.Results.Tests (2)
Microsoft.AspNetCore.Http.Tests (2)
Microsoft.AspNetCore.HttpOverrides (3)
Microsoft.AspNetCore.HttpOverrides.Tests (13)
Microsoft.AspNetCore.Identity (2)
Microsoft.AspNetCore.Identity.EntityFrameworkCore (8)
Microsoft.AspNetCore.Identity.EntityFrameworkCore.Test (1)
Microsoft.AspNetCore.Identity.FunctionalTests (1)
Microsoft.AspNetCore.Identity.InMemory.Test (73)
Microsoft.AspNetCore.Identity.Specification.Tests (11)
Microsoft.AspNetCore.Identity.Test (192)
SignInManagerTest.cs (37)
322manager.Setup(m => m.GetValidTwoFactorProvidersAsync(user)).Returns(Task.FromResult(providers)).Verifiable();
332It.IsAny<AuthenticationProperties>())).Returns(Task.FromResult(0)).Verifiable();
364manager.Setup(m => m.GetValidTwoFactorProvidersAsync(user)).Returns(Task.FromResult(providers)).Verifiable();
380It.IsAny<AuthenticationProperties>())).Returns(Task.FromResult(0)).Verifiable();
441.Returns(Task.FromResult(new PasskeyRequestOptionsResult
448.Returns(Task.FromResult(assertionResult));
452.Returns(Task.FromResult(IdentityResult.Success))
524.Returns(() => Task.FromResult(authenticateResult))
532return Task.FromResult(true);
569It.IsAny<AuthenticationProperties>())).Returns(Task.FromResult(0)).Verifiable();
626return Task.FromResult(IdentityResult.Success);
630manager.Setup(m => m.IsLockedOutAsync(user)).Returns(() => Task.FromResult(lockedout));
723It.IsAny<AuthenticationProperties>())).Returns(Task.FromResult(0)).Verifiable();
724auth.Setup(a => a.SignOutAsync(context, IdentityConstants.ExternalScheme, It.IsAny<AuthenticationProperties>())).Returns(Task.FromResult(0)).Verifiable();
725auth.Setup(a => a.SignOutAsync(context, IdentityConstants.TwoFactorUserIdScheme, It.IsAny<AuthenticationProperties>())).Returns(Task.FromResult(0)).Verifiable();
833.Returns(Task.FromResult(authResult)).Verifiable();
846.Returns(Task.FromResult(0)).Verifiable();
885.Returns(Task.FromResult(AuthenticateResult.NoResult())).Verifiable();
921.Returns(Task.FromResult(authResult)).Verifiable();
976It.IsAny<AuthenticationProperties>())).Returns(Task.FromResult(0)).Verifiable();
979auth.Setup(a => a.SignOutAsync(context, IdentityConstants.ExternalScheme, It.IsAny<AuthenticationProperties>())).Returns(Task.FromResult(0)).Verifiable();
980auth.Setup(a => a.SignOutAsync(context, IdentityConstants.TwoFactorUserIdScheme, It.IsAny<AuthenticationProperties>())).Returns(Task.FromResult(0)).Verifiable();
992It.IsAny<AuthenticationProperties>())).Returns(Task.FromResult(0)).Verifiable();
1019return Task.FromResult(IdentityResult.Success);
1022manager.Setup(m => m.IsLockedOutAsync(user)).Returns(() => Task.FromResult(lockedout));
1059It.Is<AuthenticationProperties>(v => v.IsPersistent == true))).Returns(Task.FromResult(0)).Verifiable();
1120manager.Setup(m => m.GetValidTwoFactorProvidersAsync(user)).Returns(Task.FromResult(providers)).Verifiable();
1160auth.Setup(a => a.SignOutAsync(context, IdentityConstants.ApplicationScheme, It.IsAny<AuthenticationProperties>())).Returns(Task.FromResult(0)).Verifiable();
1161auth.Setup(a => a.SignOutAsync(context, IdentityConstants.TwoFactorUserIdScheme, It.IsAny<AuthenticationProperties>())).Returns(Task.FromResult(0)).Verifiable();
1162auth.Setup(a => a.SignOutAsync(context, IdentityConstants.ExternalScheme, It.IsAny<AuthenticationProperties>())).Returns(Task.FromResult(0)).Verifiable();
1271return Task.FromResult(IdentityResult.Success);
1274manager.Setup(m => m.IsLockedOutAsync(user)).Returns(() => Task.FromResult(lockedout));
1298return Task.FromResult(IdentityResult.Success);
1301manager.Setup(m => m.IsLockedOutAsync(user)).Returns(() => Task.FromResult(lockedout));
1370It.Is<AuthenticationProperties>(v => isPersistent == null || v.IsPersistent == isPersistent))).Returns(Task.FromResult(0)).Verifiable();
1747public Task<IEnumerable<AuthenticationScheme>> GetAllSchemesAsync() => Task.FromResult<IEnumerable<AuthenticationScheme>>(_defaultCookieSchemes.Values);
1748public Task<AuthenticationScheme> GetSchemeAsync(string name) => Task.FromResult(_defaultCookieSchemes.TryGetValue(name, out var scheme) ? scheme : null);
UserManagerTest.cs (119)
73store.Setup(s => s.GetUserNameAsync(user, CancellationToken.None)).Returns(Task.FromResult(user.UserName)).Verifiable();
74store.Setup(s => s.SetNormalizedUserNameAsync(user, normalizer.NormalizeName(user.UserName), CancellationToken.None)).Returns(Task.FromResult(0)).Verifiable();
92store.Setup(s => s.GetSecurityStampAsync(user, CancellationToken.None)).Returns(Task.FromResult(user.SecurityStamp)).Verifiable();
93store.Setup(s => s.SetSecurityStampAsync(user, It.IsAny<string>(), CancellationToken.None)).Returns(Task.FromResult(0)).Verifiable();
112store.Setup(s => s.GetUserNameAsync(user, CancellationToken.None)).Returns(Task.FromResult(user.UserName)).Verifiable();
113store.Setup(s => s.GetEmailAsync(user, CancellationToken.None)).Returns(Task.FromResult(user.Email)).Verifiable();
114store.Setup(s => s.SetNormalizedEmailAsync(user, normalizer.NormalizeEmail(user.Email), CancellationToken.None)).Returns(Task.FromResult(0)).Verifiable();
115store.Setup(s => s.SetNormalizedUserNameAsync(user, normalizer.NormalizeName(user.UserName), CancellationToken.None)).Returns(Task.FromResult(0)).Verifiable();
188store.Setup(s => s.GetUserNameAsync(user, CancellationToken.None)).Returns(Task.FromResult(user.UserName)).Verifiable();
189store.Setup(s => s.SetNormalizedUserNameAsync(user, normalizer.NormalizeName(user.UserName), CancellationToken.None)).Returns(Task.FromResult(0)).Verifiable();
208store.Setup(s => s.GetUserNameAsync(user, CancellationToken.None)).Returns(Task.FromResult(user.UserName)).Verifiable();
209store.Setup(s => s.GetEmailAsync(user, CancellationToken.None)).Returns(Task.FromResult(user.Email)).Verifiable();
210store.Setup(s => s.SetNormalizedUserNameAsync(user, normalizer.NormalizeName(user.UserName), CancellationToken.None)).Returns(Task.FromResult(0)).Verifiable();
211store.Setup(s => s.SetNormalizedEmailAsync(user, normalizer.NormalizeEmail(user.Email), CancellationToken.None)).Returns(Task.FromResult(0)).Verifiable();
230store.Setup(s => s.SetUserNameAsync(user, "foo", CancellationToken.None)).Returns(Task.FromResult(0)).Verifiable();
231store.Setup(s => s.GetUserNameAsync(user, CancellationToken.None)).Returns(Task.FromResult("foo")).Verifiable();
232store.Setup(s => s.SetNormalizedUserNameAsync(user, normalizer.NormalizeName("foo"), CancellationToken.None)).Returns(Task.FromResult(0)).Verifiable();
233store.Setup(s => s.UpdateAsync(user, CancellationToken.None)).Returns(Task.FromResult(IdentityResult.Success)).Verifiable();
250store.Setup(s => s.FindByIdAsync(user.Id, CancellationToken.None)).Returns(Task.FromResult(user)).Verifiable();
268store.Setup(s => s.FindByNameAsync(normalizer.NormalizeName(user.UserName), CancellationToken.None)).Returns(Task.FromResult(user)).Verifiable();
285store.Setup(s => s.FindByNameAsync(user.UserName, CancellationToken.None)).Returns(Task.FromResult(user)).Verifiable();
304store.Setup(s => s.FindByEmailAsync(normalizer.NormalizeEmail(user.Email), CancellationToken.None)).Returns(Task.FromResult(user)).Verifiable();
321store.Setup(s => s.FindByEmailAsync(user.Email, CancellationToken.None)).Returns(Task.FromResult(user)).Verifiable();
345store.Setup(s => s.FindByEmailAsync("@Foo", CancellationToken.None)).Returns(Task.FromResult(user)).Verifiable();
363store.Setup(s => s.FindByNameAsync("#Foo", CancellationToken.None)).Returns(Task.FromResult(user)).Verifiable();
384.Returns(Task.FromResult(0))
387.Returns(Task.FromResult(0))
390.Returns(Task.FromResult(0))
395.Returns(Task.FromResult(false))
398.Returns(Task.FromResult(false))
401.Returns(Task.FromResult(false))
422.Returns(Task.FromResult(0))
425.Returns(Task.FromResult(0))
428.Returns(Task.FromResult(0))
433.Returns(Task.FromResult(false))
436.Returns(Task.FromResult(false))
439.Returns(Task.FromResult(false))
462.Returns(Task.FromResult(0))
465.Returns(Task.FromResult(true))
486.Returns(Task.FromResult(0))
489.Returns(Task.FromResult(0))
492.Returns(Task.FromResult(0))
496.Returns(Task.FromResult(true))
499.Returns(Task.FromResult(true))
502.Returns(Task.FromResult(true))
523.Returns(Task.FromResult(0))
526.Returns(Task.FromResult(true))
529.Returns(Task.FromResult(false))
549.Returns(Task.FromResult(0))
573.Returns(Task.FromResult(0))
605.Returns(Task.FromResult(0))
607store.Setup(s => s.UpdateAsync(user, CancellationToken.None)).Returns(Task.FromResult(IdentityResult.Success)).Verifiable();
643store.Setup(s => s.SetPasswordHashAsync(user, It.IsAny<string>(), CancellationToken.None)).Returns(Task.FromResult(0)).Verifiable();
644store.Setup(x => x.UpdateAsync(It.IsAny<PocoUser>(), It.IsAny<CancellationToken>())).Returns(Task.FromResult(IdentityResult.Success));
737.Returns(Task.FromResult(0))
768.Returns(Task.FromResult(0))
815store.Setup(s => s.GetPasskeysAsync(user, CancellationToken.None)).Returns(Task.FromResult(passkeys)).Verifiable();
833store.Setup(s => s.FindByPasskeyIdAsync(credentialId, CancellationToken.None)).Returns(Task.FromResult(user)).Verifiable();
1020store.Setup(x => x.GetUserIdAsync(It.IsAny<PocoUser>(), It.IsAny<CancellationToken>())).Returns(Task.FromResult(Guid.NewGuid().ToString()));
1553=> Task.FromResult(badResult);
1570return Task.FromResult<IList<Claim>>(new List<Claim>());
1575return Task.FromResult(0);
1580return Task.FromResult(0);
1585return Task.FromResult(0);
1590return Task.FromResult(0);
1595return Task.FromResult("");
1600return Task.FromResult(false);
1605return Task.FromResult(0);
1610return Task.FromResult<PocoUser>(null);
1615return Task.FromResult<DateTimeOffset?>(DateTimeOffset.MinValue);
1620return Task.FromResult(0);
1625return Task.FromResult(0);
1630return Task.FromResult(0);
1635return Task.FromResult(0);
1640return Task.FromResult(false);
1645return Task.FromResult(0);
1650return Task.FromResult(0);
1655return Task.FromResult(0);
1660return Task.FromResult<IList<UserLoginInfo>>(new List<UserLoginInfo>());
1665return Task.FromResult<PocoUser>(null);
1674return Task.FromResult(0);
1679return Task.FromResult(IdentityResult.Success);
1684return Task.FromResult(IdentityResult.Success);
1689return Task.FromResult(IdentityResult.Success);
1694return Task.FromResult<PocoUser>(null);
1699return Task.FromResult<PocoUser>(null);
1704return Task.FromResult(0);
1709return Task.FromResult<string>(null);
1714return Task.FromResult(false);
1719return Task.FromResult(0);
1724return Task.FromResult("");
1729return Task.FromResult(false);
1734return Task.FromResult(0);
1739return Task.FromResult(0);
1744return Task.FromResult(0);
1749return Task.FromResult<IList<string>>(new List<string>());
1754return Task.FromResult(false);
1759return Task.FromResult(0);
1764return Task.FromResult("");
1769return Task.FromResult(0);
1774return Task.FromResult(false);
1779return Task.FromResult<string>(null);
1784return Task.FromResult<string>(null);
1789return Task.FromResult<string>(null);
1794return Task.FromResult(0);
1799return Task.FromResult<IList<PocoUser>>(new List<PocoUser>());
1804return Task.FromResult<IList<PocoUser>>(new List<PocoUser>());
1809return Task.FromResult("");
1814return Task.FromResult(0);
1824return Task.FromResult<IList<UserPasskeyInfo>>([]);
1829return Task.FromResult<PocoUser>(null);
1834return Task.FromResult<UserPasskeyInfo>(null);
1849return Task.FromResult("Test");
1854return Task.FromResult(true);
1859return Task.FromResult(true);
2161.Returns(Task.FromResult(user2))
2164.Returns(Task.FromResult(user2.Id))
2167.Returns(Task.FromResult(user.UserName))
2170.Returns(Task.FromResult(user.Email))
Microsoft.AspNetCore.InternalTesting.Tests (2)
Microsoft.AspNetCore.Localization (4)
Microsoft.AspNetCore.Localization.Routing (1)
Microsoft.AspNetCore.Localization.Tests (18)
Microsoft.AspNetCore.Mvc.Abstractions (3)
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (2)
Microsoft.AspNetCore.Mvc.Core (3)
Microsoft.AspNetCore.Mvc.Core.Test (65)
Microsoft.AspNetCore.Mvc.Core.TestCommon (34)
Microsoft.AspNetCore.Mvc.Cors.Test (2)
Microsoft.AspNetCore.Mvc.IntegrationTests (2)
Microsoft.AspNetCore.Mvc.Razor (2)
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.Test (2)
Microsoft.AspNetCore.Mvc.Razor.Test (26)
Microsoft.AspNetCore.Mvc.RazorPages (3)
Microsoft.AspNetCore.Mvc.RazorPages.Test (27)
Microsoft.AspNetCore.Mvc.TagHelpers (2)
Microsoft.AspNetCore.Mvc.TagHelpers.Test (153)
InputTagHelperTest.cs (31)
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))
656return Task.FromResult<TagHelperContent>(tagHelperContent);
891getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>(result: null))
945getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>(result: null))
1005getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>(result: null))
1065getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>(result: null))
1125getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>(result: null))
1169return Task.FromResult<TagHelperContent>(tagHelperContent);
1269return Task.FromResult<TagHelperContent>(tagHelperContent);
1368getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>(result: null))
1435return Task.FromResult<TagHelperContent>(tagHelperContent);
1535return Task.FromResult<TagHelperContent>(tagHelperContent);
1647return Task.FromResult<TagHelperContent>(tagHelperContent);
1765getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>(
1838getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>(
1907getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>(
2001getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>(
2081getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>(
2143getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>(
2211getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>(
2277getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>(
2335getChildContentAsync: (useCachedResult, encoder) => Task.FromResult<TagHelperContent>(
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>(
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (47)
Microsoft.AspNetCore.OpenApi.Tests (6)
Microsoft.AspNetCore.Owin.Tests (3)
Microsoft.AspNetCore.Razor (1)
Microsoft.AspNetCore.Razor.Runtime.Test (13)
Microsoft.AspNetCore.Razor.Test (8)
Microsoft.AspNetCore.RequestDecompression.Tests (2)
Microsoft.AspNetCore.ResponseCompression.Tests (1)
Microsoft.AspNetCore.Routing (1)
Microsoft.AspNetCore.Routing.Tests (15)
Microsoft.AspNetCore.Server.HttpSys (9)
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (86)
Microsoft.AspNetCore.Server.IIS (4)
Microsoft.AspNetCore.Server.IISIntegration (3)
Microsoft.AspNetCore.Server.IISIntegration.Tests (6)
Microsoft.AspNetCore.Server.IntegrationTesting (1)
Microsoft.AspNetCore.Server.IntegrationTesting.IIS (1)
Microsoft.AspNetCore.Server.Kestrel.Core (2)
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (2)
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (2)
Microsoft.AspNetCore.Session.Tests (10)
Microsoft.AspNetCore.Shared.Tests (7)
Microsoft.AspNetCore.SignalR.Client.Core (1)
Microsoft.AspNetCore.SignalR.Client.FunctionalTests (1)
Microsoft.AspNetCore.SignalR.Client.Tests (47)
TestHttpMessageHandler.cs (6)
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)));
Microsoft.AspNetCore.SignalR.Core (2)
Microsoft.AspNetCore.SignalR.Microbenchmarks (3)
Microsoft.AspNetCore.SignalR.StackExchangeRedis.Tests (2)
Microsoft.AspNetCore.SignalR.Tests (3)
Microsoft.AspNetCore.SpaServices.Extensions (1)
Microsoft.AspNetCore.SpaServices.Extensions.Tests (1)
Microsoft.AspNetCore.TestHost (1)
Microsoft.AspNetCore.TestHost.Tests (11)
Microsoft.AspNetCore.Testing.Tests (2)
Microsoft.AspNetCore.Tests (2)
Microsoft.AspNetCore.WebSockets.Tests (2)
Microsoft.AspNetCore.WebUtilities.Tests (3)
Microsoft.Build.Tasks.CodeAnalysis (3)
Microsoft.Build.Tasks.CodeAnalysis.Sdk (3)
Microsoft.CodeAnalysis (5)
Microsoft.CodeAnalysis.Analyzers (14)
Microsoft.CodeAnalysis.AnalyzerUtilities (12)
Microsoft.CodeAnalysis.BannedApiAnalyzers (12)
Microsoft.CodeAnalysis.CodeStyle (12)
Microsoft.CodeAnalysis.CodeStyle.Fixes (6)
Microsoft.CodeAnalysis.CSharp (1)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (5)
Microsoft.CodeAnalysis.CSharp.EditorFeatures (3)
Formatting\CSharpFormattingInteractionService.cs (3)
88return Task.FromResult(Formatter.GetFormattedTextChanges(parsedDocument.Root, [formattingSpan], document.Project.Solution.Services, options, cancellationToken).ToImmutableArray());
96return Task.FromResult(service.GetFormattingChangesOnPaste(parsedDocument, textSpan, options, cancellationToken));
110return Task.FromResult(service.GetFormattingChangesOnTypedCharacter(parsedDocument, position, indentationOptions, cancellationToken));
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (15)
Microsoft.CodeAnalysis.CSharp.EditorFeatures2.UnitTests (6)
Microsoft.CodeAnalysis.CSharp.Features (26)
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (12)
Microsoft.CodeAnalysis.EditorFeatures (13)
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (1)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (19)
Microsoft.CodeAnalysis.ExternalAccess.Copilot (9)
Microsoft.CodeAnalysis.ExternalAccess.FSharp (1)
Microsoft.CodeAnalysis.Features (63)
Microsoft.CodeAnalysis.InteractiveHost (8)
Microsoft.CodeAnalysis.LanguageServer (4)
Microsoft.CodeAnalysis.LanguageServer.Protocol (14)
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (18)
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (12)
Microsoft.CodeAnalysis.PublicApiAnalyzers (12)
Microsoft.CodeAnalysis.Remote.ServiceHub (1)
Microsoft.CodeAnalysis.ResxSourceGenerator (12)
Microsoft.CodeAnalysis.Scripting (2)
Microsoft.CodeAnalysis.Test.Utilities (1)
Microsoft.CodeAnalysis.Threading.Package (1)
Microsoft.CodeAnalysis.UnitTests (1)
Microsoft.CodeAnalysis.VisualBasic (1)
Microsoft.CodeAnalysis.Workspaces (42)
Microsoft.CodeAnalysis.Workspaces.MSBuild (1)
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (2)
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (4)
Microsoft.CodeAnalysis.Workspaces.UnitTests (24)
Microsoft.CommonLanguageServerProtocol.Framework.Example (1)
Microsoft.CommonLanguageServerProtocol.Framework.Package (1)
Microsoft.CommonLanguageServerProtocol.Framework.UnitTests (8)
Microsoft.DotNet.Build.Tasks.Feed (1)
Microsoft.DotNet.Build.Tasks.Feed.Tests (4)
Microsoft.DotNet.Helix.JobSender (4)
Microsoft.DotNet.Helix.JobSender.Tests (1)
Microsoft.DotNet.Open.Api.Tools.Tests (2)
Microsoft.DotNet.XUnitAssert.Tests (13)
Microsoft.Extensions.AI (1)
Microsoft.Extensions.AI.Abstractions.Tests (13)
Microsoft.Extensions.AI.Integration.Tests (2)
Microsoft.Extensions.AI.Tests (45)
ChatCompletion\ChatClientStructuredOutputExtensionsTests.cs (11)
77return Task.FromResult(expectedResponse);
138return Task.FromResult(expectedResponse);
190return Task.FromResult(expectedResponse);
234return Task.FromResult(expectedResponse);
248GetResponseAsyncCallback = (messages, options, cancellationToken) => Task.FromResult(expectedResponse),
267GetResponseAsyncCallback = (messages, options, cancellationToken) => Task.FromResult(expectedResponse),
286GetResponseAsyncCallback = (messages, options, cancellationToken) => Task.FromResult(expectedResponse),
313return Task.FromResult(expectedResponse);
342GetResponseAsyncCallback = (messages, options, cancellationToken) => Task.FromResult(expectedResponse)
409return Task.FromResult(expectedResponse);
437return Task.FromResult(new ChatResponse(new ChatMessage(ChatRole.Assistant, resultDuplicatedJson)));
Microsoft.Extensions.Caching.Hybrid (2)
Microsoft.Extensions.Caching.Hybrid.Tests (4)
Microsoft.Extensions.Caching.Memory (1)
Microsoft.Extensions.Caching.MicroBenchmarks (1)
Microsoft.Extensions.Diagnostics.HealthChecks (2)
Microsoft.Extensions.Diagnostics.HealthChecks.Common (5)
Microsoft.Extensions.Diagnostics.HealthChecks.Tests (41)
DefaultHealthCheckServiceTest.cs (18)
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())));
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);
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)));
284b.AddAsyncCheck("Succeeds", ct => Task.FromResult(HealthCheckResult.Healthy()));
334return Task.FromResult(HealthCheckResult.Healthy());
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 } }));
HealthCheckPublisherHostedServiceTest.cs (18)
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))),
526instance: new DelegateHealthCheck(_ => Task.FromResult(HealthCheckResult.Healthy(HealthyMessage))),
533instance: new DelegateHealthCheck(_ => Task.FromResult(HealthCheckResult.Healthy(HealthyMessage))),
545instance: new DelegateHealthCheck(_ => Task.FromResult(HealthCheckResult.Healthy(HealthyMessage))),
557instance: new DelegateHealthCheck(_ => Task.FromResult(HealthCheckResult.Healthy(HealthyMessage))),
572return Task.FromResult(HealthCheckResult.Healthy(HealthyMessage));
585instance: new DelegateHealthCheck(_ => Task.FromResult(HealthCheckResult.Healthy(HealthyMessage))),
597instance: new DelegateHealthCheck(_ => Task.FromResult(HealthCheckResult.Healthy(HealthyMessage))),
609instance: new DelegateHealthCheck(_ => Task.FromResult(HealthCheckResult.Healthy(HealthyMessage))),
621instance: new DelegateHealthCheck(_ => Task.FromResult(HealthCheckResult.Healthy(HealthyMessage))),
Microsoft.Extensions.Diagnostics.Probes.Tests (1)
Microsoft.Extensions.Http.Diagnostics.PerformanceTests (2)
Microsoft.Extensions.Http.Diagnostics.Tests (13)
Microsoft.Extensions.Http.Polly.Tests (11)
Microsoft.Extensions.Http.Resilience.PerformanceTests (1)
Microsoft.Extensions.Http.Resilience.Tests (5)
Microsoft.Extensions.Identity.Core (4)
Microsoft.Extensions.Identity.Stores (19)
Microsoft.Extensions.ML.Tests (2)
Microsoft.Interop.LibraryImportGenerator (1)
Microsoft.Maui (8)
Microsoft.Maui.Controls (19)
Microsoft.Maui.Controls.Foldable (2)
Microsoft.Maui.Essentials (2)
Microsoft.Maui.Graphics (1)
Microsoft.ML.AutoML (6)
Microsoft.ML.Fairlearn (1)
Microsoft.ML.GenAI.Core (1)
Microsoft.ML.GenAI.LLaMA (2)
Microsoft.ML.GenAI.Mistral (2)
Microsoft.ML.GenAI.Phi (2)
Microsoft.ML.GenAI.Samples (1)
Microsoft.ML.Sweeper (3)
Microsoft.VisualStudio.LanguageServices (13)
Microsoft.VisualStudio.LanguageServices.CodeLens (1)
Microsoft.VisualStudio.LanguageServices.CSharp (1)
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (5)
Microsoft.VisualStudio.LanguageServices.LiveShare (4)
Microsoft.VisualStudio.LanguageServices.Xaml (2)
PathSchemeSelection (1)
ProjectCachePlugin (1)
RazorWebSite (2)
Replay (3)
Roslyn.Compilers.Extension (2)
Roslyn.Diagnostics.Analyzers (13)
Roslyn.VisualStudio.DiagnosticsWindow (1)
Roslyn.VisualStudio.Next.UnitTests (1)
Sandbox (2)
ServerComparison.TestSites (1)
Shared.Tests (1)
SocialSample (4)
SocialWeather (2)
StatusCodePagesSample (1)
Stress.AppHost (4)
System.Console (5)
System.Data.Common (11)
System.Data.Odbc (3)
System.IO.Pipes (1)
System.IO.Ports (1)
System.Memory.Data (1)
System.Net.Http (12)
System.Net.NameResolution (4)
System.Net.Requests (1)
System.Net.Security (1)
System.Net.Sockets (1)
System.Private.CoreLib (25)
System.Private.Xml (17)
System.ServiceModel.Http (7)
System.ServiceModel.Primitives (20)
System.ServiceModel.Primitives.Tests (5)
System.ServiceModel.UnixDomainSocket (1)
System.Threading.Channels (2)
System.Threading.Tasks.Dataflow (1)
TagHelpersWebSite (1)
Test.Utilities (12)
Text.Analyzers (12)
UnitTests.Common (1)
vbc (3)
VBCSCompiler (3)
VBCSCompiler.UnitTests (15)
Wasm.Performance.ConsoleHost (1)