225 references to ThrowsAsync
Microsoft.AspNetCore.Authentication.Test (9)
FacebookTests.cs (2)
60await Assert.ThrowsAsync<ArgumentNullException>("AppId", () => context.ChallengeAsync("Facebook")); 76await Assert.ThrowsAsync<ArgumentNullException>("AppSecret", () => context.ChallengeAsync("Facebook"));
OAuthTests.cs (5)
54await Assert.ThrowsAsync<ArgumentNullException>("ClientId", () => server.SendAsync("http://example.com/")); 70await Assert.ThrowsAsync<ArgumentNullException>("ClientSecret", () => server.SendAsync("http://example.com/")); 86await Assert.ThrowsAsync<ArgumentException>("CallbackPath", () => server.SendAsync("http://example.com/")); 102await Assert.ThrowsAsync<ArgumentNullException>("TokenEndpoint", () => server.SendAsync("http://example.com/")); 118await Assert.ThrowsAsync<ArgumentNullException>("AuthorizationEndpoint", () => server.SendAsync("http://example.com/"));
TwitterTests.cs (2)
96await Assert.ThrowsAsync<ArgumentNullException>("ConsumerKey", async () => await server.SendAsync("http://example.com/challenge")); 112await Assert.ThrowsAsync<ArgumentNullException>("ConsumerSecret", async () => await server.SendAsync("http://example.com/challenge"));
Microsoft.AspNetCore.Http.Results.Tests (37)
AcceptedAtRouteOfTResultTests.cs (1)
149await Assert.ThrowsAsync<ArgumentNullException>("httpContext", () => result.ExecuteAsync(httpContext));
AcceptedAtRouteResultTests.cs (1)
102await Assert.ThrowsAsync<ArgumentNullException>("httpContext", () => result.ExecuteAsync(httpContext));
AcceptedOfTResultTests.cs (1)
90await Assert.ThrowsAsync<ArgumentNullException>("httpContext", () => result.ExecuteAsync(httpContext));
AcceptedResultTests.cs (1)
59await Assert.ThrowsAsync<ArgumentNullException>("httpContext", () => result.ExecuteAsync(httpContext));
BadRequestOfTResultTests.cs (1)
133await Assert.ThrowsAsync<ArgumentNullException>("httpContext", () => result.ExecuteAsync(httpContext));
BadRequestResultTests.cs (1)
72await Assert.ThrowsAsync<ArgumentNullException>("httpContext", () => result.ExecuteAsync(httpContext));
ChallengeResultTests.cs (1)
52await Assert.ThrowsAsync<ArgumentNullException>("httpContext", () => result.ExecuteAsync(httpContext));
ConflictOfTResultTests.cs (1)
111await Assert.ThrowsAsync<ArgumentNullException>("httpContext", () => result.ExecuteAsync(httpContext));
ConflictResultTests.cs (1)
73await Assert.ThrowsAsync<ArgumentNullException>("httpContext", () => result.ExecuteAsync(httpContext));
ContentResultTests.cs (1)
134await Assert.ThrowsAsync<ArgumentNullException>("httpContext", () => result.ExecuteAsync(httpContext));
CreatedAtRouteOfTResultTests.cs (1)
119await Assert.ThrowsAsync<ArgumentNullException>("httpContext", () => result.ExecuteAsync(httpContext));
CreatedAtRouteResultTests.cs (1)
100await Assert.ThrowsAsync<ArgumentNullException>("httpContext", () => result.ExecuteAsync(httpContext));
CreatedOfTResultTests.cs (1)
125await Assert.ThrowsAsync<ArgumentNullException>("httpContext", () => result.ExecuteAsync(httpContext));
CreatedResultTests.cs (1)
90await Assert.ThrowsAsync<ArgumentNullException>("httpContext", () => result.ExecuteAsync(httpContext));
EmptyResultTests.cs (1)
34await Assert.ThrowsAsync<ArgumentNullException>("httpContext", () => result.ExecuteAsync(httpContext));
ForbidResultTests.cs (1)
119await Assert.ThrowsAsync<ArgumentNullException>("httpContext", () => result.ExecuteAsync(httpContext));
HttpFileStreamResultTests.cs (1)
89await Assert.ThrowsAsync<ArgumentNullException>("httpContext", () => result.ExecuteAsync(httpContext));
InternalServerErrorOfTResultTests.cs (1)
133await Assert.ThrowsAsync<ArgumentNullException>("httpContext", () => result.ExecuteAsync(httpContext));
InternalServerErrorResultTests.cs (1)
70await Assert.ThrowsAsync<ArgumentNullException>("httpContext", () => result.ExecuteAsync(httpContext));
JsonResultTests.cs (1)
256await Assert.ThrowsAsync<ArgumentNullException>("httpContext", () => result.ExecuteAsync(httpContext));
NoContentResultTests.cs (1)
70await Assert.ThrowsAsync<ArgumentNullException>("httpContext", () => result.ExecuteAsync(httpContext));
NotFoundOfTResultTests.cs (1)
93await Assert.ThrowsAsync<ArgumentNullException>("httpContext", () => result.ExecuteAsync(httpContext));
NotFoundResultTests.cs (1)
66await Assert.ThrowsAsync<ArgumentNullException>("httpContext", () => result.ExecuteAsync(httpContext));
OkOfTResultTests.cs (1)
110await Assert.ThrowsAsync<ArgumentNullException>("httpContext", () => result.ExecuteAsync(httpContext));
OkResultTests.cs (1)
71await Assert.ThrowsAsync<ArgumentNullException>("httpContext", () => result.ExecuteAsync(httpContext));
ProblemResultTests.cs (1)
199await Assert.ThrowsAsync<ArgumentNullException>("httpContext", () => result.ExecuteAsync(httpContext));
PushStreamResultTests.cs (1)
78await Assert.ThrowsAsync<ArgumentNullException>("httpContext", () => result.ExecuteAsync(httpContext));
RedirectResultTests.cs (1)
33await Assert.ThrowsAsync<ArgumentNullException>("httpContext", () => result.ExecuteAsync(httpContext));
RedirectToRouteResultTests.cs (1)
95await Assert.ThrowsAsync<ArgumentNullException>("httpContext", () => result.ExecuteAsync(httpContext));
ServerSentEventsResultTests.cs (1)
103await Assert.ThrowsAsync<ArgumentNullException>("httpContext", () => result.ExecuteAsync(httpContext));
SignInResultTests.cs (1)
85await Assert.ThrowsAsync<ArgumentNullException>("httpContext", () => result.ExecuteAsync(httpContext));
SignOutResultTests.cs (1)
84await Assert.ThrowsAsync<ArgumentNullException>("httpContext", () => result.ExecuteAsync(httpContext));
StatusCodeResultTests.cs (1)
35await Assert.ThrowsAsync<ArgumentNullException>("httpContext", () => result.ExecuteAsync(httpContext));
UnauthorizedResultTests.cs (1)
45await Assert.ThrowsAsync<ArgumentNullException>("httpContext", () => result.ExecuteAsync(httpContext));
UnprocessableEntityOfTResultTests.cs (1)
110await Assert.ThrowsAsync<ArgumentNullException>("httpContext", () => result.ExecuteAsync(httpContext));
UnprocessableEntityResultTests.cs (1)
72await Assert.ThrowsAsync<ArgumentNullException>("httpContext", () => result.ExecuteAsync(httpContext));
ValidationProblemResultTests.cs (1)
119await Assert.ThrowsAsync<ArgumentNullException>("httpContext", () => result.ExecuteAsync(httpContext));
Microsoft.AspNetCore.Identity.EntityFrameworkCore.Test (50)
UserStoreTest.cs (50)
101await Assert.ThrowsAsync<ArgumentNullException>("user", async () => await store.GetUserIdAsync(null)); 102await Assert.ThrowsAsync<ArgumentNullException>("user", async () => await store.GetUserNameAsync(null)); 103await Assert.ThrowsAsync<ArgumentNullException>("user", async () => await store.SetUserNameAsync(null, null)); 104await Assert.ThrowsAsync<ArgumentNullException>("user", async () => await store.CreateAsync(null)); 105await Assert.ThrowsAsync<ArgumentNullException>("user", async () => await store.UpdateAsync(null)); 106await Assert.ThrowsAsync<ArgumentNullException>("user", async () => await store.DeleteAsync(null)); 107await Assert.ThrowsAsync<ArgumentNullException>("user", async () => await store.AddClaimsAsync(null, null)); 108await Assert.ThrowsAsync<ArgumentNullException>("user", async () => await store.ReplaceClaimAsync(null, null, null)); 109await Assert.ThrowsAsync<ArgumentNullException>("user", async () => await store.RemoveClaimsAsync(null, null)); 110await Assert.ThrowsAsync<ArgumentNullException>("user", async () => await store.GetClaimsAsync(null)); 111await Assert.ThrowsAsync<ArgumentNullException>("user", async () => await store.GetLoginsAsync(null)); 112await Assert.ThrowsAsync<ArgumentNullException>("user", async () => await store.GetRolesAsync(null)); 113await Assert.ThrowsAsync<ArgumentNullException>("user", async () => await store.AddLoginAsync(null, null)); 115Assert.ThrowsAsync<ArgumentNullException>("user", async () => await store.RemoveLoginAsync(null, null, null)); 116await Assert.ThrowsAsync<ArgumentNullException>("user", async () => await store.AddToRoleAsync(null, null)); 118Assert.ThrowsAsync<ArgumentNullException>("user", 120await Assert.ThrowsAsync<ArgumentNullException>("user", async () => await store.IsInRoleAsync(null, null)); 121await Assert.ThrowsAsync<ArgumentNullException>("user", async () => await store.GetPasswordHashAsync(null)); 123Assert.ThrowsAsync<ArgumentNullException>("user", 125await Assert.ThrowsAsync<ArgumentNullException>("user", async () => await store.GetSecurityStampAsync(null)); 126await Assert.ThrowsAsync<ArgumentNullException>("user", 128await Assert.ThrowsAsync<ArgumentNullException>("login", async () => await store.AddLoginAsync(new IdentityUser("fake"), null)); 129await Assert.ThrowsAsync<ArgumentNullException>("claims", 131await Assert.ThrowsAsync<ArgumentNullException>("claims", 133await Assert.ThrowsAsync<ArgumentNullException>("user", async () => await store.GetEmailConfirmedAsync(null)); 134await Assert.ThrowsAsync<ArgumentNullException>("user", 136await Assert.ThrowsAsync<ArgumentNullException>("user", async () => await store.GetEmailAsync(null)); 137await Assert.ThrowsAsync<ArgumentNullException>("user", async () => await store.SetEmailAsync(null, null)); 138await Assert.ThrowsAsync<ArgumentNullException>("user", async () => await store.GetPhoneNumberAsync(null)); 139await Assert.ThrowsAsync<ArgumentNullException>("user", async () => await store.SetPhoneNumberAsync(null, null)); 140await Assert.ThrowsAsync<ArgumentNullException>("user", 142await Assert.ThrowsAsync<ArgumentNullException>("user", 144await Assert.ThrowsAsync<ArgumentNullException>("user", async () => await store.GetTwoFactorEnabledAsync(null)); 145await Assert.ThrowsAsync<ArgumentNullException>("user", 147await Assert.ThrowsAsync<ArgumentNullException>("user", async () => await store.RedeemCodeAsync(user: null, code: "fake", default)); 148await Assert.ThrowsAsync<ArgumentNullException>("code", async () => await store.RedeemCodeAsync(new IdentityUser("fake"), code: null, default)); 149await Assert.ThrowsAsync<ArgumentException>("code", async () => await store.RedeemCodeAsync(new IdentityUser("fake"), code: "", default)); 150await Assert.ThrowsAsync<ArgumentNullException>("user", async () => await store.GetAccessFailedCountAsync(null)); 151await Assert.ThrowsAsync<ArgumentNullException>("user", async () => await store.GetLockoutEnabledAsync(null)); 152await Assert.ThrowsAsync<ArgumentNullException>("user", async () => await store.SetLockoutEnabledAsync(null, false)); 153await Assert.ThrowsAsync<ArgumentNullException>("user", async () => await store.GetLockoutEndDateAsync(null)); 154await Assert.ThrowsAsync<ArgumentNullException>("user", async () => await store.SetLockoutEndDateAsync(null, new DateTimeOffset())); 155await Assert.ThrowsAsync<ArgumentNullException>("user", async () => await store.ResetAccessFailedCountAsync(null)); 156await Assert.ThrowsAsync<ArgumentNullException>("user", async () => await store.IncrementAccessFailedCountAsync(null)); 157await Assert.ThrowsAsync<ArgumentNullException>("normalizedRoleName", async () => await store.AddToRoleAsync(new IdentityUser("fake"), null)); 158await Assert.ThrowsAsync<ArgumentNullException>("normalizedRoleName", async () => await store.RemoveFromRoleAsync(new IdentityUser("fake"), null)); 159await Assert.ThrowsAsync<ArgumentNullException>("normalizedRoleName", async () => await store.IsInRoleAsync(new IdentityUser("fake"), null)); 160await Assert.ThrowsAsync<ArgumentException>("normalizedRoleName", async () => await store.AddToRoleAsync(new IdentityUser("fake"), "")); 161await Assert.ThrowsAsync<ArgumentException>("normalizedRoleName", async () => await store.RemoveFromRoleAsync(new IdentityUser("fake"), "")); 162await Assert.ThrowsAsync<ArgumentException>("normalizedRoleName", async () => await store.IsInRoleAsync(new IdentityUser("fake"), ""));
Microsoft.AspNetCore.Identity.Test (81)
PasswordValidatorTest.cs (1)
27await Assert.ThrowsAsync<ArgumentNullException>("manager", () => validator.ValidateAsync(null, null, "foo"));
RoleManagerTest.cs (5)
126await Assert.ThrowsAsync<ArgumentNullException>("role", async () => await manager.CreateAsync(null)); 127await Assert.ThrowsAsync<ArgumentNullException>("role", async () => await manager.UpdateAsync(null)); 128await Assert.ThrowsAsync<ArgumentNullException>("role", async () => await manager.DeleteAsync(null)); 129await Assert.ThrowsAsync<ArgumentNullException>("roleName", async () => await manager.FindByNameAsync(null)); 130await Assert.ThrowsAsync<ArgumentNullException>("roleName", async () => await manager.RoleExistsAsync(null));
RoleValidatorTest.cs (2)
17await Assert.ThrowsAsync<ArgumentNullException>("manager", async () => await validator.ValidateAsync(null, null)); 18await Assert.ThrowsAsync<ArgumentNullException>("role", async () => await validator.ValidateAsync(manager, null));
UserClaimsPrincipalFactoryTest.cs (1)
23await Assert.ThrowsAsync<ArgumentNullException>("user",
UserManagerTest.cs (70)
1355await Assert.ThrowsAsync<ArgumentNullException>("user", async () => await manager.CreateAsync(null)); 1356await Assert.ThrowsAsync<ArgumentNullException>("user", async () => await manager.CreateAsync(null, null)); 1358Assert.ThrowsAsync<ArgumentNullException>("password", 1360await Assert.ThrowsAsync<ArgumentNullException>("user", async () => await manager.UpdateAsync(null)); 1361await Assert.ThrowsAsync<ArgumentNullException>("user", async () => await manager.DeleteAsync(null)); 1362await Assert.ThrowsAsync<ArgumentNullException>("user", async () => await manager.AddClaimAsync(null, null)); 1363await Assert.ThrowsAsync<ArgumentNullException>("user", async () => await manager.ReplaceClaimAsync(null, null, null)); 1364await Assert.ThrowsAsync<ArgumentNullException>("user", async () => await manager.AddClaimsAsync(null, null)); 1365await Assert.ThrowsAsync<ArgumentNullException>("userName", async () => await manager.FindByNameAsync(null)); 1366await Assert.ThrowsAsync<ArgumentNullException>("login", async () => await manager.AddLoginAsync(null, null)); 1367await Assert.ThrowsAsync<ArgumentNullException>("loginProvider", 1369await Assert.ThrowsAsync<ArgumentNullException>("providerKey", 1371await Assert.ThrowsAsync<ArgumentNullException>("email", async () => await manager.FindByEmailAsync(null)); 1373await Assert.ThrowsAsync<ArgumentNullException>("roles", async () => await manager.AddToRolesAsync(new PocoUser(), null)); 1374await Assert.ThrowsAsync<ArgumentNullException>("roles", async () => await manager.RemoveFromRolesAsync(new PocoUser(), null)); 1375await Assert.ThrowsAsync<ArgumentNullException>("passkey", async () => await manager.AddOrUpdatePasskeyAsync(new PocoUser(), null)); 1376await Assert.ThrowsAsync<ArgumentNullException>("credentialId", async () => await manager.GetPasskeyAsync(new PocoUser(), null)); 1377await Assert.ThrowsAsync<ArgumentNullException>("credentialId", async () => await manager.FindByPasskeyIdAsync(null)); 1378await Assert.ThrowsAsync<ArgumentNullException>("credentialId", async () => await manager.RemovePasskeyAsync(new PocoUser(), null)); 1386await Assert.ThrowsAsync<ArgumentNullException>("user", 1388await Assert.ThrowsAsync<ArgumentNullException>("user", 1390await Assert.ThrowsAsync<ArgumentNullException>("user", 1392await Assert.ThrowsAsync<ArgumentNullException>("user", 1394await Assert.ThrowsAsync<ArgumentNullException>("user", 1396await Assert.ThrowsAsync<ArgumentNullException>("user", 1398await Assert.ThrowsAsync<ArgumentNullException>("user", 1400await Assert.ThrowsAsync<ArgumentNullException>("user", 1402await Assert.ThrowsAsync<ArgumentNullException>("user", 1404await Assert.ThrowsAsync<ArgumentNullException>("user", 1406await Assert.ThrowsAsync<ArgumentNullException>("user", 1408await Assert.ThrowsAsync<ArgumentNullException>("user", 1410await Assert.ThrowsAsync<ArgumentNullException>("user", 1412await Assert.ThrowsAsync<ArgumentNullException>("user", 1414await Assert.ThrowsAsync<ArgumentNullException>("user", 1416await Assert.ThrowsAsync<ArgumentNullException>("user", 1418await Assert.ThrowsAsync<ArgumentNullException>("user", 1420await Assert.ThrowsAsync<ArgumentNullException>("user", 1422await Assert.ThrowsAsync<ArgumentNullException>("user", 1424await Assert.ThrowsAsync<ArgumentNullException>("user", 1426await Assert.ThrowsAsync<ArgumentNullException>("user", 1428await Assert.ThrowsAsync<ArgumentNullException>("user", 1430await Assert.ThrowsAsync<ArgumentNullException>("user", 1432await Assert.ThrowsAsync<ArgumentNullException>("user", 1434await Assert.ThrowsAsync<ArgumentNullException>("user", 1436await Assert.ThrowsAsync<ArgumentNullException>("user", 1438await Assert.ThrowsAsync<ArgumentNullException>("user", 1440await Assert.ThrowsAsync<ArgumentNullException>("user", 1442await Assert.ThrowsAsync<ArgumentNullException>("user", 1444await Assert.ThrowsAsync<ArgumentNullException>("user", 1446await Assert.ThrowsAsync<ArgumentNullException>("user", 1448await Assert.ThrowsAsync<ArgumentNullException>("user", 1450await Assert.ThrowsAsync<ArgumentNullException>("user", 1452await Assert.ThrowsAsync<ArgumentNullException>("user", 1454await Assert.ThrowsAsync<ArgumentNullException>("user", 1456await Assert.ThrowsAsync<ArgumentNullException>("user", 1458await Assert.ThrowsAsync<ArgumentNullException>("user", 1460await Assert.ThrowsAsync<ArgumentNullException>("user", 1462await Assert.ThrowsAsync<ArgumentNullException>("user", 1464await Assert.ThrowsAsync<ArgumentNullException>("user", 1466await Assert.ThrowsAsync<ArgumentNullException>("user", 1468await Assert.ThrowsAsync<ArgumentNullException>("user", 1470await Assert.ThrowsAsync<ArgumentNullException>("user", 1472await Assert.ThrowsAsync<ArgumentNullException>("user", 1474await Assert.ThrowsAsync<ArgumentNullException>("user", 1476await Assert.ThrowsAsync<ArgumentNullException>("user", 1478await Assert.ThrowsAsync<ArgumentNullException>("user", 1480await Assert.ThrowsAsync<ArgumentNullException>("user", 1482await Assert.ThrowsAsync<ArgumentNullException>("user", 1484await Assert.ThrowsAsync<ArgumentNullException>("user", 1486await Assert.ThrowsAsync<ArgumentNullException>("user",
UserValidatorTest.cs (2)
17await Assert.ThrowsAsync<ArgumentNullException>("manager", () => validator.ValidateAsync(null, null)); 18await Assert.ThrowsAsync<ArgumentNullException>("user", () => validator.ValidateAsync(manager, null));
Microsoft.AspNetCore.OutputCaching.Tests (2)
MemoryOutputCacheStoreTests.cs (2)
48_ = await Assert.ThrowsAsync<ArgumentNullException>("key", () => store.SetAsync(key, value, null, TimeSpan.FromMilliseconds(5), default).AsTask()); 58_ = await Assert.ThrowsAsync<ArgumentNullException>("value", () => store.SetAsync(key, value, null, TimeSpan.FromMilliseconds(5), default).AsTask());
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (8)
ScriptTests.cs (8)
110await Assert.ThrowsAsync<ArgumentException>("globals", () => fn(new object())); 120await Assert.ThrowsAsync<ArgumentException>("globals", () => fn()); 121await Assert.ThrowsAsync<ArgumentException>("globals", () => fn(new object())); 305await Assert.ThrowsAsync<ArgumentException>("globals", () => script.RunAsync(new Globals { X = 1, Y = 2 })); 314await Assert.ThrowsAsync<ArgumentException>("globals", () => script.RunAsync()); 323await Assert.ThrowsAsync<ArgumentException>("globals", () => script.RunAsync(new object())); 331await Assert.ThrowsAsync<ArgumentNullException>("previousState", () => state.Script.RunFromAsync(null)); 340await Assert.ThrowsAsync<ArgumentException>("previousState", () => state1.Script.RunFromAsync(state2));
Microsoft.CodeAnalysis.Workspaces.UnitTests (9)
Simplifier\SimplifierTests.cs (9)
38await Assert.ThrowsAsync<ArgumentNullException>("node", () => Simplifier.ExpandAsync<SyntaxNode>(node: null!, document: null!)); 39await Assert.ThrowsAsync<ArgumentNullException>("document", () => Simplifier.ExpandAsync(node: node, document: null!)); 40await Assert.ThrowsAsync<ArgumentNullException>("document", () => Simplifier.ExpandAsync(token: default, document: null!)); 63await Assert.ThrowsAsync<ArgumentNullException>("document", () => Simplifier.ReduceAsync(document: null!)); 64await Assert.ThrowsAsync<ArgumentNullException>("document", () => Simplifier.ReduceAsync(document: null!, annotation: null!)); 65await Assert.ThrowsAsync<ArgumentNullException>("annotation", () => Simplifier.ReduceAsync(document, annotation: null!)); 66await Assert.ThrowsAsync<ArgumentNullException>("document", () => Simplifier.ReduceAsync(document: null!, span: default)); 67await Assert.ThrowsAsync<ArgumentNullException>("document", () => Simplifier.ReduceAsync(document: null!, spans: null!)); 68await Assert.ThrowsAsync<ArgumentNullException>("spans", () => Simplifier.ReduceAsync(document, spans: null!));
Microsoft.DotNet.XUnitAssert.Tests (17)
AsyncCollectionAssertsTests.cs (3)
73 await Assert.ThrowsAsync<ArgumentNullException>("collection", () => Assert.AllAsync(default(IAsyncEnumerable<object>)!, async _ => await Task.Yield())); 74 await Assert.ThrowsAsync<ArgumentNullException>("action", () => Assert.AllAsync(new object[0].ToAsyncEnumerable(), (Func<object, Task>)null!)); 75 await Assert.ThrowsAsync<ArgumentNullException>("action", () => Assert.AllAsync(new object[0].ToAsyncEnumerable(), (Func<object, int, Task>)null!));
CollectionAssertsTests.cs (3)
71 await Assert.ThrowsAsync<ArgumentNullException>("collection", () => Assert.AllAsync(default(IEnumerable<object>)!, async _ => await Task.Yield())); 72 await Assert.ThrowsAsync<ArgumentNullException>("action", () => Assert.AllAsync(new object[0], (Func<object, Task>)null!)); 73 await Assert.ThrowsAsync<ArgumentNullException>("action", () => Assert.AllAsync(new object[0], (Func<object, int, Task>)null!));
ExceptionAssertsTests.cs (9)
632 await Assert.ThrowsAsync<ArgumentNullException>("testCode", () => Assert.ThrowsAnyAsync<ArgumentException>(default(Func<Task>)!)); 691 await Assert.ThrowsAsync<ArgumentNullException>("testCode", () => Assert.ThrowsAsync<ArgumentException>(default(Func<Task>)!)); 760 await Assert.ThrowsAsync<ArgumentNullException>("testCode", () => Assert.ThrowsAsync<ArgumentException>("paramName", default(Func<Task>)!)); 768 var ex = await Record.ExceptionAsync(() => Assert.ThrowsAsync<ArgumentException>("paramName", testCode)); 784 await Assert.ThrowsAsync<ArgumentException>("paramName", testCode); 792 var ex = await Record.ExceptionAsync(() => Assert.ThrowsAsync<ArgumentException>("paramName2", testCode)); 810 var ex = await Record.ExceptionAsync(() => Assert.ThrowsAsync<ArgumentException>("paramName", testCode)); 828 var ex = await Record.ExceptionAsync(() => Assert.ThrowsAsync<ArgumentException>("paramName", testCode));
PropertyAssertsTests.cs (2)
68 await Assert.ThrowsAsync<ArgumentNullException>("object", () => Assert.PropertyChangedAsync(null!, "propertyName", () => Task.FromResult(0))); 69 await Assert.ThrowsAsync<ArgumentNullException>("testCode", () => Assert.PropertyChangedAsync(Substitute.For<INotifyPropertyChanged>(), "propertyName", default(Func<Task>)!));
Microsoft.Extensions.AI.Abstractions.Tests (9)
Embeddings\EmbeddingGeneratorExtensionsTests.cs (3)
81await Assert.ThrowsAsync<ArgumentNullException>("generator", () => ((TestEmbeddingGenerator)null!).GenerateAsync("hello")); 82await Assert.ThrowsAsync<ArgumentNullException>("generator", () => ((TestEmbeddingGenerator)null!).GenerateVectorAsync("hello")); 83await Assert.ThrowsAsync<ArgumentNullException>("generator", () => ((TestEmbeddingGenerator)null!).GenerateAndZipAsync(["hello"]));
Image\ImageGeneratorExtensionsTests.cs (6)
94await Assert.ThrowsAsync<ArgumentNullException>("generator", async () => 97await Assert.ThrowsAsync<ArgumentNullException>("originalImage", async () => 100await Assert.ThrowsAsync<ArgumentNullException>("prompt", async () => 142await Assert.ThrowsAsync<ArgumentNullException>("generator", async () => 152await Assert.ThrowsAsync<ArgumentNullException>("fileName", async () => 162await Assert.ThrowsAsync<ArgumentNullException>("prompt", async () =>
Microsoft.Extensions.AI.Tests (3)
Functions\AIFunctionFactoryTest.cs (3)
358await Assert.ThrowsAsync<ArgumentNullException>("arguments.Services", () => func.InvokeAsync(arguments).AsTask()); 525Exception e = await Assert.ThrowsAsync<ArgumentException>("arguments.Services", () => f.InvokeAsync(new() { ["myInteger"] = 1 }).AsTask()); 548Exception e = await Assert.ThrowsAsync<ArgumentException>("arguments.Services", () => f.InvokeAsync(new() { ["myInteger"] = 1 }).AsTask());