1027 references to ThrowsAsync
Aspire.Dashboard.Tests (8)
Aspire.Hosting.Nats.Tests (1)
Aspire.Hosting.Testing.Tests (9)
Aspire.Hosting.Tests (14)
Binding.ReliableSession.IntegrationTests (2)
Diagnostics.EFCore.FunctionalTests (3)
IIS.FunctionalTests (4)
InMemory.FunctionalTests (66)
InProcessWebSite (1)
Interop.FunctionalTests (18)
Microsoft.AspNetCore.Authentication.Core.Test (10)
Microsoft.AspNetCore.Authentication.Negotiate.Test (9)
NegotiateHandlerTests.cs (6)
29var ex = await Assert.ThrowsAsync<NotSupportedException>(() => SendAsync(server, "/Anonymous1", connection: null));
94var ex = await Assert.ThrowsAsync<InvalidOperationException>(() => SendAsync(server, "/404", testConnection));
104var ex = await Assert.ThrowsAsync<TrueException>(() => SendAsync(server, "/404", new TestConnection(), "Negotiate ClientNtlmBlob2"));
322var ex = await Assert.ThrowsAsync<Exception>(() => SendAsync(server, "/404", testConnection, "Negotiate OtherError"));
471return Assert.ThrowsAsync<InvalidOperationException>(() => context.SignInAsync(new ClaimsPrincipal()));
476return Assert.ThrowsAsync<InvalidOperationException>(() => context.SignOutAsync());
Microsoft.AspNetCore.Authentication.Test (70)
Microsoft.AspNetCore.Authorization.Test (2)
Microsoft.AspNetCore.Components.Endpoints.Tests (1)
Microsoft.AspNetCore.Components.Server.Tests (12)
Microsoft.AspNetCore.Components.Tests (29)
Microsoft.AspNetCore.Components.Web.Tests (12)
Microsoft.AspNetCore.Components.WebAssembly.Tests (3)
Microsoft.AspNetCore.Components.WebView.Test (1)
Microsoft.AspNetCore.ConcurrencyLimiter.Tests (2)
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (3)
Microsoft.AspNetCore.Diagnostics.Tests (1)
Microsoft.AspNetCore.HeaderPropagation.Tests (2)
Microsoft.AspNetCore.HostFiltering.Tests (1)
Microsoft.AspNetCore.Hosting.Tests (6)
Microsoft.AspNetCore.Hosting.WindowsServices.Tests (2)
Microsoft.AspNetCore.Http.Abstractions.Tests (9)
Microsoft.AspNetCore.Http.Connections.Tests (5)
Microsoft.AspNetCore.Http.Extensions.Tests (40)
Microsoft.AspNetCore.Http.Results.Tests (16)
Microsoft.AspNetCore.Http.Tests (8)
Microsoft.AspNetCore.HttpsPolicy.Tests (1)
Microsoft.AspNetCore.Identity.EntityFrameworkCore.Test (26)
UserStoreTest.cs (24)
68await Assert.ThrowsAsync<ObjectDisposedException>(async () => await store.AddClaimsAsync(null, null));
69await Assert.ThrowsAsync<ObjectDisposedException>(async () => await store.AddLoginAsync(null, null));
70await Assert.ThrowsAsync<ObjectDisposedException>(async () => await store.AddToRoleAsync(null, null));
71await Assert.ThrowsAsync<ObjectDisposedException>(async () => await store.GetClaimsAsync(null));
72await Assert.ThrowsAsync<ObjectDisposedException>(async () => await store.GetLoginsAsync(null));
73await Assert.ThrowsAsync<ObjectDisposedException>(async () => await store.GetRolesAsync(null));
74await Assert.ThrowsAsync<ObjectDisposedException>(async () => await store.IsInRoleAsync(null, null));
75await Assert.ThrowsAsync<ObjectDisposedException>(async () => await store.RemoveClaimsAsync(null, null));
76await Assert.ThrowsAsync<ObjectDisposedException>(async () => await store.RemoveLoginAsync(null, null, null));
77await Assert.ThrowsAsync<ObjectDisposedException>(
79await Assert.ThrowsAsync<ObjectDisposedException>(async () => await store.RemoveClaimsAsync(null, null));
80await Assert.ThrowsAsync<ObjectDisposedException>(async () => await store.ReplaceClaimAsync(null, null, null));
81await Assert.ThrowsAsync<ObjectDisposedException>(async () => await store.FindByLoginAsync(null, null));
82await Assert.ThrowsAsync<ObjectDisposedException>(async () => await store.FindByIdAsync(null));
83await Assert.ThrowsAsync<ObjectDisposedException>(async () => await store.FindByNameAsync(null));
84await Assert.ThrowsAsync<ObjectDisposedException>(async () => await store.CreateAsync(null));
85await Assert.ThrowsAsync<ObjectDisposedException>(async () => await store.UpdateAsync(null));
86await Assert.ThrowsAsync<ObjectDisposedException>(async () => await store.DeleteAsync(null));
87await Assert.ThrowsAsync<ObjectDisposedException>(
89await Assert.ThrowsAsync<ObjectDisposedException>(async () => await store.GetEmailConfirmedAsync(null));
90await Assert.ThrowsAsync<ObjectDisposedException>(
92await Assert.ThrowsAsync<ObjectDisposedException>(
194await Assert.ThrowsAsync<InvalidOperationException>(async () => await manager.FindByEmailAsync("dupe@dupe.com"));
204await Assert.ThrowsAsync<InvalidOperationException>(
Microsoft.AspNetCore.Identity.FunctionalTests (1)
Microsoft.AspNetCore.Identity.Specification.Tests (4)
Microsoft.AspNetCore.Identity.Test (86)
UserManagerTest.cs (79)
606var ex = await Assert.ThrowsAsync<InvalidOperationException>(() => manager.CreateAsync(user));
623var ex = await Assert.ThrowsAsync<InvalidOperationException>(() => manager.UpdateAsync(user));
691await Assert.ThrowsAsync<NotSupportedException>(() => manager.FindByEmailAsync(null));
692await Assert.ThrowsAsync<NotSupportedException>(() => manager.SetEmailAsync(null, null));
693await Assert.ThrowsAsync<NotSupportedException>(() => manager.GetEmailAsync(null));
694await Assert.ThrowsAsync<NotSupportedException>(() => manager.IsEmailConfirmedAsync(null));
695await Assert.ThrowsAsync<NotSupportedException>(() => manager.ConfirmEmailAsync(null, null));
703await Assert.ThrowsAsync<NotSupportedException>(async () => await manager.SetPhoneNumberAsync(null, null));
704await Assert.ThrowsAsync<NotSupportedException>(async () => await manager.SetPhoneNumberAsync(null, null));
705await Assert.ThrowsAsync<NotSupportedException>(async () => await manager.GetPhoneNumberAsync(null));
713await Assert.ThrowsAsync<NotSupportedException>(
715await Assert.ThrowsAsync<NotSupportedException>(
724await Assert.ThrowsAsync<NotSupportedException>(() => manager.CreateAsync(null, null));
725await Assert.ThrowsAsync<NotSupportedException>(() => manager.ChangePasswordAsync(null, null, null));
726await Assert.ThrowsAsync<NotSupportedException>(() => manager.AddPasswordAsync(null, null));
727await Assert.ThrowsAsync<NotSupportedException>(() => manager.RemovePasswordAsync(null));
728await Assert.ThrowsAsync<NotSupportedException>(() => manager.CheckPasswordAsync(null, null));
729await Assert.ThrowsAsync<NotSupportedException>(() => manager.HasPasswordAsync(null));
739await Assert.ThrowsAsync<NotSupportedException>(() => manager.UpdateSecurityStampAsync(null));
740await Assert.ThrowsAsync<NotSupportedException>(() => manager.GetSecurityStampAsync(null));
741await Assert.ThrowsAsync<NotSupportedException>(
743await Assert.ThrowsAsync<NotSupportedException>(
752await Assert.ThrowsAsync<NotSupportedException>(async () => await manager.AddLoginAsync(null, null));
753await Assert.ThrowsAsync<NotSupportedException>(async () => await manager.RemoveLoginAsync(null, null, null));
754await Assert.ThrowsAsync<NotSupportedException>(async () => await manager.GetLoginsAsync(null));
755await Assert.ThrowsAsync<NotSupportedException>(async () => await manager.FindByLoginAsync(null, null));
763await Assert.ThrowsAsync<NotSupportedException>(async () => await manager.AddClaimAsync(null, null));
764await Assert.ThrowsAsync<NotSupportedException>(async () => await manager.ReplaceClaimAsync(null, null, null));
765await Assert.ThrowsAsync<NotSupportedException>(async () => await manager.RemoveClaimAsync(null, null));
766await Assert.ThrowsAsync<NotSupportedException>(async () => await manager.GetClaimsAsync(null));
801await Assert.ThrowsAsync<NotImplementedException>(() => manager.GenerateUserTokenAsync(new PocoUser(), "A", "purpose"));
898await Assert.ThrowsAsync<NotImplementedException>(() => manager.GenerateUserTokenAsync(new PocoUser(), TokenOptions.DefaultProvider, "purpose"));
906await Assert.ThrowsAsync<NotSupportedException>(async () => await manager.GetTwoFactorEnabledAsync(null));
908Assert.ThrowsAsync<NotSupportedException>(async () => await manager.SetTwoFactorEnabledAsync(null, true));
916await Assert.ThrowsAsync<NotSupportedException>(async () => await manager.GetLockoutEnabledAsync(null));
917await Assert.ThrowsAsync<NotSupportedException>(async () => await manager.SetLockoutEnabledAsync(null, true));
918await Assert.ThrowsAsync<NotSupportedException>(async () => await manager.AccessFailedAsync(null));
919await Assert.ThrowsAsync<NotSupportedException>(async () => await manager.IsLockedOutAsync(null));
920await Assert.ThrowsAsync<NotSupportedException>(async () => await manager.ResetAccessFailedCountAsync(null));
921await Assert.ThrowsAsync<NotSupportedException>(async () => await manager.GetAccessFailedCountAsync(null));
929await Assert.ThrowsAsync<NotSupportedException>(async () => await manager.AddToRoleAsync(null, "bogus"));
930await Assert.ThrowsAsync<NotSupportedException>(async () => await manager.AddToRolesAsync(null, null));
931await Assert.ThrowsAsync<NotSupportedException>(async () => await manager.GetRolesAsync(null));
932await Assert.ThrowsAsync<NotSupportedException>(async () => await manager.RemoveFromRoleAsync(null, "bogus"));
933await Assert.ThrowsAsync<NotSupportedException>(async () => await manager.RemoveFromRolesAsync(null, null));
934await Assert.ThrowsAsync<NotSupportedException>(async () => await manager.IsInRoleAsync(null, "bogus"));
970var error = await Assert.ThrowsAsync<TException>(code);
1151await Assert.ThrowsAsync<ObjectDisposedException>(() => manager.AddClaimAsync(null, null));
1152await Assert.ThrowsAsync<ObjectDisposedException>(() => manager.AddClaimsAsync(null, null));
1153await Assert.ThrowsAsync<ObjectDisposedException>(() => manager.AddLoginAsync(null, null));
1154await Assert.ThrowsAsync<ObjectDisposedException>(() => manager.AddPasswordAsync(null, null));
1155await Assert.ThrowsAsync<ObjectDisposedException>(() => manager.AddToRoleAsync(null, null));
1156await Assert.ThrowsAsync<ObjectDisposedException>(() => manager.AddToRolesAsync(null, null));
1157await Assert.ThrowsAsync<ObjectDisposedException>(() => manager.ChangePasswordAsync(null, null, null));
1158await Assert.ThrowsAsync<ObjectDisposedException>(() => manager.GetClaimsAsync(null));
1159await Assert.ThrowsAsync<ObjectDisposedException>(() => manager.GetLoginsAsync(null));
1160await Assert.ThrowsAsync<ObjectDisposedException>(() => manager.GetRolesAsync(null));
1161await Assert.ThrowsAsync<ObjectDisposedException>(() => manager.IsInRoleAsync(null, null));
1162await Assert.ThrowsAsync<ObjectDisposedException>(() => manager.RemoveClaimAsync(null, null));
1163await Assert.ThrowsAsync<ObjectDisposedException>(() => manager.RemoveClaimsAsync(null, null));
1164await Assert.ThrowsAsync<ObjectDisposedException>(() => manager.RemoveLoginAsync(null, null, null));
1165await Assert.ThrowsAsync<ObjectDisposedException>(() => manager.RemovePasswordAsync(null));
1166await Assert.ThrowsAsync<ObjectDisposedException>(() => manager.RemoveFromRoleAsync(null, null));
1167await Assert.ThrowsAsync<ObjectDisposedException>(() => manager.RemoveFromRolesAsync(null, null));
1168await Assert.ThrowsAsync<ObjectDisposedException>(() => manager.FindByLoginAsync(null, null));
1169await Assert.ThrowsAsync<ObjectDisposedException>(() => manager.FindByIdAsync(null));
1170await Assert.ThrowsAsync<ObjectDisposedException>(() => manager.FindByNameAsync(null));
1171await Assert.ThrowsAsync<ObjectDisposedException>(() => manager.CreateAsync(null));
1172await Assert.ThrowsAsync<ObjectDisposedException>(() => manager.CreateAsync(null, null));
1173await Assert.ThrowsAsync<ObjectDisposedException>(() => manager.UpdateAsync(null));
1174await Assert.ThrowsAsync<ObjectDisposedException>(() => manager.DeleteAsync(null));
1175await Assert.ThrowsAsync<ObjectDisposedException>(() => manager.ReplaceClaimAsync(null, null, null));
1176await Assert.ThrowsAsync<ObjectDisposedException>(() => manager.UpdateSecurityStampAsync(null));
1177await Assert.ThrowsAsync<ObjectDisposedException>(() => manager.GetSecurityStampAsync(null));
1178await Assert.ThrowsAsync<ObjectDisposedException>(() => manager.GeneratePasswordResetTokenAsync(null));
1179await Assert.ThrowsAsync<ObjectDisposedException>(() => manager.ResetPasswordAsync(null, null, null));
1180await Assert.ThrowsAsync<ObjectDisposedException>(() => manager.GenerateEmailConfirmationTokenAsync(null));
1181await Assert.ThrowsAsync<ObjectDisposedException>(() => manager.IsEmailConfirmedAsync(null));
1182await Assert.ThrowsAsync<ObjectDisposedException>(() => manager.ConfirmEmailAsync(null, null));
Microsoft.AspNetCore.InternalTesting (2)
Microsoft.AspNetCore.InternalTesting.Tests (6)
Microsoft.AspNetCore.Mvc.Core.Test (39)
Microsoft.AspNetCore.Mvc.Core.TestCommon (5)
Microsoft.AspNetCore.Mvc.Formatters.Xml.Test (12)
Microsoft.AspNetCore.Mvc.FunctionalTests (3)
Microsoft.AspNetCore.Mvc.IntegrationTests (22)
Microsoft.AspNetCore.Mvc.NewtonsoftJson.Test (5)
Microsoft.AspNetCore.Mvc.Razor.Test (21)
Microsoft.AspNetCore.Mvc.TagHelpers.Test (23)
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (21)
Microsoft.AspNetCore.OpenApi.Tests (1)
Microsoft.AspNetCore.OutputCaching.Tests (1)
Microsoft.AspNetCore.Razor.Runtime.Test (1)
Microsoft.AspNetCore.RequestDecompression.Tests (1)
Microsoft.AspNetCore.Rewrite.Tests (1)
Microsoft.AspNetCore.Routing.FunctionalTests (7)
Microsoft.AspNetCore.Routing.Tests (6)
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (44)
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (48)
BodyControlTests.cs (13)
29await Assert.ThrowsAsync<Exception>(() => request.ReadAsync(new byte[1], 0, 1)));
31await Assert.ThrowsAsync<Exception>(async () => await requestPipe.ReadAsync()));
44var writeEx = await Assert.ThrowsAsync<InvalidOperationException>(() => response.WriteAsync(new byte[1], 0, 1));
48await Assert.ThrowsAsync<Exception>(() => request.ReadAsync(new byte[1], 0, 1)));
51await Assert.ThrowsAsync<Exception>(() => upgrade.ReadAsync(new byte[1], 0, 1)));
54await Assert.ThrowsAsync<Exception>(async () => await requestPipe.ReadAsync()));
70var writeEx = await Assert.ThrowsAsync<InvalidOperationException>(() => response.WriteAsync(new byte[1], 0, 1));
74await Assert.ThrowsAsync<Exception>(() => request.ReadAsync(new byte[1], 0, 1)));
77await Assert.ThrowsAsync<Exception>(() => upgrade.ReadAsync(new byte[1], 0, 1)));
79await Assert.ThrowsAsync<Exception>(async () => await requestPipe.ReadAsync()));
120await Assert.ThrowsAsync<ObjectDisposedException>(async () => await requestPipe.ReadAsync());
137await Assert.ThrowsAsync<ObjectDisposedException>(async () => await responsePipe.WriteAsync(new Memory<byte>()));
138await Assert.ThrowsAsync<ObjectDisposedException>(async () => await responsePipe.FlushAsync());
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Tests (17)
Microsoft.AspNetCore.Session.Tests (4)
Microsoft.AspNetCore.Shared.Tests (4)
Microsoft.AspNetCore.SignalR.Client.FunctionalTests (23)
Microsoft.AspNetCore.SignalR.Client.Tests (50)
Microsoft.AspNetCore.SignalR.Specification.Tests (10)
Microsoft.AspNetCore.SignalR.StackExchangeRedis.Tests (1)
Microsoft.AspNetCore.SignalR.Tests (13)
Microsoft.AspNetCore.TestHost.Tests (31)
Microsoft.AspNetCore.Tests (4)
Microsoft.AspNetCore.WebUtilities.Tests (22)
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (1)
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (1)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (2)
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (2)
Microsoft.CodeAnalysis.UnitTests (2)
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (14)
Microsoft.CodeAnalysis.Workspaces.UnitTests (10)
Microsoft.DotNet.Build.Tasks.Feed.Tests (3)
Microsoft.DotNet.XUnitAssert.Tests (5)
Microsoft.Extensions.Caching.SqlServer.Tests (1)
Microsoft.Extensions.Caching.StackExchangeRedis.Tests (1)
Microsoft.Extensions.Diagnostics.HealthChecks.Tests (2)
Microsoft.Extensions.Diagnostics.Testing.Tests (6)
Microsoft.Extensions.Http.Diagnostics.Tests (5)
Microsoft.Extensions.Http.Polly.Tests (6)
Microsoft.Extensions.Http.Resilience.Tests (3)
Microsoft.Extensions.ServiceDiscovery.Tests (3)
Microsoft.Extensions.TimeProvider.Testing.Tests (6)
Microsoft.Gen.Logging.Unit.Tests (1)
Microsoft.Gen.Metrics.Unit.Tests (1)
Microsoft.JSInterop.Tests (8)
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (2)
Sockets.BindTests (1)
Sockets.FunctionalTests (1)
System.Windows.Forms.Primitives.TestUtilities (1)
System.Windows.Forms.Tests (1)
VBCSCompiler.UnitTests (1)
xunit.assert (1)