1514 references to Throws
Aspire.Hosting.Containers.Tests (3)
ContainerMountAnnotationTests.cs (3)
17
Assert.
Throws
<ArgumentNullException>("source", () => new ContainerMountAnnotation(source, "/usr/foo", ContainerMountType.BindMount, false));
24
Assert.
Throws
<ArgumentException>("source", () => new ContainerMountAnnotation("usr/foo", "/usr/foo", ContainerMountType.BindMount, false));
30
Assert.
Throws
<ArgumentException>("isReadOnly", () => new ContainerMountAnnotation(null, "/usr/foo", ContainerMountType.Volume, true));
Microsoft.AspNetCore.Http.Results.Tests (38)
ResultsTests.cs (17)
344
Assert.
Throws
<ArgumentNullException>("contents", () => Results.Bytes(null));
350
Assert.
Throws
<ArgumentNullException>("fileContents", () => Results.File(default(byte[])));
356
Assert.
Throws
<ArgumentNullException>("fileStream", () => Results.File(default(Stream)));
362
Assert.
Throws
<ArgumentNullException>("stream", () => Results.Stream(default(Stream)));
368
Assert.
Throws
<ArgumentNullException>("pipeReader", () => Results.Stream(default(PipeReader)));
374
Assert.
Throws
<ArgumentNullException>("streamWriterCallback", () => TypedResults.Stream(default(Func<Stream, Task>)));
478
Assert.
Throws
<ArgumentNullException>("principal", () => Results.SignIn(null));
1039
Assert.
Throws
<ArgumentNullException>("context", () => Results.Json<object>(null, context: null));
1045
Assert.
Throws
<ArgumentNullException>("context", () => Results.Json(null, type: typeof(object), context: null));
1065
Assert.
Throws
<ArgumentNullException>("jsonTypeInfo", () => Results.Json(null, jsonTypeInfo: null));
1071
Assert.
Throws
<ArgumentNullException>("jsonTypeInfo", () => Results.Json<object>(null, jsonTypeInfo: null));
1077
Assert.
Throws
<ArgumentNullException>("localUrl", () => Results.LocalRedirect(default(string)));
1083
Assert.
Throws
<ArgumentException>("localUrl", () => Results.LocalRedirect(string.Empty));
1244
Assert.
Throws
<ArgumentNullException>("problemDetails", () => Results.Problem(default(ProblemDetails)));
1392
Assert.
Throws
<ArgumentNullException>("errors", () => Results.ValidationProblem(default(IDictionary<string, string[]>)));
1460
Assert.
Throws
<ArgumentNullException>("url", () => Results.Redirect(default(string)));
1466
Assert.
Throws
<ArgumentException>("url", () => Results.Redirect(string.Empty));
TypedResultsTests.cs (21)
99
Assert.
Throws
<ArgumentNullException>("uri", () => TypedResults.Accepted(default(Uri)));
105
Assert.
Throws
<ArgumentNullException>("uri", () => TypedResults.Accepted(default(Uri), default(object)));
318
Assert.
Throws
<ArgumentNullException>("contents", () => TypedResults.Bytes(null));
324
Assert.
Throws
<ArgumentNullException>("fileContents", () => TypedResults.File(default(byte[])));
330
Assert.
Throws
<ArgumentNullException>("fileStream", () => TypedResults.File(default(Stream)));
336
Assert.
Throws
<ArgumentNullException>("stream", () => TypedResults.Stream(default(Stream)));
342
Assert.
Throws
<ArgumentNullException>("pipeReader", () => TypedResults.Stream(default(PipeReader)));
348
Assert.
Throws
<ArgumentNullException>("streamWriterCallback", () => TypedResults.Stream(default(Func<Stream, Task>)));
354
Assert.
Throws
<ArgumentNullException>("path", () => TypedResults.PhysicalFile(default(string)));
360
Assert.
Throws
<ArgumentException>("path", () => TypedResults.PhysicalFile(string.Empty));
366
Assert.
Throws
<ArgumentNullException>("path", () => TypedResults.VirtualFile(default(string)));
372
Assert.
Throws
<ArgumentException>("path", () => TypedResults.VirtualFile(string.Empty));
488
Assert.
Throws
<ArgumentNullException>("principal", () => TypedResults.SignIn(null));
899
Assert.
Throws
<ArgumentNullException>("context", () => TypedResults.Json(data, context: null));
915
Assert.
Throws
<ArgumentNullException>("jsonTypeInfo", () => TypedResults.Json(data, jsonTypeInfo: null));
921
Assert.
Throws
<ArgumentNullException>("localUrl", () => TypedResults.LocalRedirect(default(string)));
927
Assert.
Throws
<ArgumentException>("localUrl", () => TypedResults.LocalRedirect(string.Empty));
1060
Assert.
Throws
<ArgumentNullException>("problemDetails", () => TypedResults.Problem(default(ProblemDetails)));
1184
Assert.
Throws
<ArgumentNullException>("errors", () => TypedResults.ValidationProblem(default(IDictionary<string, string[]>)));
1242
Assert.
Throws
<ArgumentNullException>("url", () => TypedResults.Redirect(default(string)));
1248
Assert.
Throws
<ArgumentException>("url", () => TypedResults.Redirect(string.Empty));
Microsoft.AspNetCore.Http.Tests (1)
HttpServiceCollectionExtensionsTests.cs (1)
28
Assert.
Throws
<ArgumentNullException>("services", () => HttpServiceCollectionExtensions.AddHttpContextAccessor(null));
Microsoft.AspNetCore.Identity.EntityFrameworkCore.Test (1)
UserStoreTest.cs (1)
99
Assert.
Throws
<ArgumentNullException>("context", () => new UserStore(null));
Microsoft.AspNetCore.Identity.Test (6)
RoleManagerTest.cs (1)
123
Assert.
Throws
<ArgumentNullException>("store",
SignInManagerTest.cs (3)
21
Assert.
Throws
<ArgumentNullException>("userManager", () => new SignInManager<PocoUser>(null, null, null, null, null, null, null));
23
Assert.
Throws
<ArgumentNullException>("contextAccessor", () => new SignInManager<PocoUser>(userManager, null, null, null, null, null, null));
27
Assert.
Throws
<ArgumentNullException>("claimsFactory", () => new SignInManager<PocoUser>(userManager, contextAccessor.Object, null, null, null, null, null));
UserClaimsPrincipalFactoryTest.cs (1)
18
Assert.
Throws
<ArgumentException>("optionsAccessor",
UserManagerTest.cs (1)
1018
Assert.
Throws
<ArgumentNullException>("store",
Microsoft.AspNetCore.Mvc.Core.Test (4)
Formatters\FormatterMappingsTest.cs (1)
20
Assert.
Throws
<ArgumentException>("format", () => options.GetMediaTypeMappingForFormat(format));
Formatters\MediaTypeTest.cs (3)
108
Assert.
Throws
<ArgumentNullException>("mediaType", () => new MediaType(null, 0, 2));
117
Assert.
Throws
<ArgumentOutOfRangeException>("offset", () => new MediaType("media", offset, 5));
124
Assert.
Throws
<ArgumentOutOfRangeException>("length", () => new MediaType("media", 0, -1));
Microsoft.AspNetCore.Razor.Test (2)
TagHelpers\ReadOnlyTagHelperAttributeListTest.cs (1)
115
var exception = Assert.
Throws
<ArgumentOutOfRangeException>("index", () => attributes[index]);
TagHelpers\TagHelperAttributeListTest.cs (1)
86
var exception = Assert.
Throws
<ArgumentOutOfRangeException>("index", () => attributes[index]);
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (6)
RequestBodyTests.cs (6)
129
Assert.
Throws
<ArgumentNullException>("buffer", () => httpContext.Request.Body.Read(null, 0, 1));
130
Assert.
Throws
<ArgumentOutOfRangeException>("offset", () => httpContext.Request.Body.Read(input, -1, 1));
131
Assert.
Throws
<ArgumentOutOfRangeException>("count", () => httpContext.Request.Body.Read(input, input.Length + 1, 1));
132
Assert.
Throws
<ArgumentOutOfRangeException>("count", () => httpContext.Request.Body.Read(input, 10, -1));
133
Assert.
Throws
<ArgumentOutOfRangeException>("count", () => httpContext.Request.Body.Read(input, 1, input.Length));
134
Assert.
Throws
<ArgumentOutOfRangeException>("count", () => httpContext.Request.Body.Read(input, 0, input.Length + 1));
Microsoft.AspNetCore.WebUtilities.Tests (1)
QueryHelpersTests.cs (1)
107
Assert.
Throws
<ArgumentNullException>("value", () => QueryHelpers.AddQueryString("http://contoso.com/", "hello", null!));
Microsoft.Build.Engine.UnitTests (9)
Evaluation\SimpleVersion_Tests.cs (9)
67
Assert.
Throws
<ArgumentOutOfRangeException>("major", () => new SimpleVersion(-1, 0));
68
Assert.
Throws
<ArgumentOutOfRangeException>("major", () => new SimpleVersion(-1, 0, 0));
69
Assert.
Throws
<ArgumentOutOfRangeException>("major", () => new SimpleVersion(-1, 0, 0, 0));
75
Assert.
Throws
<ArgumentOutOfRangeException>("minor", () => new SimpleVersion(0, -1));
76
Assert.
Throws
<ArgumentOutOfRangeException>("minor", () => new SimpleVersion(0, -1, 0));
77
Assert.
Throws
<ArgumentOutOfRangeException>("minor", () => new SimpleVersion(0, -1, 0, 0));
83
Assert.
Throws
<ArgumentOutOfRangeException>("build", () => new SimpleVersion(0, 0, -1));
84
Assert.
Throws
<ArgumentOutOfRangeException>("build", () => new SimpleVersion(0, 0, -1, 0));
90
Assert.
Throws
<ArgumentOutOfRangeException>("revision", () => new SimpleVersion(0, 0, 0, -1));
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (2)
IOperation\IOperationTests_ICompoundAssignmentOperation.cs (2)
24
Assert.
Throws
<ArgumentNullException>("compoundAssignment", () => nullAssignment.GetInConversion());
25
Assert.
Throws
<ArgumentNullException>("compoundAssignment", () => nullAssignment.GetOutConversion());
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (12)
Compilation\CompilationAPITests.cs (7)
446
Assert.
Throws
<ArgumentNullException>("peStream", () => comp.Emit(peStream: null));
447
Assert.
Throws
<ArgumentException>("peStream", () => comp.Emit(peStream: new TestStream(canRead: true, canWrite: false, canSeek: true)));
448
Assert.
Throws
<ArgumentException>("pdbStream", () => comp.Emit(peStream: new MemoryStream(), pdbStream: new TestStream(canRead: true, canWrite: false, canSeek: true)));
457
Assert.
Throws
<ArgumentException>("embeddedTexts", () => comp.Emit(
469
Assert.
Throws
<ArgumentException>("win32Resources", () => comp.Emit(
473
Assert.
Throws
<ArgumentException>("win32Resources", () => comp.Emit(
2961
Assert.
Throws
<ArgumentException>(null, () => compilation.CreateBuiltinOperator(
Symbols\FunctionPointerTypeSymbolTests.cs (5)
1532
Assert.
Throws
<ArgumentNullException>("returnType", () => comp.CreateFunctionPointerTypeSymbol(returnType: null!, returnRefKind: RefKind.None, parameterTypes: ImmutableArray<ITypeSymbol>.Empty, parameterRefKinds: ImmutableArray<RefKind>.Empty));
1533
Assert.
Throws
<ArgumentNullException>("parameterTypes", () => comp.CreateFunctionPointerTypeSymbol(returnType: @string, returnRefKind: RefKind.None, parameterTypes: default, parameterRefKinds: ImmutableArray<RefKind>.Empty));
1534
Assert.
Throws
<ArgumentNullException>("parameterTypes[0]", () => comp.CreateFunctionPointerTypeSymbol(returnType: @string, returnRefKind: RefKind.None, parameterTypes: ImmutableArray.Create((ITypeSymbol?)null)!, parameterRefKinds: ImmutableArray.Create(RefKind.None)));
1535
Assert.
Throws
<ArgumentNullException>("parameterRefKinds", () => comp.CreateFunctionPointerTypeSymbol(returnType: @string, returnRefKind: RefKind.None, parameterTypes: ImmutableArray<ITypeSymbol>.Empty, parameterRefKinds: default));
1536
Assert.
Throws
<ArgumentNullException>("callingConventionTypes[0]", () => comp.CreateFunctionPointerTypeSymbol(returnType: @string, returnRefKind: RefKind.None, parameterTypes: ImmutableArray<ITypeSymbol>.Empty, parameterRefKinds: ImmutableArray<RefKind>.Empty, callingConvention: SignatureCallingConvention.Unmanaged, ImmutableArray.Create((INamedTypeSymbol)null!)));
Microsoft.CodeAnalysis.Scripting.UnitTests (37)
ScriptOptionsTests.cs (37)
41
Assert.
Throws
<ArgumentNullException>("references", () => options.AddReferences((MetadataReference[])null));
42
Assert.
Throws
<ArgumentNullException>("references[0]", () => options.AddReferences(new MetadataReference[] { null }));
44
Assert.
Throws
<ArgumentNullException>("references", () => options.AddReferences((IEnumerable<MetadataReference>)null));
45
Assert.
Throws
<ArgumentNullException>("references[0]", () => options.AddReferences((IEnumerable<MetadataReference>)new MetadataReference[] { null }));
47
Assert.
Throws
<ArgumentNullException>("references", () => options.AddReferences((Assembly[])null));
48
Assert.
Throws
<ArgumentNullException>("references[0]", () => options.AddReferences(new Assembly[] { null }));
50
Assert.
Throws
<ArgumentNullException>("references", () => options.AddReferences((IEnumerable<Assembly>)null));
51
Assert.
Throws
<ArgumentNullException>("references[0]", () => options.AddReferences((IEnumerable<Assembly>)new Assembly[] { null }));
53
Assert.
Throws
<ArgumentNullException>("references", () => options.AddReferences((string[])null));
54
Assert.
Throws
<ArgumentNullException>("references[0]", () => options.AddReferences(new string[] { null }));
56
Assert.
Throws
<ArgumentNullException>("references", () => options.AddReferences((IEnumerable<string>)null));
57
Assert.
Throws
<ArgumentNullException>("references[0]", () => options.AddReferences((IEnumerable<string>)new string[] { null }));
83
Assert.
Throws
<ArgumentNullException>("references", () => options.WithReferences((MetadataReference[])null));
84
Assert.
Throws
<ArgumentNullException>("references", () => options.WithReferences((IEnumerable<MetadataReference>)null));
85
Assert.
Throws
<ArgumentNullException>("references", () => options.WithReferences(default(ImmutableArray<MetadataReference>)));
86
Assert.
Throws
<ArgumentNullException>("references[0]", () => options.WithReferences(new MetadataReference[] { null }));
87
Assert.
Throws
<ArgumentNullException>("references[0]", () => options.WithReferences(ImmutableArray.Create((MetadataReference)null)));
89
Assert.
Throws
<ArgumentNullException>("references", () => options.WithReferences((Assembly[])null));
90
Assert.
Throws
<ArgumentNullException>("references", () => options.WithReferences((IEnumerable<Assembly>)null));
91
Assert.
Throws
<ArgumentNullException>("references", () => options.WithReferences(default(ImmutableArray<Assembly>)));
92
Assert.
Throws
<ArgumentNullException>("references[0]", () => options.WithReferences(new Assembly[] { null }));
93
Assert.
Throws
<ArgumentNullException>("references[0]", () => options.WithReferences(ImmutableArray.Create((Assembly)null)));
95
Assert.
Throws
<ArgumentNullException>("references", () => options.WithReferences((string[])null));
96
Assert.
Throws
<ArgumentNullException>("references", () => options.WithReferences((IEnumerable<string>)null));
97
Assert.
Throws
<ArgumentNullException>("references", () => options.WithReferences(default(ImmutableArray<string>)));
98
Assert.
Throws
<ArgumentNullException>("references[0]", () => options.WithReferences(new string[] { null }));
99
Assert.
Throws
<ArgumentNullException>("references[0]", () => options.WithReferences(ImmutableArray.Create((string)null)));
122
Assert.
Throws
<ArgumentNullException>("imports", () => options.AddImports((string[])null));
125
Assert.
Throws
<ArgumentNullException>("imports", () => options.AddImports((IEnumerable<string>)null));
126
Assert.
Throws
<ArgumentNullException>("imports[0]", () => options.AddImports((IEnumerable<string>)new string[] { null }));
128
Assert.
Throws
<ArgumentNullException>("imports", () => options.AddImports(default(ImmutableArray<string>)));
129
Assert.
Throws
<ArgumentNullException>("imports[0]", () => options.AddImports(ImmutableArray.Create((string)null)));
143
Assert.
Throws
<ArgumentNullException>("imports", () => options.WithImports((string[])null));
146
Assert.
Throws
<ArgumentNullException>("imports", () => options.WithImports((IEnumerable<string>)null));
147
Assert.
Throws
<ArgumentNullException>("imports[0]", () => options.WithImports((IEnumerable<string>)new string[] { null }));
149
Assert.
Throws
<ArgumentNullException>("imports", () => options.WithImports(default(ImmutableArray<string>)));
150
Assert.
Throws
<ArgumentNullException>("imports[0]", () => options.WithImports(ImmutableArray.Create((string)null)));
Microsoft.CodeAnalysis.Test.Utilities (4)
Compilation\TestOperationVisitor.cs (4)
1178
Assert.
Throws
<ArgumentException>("compoundAssignment", () => VisualBasic.VisualBasicExtensions.GetInConversion(operation));
1179
Assert.
Throws
<ArgumentException>("compoundAssignment", () => VisualBasic.VisualBasicExtensions.GetOutConversion(operation));
1185
Assert.
Throws
<ArgumentException>("compoundAssignment", () => CSharp.CSharpExtensions.GetInConversion(operation));
1186
Assert.
Throws
<ArgumentException>("compoundAssignment", () => CSharp.CSharpExtensions.GetOutConversion(operation));
Microsoft.CodeAnalysis.UnitTests (21)
Analyzers\AnalyzerFileReferenceTests.cs (1)
48
Assert.
Throws
<ArgumentNullException>("assemblyLoader", () => new AnalyzerFileReference(TempRoot.Root, null!));
Collections\ImmutableDictionaryTestBase.cs (2)
288
Assert.
Throws
<ArgumentException>(null, () => map1.Add(key, value2));
289
Assert.
Throws
<ArgumentException>(null, () => map2.Add(key, value1));
Collections\List\ICollection.Generic.Tests.cs (1)
468
Assert.
Throws
<ArgumentNullException>("item", () => collection.Contains(default(T)!));
EmbeddedTextTests.cs (16)
25
Assert.
Throws
<ArgumentNullException>("filePath", () => EmbeddedText.FromBytes(null, default(ArraySegment<byte>)));
26
Assert.
Throws
<ArgumentException>("filePath", () => EmbeddedText.FromBytes("", default(ArraySegment<byte>)));
27
Assert.
Throws
<ArgumentNullException>("bytes", () => EmbeddedText.FromBytes("path", default(ArraySegment<byte>)));
28
Assert.
Throws
<ArgumentException>("checksumAlgorithm", () => EmbeddedText.FromBytes("path", new ArraySegment<byte>(new byte[0], 0, 0), SourceHashAlgorithm.None));
34
Assert.
Throws
<ArgumentNullException>("filePath", () => EmbeddedText.FromSource(null, null));
35
Assert.
Throws
<ArgumentException>("filePath", () => EmbeddedText.FromSource("", null));
36
Assert.
Throws
<ArgumentNullException>("text", () => EmbeddedText.FromSource("path", null));
39
Assert.
Throws
<ArgumentException>("text", () => EmbeddedText.FromSource("path", SourceText.From("source")));
42
Assert.
Throws
<ArgumentException>("text", () => EmbeddedText.FromSource("path", SourceText.From(new byte[0], 0, Encoding.UTF8, canBeEmbedded: false)));
43
Assert.
Throws
<ArgumentException>("text", () => EmbeddedText.FromSource("path", SourceText.From(new MemoryStream(new byte[0]), Encoding.UTF8, canBeEmbedded: false)));
49
Assert.
Throws
<ArgumentNullException>("filePath", () => EmbeddedText.FromStream(null, null));
50
Assert.
Throws
<ArgumentException>("filePath", () => EmbeddedText.FromStream("", null));
51
Assert.
Throws
<ArgumentNullException>("stream", () => EmbeddedText.FromStream("path", null));
52
Assert.
Throws
<ArgumentException>("stream", () => EmbeddedText.FromStream("path", new CannotReadStream()));
53
Assert.
Throws
<ArgumentException>("stream", () => EmbeddedText.FromStream("path", new CannotSeekStream()));
54
Assert.
Throws
<ArgumentException>("checksumAlgorithm", () => EmbeddedText.FromStream("path", new MemoryStream(), SourceHashAlgorithm.None));
Emit\SemanticEditTests.cs (1)
29
Assert.
Throws
<ArgumentOutOfRangeException>("kind", () => new SemanticEdit(SemanticEditKind.None, oldSymbol: null, newSymbol: null));
Microsoft.CodeAnalysis.Workspaces.UnitTests (37)
Simplifier\SimplifierTests.cs (1)
53
Assert.
Throws
<ArgumentNullException>("workspace", () => Simplifier.Expand(token: default, semanticModel: null!, workspace: null!));
SolutionTests\ProjectDependencyGraphTests.cs (2)
117
Assert.
Throws
<ArgumentNullException>("projectId",
339
Assert.
Throws
<ArgumentNullException>("projectId",
SolutionTests\SolutionTests.cs (34)
1449
Assert.
Throws
<ArgumentNullException>("assemblyName", () => solution.WithProjectAssemblyName(projectId, null!));
1450
Assert.
Throws
<ArgumentNullException>("projectId", () => solution.WithProjectAssemblyName(null!, "x.dll"));
1473
Assert.
Throws
<ArgumentNullException>("projectId", () => solution.WithProjectOutputFilePath(null!, "x.dll"));
1474
Assert.
Throws
<ArgumentNullException>("projectId", () => solution.WithProjectOutputFilePath(null!, "x.dll"));
1528
Assert.
Throws
<ArgumentNullException>("projectId", () => solution.WithProjectOutputRefFilePath(null!, "x.dll"));
1551
Assert.
Throws
<ArgumentNullException>("projectId", () => solution.WithProjectCompilationOutputInfo(null!, info));
1574
Assert.
Throws
<ArgumentNullException>("projectId", () => solution.WithProjectDefaultNamespace(null!, "x"));
1688
Assert.
Throws
<ArgumentNullException>("projectId", () => solution.WithProjectName(null!, "x"));
1711
Assert.
Throws
<ArgumentNullException>("projectId", () => solution.WithProjectFilePath(null!, "x"));
1726
Assert.
Throws
<ArgumentNullException>("projectId", () => solution.WithProjectCompilationOptions(null!, options));
1727
Assert.
Throws
<ArgumentNullException>("options", () => solution.WithProjectCompilationOptions(projectId, options: null!));
1775
Assert.
Throws
<ArgumentNullException>("projectId", () => solution.WithProjectParseOptions(null!, options));
1776
Assert.
Throws
<ArgumentNullException>("options", () => solution.WithProjectParseOptions(projectId, options: null!));
1987
Assert.
Throws
<ArgumentNullException>("projectReferences", () => solution.AddProjectReferences(projectId, null!));
2025
Assert.
Throws
<ArgumentNullException>("projectId", () => solution.RemoveProjectReference(null!, projectRef2));
2026
Assert.
Throws
<ArgumentNullException>("projectReference", () => solution.RemoveProjectReference(projectId, null!));
2029
Assert.
Throws
<ArgumentException>("projectReference", () => solution.RemoveProjectReference(projectId, new ProjectReference(ProjectId.CreateNewId())));
2106
Assert.
Throws
<ArgumentNullException>("metadataReferences", () => solution.AddMetadataReferences(projectId, null!));
2131
Assert.
Throws
<ArgumentNullException>("projectId", () => solution.RemoveMetadataReference(null!, metadataRef1));
2132
Assert.
Throws
<ArgumentNullException>("metadataReference", () => solution.RemoveMetadataReference(projectId, null!));
2179
Assert.
Throws
<ArgumentNullException>("analyzerReferences", () => solution.AddAnalyzerReferences(projectId, null!));
2205
Assert.
Throws
<ArgumentNullException>("analyzerReference", () => solution.RemoveAnalyzerReference(projectId, null!));
2246
Assert.
Throws
<ArgumentNullException>("analyzerReferences", () => solution.AddAnalyzerReferences(null!));
2270
Assert.
Throws
<ArgumentNullException>("analyzerReference", () => solution.RemoveAnalyzerReference(null!));
2377
Assert.
Throws
<ArgumentNullException>("loader", () => solution.AddDocument(documentId, "name", loader: null!));
2406
Assert.
Throws
<ArgumentNullException>("documentId", () => solution.AddDocument(documentId: null!, "name", "text"));
2407
Assert.
Throws
<ArgumentNullException>("name", () => solution.AddDocument(documentId, name: null!, "text"));
2408
Assert.
Throws
<ArgumentNullException>("text", () => solution.AddDocument(documentId, "name", text: (string)null!));
2434
Assert.
Throws
<ArgumentNullException>("documentId", () => solution.AddDocument(documentId: null!, "name", sourceText));
2435
Assert.
Throws
<ArgumentNullException>("name", () => solution.AddDocument(documentId, name: null!, sourceText));
2436
Assert.
Throws
<ArgumentNullException>("text", () => solution.AddDocument(documentId, "name", text: (SourceText)null!));
2463
Assert.
Throws
<ArgumentNullException>("documentId", () => solution.AddDocument(documentId: null!, "name", root));
2464
Assert.
Throws
<ArgumentNullException>("name", () => solution.AddDocument(documentId, name: null!, root));
2465
Assert.
Throws
<ArgumentNullException>("syntaxRoot", () => solution.AddDocument(documentId, "name", syntaxRoot: null!));
Microsoft.DotNet.XUnitAssert.Tests (22)
AsyncCollectionAssertsTests.cs (3)
1384
Assert.
Throws
<ArgumentNullException>("collection", () => Assert.Single(default(IAsyncEnumerable<object>)!));
1469
Assert.
Throws
<ArgumentNullException>("collection", () => Assert.Single(default(IAsyncEnumerable<object>)!, _ => true));
1470
Assert.
Throws
<ArgumentNullException>("predicate", () => Assert.Single(new object[0].ToAsyncEnumerable(), null!));
CollectionAssertsTests.cs (4)
2281
Assert.
Throws
<ArgumentNullException>("collection", () => Assert.Single(null!));
2416
Assert.
Throws
<ArgumentNullException>("collection", () => Assert.Single(default(IEnumerable<object>)!));
2501
Assert.
Throws
<ArgumentNullException>("collection", () => Assert.Single(default(IEnumerable<object>)!, _ => true));
2502
Assert.
Throws
<ArgumentNullException>("predicate", () => Assert.Single(new object[0], null!));
ExceptionAssertsTests.cs (15)
18
Assert.
Throws
<ArgumentNullException>("exceptionType", () => Assert.Throws(null!, testCode));
19
Assert.
Throws
<ArgumentNullException>("testCode", () => Assert.Throws(typeof(Exception), default(Action)!));
90
Assert.
Throws
<ArgumentNullException>("exceptionType", () => Assert.Throws(null!, testCode));
91
Assert.
Throws
<ArgumentNullException>("testCode", () => Assert.Throws(typeof(Exception), default(Func<object>)!));
175
Assert.
Throws
<ArgumentNullException>("testCode", () => Assert.Throws<ArgumentException>(default(Action)!));
244
Assert.
Throws
<ArgumentNullException>("testCode", () => Assert.Throws<ArgumentException>(default(Func<object>)!));
327
Assert.
Throws
<ArgumentNullException>("testCode", () => Assert.Throws<ArgumentException>(default(Action)!));
413
Assert.
Throws
<ArgumentNullException>("testCode", () => Assert.Throws<ArgumentException>(default(Func<object>)!));
421
var ex = Record.Exception(() => Assert.
Throws
<ArgumentException>("paramName", testCode));
437
Assert.
Throws
<ArgumentException>("paramName", testCode);
445
var ex = Record.Exception(() => Assert.
Throws
<ArgumentException>("paramName2", testCode));
463
var ex = Record.Exception(() => Assert.
Throws
<ArgumentException>("paramName", testCode));
481
var ex = Record.Exception(() => Assert.
Throws
<ArgumentException>("paramName", testCode));
502
Assert.
Throws
<ArgumentNullException>("testCode", () => Assert.ThrowsAny<ArgumentException>(default(Action)!));
561
Assert.
Throws
<ArgumentNullException>("testCode", () => Assert.ThrowsAny<ArgumentException>(default(Func<object>)!));
Microsoft.Extensions.AI.Abstractions.Tests (45)
ChatCompletion\ChatClientExtensionsTests.cs (4)
17
Assert.
Throws
<ArgumentNullException>("client", () => ChatClientExtensions.GetService<object>(null!));
23
Assert.
Throws
<ArgumentNullException>("client", () => ChatClientExtensions.GetRequiredService(null!, typeof(string)));
24
Assert.
Throws
<ArgumentNullException>("client", () => ChatClientExtensions.GetRequiredService<object>(null!));
27
Assert.
Throws
<ArgumentNullException>("serviceType", () => client.GetRequiredService(null!));
ChatCompletion\ChatFinishReasonTests.cs (2)
21
Assert.
Throws
<ArgumentNullException>("value", () => new ChatFinishReason(null!));
22
Assert.
Throws
<ArgumentException>("value", () => new ChatFinishReason(" "));
ChatCompletion\ChatResponseFormatTests.cs (3)
24
Assert.
Throws
<ArgumentException>("schemaName", () => new ChatResponseFormatJson(null, "name"));
25
Assert.
Throws
<ArgumentException>("schemaDescription", () => new ChatResponseFormatJson(null, null, "description"));
26
Assert.
Throws
<ArgumentException>("schemaName", () => new ChatResponseFormatJson(null, "name", "description"));
ChatCompletion\ChatResponseTests.cs (1)
27
Assert.
Throws
<ArgumentNullException>("message", () => new ChatResponse((ChatMessage)null!));
ChatCompletion\ChatResponseUpdateExtensionsTests.cs (1)
21
Assert.
Throws
<ArgumentNullException>("updates", () => ((List<ChatResponseUpdate>)null!).ToChatResponse());
ChatCompletion\ChatRoleTests.cs (2)
21
Assert.
Throws
<ArgumentNullException>("value", () => new ChatRole(null!));
22
Assert.
Throws
<ArgumentException>("value", () => new ChatRole(" "));
Contents\DataContentTests.cs (1)
57
Assert.
Throws
<ArgumentException>("mediaType", () => new DataContent("data:image/png;base64,aGVsbG8=", type));
Contents\FunctionCallContentTests..cs (4)
320
Assert.
Throws
<ArgumentNullException>("encodedArguments", () => FunctionCallContent.CreateFromParsedArguments((string)null!, "callId", "functionName", _ => null));
321
Assert.
Throws
<ArgumentNullException>("callId", () => FunctionCallContent.CreateFromParsedArguments("{}", null!, "functionName", _ => null));
322
Assert.
Throws
<ArgumentNullException>("name", () => FunctionCallContent.CreateFromParsedArguments("{}", "callId", null!, _ => null));
323
Assert.
Throws
<ArgumentNullException>("argumentParser", () => FunctionCallContent.CreateFromParsedArguments("{}", "callId", "functionName", null!));
Contents\UriContentTests.cs (12)
15
Assert.
Throws
<ArgumentNullException>("uri", () => new UriContent((string)null!, "image/png"));
16
Assert.
Throws
<ArgumentNullException>("uri", () => new UriContent((Uri)null!, "image/png"));
19
Assert.
Throws
<ArgumentNullException>("mediaType", () => new UriContent("data:image/png;base64,aGVsbG8=", null!));
20
Assert.
Throws
<ArgumentException>("mediaType", () => new UriContent("data:image/png;base64,aGVsbG8=", ""));
21
Assert.
Throws
<ArgumentException>("mediaType", () => new UriContent("data:image/png;base64,aGVsbG8=", "image"));
23
Assert.
Throws
<ArgumentNullException>("mediaType", () => new UriContent(new Uri("data:image/png;base64,aGVsbG8="), null!));
24
Assert.
Throws
<ArgumentException>("mediaType", () => new UriContent(new Uri("data:image/png;base64,aGVsbG8="), ""));
25
Assert.
Throws
<ArgumentException>("mediaType", () => new UriContent(new Uri("data:image/png;base64,aGVsbG8="), "audio"));
28
Assert.
Throws
<ArgumentNullException>("value", () => c.Uri = null!);
40
Assert.
Throws
<ArgumentException>("mediaType", () => new UriContent("http://localhost/something", type));
43
Assert.
Throws
<ArgumentException>("value", () => c.MediaType = type);
44
Assert.
Throws
<ArgumentNullException>("value", () => c.MediaType = null!);
Contents\UsageContentTests.cs (2)
14
Assert.
Throws
<ArgumentNullException>("details", () => new UsageContent(null!));
56
Assert.
Throws
<ArgumentNullException>("value", () => c.Details = null!);
Embeddings\EmbeddingGenerationOptionsTests.cs (2)
30
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => options.Dimensions = 0);
31
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => options.Dimensions = -1);
Embeddings\EmbeddingGeneratorExtensionsTests.cs (3)
16
Assert.
Throws
<ArgumentNullException>("generator", () => EmbeddingGeneratorExtensions.GetService<object>(null!));
22
Assert.
Throws
<ArgumentNullException>("generator", () => EmbeddingGeneratorExtensions.GetRequiredService<object>(null!));
25
Assert.
Throws
<ArgumentNullException>("serviceType", () => generator.GetRequiredService(null!));
Embeddings\GeneratedEmbeddingsTests.cs (8)
20
Assert.
Throws
<ArgumentNullException>("embeddings", () => new GeneratedEmbeddings<Embedding<float>>(null!));
21
Assert.
Throws
<ArgumentOutOfRangeException>("capacity", () => new GeneratedEmbeddings<Embedding<float>>(-1));
50
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => instance[0]);
51
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => instance[-1]);
81
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => generatedEmbeddings[-1]);
82
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => generatedEmbeddings[2]);
244
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => embeddings[-1]);
245
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => embeddings[2]);
Microsoft.Extensions.AI.AzureAIInference.Tests (10)
AzureAIInferenceChatClientTests.cs (5)
29
Assert.
Throws
<ArgumentNullException>("chatCompletionsClient", () => new AzureAIInferenceChatClient(null!, "model"));
32
Assert.
Throws
<ArgumentException>("modelId", () => new AzureAIInferenceChatClient(client, " "));
41
Assert.
Throws
<ArgumentNullException>("value", () => client.ToolCallJsonSerializerOptions = null!);
51
Assert.
Throws
<ArgumentNullException>("chatCompletionsClient", () => ((ChatCompletionsClient)null!).AsChatClient("model"));
54
Assert.
Throws
<ArgumentException>("modelId", () => client.AsChatClient(" "));
AzureAIInferenceEmbeddingGeneratorTests.cs (5)
23
Assert.
Throws
<ArgumentNullException>("embeddingsClient", () => new AzureAIInferenceEmbeddingGenerator(null!));
26
Assert.
Throws
<ArgumentException>("modelId", () => new AzureAIInferenceEmbeddingGenerator(client, ""));
27
Assert.
Throws
<ArgumentException>("modelId", () => new AzureAIInferenceEmbeddingGenerator(client, " "));
35
Assert.
Throws
<ArgumentNullException>("embeddingsClient", () => ((EmbeddingsClient)null!).AsEmbeddingGenerator());
38
Assert.
Throws
<ArgumentException>("modelId", () => client.AsEmbeddingGenerator(" "));
Microsoft.Extensions.AI.Ollama.Tests (5)
OllamaChatClientTests.cs (3)
26
Assert.
Throws
<ArgumentNullException>("endpoint", () => new OllamaChatClient((Uri)null!));
27
Assert.
Throws
<ArgumentException>("modelId", () => new OllamaChatClient("http://localhost", " "));
36
Assert.
Throws
<ArgumentNullException>("value", () => client.ToolCallJsonSerializerOptions = null!);
OllamaEmbeddingGeneratorTests.cs (2)
20
Assert.
Throws
<ArgumentNullException>("endpoint", () => new OllamaEmbeddingGenerator((string)null!));
21
Assert.
Throws
<ArgumentException>("modelId", () => new OllamaEmbeddingGenerator(new Uri("http://localhost"), " "));
Microsoft.Extensions.AI.OpenAI.Tests (19)
OpenAIChatClientTests.cs (10)
29
Assert.
Throws
<ArgumentNullException>("openAIClient", () => new OpenAIChatClient(null!, "model"));
30
Assert.
Throws
<ArgumentNullException>("chatClient", () => new OpenAIChatClient(null!));
33
Assert.
Throws
<ArgumentNullException>("modelId", () => new OpenAIChatClient(openAIClient, null!));
34
Assert.
Throws
<ArgumentException>("modelId", () => new OpenAIChatClient(openAIClient, ""));
35
Assert.
Throws
<ArgumentException>("modelId", () => new OpenAIChatClient(openAIClient, " "));
44
Assert.
Throws
<ArgumentNullException>("value", () => client.ToolCallJsonSerializerOptions = null!);
54
Assert.
Throws
<ArgumentNullException>("openAIClient", () => ((OpenAIClient)null!).AsChatClient("model"));
55
Assert.
Throws
<ArgumentNullException>("chatClient", () => ((ChatClient)null!).AsChatClient());
58
Assert.
Throws
<ArgumentNullException>("modelId", () => client.AsChatClient(null!));
59
Assert.
Throws
<ArgumentException>("modelId", () => client.AsChatClient(" "));
OpenAIEmbeddingGeneratorTests.cs (9)
25
Assert.
Throws
<ArgumentNullException>("openAIClient", () => new OpenAIEmbeddingGenerator(null!, "model"));
26
Assert.
Throws
<ArgumentNullException>("embeddingClient", () => new OpenAIEmbeddingGenerator(null!));
29
Assert.
Throws
<ArgumentNullException>("modelId", () => new OpenAIEmbeddingGenerator(openAIClient, null!));
30
Assert.
Throws
<ArgumentException>("modelId", () => new OpenAIEmbeddingGenerator(openAIClient, ""));
31
Assert.
Throws
<ArgumentException>("modelId", () => new OpenAIEmbeddingGenerator(openAIClient, " "));
37
Assert.
Throws
<ArgumentNullException>("openAIClient", () => ((OpenAIClient)null!).AsEmbeddingGenerator("model"));
38
Assert.
Throws
<ArgumentNullException>("embeddingClient", () => ((EmbeddingClient)null!).AsEmbeddingGenerator());
41
Assert.
Throws
<ArgumentNullException>("modelId", () => client.AsEmbeddingGenerator(null!));
42
Assert.
Throws
<ArgumentException>("modelId", () => client.AsEmbeddingGenerator(" "));
Microsoft.Extensions.AI.Tests (28)
ChatCompletion\ChatClientBuilderTest.cs (3)
61
Assert.
Throws
<ArgumentNullException>("innerClient", () => new ChatClientBuilder((IChatClient)null!));
62
Assert.
Throws
<ArgumentNullException>("innerClient", () => ((IChatClient)null!).AsBuilder());
68
Assert.
Throws
<ArgumentNullException>("innerClientFactory", () => new ChatClientBuilder((Func<IServiceProvider, IChatClient>)null!));
ChatCompletion\ConfigureOptionsChatClientTests.cs (3)
18
Assert.
Throws
<ArgumentNullException>("innerClient", () => new ConfigureOptionsChatClient(null!, _ => { }));
19
Assert.
Throws
<ArgumentNullException>("configure", () => new ConfigureOptionsChatClient(new TestChatClient(), null!));
27
Assert.
Throws
<ArgumentNullException>("configure", () => builder.ConfigureOptions(null!));
ChatCompletion\FunctionInvocationContextTests.cs (3)
37
Assert.
Throws
<ArgumentNullException>("value", () => ctx.CallContent = null!);
38
Assert.
Throws
<ArgumentNullException>("value", () => ctx.Messages = null!);
39
Assert.
Throws
<ArgumentNullException>("value", () => ctx.Function = null!);
ChatCompletion\FunctionInvokingChatClientTests.cs (2)
25
Assert.
Throws
<ArgumentNullException>("innerClient", () => new FunctionInvokingChatClient(null!));
26
Assert.
Throws
<ArgumentNullException>("builder", () => ((ChatClientBuilder)null!).UseFunctionInvocation());
ChatCompletion\LoggingChatClientTests.cs (2)
20
Assert.
Throws
<ArgumentNullException>("innerClient", () => new LoggingChatClient(null!, NullLogger.Instance));
21
Assert.
Throws
<ArgumentNullException>("logger", () => new LoggingChatClient(new TestChatClient(), null!));
ChatCompletion\UseDelegateChatClientTests.cs (1)
22
Assert.
Throws
<ArgumentNullException>("getResponseFunc", () => builder.Use(null!, null!));
Embeddings\ConfigureOptionsEmbeddingGeneratorTests.cs (3)
16
Assert.
Throws
<ArgumentNullException>("innerGenerator", () => new ConfigureOptionsEmbeddingGenerator<string, Embedding<float>>(null!, _ => { }));
17
Assert.
Throws
<ArgumentNullException>("configure", () => new ConfigureOptionsEmbeddingGenerator<string, Embedding<float>>(new TestEmbeddingGenerator(), null!));
25
Assert.
Throws
<ArgumentNullException>("configure", () => builder.ConfigureOptions(null!));
Embeddings\EmbeddingGeneratorBuilderTests.cs (3)
60
Assert.
Throws
<ArgumentNullException>("innerGenerator", () => new EmbeddingGeneratorBuilder<string, Embedding<float>>((IEmbeddingGenerator<string, Embedding<float>>)null!));
61
Assert.
Throws
<ArgumentNullException>("innerGenerator", () => ((IEmbeddingGenerator<string, Embedding<float>>)null!).AsBuilder());
67
Assert.
Throws
<ArgumentNullException>("innerGeneratorFactory",
Embeddings\LoggingEmbeddingGeneratorTests.cs (2)
19
Assert.
Throws
<ArgumentNullException>("innerGenerator", () => new LoggingEmbeddingGenerator<string, Embedding<float>>(null!, NullLogger.Instance));
20
Assert.
Throws
<ArgumentNullException>("logger", () => new LoggingEmbeddingGenerator<string, Embedding<float>>(new TestEmbeddingGenerator(), null!));
Embeddings\UseDelegateEmbeddingGeneratorTests.cs (1)
20
Assert.
Throws
<ArgumentNullException>("generateFunc", () =>
Functions\AIFunctionFactoryTest.cs (5)
19
Assert.
Throws
<ArgumentNullException>("method", () => AIFunctionFactory.Create(method: null!));
20
Assert.
Throws
<ArgumentNullException>("method", () => AIFunctionFactory.Create(method: null!, target: new object()));
21
Assert.
Throws
<ArgumentNullException>("method", () => AIFunctionFactory.Create(method: null!, target: new object(), name: "myAiFunk"));
22
Assert.
Throws
<ArgumentNullException>("target", () => AIFunctionFactory.Create(typeof(AIFunctionFactoryTest).GetMethod(nameof(InvalidArguments_Throw))!, null));
23
Assert.
Throws
<ArgumentException>("method", () => AIFunctionFactory.Create(typeof(List<>).GetMethod("Add")!, new List<int>()));
Microsoft.Extensions.TimeProvider.Testing.Tests (8)
TimerTests.cs (8)
141
Assert.
Throws
<ArgumentOutOfRangeException>("dueTime", () => t.Change(TimeSpan.FromMilliseconds(-2), TimeSpan.FromMilliseconds(1)));
142
Assert.
Throws
<ArgumentOutOfRangeException>("dueTime", () => t.Change(TimeSpan.FromMilliseconds(-2), TimeSpan.FromSeconds(1)));
143
Assert.
Throws
<ArgumentOutOfRangeException>("dueTime", () => t.Change(TimeSpan.FromMilliseconds(0xFFFFFFFFL), TimeSpan.FromMilliseconds(1)));
144
Assert.
Throws
<ArgumentOutOfRangeException>("dueTime", () => t.Change(TimeSpan.FromMilliseconds(0xFFFFFFFFL), TimeSpan.FromSeconds(1)));
153
Assert.
Throws
<ArgumentOutOfRangeException>("period", () => t.Change(TimeSpan.FromMilliseconds(1), TimeSpan.FromMilliseconds(-2)));
154
Assert.
Throws
<ArgumentOutOfRangeException>("period", () => t.Change(TimeSpan.FromSeconds(1), TimeSpan.FromMilliseconds(-2)));
155
Assert.
Throws
<ArgumentOutOfRangeException>("period", () => t.Change(TimeSpan.FromMilliseconds(1), TimeSpan.FromMilliseconds(0xFFFFFFFFL)));
156
Assert.
Throws
<ArgumentOutOfRangeException>("period", () => t.Change(TimeSpan.FromSeconds(1), TimeSpan.FromMilliseconds(0xFFFFFFFFL)));
System.Drawing.Common.Tests (3)
System\Drawing\BufferedGraphicsContextTests.cs (1)
139
Assert.
Throws
<ArgumentNullException>("hdc", () => context.Allocate(null, new Rectangle(0, 0, 10, 10)));
System\Drawing\FontConverterTests.cs (1)
71
Assert.
Throws
<InvalidEnumArgumentException>(paramName, () => converter.ConvertFrom(input));
System\Drawing\Printing\PrinterResolutionTests.cs (1)
82
Assert.
Throws
<InvalidEnumArgumentException>("value", () => resolution.Kind = value);
System.Windows.Forms.Design.Tests (66)
System\ComponentModel\Design\CollectionEditorTests.cs (1)
343
Assert.
Throws
<ArgumentNullException>("itemType", () => editor.CreateInstance(null));
System\ComponentModel\Design\CollectionFormTests.cs (3)
35
Assert.
Throws
<ArgumentNullException>("editor", () => new SubCollectionForm(null));
712
Assert.
Throws
<ArgumentNullException>("itemType", () => form.CreateInstance(null));
823
Assert.
Throws
<ArgumentNullException>("edSvc", () => form.ShowEditorDialog(null));
System\ComponentModel\Design\DesignerActionItemCollectionTests.cs (2)
40
Assert.
Throws
<ArgumentNullException>("value", () => collection.Add(null));
114
Assert.
Throws
<ArgumentNullException>("value", () => collection[0] = null);
System\ComponentModel\Design\DesignerActionListCollectionTests.cs (1)
34
Assert.
Throws
<ArgumentNullException>("value", () => new DesignerActionListCollection(null));
System\ComponentModel\Design\DesignerActionServiceTests.cs (3)
248
Assert.
Throws
<ArgumentNullException>("comp", () => service.Contains(null));
388
Assert.
Throws
<ArgumentNullException>("component", () => service.GetComponentActions(null));
389
Assert.
Throws
<ArgumentNullException>("component", () => service.GetComponentActions(null, ComponentActionsType.All));
System\ComponentModel\Design\DesignerHostTests.cs (7)
980
Assert.
Throws
<ArgumentNullException>("key", () => service.GetValue(null));
998
Assert.
Throws
<ArgumentNullException>("key", () => service.GetValue(null));
1595
Assert.
Throws
<ArgumentNullException>("service", () => component.Site.GetService(null));
1865
Assert.
Throws
<ArgumentNullException>("componentType", () => host.CreateComponent(null));
2275
Assert.
Throws
<ArgumentNullException>("component", () => host.GetDesigner(null));
2375
Assert.
Throws
<ArgumentNullException>("service", () => host.GetService(null));
2430
Assert.
Throws
<ArgumentNullException>("typeName", () => host.GetType(null));
System\ComponentModel\Design\DesignerVerbCollectionTests.cs (1)
34
Assert.
Throws
<ArgumentNullException>("value", () => new DesignerVerbCollection(null));
System\ComponentModel\Design\DesignSurfaceTests.cs (8)
171
Assert.
Throws
<ArgumentNullException>("rootComponentType", () => new DesignSurface((Type)null));
172
Assert.
Throws
<ArgumentNullException>("rootComponentType", () => new DesignSurface(mockServiceProvider.Object, null));
1010
Assert.
Throws
<ArgumentNullException>("component", () => surface.CreateDesigner(null, true));
1011
Assert.
Throws
<ArgumentNullException>("component", () => surface.CreateDesigner(null, false));
1071
Assert.
Throws
<ArgumentNullException>("type", () => surface.CreateComponent(null));
1127
Assert.
Throws
<ArgumentNullException>("type", () => surface.CreateInstance(null));
1155
Assert.
Throws
<ArgumentNullException>("owningComponent", () => surface.CreateNestedContainer(null));
1156
Assert.
Throws
<ArgumentNullException>("owningComponent", () => surface.CreateNestedContainer(null, "name"));
System\ComponentModel\Design\Serialization\CodeDomSerializerExceptionTests.cs (2)
85
Assert.
Throws
<ArgumentNullException>("manager", () => new CodeDomSerializerException("message", (IDesignerSerializationManager)null));
86
Assert.
Throws
<ArgumentNullException>("manager", () => new CodeDomSerializerException(new InvalidOperationException(), (IDesignerSerializationManager)null));
System\ComponentModel\Design\Serialization\DesignerSerializationManagerTests.cs (10)
75
Assert.
Throws
<ArgumentNullException>("provider", () => new DesignerSerializationManager(null));
261
Assert.
Throws
<ArgumentNullException>("property", () => iManager.Properties);
264
Assert.
Throws
<ArgumentNullException>("property", () => iManager.Properties);
861
Assert.
Throws
<ArgumentNullException>("name", () => iManager.GetInstance(null));
960
Assert.
Throws
<ArgumentNullException>("value", () => iManager.GetName(null));
1149
Assert.
Throws
<ArgumentNullException>("typeName", () => manager.GetRuntimeType(null));
1294
Assert.
Throws
<ArgumentNullException>("serializerType", () => manager.GetSerializer(objectType, null));
1415
Assert.
Throws
<ArgumentNullException>("serializerType", () => iManager.GetSerializer(objectType, null));
1554
Assert.
Throws
<ArgumentNullException>("typeName", () => manager.GetType(null));
1642
Assert.
Throws
<ArgumentNullException>("typeName", () => iManager.GetType(null));
System\ComponentModel\Design\Serialization\ExpressionContextTests.cs (3)
48
Assert.
Throws
<ArgumentNullException>("expression", () => new ExpressionContext(null, typeof(int), new object(), new object()));
54
Assert.
Throws
<ArgumentNullException>("expressionType", () => new ExpressionContext(new CodeExpression(), null, new object(), new object()));
60
Assert.
Throws
<ArgumentNullException>("owner", () => new ExpressionContext(new CodeExpression(), typeof(int), null, new object()));
System\ComponentModel\Design\Serialization\RootContextTests.cs (2)
25
Assert.
Throws
<ArgumentNullException>("expression", () => new RootContext(null, new object()));
32
Assert.
Throws
<ArgumentNullException>("value", () => new RootContext(expression, null));
System\ComponentModel\Design\UndoUnitTests.cs (1)
47
Assert.
Throws
<ArgumentNullException>("engine", () => new UndoUnit(null, "name"));
System\Drawing\Design\BitmapEditorTests.cs (1)
99
Assert.
Throws
<ArgumentNullException>("stream", () => editor.LoadFromStream(null));
System\Drawing\Design\ImageEditorTests.cs (2)
53
Assert.
Throws
<ArgumentNullException>("e", () => SubImageEditor.CreateFilterEntry(null));
155
Assert.
Throws
<ArgumentNullException>("stream", () => editor.LoadFromStream(null));
System\Drawing\Design\MetafileEditorTests.cs (1)
78
Assert.
Throws
<ArgumentNullException>("stream", () => editor.LoadFromStream(null));
System\Drawing\Design\ToolboxItemCollectionTests.cs (2)
24
Assert.
Throws
<ArgumentNullException>("c", () => new ToolboxItemCollection((ToolboxItem[])null));
42
Assert.
Throws
<ArgumentNullException>("c", () => new ToolboxItemCollection((ToolboxItemCollection)null));
System\Drawing\Design\ToolboxItemTests.cs (4)
1311
Assert.
Throws
<ArgumentNullException>("typeName", () => item.GetType(mockDesignerHost.Object, null, null, false));
1312
Assert.
Throws
<ArgumentNullException>("typeName", () => item.GetType(null, null, null, false));
1584
Assert.
Throws
<ArgumentNullException>("value", () => item.ValidatePropertyValue(propertyName, null));
1600
Assert.
Throws
<ArgumentException>("value", () => item.ValidatePropertyValue(propertyName, new object()));
System\Resources\Tools\StronglyTypedResourceBuilderTests.cs (12)
31
Assert.
Throws
<ArgumentNullException>(
41
Assert.
Throws
<ArgumentNullException>(
53
Assert.
Throws
<ArgumentNullException>(
63
Assert.
Throws
<ArgumentNullException>(
79
Assert.
Throws
<ArgumentNullException>(
89
Assert.
Throws
<ArgumentNullException>(
101
Assert.
Throws
<ArgumentNullException>(
111
Assert.
Throws
<ArgumentNullException>(
127
Assert.
Throws
<ArgumentNullException>(
137
Assert.
Throws
<ArgumentNullException>(
152
Assert.
Throws
<ArgumentNullException>(
162
Assert.
Throws
<ArgumentNullException>(
System.Windows.Forms.Primitives.Tests (4)
System\Windows\Forms\NonNullCollectionTests.cs (4)
13
Assert.
Throws
<ArgumentNullException>("items", () => new TestCollection(null!));
19
Assert.
Throws
<ArgumentNullException>("items", () => new TestCollection(new object[] { null! }));
43
Assert.
Throws
<ArgumentNullException>("value", () => ((IList)collection).Add(null));
77
Assert.
Throws
<ArgumentNullException>("value", () => ((IList)collection)[0] = null);
System.Windows.Forms.Tests (803)
CheckedListBoxTests.cs (1)
121
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.SelectionMode = value);
System\Drawing\Design\PropertyValueUIItemTests.cs (2)
33
Assert.
Throws
<ArgumentNullException>("uiItemImage", () => new PropertyValueUIItem(null, Dummy_PropertyValueUIItemInvokeHandler, "tooltip"));
40
Assert.
Throws
<ArgumentNullException>("handler", () => new PropertyValueUIItem(uiItemImage, null, "tooltip"));
System\Windows\Forms\AccessibleObjects\Control.ControlAccessibleObjectTests.cs (1)
122
Assert.
Throws
<ArgumentNullException>("ownerControl", () => new Control.ControlAccessibleObject(null));
System\Windows\Forms\AccessibleObjects\DataGridViewRowAccessibleObjectTests.cs (1)
273
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => accessibleObject.GetChild(index));
System\Windows\Forms\AccessibleObjects\ToolStripItemAccessibleObjectTests.cs (1)
41
Assert.
Throws
<ArgumentNullException>("ownerItem", () => new ToolStripItem.ToolStripItemAccessibleObject(null));
System\Windows\Forms\ApplicationTests.cs (2)
74
Assert.
Throws
<ArgumentNullException>("value", () => Application.CurrentCulture = null);
360
Assert.
Throws
<InvalidEnumArgumentException>("highDpiMode", () => Application.SetHighDpiMode(value));
System\Windows\Forms\AxHostTests.cs (6)
218
Assert.
Throws
<ArgumentNullException>("g", () => new SubAxHost(null));
219
Assert.
Throws
<ArgumentNullException>("g", () => new SubAxHost(null, 0));
344
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.BackgroundImageLayout = value);
570
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.ImeMode = value);
1512
Assert.
Throws
<ArgumentException>("font", () => SubAxHost.GetIFontDispFromFont(font));
1573
Assert.
Throws
<ArgumentException>("font", () => SubAxHost.GetIFontFromFont(font));
System\Windows\Forms\BindingContextTests.cs (8)
398
Assert.
Throws
<ArgumentNullException>("dataSource", () => context.Contains(null));
399
Assert.
Throws
<ArgumentNullException>("dataSource", () => context.Contains(null, null));
400
Assert.
Throws
<ArgumentNullException>("dataSource", () => context.Contains(null, string.Empty));
472
Assert.
Throws
<ArgumentNullException>("dataSource", () => context[mockIListSource.Object]);
684
Assert.
Throws
<ArgumentNullException>("dataSource", () => context[dataSource, "Property"]);
736
Assert.
Throws
<ArgumentNullException>("dataSource", () => context[null]);
737
Assert.
Throws
<ArgumentNullException>("dataSource", () => context[null, null]);
738
Assert.
Throws
<ArgumentNullException>("dataSource", () => context[null, string.Empty]);
System\Windows\Forms\BindingSourceTests.cs (1)
526
Assert.
Throws
<ArgumentNullException>("container", () => new SubBindingSource(null));
System\Windows\Forms\ButtonBaseTests.cs (6)
1375
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.FlatStyle = value);
2052
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.ImageAlign = value);
2213
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => control.ImageIndex = value);
2706
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.ImeMode = value);
3495
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.TextAlign = value);
3725
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.TextImageRelation = value);
System\Windows\Forms\ButtonTests.cs (2)
611
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.AutoSizeMode = value);
665
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.DialogResult = value);
System\Windows\Forms\CheckBoxTests.cs (4)
170
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.Appearance = value);
207
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.CheckAlign = value);
289
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.CheckState = value);
444
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.TextAlign = value);
System\Windows\Forms\ColumnHeaderCollectionTests.cs (10)
24
Assert.
Throws
<ArgumentNullException>("owner", () => new ListView.ColumnHeaderCollection(null));
61
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection[index]);
86
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection[index]);
146
Assert.
Throws
<ArgumentException>("ch", () => collection.Add(header));
158
Assert.
Throws
<ArgumentException>("ch", () => collection.Add(header));
320
Assert.
Throws
<ArgumentNullException>("ch", () => collection.Add((ColumnHeader)null));
329
Assert.
Throws
<InvalidEnumArgumentException>("value", () => collection.Add("text", 1, textAlign));
330
Assert.
Throws
<InvalidEnumArgumentException>("value", () => collection.Add("name", "text", 1, textAlign, "imageKey"));
331
Assert.
Throws
<InvalidEnumArgumentException>("value", () => collection.Add("name", "text", 1, textAlign, 1));
352
Assert.
Throws
<ArgumentException>("value", () => collection.Add(value));
System\Windows\Forms\ColumnHeaderConverterTests.cs (1)
125
Assert.
Throws
<ArgumentNullException>("destinationType", () => converter.ConvertTo(new object(), null));
System\Windows\Forms\ColumnHeaderTests.cs (3)
235
Assert.
Throws
<ArgumentOutOfRangeException>("DisplayIndex", () => header.DisplayIndex = value);
488
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => header.ImageIndex = value);
1215
Assert.
Throws
<InvalidEnumArgumentException>("value", () => header.TextAlign = value);
System\Windows\Forms\ColumnStyleTests.cs (2)
44
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => new ColumnStyle(SizeType.AutoSize, -1));
141
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => style.Width = -1);
System\Windows\Forms\Combobox.ObjectCollectionTests.cs (4)
97
Assert.
Throws
<ArgumentNullException>("item", () => comboBoxObjectCollection.Add(null));
1320
Assert.
Throws
<ArgumentNullException>("value", () => comboBoxObjectCollection[0] = null);
1337
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => comboBoxObjectCollection[-1] = 1);
1354
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => comboBoxObjectCollection[3] = 1);
System\Windows\Forms\ComboBoxTests.cs (7)
162
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.AutoCompleteMode = value);
615
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.BackgroundImageLayout = value);
889
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.AutoCompleteSource = source);
983
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.DropDownStyle = value);
1318
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.RightToLeft = value);
1592
Assert.
Throws
<ArgumentOutOfRangeException>("startIndex", () => control.FindString("s", startIndex));
1716
Assert.
Throws
<ArgumentOutOfRangeException>("startIndex", () => control.FindStringExact("s", startIndex));
System\Windows\Forms\ContainerControlTests.cs (6)
177
Assert.
Throws
<ArgumentException>("value", () => control.ActiveControl = control);
178
Assert.
Throws
<ArgumentException>("value", () => control.ActiveControl = new Control());
219
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => control.AutoScaleDimensions = value);
275
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.AutoScaleMode = value);
343
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.AutoValidate = value);
1217
Assert.
Throws
<InvalidEnumArgumentException>("validationConstraints", () => control.ValidateChildren(validationConstraints));
System\Windows\Forms\ControlBindingsCollectionTests.cs (18)
230
Assert.
Throws
<ArgumentNullException>("dataSource", () => collection.Add("propertyName", null, "dataMember"));
231
Assert.
Throws
<ArgumentNullException>("dataSource", () => collection.Add("propertyName", null, "dataMember", true));
232
Assert.
Throws
<ArgumentNullException>("dataSource", () => collection.Add("propertyName", null, "dataMember", true, DataSourceUpdateMode.OnPropertyChanged));
233
Assert.
Throws
<ArgumentNullException>("dataSource", () => collection.Add("propertyName", null, "dataMember", true, DataSourceUpdateMode.OnPropertyChanged, "null"));
234
Assert.
Throws
<ArgumentNullException>("dataSource", () => collection.Add("propertyName", null, "dataMember", true, DataSourceUpdateMode.OnPropertyChanged, "null", "formatString"));
235
Assert.
Throws
<ArgumentNullException>("dataSource", () => collection.Add("propertyName", null, "dataMember", true, DataSourceUpdateMode.OnPropertyChanged, "null", "formatString", CultureInfo.CurrentCulture));
244
Assert.
Throws
<ArgumentException>("PropertyName", () => collection.Add("NoSuchProperty", new object(), "dataMember"));
245
Assert.
Throws
<ArgumentException>("PropertyName", () => collection.Add("NoSuchProperty", new object(), "dataMember", true));
246
Assert.
Throws
<ArgumentException>("PropertyName", () => collection.Add("NoSuchProperty", new object(), "dataMember", true, DataSourceUpdateMode.OnPropertyChanged));
247
Assert.
Throws
<ArgumentException>("PropertyName", () => collection.Add("NoSuchProperty", new object(), "dataMember", true, DataSourceUpdateMode.OnPropertyChanged, "null"));
248
Assert.
Throws
<ArgumentException>("PropertyName", () => collection.Add("NoSuchProperty", new object(), "dataMember", true, DataSourceUpdateMode.OnPropertyChanged, "null", "formatString"));
249
Assert.
Throws
<ArgumentException>("PropertyName", () => collection.Add("NoSuchProperty", new object(), "dataMember", true, DataSourceUpdateMode.OnPropertyChanged, "null", "formatString", CultureInfo.CurrentCulture));
261
Assert.
Throws
<ArgumentException>("binding", () => collection.Add(nameof(Control.Text), new object(), "dataMember"));
262
Assert.
Throws
<ArgumentException>("binding", () => collection.Add(nameof(Control.Text), new object(), "dataMember", true));
263
Assert.
Throws
<ArgumentException>("binding", () => collection.Add(nameof(Control.Text), new object(), "dataMember", true, DataSourceUpdateMode.OnPropertyChanged));
264
Assert.
Throws
<ArgumentException>("binding", () => collection.Add(nameof(Control.Text), new object(), "dataMember", true, DataSourceUpdateMode.OnPropertyChanged, "null"));
265
Assert.
Throws
<ArgumentException>("binding", () => collection.Add(nameof(Control.Text), new object(), "dataMember", true, DataSourceUpdateMode.OnPropertyChanged, "null", "formatString"));
266
Assert.
Throws
<ArgumentException>("binding", () => collection.Add(nameof(Control.Text), new object(), "dataMember", true, DataSourceUpdateMode.OnPropertyChanged, "null", "formatString", CultureInfo.CurrentCulture));
System\Windows\Forms\ControlPaintTests.cs (1)
263
Assert.
Throws
<ArgumentNullException>("bitmap", () => ControlPaint.CreateHBitmapTransparencyMask(null));
System\Windows\Forms\ControlTests.ControlCollection.cs (10)
30
Assert.
Throws
<ArgumentNullException>("owner", () => new Control.ControlCollection(null));
1518
Assert.
Throws
<ArgumentNullException>("key", () => collection.Find(key, searchAllChildren: true));
1519
Assert.
Throws
<ArgumentNullException>("key", () => collection.Find(key, searchAllChildren: false));
1730
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => enumerator.Current);
1733
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => enumerator.Current);
1737
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => enumerator.Current);
1894
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection[index]);
1909
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection[index]);
3509
Assert.
Throws
<ArgumentException>("control", () => collection.Add(new object()));
3510
Assert.
Throws
<ArgumentException>("control", () => collection.Add(null));
System\Windows\Forms\ControlTests.Methods.cs (1)
2097
Assert.
Throws
<InvalidEnumArgumentException>("skipValue", () => control.GetChildAtPoint(new Point(5, 5), skipValue));
System\Windows\Forms\ControlTests.Properties.cs (7)
178
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.AccessibleRole = value);
2137
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.BackgroundImageLayout = value);
4425
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.Dock = value);
6447
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.ImeMode = value);
6554
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.ImeModeBase = value);
10438
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.RightToLeft = value);
11861
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => control.TabIndex = -1);
System\Windows\Forms\CursorConverterTests.cs (2)
61
Assert.
Throws
<ArgumentException>("stream", () => converter.ConvertFrom(Array.Empty<byte>()));
171
Assert.
Throws
<ArgumentNullException>("destinationType", () => converter.ConvertTo(new object(), null));
System\Windows\Forms\CursorTests.cs (9)
55
Assert.
Throws
<ArgumentException>("handle", () => new Cursor(IntPtr.Zero));
88
Assert.
Throws
<ArgumentException>("stream", () => new Cursor(new MemoryStream()));
94
Assert.
Throws
<ArgumentNullException>("stream", () => new Cursor((Stream)null));
113
Assert.
Throws
<ArgumentException>("stream", () => new Cursor(stream));
130
Assert.
Throws
<ArgumentNullException>("path", () => new Cursor((string)null));
138
Assert.
Throws
<ArgumentException>("path", () => new Cursor(fileName));
151
Assert.
Throws
<ArgumentException>("fileName", () => new Cursor(fileName));
167
Assert.
Throws
<ArgumentNullException>("type", () => new Cursor((Type)null, "resource"));
176
Assert.
Throws
<ArgumentNullException>("stream", () => new Cursor(type, resource));
System\Windows\Forms\DataFormatsTests.cs (2)
110
Assert.
Throws
<ArgumentException>("format", () => DataFormats.GetFormat(""));
111
Assert.
Throws
<ArgumentNullException>("format", () => DataFormats.GetFormat(null));
System\Windows\Forms\DataGridView.DataGridViewControlCollectionTests.cs (1)
24
Assert.
Throws
<ArgumentNullException>("owner", () => new DataGridView.DataGridViewControlCollection(null));
System\Windows\Forms\DataGridViewCellCancelEventArgsTests.cs (2)
26
Assert.
Throws
<ArgumentOutOfRangeException>("columnIndex", () => new DataGridViewCellCancelEventArgs(-2, 0));
32
Assert.
Throws
<ArgumentOutOfRangeException>("rowIndex", () => new DataGridViewCellCancelEventArgs(0, -2));
System\Windows\Forms\DataGridViewCellContextMenuStripNeededEventArgsTests.cs (2)
26
Assert.
Throws
<ArgumentOutOfRangeException>("columnIndex", () => new DataGridViewCellContextMenuStripNeededEventArgs(-2, 0));
32
Assert.
Throws
<ArgumentOutOfRangeException>("rowIndex", () => new DataGridViewCellContextMenuStripNeededEventArgs(0, -2));
System\Windows\Forms\DataGridViewCellEventArgsTests.cs (2)
25
Assert.
Throws
<ArgumentOutOfRangeException>("columnIndex", () => new DataGridViewCellEventArgs(-2, 0));
31
Assert.
Throws
<ArgumentOutOfRangeException>("rowIndex", () => new DataGridViewCellEventArgs(0, -2));
System\Windows\Forms\DataGridViewCellFormattingEventArgsTests.cs (2)
34
Assert.
Throws
<ArgumentOutOfRangeException>("columnIndex", () => new DataGridViewCellFormattingEventArgs(-2, 0, "value", typeof(string), null));
40
Assert.
Throws
<ArgumentOutOfRangeException>("rowIndex", () => new DataGridViewCellFormattingEventArgs(0, -2, "value", typeof(string), null));
System\Windows\Forms\DataGridViewCellMouseEventArgsTests.cs (5)
35
Assert.
Throws
<ArgumentOutOfRangeException>("columnIndex", () => new DataGridViewCellMouseEventArgs(-2, 0, 1, 2, null));
36
Assert.
Throws
<ArgumentOutOfRangeException>("columnIndex", () => new DataGridViewCellMouseEventArgs(-2, 0, 1, 2, new MouseEventArgs(MouseButtons.Left, 1, 2, 3, 4)));
42
Assert.
Throws
<ArgumentOutOfRangeException>("rowIndex", () => new DataGridViewCellMouseEventArgs(0, -2, 1, 2, null));
43
Assert.
Throws
<ArgumentOutOfRangeException>("rowIndex", () => new DataGridViewCellMouseEventArgs(0, -2, 1, 2, new MouseEventArgs(MouseButtons.Left, 1, 2, 3, 4)));
49
Assert.
Throws
<ArgumentNullException>("e", () => new DataGridViewCellMouseEventArgs(1, 2, 1, 2, null));
System\Windows\Forms\DataGridViewCellPaintingEventArgsTests.cs (4)
48
Assert.
Throws
<ArgumentNullException>("dataGridView", () => new DataGridViewCellPaintingEventArgs(null, graphics, Rectangle.Empty, Rectangle.Empty, -2, -2, DataGridViewElementStates.Displayed, null, null, null, new DataGridViewCellStyle(), null, DataGridViewPaintParts.All));
55
Assert.
Throws
<ArgumentNullException>("graphics", () => new DataGridViewCellPaintingEventArgs(dataGridView, null, Rectangle.Empty, Rectangle.Empty, -2, -2, DataGridViewElementStates.Displayed, null, null, null, new DataGridViewCellStyle(), null, DataGridViewPaintParts.All));
64
Assert.
Throws
<ArgumentNullException>("cellStyle", () => new DataGridViewCellPaintingEventArgs(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, -2, -2, DataGridViewElementStates.Displayed, null, null, null, null, null, DataGridViewPaintParts.All));
74
Assert.
Throws
<ArgumentException>("paintParts", () => new DataGridViewCellPaintingEventArgs(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, -2, -2, DataGridViewElementStates.Displayed, null, null, null, new DataGridViewCellStyle(), null, paintParts));
System\Windows\Forms\DataGridViewCellStateChangedEventArgsTests.cs (1)
25
Assert.
Throws
<ArgumentNullException>("dataGridViewCell", () => new DataGridViewCellStateChangedEventArgs(null, DataGridViewElementStates.None));
System\Windows\Forms\DataGridViewCellStyleTests.cs (3)
107
Assert.
Throws
<ArgumentNullException>("dataGridViewCellStyle", () => new DataGridViewCellStyle(null));
130
Assert.
Throws
<InvalidEnumArgumentException>("value", () => style.Alignment = value);
612
Assert.
Throws
<InvalidEnumArgumentException>("value", () => style.WrapMode = value);
System\Windows\Forms\DataGridViewCellTests.cs (46)
105
Assert.
Throws
<ArgumentOutOfRangeException>("rowIndex", () => cell.ContentBounds);
677
Assert.
Throws
<ArgumentOutOfRangeException>("rowIndex", () => cell.EditedFormattedValue);
730
Assert.
Throws
<ArgumentOutOfRangeException>("rowIndex", () => cell.ErrorIconBounds);
1325
Assert.
Throws
<ArgumentOutOfRangeException>("rowIndex", () => cell.FormattedValue);
1505
Assert.
Throws
<ArgumentOutOfRangeException>("rowIndex", () => cell.InheritedState);
3111
Assert.
Throws
<ArgumentNullException>("dataGridViewAdvancedBorderStyleInput", () => cell.AdjustCellBorderStyle(null, controlAdvancedBorderStylePlaceholder, true, true, true, true));
3143
Assert.
Throws
<ArgumentNullException>("dataGridViewAdvancedBorderStylePlaceholder", () => cell.AdjustCellBorderStyle(controlAdvancedBorderStyleInput, null, true, true, true, true));
3305
Assert.
Throws
<ArgumentNullException>("advancedBorderStyle", () => cell.BorderWidths(null));
3651
Assert.
Throws
<ArgumentOutOfRangeException>("rowIndex", () => cell.GetContentBounds(rowIndex));
3803
Assert.
Throws
<ArgumentOutOfRangeException>("rowIndex", () => cell.GetEditedFormattedValue(rowIndex, DataGridViewDataErrorContexts.Formatting));
4133
Assert.
Throws
<ArgumentOutOfRangeException>("e.RowIndex", () => cell.GetErrorText(1));
4396
Assert.
Throws
<ArgumentOutOfRangeException>("rowIndex", () => cell.GetInheritedContextMenuStrip(rowIndex));
4413
Assert.
Throws
<ArgumentOutOfRangeException>("rowIndex", () => cell.GetInheritedContextMenuStrip(rowIndex));
4629
Assert.
Throws
<ArgumentOutOfRangeException>("rowIndex", () => cell.GetInheritedState(-1));
4660
Assert.
Throws
<ArgumentOutOfRangeException>("rowIndex", () => cell.GetInheritedState(rowIndex));
4677
Assert.
Throws
<ArgumentOutOfRangeException>("rowIndex", () => cell.GetInheritedState(rowIndex));
4694
Assert.
Throws
<ArgumentOutOfRangeException>("rowIndex", () => cell.GetInheritedState(rowIndex));
4743
Assert.
Throws
<ArgumentOutOfRangeException>("rowIndex", () => cell.GetInheritedStyle(new DataGridViewCellStyle(), rowIndex, true));
4907
Assert.
Throws
<ArgumentOutOfRangeException>("rowIndex", () => cell.GetSize(rowIndex));
5052
Assert.
Throws
<ArgumentOutOfRangeException>("rowIndex", () => cell.Value = value);
5188
Assert.
Throws
<ArgumentOutOfRangeException>("rowIndex", () => cell.GetValue(rowIndex));
5205
Assert.
Throws
<ArgumentOutOfRangeException>("rowIndex", () => cell.GetValue(rowIndex));
5283
Assert.
Throws
<ArgumentNullException>("graphics", () => DataGridViewCell.MeasureTextHeight(null, "text", SystemFonts.DefaultFont, 10, TextFormatFlags.Default));
5284
Assert.
Throws
<ArgumentNullException>("graphics", () => DataGridViewCell.MeasureTextHeight(null, "text", SystemFonts.DefaultFont, 10, TextFormatFlags.Default, out widthTruncated));
5294
Assert.
Throws
<ArgumentNullException>("font", () => DataGridViewCell.MeasureTextHeight(graphics, "text", null, 10, TextFormatFlags.Default));
5295
Assert.
Throws
<ArgumentNullException>("font", () => DataGridViewCell.MeasureTextHeight(graphics, "text", null, 10, TextFormatFlags.Default, out widthTruncated));
5307
Assert.
Throws
<ArgumentOutOfRangeException>("maxWidth", () => DataGridViewCell.MeasureTextHeight(graphics, "text", SystemFonts.DefaultFont, maxWidth, TextFormatFlags.Default));
5308
Assert.
Throws
<ArgumentOutOfRangeException>("maxWidth", () => DataGridViewCell.MeasureTextHeight(graphics, "text", SystemFonts.DefaultFont, maxWidth, TextFormatFlags.Default, out widthTruncated));
5319
Assert.
Throws
<InvalidEnumArgumentException>("flags", () => DataGridViewCell.MeasureTextHeight(graphics, "text", SystemFonts.DefaultFont, 10, flags));
5320
Assert.
Throws
<InvalidEnumArgumentException>("flags", () => DataGridViewCell.MeasureTextHeight(graphics, "text", SystemFonts.DefaultFont, 10, flags, out widthTruncated));
5350
Assert.
Throws
<ArgumentNullException>("graphics", () => DataGridViewCell.MeasureTextPreferredSize(null, "text", SystemFonts.DefaultFont, 0.2f, TextFormatFlags.Default));
5358
Assert.
Throws
<ArgumentNullException>("font", () => DataGridViewCell.MeasureTextPreferredSize(graphics, "text", null, 0.2f, TextFormatFlags.Default));
5368
Assert.
Throws
<ArgumentOutOfRangeException>("maxRatio", () => DataGridViewCell.MeasureTextPreferredSize(graphics, "text", SystemFonts.DefaultFont, maxRatio, TextFormatFlags.Default));
5377
Assert.
Throws
<InvalidEnumArgumentException>("flags", () => DataGridViewCell.MeasureTextPreferredSize(graphics, "text", SystemFonts.DefaultFont, 0.2f, flags));
5406
Assert.
Throws
<ArgumentNullException>("graphics", () => DataGridViewCell.MeasureTextSize(null, "text", SystemFonts.DefaultFont, TextFormatFlags.Default));
5414
Assert.
Throws
<ArgumentNullException>("font", () => DataGridViewCell.MeasureTextSize(graphics, "text", null, TextFormatFlags.Default));
5423
Assert.
Throws
<InvalidEnumArgumentException>("flags", () => DataGridViewCell.MeasureTextSize(graphics, "text", SystemFonts.DefaultFont, flags));
5452
Assert.
Throws
<ArgumentNullException>("graphics", () => DataGridViewCell.MeasureTextWidth(null, "text", SystemFonts.DefaultFont, 10, TextFormatFlags.Default));
5460
Assert.
Throws
<ArgumentNullException>("font", () => DataGridViewCell.MeasureTextWidth(graphics, "text", null, 10, TextFormatFlags.Default));
5470
Assert.
Throws
<ArgumentOutOfRangeException>("maxHeight", () => DataGridViewCell.MeasureTextWidth(graphics, "text", SystemFonts.DefaultFont, maxHeight, TextFormatFlags.Default));
5479
Assert.
Throws
<InvalidEnumArgumentException>("flags", () => DataGridViewCell.MeasureTextWidth(graphics, "text", SystemFonts.DefaultFont, 10, flags));
6164
Assert.
Throws
<ArgumentNullException>("cellStyle", () => cell.ParseFormattedValue(1, null, new Int32Converter(), new Int32Converter()));
6217
Assert.
Throws
<ArgumentException>("formattedValue", () => cell.ParseFormattedValue(formattedValue, new DataGridViewCellStyle(), new Int32Converter(), new Int32Converter()));
6349
Assert.
Throws
<ArgumentOutOfRangeException>("rowIndex", () => cell.SetValue(rowIndex, "value"));
6366
Assert.
Throws
<ArgumentOutOfRangeException>("rowIndex", () => cell.SetValue(rowIndex, "value"));
6383
Assert.
Throws
<ArgumentOutOfRangeException>("rowIndex", () => cell.SetValue(rowIndex, "value"));
System\Windows\Forms\DataGridViewCellValueEventArgsTests.cs (2)
27
Assert.
Throws
<ArgumentOutOfRangeException>("columnIndex", () => new DataGridViewCellValueEventArgs(columnIndex, 0));
35
Assert.
Throws
<ArgumentOutOfRangeException>("rowIndex", () => new DataGridViewCellValueEventArgs(0, rowIndex));
System\Windows\Forms\DataGridViewColumnCollectionTests.cs (1)
332
Assert.
Throws
<ArgumentNullException>("dataGridViewColumn", () => collection.Add(null));
System\Windows\Forms\DataGridViewColumnDividerDoubleClickEventArgsTests.cs (3)
35
Assert.
Throws
<ArgumentOutOfRangeException>("columnIndex", () => new DataGridViewColumnDividerDoubleClickEventArgs(-2, null));
36
Assert.
Throws
<ArgumentOutOfRangeException>("columnIndex", () => new DataGridViewColumnDividerDoubleClickEventArgs(-2, new HandledMouseEventArgs(MouseButtons.Left, 1, 2, 3, 4, true)));
42
Assert.
Throws
<ArgumentNullException>("e", () => new DataGridViewColumnDividerDoubleClickEventArgs(1, null));
System\Windows\Forms\DataGridViewColumnEventArgsTests.cs (1)
22
Assert.
Throws
<ArgumentNullException>("dataGridViewColumn", () => new DataGridViewColumnEventArgs(null));
System\Windows\Forms\DataGridViewColumnTests.cs (6)
493
Assert.
Throws
<InvalidEnumArgumentException>("value", () => column.AutoSizeMode = value);
1002
Assert.
Throws
<ArgumentException>("value", () => column.DefaultHeaderCellType = value);
1013
Assert.
Throws
<ArgumentException>("value", () => column.DefaultHeaderCellType = value);
1120
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => column.DividerWidth = value);
1783
Assert.
Throws
<InvalidEnumArgumentException>("autoSizeColumnMode", () => column.GetPreferredWidth(autoSizeColumnMode, fixedHeight: true));
1784
Assert.
Throws
<InvalidEnumArgumentException>("autoSizeColumnMode", () => column.GetPreferredWidth(autoSizeColumnMode, fixedHeight: false));
System\Windows\Forms\DataGridViewDataErrorEventArgsTests.cs (2)
34
Assert.
Throws
<ArgumentOutOfRangeException>("columnIndex", () => new DataGridViewDataErrorEventArgs(null, -2, 0, DataGridViewDataErrorContexts.Formatting));
40
Assert.
Throws
<ArgumentOutOfRangeException>("rowIndex", () => new DataGridViewDataErrorEventArgs(null, 0, -2, DataGridViewDataErrorContexts.Formatting));
System\Windows\Forms\DataGridViewEditingControlShowingEventArgsTests.cs (1)
39
Assert.
Throws
<ArgumentNullException>("value", () => e.CellStyle = null);
System\Windows\Forms\DataGridViewHeaderCellTests.cs (26)
3005
Assert.
Throws
<ArgumentException>("rowIndex", () => cell.GetInheritedState(-1));
3016
Assert.
Throws
<ArgumentException>("rowIndex", () => cell.GetInheritedState(rowIndex));
3027
Assert.
Throws
<ArgumentException>("rowIndex", () => cell.GetInheritedState(rowIndex));
3038
Assert.
Throws
<ArgumentOutOfRangeException>("rowIndex", () => cell.GetInheritedState(rowIndex));
3055
Assert.
Throws
<ArgumentException>("rowIndex", () => cell.GetInheritedState(rowIndex));
3075
Assert.
Throws
<ArgumentException>("rowIndex", () => cell.GetInheritedState(rowIndex));
3093
Assert.
Throws
<ArgumentOutOfRangeException>("rowIndex", () => cell.GetInheritedState(rowIndex));
3104
Assert.
Throws
<ArgumentOutOfRangeException>("rowIndex", () => cell.GetInheritedState(rowIndex));
3121
Assert.
Throws
<ArgumentException>("rowIndex", () => cell.GetInheritedState(rowIndex));
3273
Assert.
Throws
<ArgumentOutOfRangeException>("rowIndex", () => cell.GetSize(rowIndex));
3285
Assert.
Throws
<ArgumentOutOfRangeException>("rowIndex", () => cell.GetSize(rowIndex));
3297
Assert.
Throws
<ArgumentOutOfRangeException>("rowIndex", () => cell.GetSize(rowIndex));
3309
Assert.
Throws
<ArgumentOutOfRangeException>("rowIndex", () => cell.GetSize(rowIndex));
3326
Assert.
Throws
<ArgumentOutOfRangeException>("rowIndex", () => cell.GetSize(rowIndex));
3343
Assert.
Throws
<ArgumentOutOfRangeException>("rowIndex", () => cell.GetSize(rowIndex));
3466
Assert.
Throws
<ArgumentOutOfRangeException>("rowIndex", () => cell.Value = value);
3607
Assert.
Throws
<ArgumentOutOfRangeException>("rowIndex", () => cell.Value = value1);
3645
Assert.
Throws
<ArgumentOutOfRangeException>("rowIndex", () => cell.Value = value1);
3686
Assert.
Throws
<ArgumentOutOfRangeException>("rowIndex", () => cell.Value = value1);
3715
Assert.
Throws
<ArgumentOutOfRangeException>("rowIndex", () => cell.GetValue(rowIndex));
3727
Assert.
Throws
<ArgumentOutOfRangeException>("rowIndex", () => cell.GetValue(rowIndex));
3739
Assert.
Throws
<ArgumentOutOfRangeException>("rowIndex", () => cell.GetValue(rowIndex));
3756
Assert.
Throws
<ArgumentOutOfRangeException>("rowIndex", () => cell.GetValue(rowIndex));
3774
Assert.
Throws
<ArgumentOutOfRangeException>("rowIndex", () => cell.GetValue(rowIndex));
3788
Assert.
Throws
<ArgumentOutOfRangeException>("rowIndex", () => cell.GetValue(rowIndex));
3805
Assert.
Throws
<ArgumentOutOfRangeException>("rowIndex", () => cell.GetValue(rowIndex));
System\Windows\Forms\DataGridViewRowContextMenuStripNeededEventArgsTests.cs (1)
25
Assert.
Throws
<ArgumentOutOfRangeException>("rowIndex", () => new DataGridViewRowContextMenuStripNeededEventArgs(-2));
System\Windows\Forms\DataGridViewRowDividerDoubleClickEventArgsTests.cs (3)
35
Assert.
Throws
<ArgumentNullException>("e", () => new DataGridViewRowDividerDoubleClickEventArgs(-2, null));
36
Assert.
Throws
<ArgumentOutOfRangeException>("rowIndex", () => new DataGridViewRowDividerDoubleClickEventArgs(-2, new HandledMouseEventArgs(MouseButtons.Left, 1, 2, 3, 4, true)));
42
Assert.
Throws
<ArgumentNullException>("e", () => new DataGridViewRowDividerDoubleClickEventArgs(1, null));
System\Windows\Forms\DataGridViewRowEventArgsTests.cs (1)
22
Assert.
Throws
<ArgumentNullException>("dataGridViewRow", () => new DataGridViewRowEventArgs(null));
System\Windows\Forms\DataGridViewRowHeightInfoNeededEventArgsTests.cs (2)
52
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => e.Height = value);
108
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => e.MinimumHeight = value);
System\Windows\Forms\DataGridViewRowPostPaintEventArgsTests.cs (3)
44
Assert.
Throws
<ArgumentNullException>("dataGridView", () => new DataGridViewRowPostPaintEventArgs(null, graphics, Rectangle.Empty, Rectangle.Empty, -2, DataGridViewElementStates.Displayed, null, new DataGridViewCellStyle(), false, false));
51
Assert.
Throws
<ArgumentNullException>("graphics", () => new DataGridViewRowPostPaintEventArgs(dataGridView, null, Rectangle.Empty, Rectangle.Empty, -2, DataGridViewElementStates.Displayed, null, new DataGridViewCellStyle(), false, false));
60
Assert.
Throws
<ArgumentNullException>("inheritedRowStyle", () => new DataGridViewRowPostPaintEventArgs(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, -2, DataGridViewElementStates.Displayed, null, null, false, false));
System\Windows\Forms\DataGridViewRowPrePaintEventArgsTests.cs (4)
45
Assert.
Throws
<ArgumentNullException>("dataGridView", () => new DataGridViewRowPrePaintEventArgs(null, graphics, Rectangle.Empty, Rectangle.Empty, -2, DataGridViewElementStates.Displayed, null, new DataGridViewCellStyle(), false, false));
52
Assert.
Throws
<ArgumentNullException>("graphics", () => new DataGridViewRowPrePaintEventArgs(dataGridView, null, Rectangle.Empty, Rectangle.Empty, -2, DataGridViewElementStates.Displayed, null, new DataGridViewCellStyle(), false, false));
61
Assert.
Throws
<ArgumentNullException>("inheritedRowStyle", () => new DataGridViewRowPrePaintEventArgs(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, -2, DataGridViewElementStates.Displayed, null, null, false, false));
108
Assert.
Throws
<ArgumentException>("value", () => e.PaintParts = value);
System\Windows\Forms\DataGridViewRowsRemovedEventArgsTests.cs (2)
26
Assert.
Throws
<ArgumentOutOfRangeException>("rowIndex", () => new DataGridViewRowsRemovedEventArgs(rowIndex, 1));
35
Assert.
Throws
<ArgumentOutOfRangeException>("rowCount", () => new DataGridViewRowsRemovedEventArgs(1, rowCount));
System\Windows\Forms\DataGridViewRowTests.cs (13)
724
Assert.
Throws
<ArgumentException>("value", () => row.DefaultHeaderCellType = value);
735
Assert.
Throws
<ArgumentException>("value", () => row.DefaultHeaderCellType = value);
876
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => row.DividerHeight = value);
1111
Assert.
Throws
<ArgumentOutOfRangeException>("rowIndex", () => row.ErrorText = "value");
1778
Assert.
Throws
<ArgumentException>("value", () => row.HeaderCellCore = value);
2017
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => row.Height = value);
2487
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => row.MinimumHeight = value);
2902
Assert.
Throws
<InvalidEnumArgumentException>("value", () => row.Resizable = value);
4371
Assert.
Throws
<ArgumentOutOfRangeException>("rowIndex", () => row.GetContextMenuStrip(rowIndex));
4495
Assert.
Throws
<ArgumentOutOfRangeException>("rowIndex", () => row.GetErrorText(rowIndex));
4551
Assert.
Throws
<ArgumentException>("rowIndex", () => row.GetState(rowIndex));
4565
Assert.
Throws
<ArgumentOutOfRangeException>("rowIndex", () => row.GetState(rowIndex));
5727
Assert.
Throws
<ArgumentNullException>("values", () => row.SetValues(null));
System\Windows\Forms\DataGridViewSelectedCellCollectionTests.cs (4)
69
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection[index]);
88
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection[index]);
245
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => iList[index]);
265
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => iList[index]);
System\Windows\Forms\DataGridViewSelectedColumnCollectionTests.cs (4)
77
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection[index]);
100
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection[index]);
273
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => iList[index]);
297
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => iList[index]);
System\Windows\Forms\DataGridViewSelectedRowCollectionTests.cs (4)
67
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection[index]);
85
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection[index]);
238
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => iList[index]);
257
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => iList[index]);
System\Windows\Forms\DataGridViewTests.cs (4)
493
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => control.ColumnHeadersHeight = value);
786
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.ColumnHeadersHeightSizeMode = value);
1421
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => control.RowHeadersWidth = value);
1727
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.RowHeadersWidthSizeMode = value);
System\Windows\Forms\DateTimePickerTests.cs (1)
170
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.Format = value);
System\Windows\Forms\Design\WindowsFormsComponentEditorTests.cs (3)
87
Assert.
Throws
<ArgumentException>("component", () => editor.EditComponent(component, null));
88
Assert.
Throws
<ArgumentException>("component", () => editor.EditComponent(null, component));
89
Assert.
Throws
<ArgumentException>("component", () => editor.EditComponent(null, component, null));
System\Windows\Forms\DrawItemEventArgsTests.cs (2)
67
Assert.
Throws
<ArgumentNullException>("graphics", () => new DrawItemEventArgs(null, SystemFonts.DefaultFont, new Rectangle(1, 2, 3, 4), 0, DrawItemState.None));
68
Assert.
Throws
<ArgumentNullException>("graphics", () => new DrawItemEventArgs(null, SystemFonts.DefaultFont, new Rectangle(1, 2, 3, 4), 0, DrawItemState.None, Color.Red, Color.Blue));
System\Windows\Forms\DrawListViewColumnHeaderEventArgsTests.cs (1)
42
Assert.
Throws
<ArgumentNullException>("graphics", () => new DrawListViewColumnHeaderEventArgs(null, new Rectangle(1, 2, 3, 4), 0, new ColumnHeader(), ListViewItemStates.Default, Color.Red, Color.Blue, SystemFonts.DefaultFont));
System\Windows\Forms\DrawListViewItemEventArgsTests.cs (2)
40
Assert.
Throws
<ArgumentNullException>("graphics", () => new DrawListViewItemEventArgs(null, new ListViewItem(), new Rectangle(1, 2, 3, 4), 0, ListViewItemStates.Default));
48
Assert.
Throws
<ArgumentNullException>("item", () => new DrawListViewItemEventArgs(graphics, null, new Rectangle(1, 2, 3, 4), 0, ListViewItemStates.Default));
System\Windows\Forms\DrawListViewSubItemEventArgsTests.cs (3)
43
Assert.
Throws
<ArgumentNullException>("graphics", () => new DrawListViewSubItemEventArgs(null, new Rectangle(1, 2, 3, 4), new ListViewItem(), new ListViewItem.ListViewSubItem(), -1, 0, new ColumnHeader(), ListViewItemStates.Default));
51
Assert.
Throws
<ArgumentNullException>("item", () => new DrawListViewSubItemEventArgs(graphics, new Rectangle(1, 2, 3, 4), null, new ListViewItem.ListViewSubItem(), -1, 0, new ColumnHeader(), ListViewItemStates.Default));
61
Assert.
Throws
<ArgumentNullException>("subItem", () => new DrawListViewSubItemEventArgs(graphics, new Rectangle(1, 2, 3, 4), new ListViewItem(), null, itemIndex, 0, new ColumnHeader(), ListViewItemStates.Default));
System\Windows\Forms\ErrorProviderTests.cs (8)
61
Assert.
Throws
<ArgumentNullException>("parentControl", () => new ErrorProvider((ContainerControl)null));
88
Assert.
Throws
<ArgumentNullException>("container", () => new ErrorProvider((IContainer)null));
119
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => provider.BlinkRate = -1);
181
Assert.
Throws
<InvalidEnumArgumentException>("value", () => provider.BlinkStyle = value);
587
Assert.
Throws
<ArgumentNullException>("value", () => provider.Icon = null);
966
Assert.
Throws
<ArgumentNullException>("control", () => provider.GetError(null));
984
Assert.
Throws
<ArgumentNullException>("control", () => provider.GetIconAlignment(null));
1002
Assert.
Throws
<ArgumentNullException>("control", () => provider.GetIconPadding(null));
System\Windows\Forms\FileDialogTests.cs (1)
334
Assert.
Throws
<ArgumentException>("value", () => dialog.Filter = value);
System\Windows\Forms\FlowLayoutPanelTests.cs (2)
177
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.FlowDirection = value);
261
Assert.
Throws
<ArgumentNullException>("control", () => control.GetFlowBreak(null));
System\Windows\Forms\FlowLayoutSettingsTests.cs (2)
54
Assert.
Throws
<InvalidEnumArgumentException>("value", () => settings.FlowDirection = value);
113
Assert.
Throws
<ArgumentNullException>("child", () => settings.GetFlowBreak(null));
System\Windows\Forms\Form.ControlCollectionTests.cs (1)
24
Assert.
Throws
<ArgumentNullException>("owner", () => new Form.ControlCollection(null));
System\Windows\Forms\FormTests.cs (1)
1223
Assert.
Throws
<ArgumentException>("value", () => control.Parent = parent);
System\Windows\Forms\GroupBoxTests.cs (1)
563
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.AutoSizeMode = value);
System\Windows\Forms\HelpProviderTests.cs (4)
99
Assert.
Throws
<ArgumentNullException>("ctl", () => provider.GetHelpKeyword(null));
113
Assert.
Throws
<ArgumentNullException>("ctl", () => provider.GetHelpNavigator(null));
127
Assert.
Throws
<ArgumentNullException>("ctl", () => provider.GetHelpString(null));
141
Assert.
Throws
<ArgumentNullException>("ctl", () => provider.GetShowHelp(null));
System\Windows\Forms\HScrollBarTests.cs (1)
199
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.RightToLeft = value);
System\Windows\Forms\ImageList.ImageCollectionTests.cs (12)
225
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection[index]);
237
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection[index]);
307
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection[index] = null);
319
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection[index] = null);
330
Assert.
Throws
<ArgumentNullException>("value", () => collection[0] = null);
796
Assert.
Throws
<ArgumentNullException>("value", () => collection.Add(null, Color.Transparent));
943
Assert.
Throws
<ArgumentNullException>("value", () => collection.AddStrip(null));
955
Assert.
Throws
<ArgumentException>("value", () => collection.AddStrip(image));
967
Assert.
Throws
<ArgumentException>("value", () => collection.AddStrip(image));
1682
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection[index] = value);
1696
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection[index] = image);
1714
Assert.
Throws
<ArgumentException>("value", () => collection[0] = value);
System\Windows\Forms\ImageListTests.cs (5)
53
Assert.
Throws
<ArgumentNullException>("container", () => new ImageList(null));
225
Assert.
Throws
<InvalidEnumArgumentException>("value", () => list.ColorDepth = value);
404
Assert.
Throws
<ArgumentException>("value", () => list.ImageSize = Size.Empty);
419
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => list.ImageSize = new Size(width, 1));
427
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => list.ImageSize = new Size(1, height));
System\Windows\Forms\InputLanguageChangedEventArgsTests.cs (3)
32
Assert.
Throws
<ArgumentNullException>("culture", () => new InputLanguageChangedEventArgs((CultureInfo)null, 0));
45
Assert.
Throws
<ArgumentException>("culture", () => new InputLanguageChangedEventArgs(culture, 0));
73
Assert.
Throws
<ArgumentNullException>("inputLanguage", () => new InputLanguageChangedEventArgs((InputLanguage)null, 0));
System\Windows\Forms\InputLanguageChangingEventArgsTests.cs (3)
33
Assert.
Throws
<ArgumentNullException>("culture", () => new InputLanguageChangingEventArgs((CultureInfo)null, true));
46
Assert.
Throws
<ArgumentException>("culture", () => new InputLanguageChangingEventArgs(culture, true));
74
Assert.
Throws
<ArgumentNullException>("inputLanguage", () => new InputLanguageChangingEventArgs((InputLanguage)null, true));
System\Windows\Forms\InputLanguageTests.cs (2)
68
Assert.
Throws
<ArgumentException>("value", () => InputLanguage.CurrentInputLanguage = language);
105
Assert.
Throws
<ArgumentNullException>("culture", () => InputLanguage.FromCulture(null));
System\Windows\Forms\LabelTests.cs (1)
248
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.ImageAlign = value);
System\Windows\Forms\Layout\FlowLayoutTests.cs (1)
291
Assert.
Throws
<ArgumentNullException>("container", () => engine.Layout(null, new LayoutEventArgs(control, "affectedProperty")));
System\Windows\Forms\Layout\LayoutEngineTests.cs (1)
51
Assert.
Throws
<ArgumentNullException>("container", () => engine.Layout(null, new LayoutEventArgs(new Component(), "affectedProperty")));
System\Windows\Forms\Layout\TableLayoutSettingsTests.cs (18)
81
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => settings.ColumnCount = -1);
119
Assert.
Throws
<InvalidEnumArgumentException>("value", () => settings.GrowStyle = value);
155
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => settings.RowCount = -1);
181
Assert.
Throws
<ArgumentNullException>("control", () => settings.GetCellPosition(null));
189
Assert.
Throws
<ArgumentNullException>("control", () => settings.GetCellPosition(null));
215
Assert.
Throws
<ArgumentOutOfRangeException>("column", () => settings.GetCellPosition(child));
225
Assert.
Throws
<ArgumentOutOfRangeException>("column", () => settings.GetCellPosition(child));
235
Assert.
Throws
<ArgumentOutOfRangeException>("row", () => settings.GetCellPosition(child));
245
Assert.
Throws
<ArgumentOutOfRangeException>("row", () => settings.GetCellPosition(child));
271
Assert.
Throws
<ArgumentNullException>("control", () => settings.GetColumn(null));
279
Assert.
Throws
<ArgumentNullException>("control", () => settings.GetColumn(null));
322
Assert.
Throws
<ArgumentNullException>("control", () => settings.GetColumnSpan(null));
330
Assert.
Throws
<ArgumentNullException>("control", () => settings.GetColumnSpan(null));
372
Assert.
Throws
<ArgumentNullException>("control", () => settings.GetRow(null));
380
Assert.
Throws
<ArgumentNullException>("control", () => settings.GetRow(null));
422
Assert.
Throws
<ArgumentNullException>("control", () => settings.GetRowSpan(null));
430
Assert.
Throws
<ArgumentNullException>("control", () => settings.GetRowSpan(null));
1114
Assert.
Throws
<ArgumentNullException>("control", () => settings.GetColumnSpan(null));
System\Windows\Forms\Layout\TableLayoutSettingsTypeConverterTests.cs (1)
290
Assert.
Throws
<ArgumentNullException>("destinationType", () => converter.ConvertTo(new object(), null));
System\Windows\Forms\LinkAreaConverterTests.cs (3)
96
Assert.
Throws
<ArgumentNullException>("destinationType", () => converter.ConvertTo(new object(), null));
132
Assert.
Throws
<ArgumentNullException>("propertyValues", () => converter.CreateInstance(null, null));
191
Assert.
Throws
<ArgumentException>("propertyValues", () => converter.CreateInstance(null, propertyValues));
System\Windows\Forms\LinkConverterTests.cs (1)
105
Assert.
Throws
<ArgumentNullException>("destinationType", () => converter.ConvertTo(new object(), null));
System\Windows\Forms\ListBox.IntegerCollectionTests.cs (9)
24
Assert.
Throws
<ArgumentNullException>("owner", () => new ListBox.IntegerCollection(null));
69
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection[index]);
83
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection[index]);
230
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection[index] = 2);
244
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection[index] = 2);
1537
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection[index]);
1551
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection[index]);
1714
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection[index] = 2);
1728
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection[index] = 2);
System\Windows\Forms\ListBox.ObjectCollectionTests.cs (23)
51
Assert.
Throws
<ArgumentNullException>("owner", () => new ListBox.ObjectCollection(null));
52
Assert.
Throws
<ArgumentNullException>("owner", () => new ListBox.ObjectCollection(null, new ListBox.ObjectCollection(owner)));
53
Assert.
Throws
<ArgumentNullException>("owner", () => new ListBox.ObjectCollection(null, Array.Empty<object>()));
80
Assert.
Throws
<ArgumentNullException>("value", () => new ListBox.ObjectCollection(owner, (object[])null));
81
Assert.
Throws
<ArgumentNullException>("value", () => new ListBox.ObjectCollection(owner, (ListBox.ObjectCollection)null));
143
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection[index]);
157
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection[index]);
1255
Assert.
Throws
<ArgumentNullException>("value", () => collection[index] = null);
1270
Assert.
Throws
<ArgumentNullException>("value", () => collection[index] = null);
1281
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection[index] = 2);
1295
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection[index] = 2);
2186
Assert.
Throws
<ArgumentNullException>("item", () => collection.Add(null));
3980
Assert.
Throws
<ArgumentNullException>("value", () => collection.Contains(null));
4118
Assert.
Throws
<ArgumentNullException>("value", () => collection.IndexOf(null));
6928
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection[index]);
6942
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection[index]);
8060
Assert.
Throws
<ArgumentNullException>("value", () => collection[index] = null);
8075
Assert.
Throws
<ArgumentNullException>("value", () => collection[index] = null);
8086
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection[index] = 2);
8100
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection[index] = 2);
8991
Assert.
Throws
<ArgumentNullException>("item", () => collection.Add(null));
9302
Assert.
Throws
<ArgumentNullException>("value", () => collection.Contains(null));
9440
Assert.
Throws
<ArgumentNullException>("value", () => collection.IndexOf(null));
System\Windows\Forms\ListBox.SelectedIndexCollectionTests.cs (1)
23
Assert.
Throws
<ArgumentNullException>("owner", () => new ListBox.SelectedIndexCollection(null!));
System\Windows\Forms\ListBox.SelectedObjectCollectionTests.cs (1)
28
=> Assert.
Throws
<ArgumentNullException>("owner", () => new ListBox.SelectedObjectCollection(null!));
System\Windows\Forms\ListBoxTests.cs (28)
590
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.BackgroundImageLayout = value);
650
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.BorderStyle = value);
779
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => control.ColumnWidth = -1);
1029
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.DrawMode = value);
1039
Assert.
Throws
<ArgumentException>("value", () => control.DrawMode = DrawMode.OwnerDrawVariable);
1812
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => control.ItemHeight = value);
1963
Assert.
Throws
<ArgumentException>("value", () => control.MultiColumn = true);
2232
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.RightToLeft = value);
2735
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => control.SelectedIndex = value);
2745
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => control.SelectedIndex = value);
2755
Assert.
Throws
<ArgumentException>("value", () => control.SelectedIndex = -1);
3907
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.SelectionMode = value);
5036
Assert.
Throws
<ArgumentOutOfRangeException>("startIndex", () => control.FindString("s", startIndex));
5140
Assert.
Throws
<ArgumentOutOfRangeException>("startIndex", () => control.FindStringExact("s", startIndex));
5311
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => control.GetItemHeight(index));
5322
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => control.GetItemHeight(index));
5455
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => control.GetItemRectangle(-1));
5456
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => control.GetItemRectangle(0));
5457
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => control.GetItemRectangle(1));
5466
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => control.GetItemRectangle(-1));
5467
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => control.GetItemRectangle(1));
5468
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => control.GetItemRectangle(2));
5475
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => control.GetItemRectangle(-1));
5476
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => control.GetItemRectangle(0));
5477
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => control.GetItemRectangle(1));
5487
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => control.GetItemRectangle(-1));
5488
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => control.GetItemRectangle(1));
5489
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => control.GetItemRectangle(2));
System\Windows\Forms\ListControlTests.cs (4)
1067
Assert.
Throws
<ArgumentException>("value", () => control.DataSource = new object());
1798
Assert.
Throws
<ArgumentException>("newDisplayMember", (() => control.ValueMember = "NoSuchValue"));
1847
Assert.
Throws
<ArgumentException>("value", (() => control.ValueMember = "NoSuchValue"));
2069
Assert.
Throws
<ArgumentNullException>("key", () => control.SelectedValue = null);
System\Windows\Forms\ListView.ListViewItemCollectionTests.cs (2)
100
Assert.
Throws
<ArgumentNullException>("key", () => collection.Find(key, searchAllSubItems: true));
101
Assert.
Throws
<ArgumentNullException>("key", () => collection.Find(key, searchAllSubItems: false));
System\Windows\Forms\ListViewGroupCollectionTests.cs (8)
43
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection[index]);
177
Assert.
Throws
<ArgumentNullException>("value", () => collection[0] = null);
188
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection[index] = new ListViewGroup());
210
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection[index]);
248
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection[index] = new ListViewGroup());
366
Assert.
Throws
<ArgumentNullException>("value", () => collection["key"] = null);
482
Assert.
Throws
<ArgumentNullException>("group", () => collection.Add(null));
534
Assert.
Throws
<ArgumentException>("value", () => collection.Add(value));
System\Windows\Forms\ListViewGroupConverterTests.cs (1)
223
Assert.
Throws
<ArgumentNullException>("destinationType", () => converter.ConvertTo(new object(), null));
System\Windows\Forms\ListViewGroupTests.cs (4)
253
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => group.TitleImageIndex = value);
785
Assert.
Throws
<InvalidEnumArgumentException>("value", () => group.FooterAlignment = value);
1037
Assert.
Throws
<InvalidEnumArgumentException>("value", () => group.HeaderAlignment = value);
1173
Assert.
Throws
<InvalidEnumArgumentException>("value", () => group.CollapsedState = value);
System\Windows\Forms\ListViewItemConverterTests.cs (1)
278
Assert.
Throws
<ArgumentNullException>("destinationType", () => converter.ConvertTo(new object(), null));
System\Windows\Forms\ListViewItemTests.cs (8)
833
Assert.
Throws
<ArgumentNullException>("subItems", () => new ListViewItem((ListViewItem.ListViewSubItem[])null, "imageKey"));
834
Assert.
Throws
<ArgumentNullException>("subItems", () => new ListViewItem((ListViewItem.ListViewSubItem[])null, 1));
835
Assert.
Throws
<ArgumentNullException>("subItems", () => new ListViewItem((ListViewItem.ListViewSubItem[])null, "imageKey", new ListViewGroup()));
836
Assert.
Throws
<ArgumentNullException>("subItems", () => new ListViewItem((ListViewItem.ListViewSubItem[])null, 0, new ListViewGroup()));
843
Assert.
Throws
<ArgumentNullException>("subItems", () => new ListViewItem(subItems, "imageKey"));
844
Assert.
Throws
<ArgumentNullException>("subItems", () => new ListViewItem(subItems, 1));
845
Assert.
Throws
<ArgumentNullException>("subItems", () => new ListViewItem(subItems, "imageKey", new ListViewGroup()));
846
Assert.
Throws
<ArgumentNullException>("subItems", () => new ListViewItem(subItems, 1, new ListViewGroup()));
System\Windows\Forms\ListViewSubItemCollectionTests.cs (9)
25
Assert.
Throws
<ArgumentNullException>("owner", () => new ListViewItem.ListViewSubItemCollection(null));
61
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection[index]);
88
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection[index] = new ListViewItem.ListViewSubItem());
99
Assert.
Throws
<ArgumentNullException>("value", () => collection[0] = null);
123
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection[index]);
150
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection[index]);
160
Assert.
Throws
<ArgumentException>("value", () => collection[0] = value);
286
Assert.
Throws
<ArgumentNullException>("item", () => collection.Add((ListViewItem.ListViewSubItem)null));
307
Assert.
Throws
<ArgumentException>("item", () => collection.Add(value));
System\Windows\Forms\ListViewSubItemConverterTests.cs (1)
91
Assert.
Throws
<ArgumentNullException>("destinationType", () => converter.ConvertTo(new object(), null));
System\Windows\Forms\ListViewTests.cs (21)
248
Assert.
Throws
<InvalidEnumArgumentException>("value", () => listView.Activation = value);
259
Assert.
Throws
<InvalidEnumArgumentException>("value", () => listView.Activation = value);
271
Assert.
Throws
<ArgumentException>("value", () => listView.Activation = value);
329
Assert.
Throws
<InvalidEnumArgumentException>("value", () => listView.Alignment = value);
614
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.BackgroundImageLayout = value);
792
Assert.
Throws
<InvalidEnumArgumentException>("value", () => listView.BorderStyle = value);
2124
Assert.
Throws
<InvalidEnumArgumentException>("value", () => listView.HeaderStyle = value);
2358
Assert.
Throws
<ArgumentException>("value", () => listView.HoverSelection = false);
4191
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => control.GetItemRect(0));
4216
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => control.GetItemRect(-1));
4217
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => control.GetItemRect(0));
4218
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => control.GetItemRect(1));
4228
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => control.GetItemRect(-1));
4229
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => control.GetItemRect(1));
4230
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => control.GetItemRect(2));
4237
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => control.GetItemRect(-1));
4238
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => control.GetItemRect(0));
4239
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => control.GetItemRect(1));
4250
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => control.GetItemRect(-1));
4251
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => control.GetItemRect(1));
4252
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => control.GetItemRect(2));
System\Windows\Forms\MdiClient.ControlCollectionTests.cs (1)
24
Assert.
Throws
<ArgumentNullException>("owner", () => new MdiClient.ControlCollection(null));
System\Windows\Forms\MonthCalendarTests.cs (25)
492
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.BackgroundImageLayout = value);
732
Assert.
Throws
<ArgumentOutOfRangeException>("x", () => calendar.CalendarDimensions = new Size(x, 1));
741
Assert.
Throws
<ArgumentOutOfRangeException>("y", () => calendar.CalendarDimensions = new Size(1, y));
918
Assert.
Throws
<InvalidEnumArgumentException>("FirstDayOfWeek", () => calendar.FirstDayOfWeek = value);
1308
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.ImeMode = value);
1378
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => calendar.MaxDate = calendar.MinDate.AddTicks(-1));
1442
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => calendar.MaxSelectionCount = value);
1511
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => calendar.MinDate = calendar.MaxDate.AddTicks(1));
1518
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => calendar.MinDate = calendar.MinDate.AddTicks(-1));
1940
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => calendar.ScrollChange = value);
2013
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => calendar.SelectionStart = calendar.MinDate.AddTicks(-1));
2024
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => calendar.SelectionStart = calendar.MaxDate.AddTicks(1));
2091
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => calendar.SelectionEnd = calendar.MinDate.AddTicks(-1));
2094
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => calendar.SelectionEnd = calendar.MinDate.AddTicks(-1));
2101
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => calendar.SelectionEnd = calendar.MaxDate.AddTicks(1));
2104
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => calendar.SelectionEnd = calendar.MaxDate.AddTicks(1));
2209
Assert.
Throws
<ArgumentOutOfRangeException>("date1", () => calendar.SelectionRange = new SelectionRange(calendar.MinDate.AddTicks(-1), calendar.MinDate));
2210
Assert.
Throws
<ArgumentOutOfRangeException>("date1", () => calendar.SelectionRange = new SelectionRange(calendar.MinDate, calendar.MinDate.AddTicks(-1)));
2226
Assert.
Throws
<ArgumentOutOfRangeException>("date2", () => calendar.SelectionRange = new SelectionRange(calendar.MaxDate.AddDays(1), calendar.MaxDate));
2227
Assert.
Throws
<ArgumentOutOfRangeException>("date2", () => calendar.SelectionRange = new SelectionRange(calendar.MaxDate, calendar.MaxDate.AddDays(1)));
2770
Assert.
Throws
<ArgumentException>("value", () => calendar.TitleBackColor = Color.Empty);
2829
Assert.
Throws
<ArgumentException>("value", () => calendar.TitleForeColor = Color.Empty);
2913
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => calendar.TodayDate = calendar.MinDate.AddTicks(-1));
2924
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => calendar.TodayDate = calendar.MaxDate.AddDays(1));
2983
Assert.
Throws
<ArgumentException>("value", () => calendar.TrailingForeColor = Color.Empty);
System\Windows\Forms\NotifyIconTests.cs (2)
50
Assert.
Throws
<ArgumentNullException>("container", () => new NotifyIcon(null));
73
Assert.
Throws
<InvalidEnumArgumentException>("value", () => notifyIcon.BalloonTipIcon = value);
System\Windows\Forms\OpacityConverterTests.cs (1)
98
Assert.
Throws
<ArgumentNullException>("destinationType", () => converter.ConvertTo(new object(), null));
System\Windows\Forms\PaddingConverterTests.cs (4)
61
Assert.
Throws
<ArgumentException>("value", () => converter.ConvertFrom(value));
108
Assert.
Throws
<ArgumentNullException>("destinationType", () => converter.ConvertTo(new object(), null));
180
Assert.
Throws
<ArgumentNullException>("propertyValues", () => converter.CreateInstance(new Mock<ITypeDescriptorContext>(MockBehavior.Strict).Object, null));
364
Assert.
Throws
<ArgumentException>("propertyValues", () => converter.CreateInstance(mockContext.Object, propertyValues));
System\Windows\Forms\PaintEventArgsTests.cs (1)
35
Assert.
Throws
<ArgumentNullException>("graphics", () => new PaintEventArgs((Graphics)null, new Rectangle(1, 2, 3, 4)));
System\Windows\Forms\PanelTests.cs (2)
551
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.AutoSizeMode = value);
607
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.BorderStyle = value);
System\Windows\Forms\PictureBoxTests.cs (5)
176
Assert.
Throws
<InvalidEnumArgumentException>("value", () => pictureBox.BorderStyle = value);
1006
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.ImeMode = value);
1276
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.RightToLeft = value);
1391
Assert.
Throws
<InvalidEnumArgumentException>("value", () => pictureBox.SizeMode = value);
1455
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => control.TabIndex = -1);
System\Windows\Forms\ProgressBarTests.cs (7)
337
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.BackgroundImageLayout = value);
759
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.ImeMode = value);
899
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => control.MarqueeAnimationSpeed = -1);
998
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => control.Maximum = -1);
1097
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => control.Minimum = -1);
1507
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.Style = value);
1757
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => control.Value = value);
System\Windows\Forms\PropertyGridTests.cs (2)
529
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.BackgroundImageLayout = value);
2389
Assert.
Throws
<ArgumentNullException>("items", () => control.SelectedGridItem = null);
System\Windows\Forms\RadioButtonTests.cs (2)
174
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.CheckAlign = value);
395
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.TextAlign = value);
System\Windows\Forms\RichTextBoxTests.cs (50)
954
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => control.BulletIndent = value);
2056
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => control.MaxLength = -1);
2597
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => control.RightMargin = -1);
3154
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.ScrollBars = value);
3792
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.SelectionAlignment = value);
4444
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => control.SelectionCharOffset = value);
5562
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => control.SelectionLength = -1);
5941
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => control.SelectionRightIndent = -1);
6396
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => control.SelectionTabs = new int[33]);
7838
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => control.ZoomFactor = value);
8433
Assert.
Throws
<ArgumentNullException>("str", () => control.Find((string)null));
8434
Assert.
Throws
<ArgumentNullException>("str", () => control.Find(null, RichTextBoxFinds.None));
8435
Assert.
Throws
<ArgumentNullException>("str", () => control.Find(null, 0, RichTextBoxFinds.None));
8436
Assert.
Throws
<ArgumentNullException>("str", () => control.Find(null, -1, RichTextBoxFinds.None));
8437
Assert.
Throws
<ArgumentNullException>("str", () => control.Find(null, 1, RichTextBoxFinds.None));
8438
Assert.
Throws
<ArgumentNullException>("str", () => control.Find(null, 0, 0, RichTextBoxFinds.None));
8439
Assert.
Throws
<ArgumentNullException>("str", () => control.Find(null, -1, 0, RichTextBoxFinds.None));
8440
Assert.
Throws
<ArgumentNullException>("str", () => control.Find(null, 1, 0, RichTextBoxFinds.None));
8441
Assert.
Throws
<ArgumentNullException>("str", () => control.Find(null, 0, -2, RichTextBoxFinds.None));
8451
Assert.
Throws
<ArgumentNullException>("str", () => control.Find((string)null));
8452
Assert.
Throws
<ArgumentNullException>("str", () => control.Find(null, RichTextBoxFinds.None));
8453
Assert.
Throws
<ArgumentNullException>("str", () => control.Find(null, 0, RichTextBoxFinds.None));
8454
Assert.
Throws
<ArgumentNullException>("str", () => control.Find(null, -1, RichTextBoxFinds.None));
8455
Assert.
Throws
<ArgumentNullException>("str", () => control.Find(null, 2, RichTextBoxFinds.None));
8456
Assert.
Throws
<ArgumentNullException>("str", () => control.Find(null, 0, 0, RichTextBoxFinds.None));
8457
Assert.
Throws
<ArgumentNullException>("str", () => control.Find(null, -1, 0, RichTextBoxFinds.None));
8458
Assert.
Throws
<ArgumentNullException>("str", () => control.Find(null, 2, 0, RichTextBoxFinds.None));
8459
Assert.
Throws
<ArgumentNullException>("str", () => control.Find(null, 0, -2, RichTextBoxFinds.None));
8466
Assert.
Throws
<ArgumentNullException>("characterSet", () => control.Find((char[])null));
8467
Assert.
Throws
<ArgumentNullException>("characterSet", () => control.Find(null, 0));
8468
Assert.
Throws
<ArgumentNullException>("characterSet", () => control.Find(null, -1));
8469
Assert.
Throws
<ArgumentNullException>("characterSet", () => control.Find(null, 1));
8470
Assert.
Throws
<ArgumentNullException>("characterSet", () => control.Find(null, 0, 0));
8471
Assert.
Throws
<ArgumentNullException>("characterSet", () => control.Find(null, -1, 0));
8472
Assert.
Throws
<ArgumentNullException>("characterSet", () => control.Find(null, 1, 0));
8473
Assert.
Throws
<ArgumentNullException>("characterSet", () => control.Find(null, 0, -2));
8483
Assert.
Throws
<ArgumentNullException>("characterSet", () => control.Find((char[])null));
8484
Assert.
Throws
<ArgumentNullException>("characterSet", () => control.Find(null, 0));
8485
Assert.
Throws
<ArgumentNullException>("characterSet", () => control.Find(null, -1));
8486
Assert.
Throws
<ArgumentNullException>("characterSet", () => control.Find(null, 2));
8487
Assert.
Throws
<ArgumentNullException>("characterSet", () => control.Find(null, 0, 0));
8488
Assert.
Throws
<ArgumentNullException>("characterSet", () => control.Find(null, -1, 0));
8489
Assert.
Throws
<ArgumentNullException>("characterSet", () => control.Find(null, 2, 0));
8490
Assert.
Throws
<ArgumentNullException>("characterSet", () => control.Find(null, 0, -2));
8499
Assert.
Throws
<ArgumentOutOfRangeException>("start", () => control.Find("s", start, RichTextBoxFinds.NoHighlight));
8500
Assert.
Throws
<ArgumentOutOfRangeException>("start", () => control.Find("s", start, 0, RichTextBoxFinds.NoHighlight));
8514
Assert.
Throws
<ArgumentOutOfRangeException>("start", () => control.Find("s", start, RichTextBoxFinds.NoHighlight));
8515
Assert.
Throws
<ArgumentOutOfRangeException>("start", () => control.Find("s", start, 0, RichTextBoxFinds.NoHighlight));
8524
Assert.
Throws
<ArgumentOutOfRangeException>("end", () => control.Find("s", 0, -2, RichTextBoxFinds.NoHighlight));
8535
Assert.
Throws
<ArgumentOutOfRangeException>("end", () => control.Find("s", 0, -2, RichTextBoxFinds.NoHighlight));
System\Windows\Forms\RowStyleTests.cs (2)
44
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => new RowStyle(SizeType.AutoSize, -1));
141
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => style.Height = -1);
System\Windows\Forms\ScreenTests.cs (3)
87
Assert.
Throws
<ArgumentNullException>("control", () => Screen.FromControl(null));
168
Assert.
Throws
<ArgumentNullException>("control", () => Screen.GetBounds(null));
198
Assert.
Throws
<ArgumentNullException>("control", () => Screen.GetWorkingArea(null));
System\Windows\Forms\ScrollableControlTests.cs (1)
470
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => control.AutoScrollMargin = new Size(x, y));
System\Windows\Forms\ScrollBarTests.cs (6)
362
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.BackgroundImageLayout = value);
681
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.ImeMode = value);
824
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => control.LargeChange = -1);
1239
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.RightToLeft = value);
1375
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => control.SmallChange = -1);
1753
ArgumentOutOfRangeException ex = Assert.
Throws
<ArgumentOutOfRangeException>(paramName, () => control.Value = value);
System\Windows\Forms\ScrollPropertiesTests.cs (4)
154
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => properties.LargeChange = -1);
221
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => properties.SmallChange = -1);
429
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => properties.Minimum = -1);
515
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => properties.Value = value);
System\Windows\Forms\SplitterPanelTests.cs (3)
381
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.BorderStyle = value);
444
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.Dock = value);
928
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => control.TabIndex = -1);
System\Windows\Forms\SplitterTests.cs (2)
371
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.BorderStyle = value);
987
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.ImeMode = value);
System\Windows\Forms\StatusStripTests.cs (1)
609
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.RenderMode = value);
System\Windows\Forms\TabControl.ControlCollectionTests.cs (1)
28
Assert.
Throws
<ArgumentNullException>("owner", () => new TabControl.ControlCollection(null));
System\Windows\Forms\TabControl.TabPageCollectionTests.cs (13)
1183
Assert.
Throws
<ArgumentNullException>("owner", () => new TabControl.TabPageCollection(null));
1573
Assert.
Throws
<ArgumentNullException>("page", () => collection.Contains(null));
1878
Assert.
Throws
<ArgumentNullException>("page", () => collection.IndexOf(null));
3338
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection[index]);
3353
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection[index]);
3673
Assert.
Throws
<ArgumentNullException>("value", () => collection[0] = null);
3685
Assert.
Throws
<ArgumentNullException>("value", () => collection[0] = null);
3697
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection[index] = page);
3713
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection[index] = page2);
3739
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => iList[index]);
3753
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => iList[index]);
3957
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => iList[index] = page);
3972
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => iList[index] = page2);
System\Windows\Forms\TabControlTests.cs (27)
448
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.Alignment = value);
525
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.Appearance = value);
737
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.BackgroundImageLayout = value);
919
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.DrawMode = value);
1608
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => control.ItemSize = new Size(-1, 1));
1615
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => control.ItemSize = new Size(1, -1));
1817
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => control.Padding = new Point(-1, 1));
1824
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => control.Padding = new Point(1, -1));
2509
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => control.SelectedIndex = -2);
2847
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.SizeMode = value);
3635
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => control.GetControl(index));
3649
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => control.GetControl(index));
3785
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => control.GetTabRect(-1));
3786
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => control.GetTabRect(0));
3787
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => control.GetTabRect(1));
3797
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => control.GetTabRect(-1));
3798
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => control.GetTabRect(1));
3799
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => control.GetTabRect(2));
3806
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => control.GetTabRect(-1));
3807
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => control.GetTabRect(0));
3808
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => control.GetTabRect(1));
3819
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => control.GetTabRect(-1));
3820
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => control.GetTabRect(1));
3821
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => control.GetTabRect(2));
3897
Assert.
Throws
<ArgumentNullException>("elementType", () => control.GetItems(null));
3982
Assert.
Throws
<ArgumentNullException>("item", () => control.GetToolTipText(null));
3989
Assert.
Throws
<ArgumentException>("item", () => control.GetToolTipText(new object()));
System\Windows\Forms\TableLayoutCellPaintEventArgsTests.cs (1)
39
Assert.
Throws
<ArgumentNullException>("graphics", () => new TableLayoutCellPaintEventArgs(
System\Windows\Forms\TableLayoutControlCollectionTests.cs (1)
23
Assert.
Throws
<ArgumentNullException>("container", () => new TableLayoutControlCollection(null));
System\Windows\Forms\TableLayoutPanelCellPositionTests.cs (10)
37
Assert.
Throws
<ArgumentOutOfRangeException>("column", () => new TableLayoutPanelCellPosition(-2, 0));
43
Assert.
Throws
<ArgumentOutOfRangeException>("row", () => new TableLayoutPanelCellPosition(0, -2));
144
Assert.
Throws
<ArgumentException>("value", () => converter.ConvertFrom(value));
151
Assert.
Throws
<ArgumentOutOfRangeException>("column", () => converter.ConvertFrom("-2,2"));
158
Assert.
Throws
<ArgumentOutOfRangeException>("row", () => converter.ConvertFrom("1,-2"));
187
Assert.
Throws
<ArgumentNullException>("destinationType", () => converter.ConvertTo(new object(), null));
222
Assert.
Throws
<ArgumentNullException>("propertyValues", () => converter.CreateInstance(null, null));
281
Assert.
Throws
<ArgumentException>("propertyValues", () => converter.CreateInstance(null, propertyValues));
288
Assert.
Throws
<ArgumentOutOfRangeException>("column", () => converter.CreateInstance(null, new Dictionary<string, object>
299
Assert.
Throws
<ArgumentOutOfRangeException>("row", () => converter.CreateInstance(null, new Dictionary<string, object>
System\Windows\Forms\TableLayoutPanelTests.cs (14)
205
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.BorderStyle = value);
298
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.CellBorderStyle = value);
332
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => control.ColumnCount = -1);
408
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.GrowStyle = value);
624
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => control.RowCount = -1);
657
Assert.
Throws
<ArgumentNullException>("control", () => control.GetCellPosition(null));
666
Assert.
Throws
<ArgumentOutOfRangeException>("column", () => control.GetCellPosition(child));
675
Assert.
Throws
<ArgumentOutOfRangeException>("row", () => control.GetCellPosition(child));
690
Assert.
Throws
<ArgumentNullException>("control", () => control.GetColumn(null));
705
Assert.
Throws
<ArgumentNullException>("control", () => control.GetColumnSpan(null));
873
Assert.
Throws
<ArgumentOutOfRangeException>("column", () => control.GetControlFromPosition(column, 0));
882
Assert.
Throws
<ArgumentOutOfRangeException>("row", () => control.GetControlFromPosition(0, row));
943
Assert.
Throws
<ArgumentNullException>("control", () => control.GetRow(null));
1151
Assert.
Throws
<ArgumentNullException>("control", () => control.GetRowSpan(null));
System\Windows\Forms\TableLayoutStyleCollectionTests.cs (8)
55
Assert.
Throws
<ArgumentNullException>("style", () => collection.Add(null));
56
Assert.
Throws
<ArgumentNullException>("style", () => ((IList)collection).Add(null));
76
Assert.
Throws
<ArgumentException>("style", () => collection.Add(style));
77
Assert.
Throws
<ArgumentException>("style", () => ((IList)collection).Add(style));
160
Assert.
Throws
<ArgumentNullException>("value", () => collection[index] = null);
161
Assert.
Throws
<ArgumentNullException>("value", () => ((IList)collection)[index] = null);
182
Assert.
Throws
<ArgumentException>("style", () => collection[0] = style);
183
Assert.
Throws
<ArgumentException>("style", () => ((IList)collection)[0] = style);
System\Windows\Forms\TableLayoutStyleTests.cs (1)
158
Assert.
Throws
<ArgumentNullException>("destinationType", () => converter.ConvertTo(new object(), null));
System\Windows\Forms\TabPageTests.cs (3)
994
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.Dock = value);
1492
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => control.ImageIndex = -2);
2682
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => control.TabIndex = -1);
System\Windows\Forms\TabPageTests.TabPageControlCollection.cs (1)
23
Assert.
Throws
<ArgumentNullException>("owner", () => new TabPage.TabPageControlCollection(null));
System\Windows\Forms\TextRendererTests.cs (3)
566
Assert.
Throws
<ArgumentNullException>("dc", () => TextRenderer.MeasureText(null, string.Empty, SystemFonts.MenuFont));
567
Assert.
Throws
<ArgumentNullException>("dc", () => TextRenderer.MeasureText(null, string.Empty, SystemFonts.MenuFont, new Size(300, 400)));
568
Assert.
Throws
<ArgumentNullException>("dc", () => TextRenderer.MeasureText(null, string.Empty, SystemFonts.MenuFont, new Size(300, 400), TextFormatFlags.Default));
System\Windows\Forms\TimerTests.cs (2)
41
Assert.
Throws
<ArgumentNullException>("container", () => new Timer(null));
228
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => timer.Interval = value);
System\Windows\Forms\ToolStripButtonTests.cs (1)
998
Assert.
Throws
<InvalidEnumArgumentException>("value", () => item.CheckState = value);
System\Windows\Forms\ToolStripContentPanelTests.cs (4)
775
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.BorderStyle = value);
898
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.Dock = value);
1424
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.RenderMode = value);
1551
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => control.TabIndex = -1);
System\Windows\Forms\ToolStripControlHostTests.cs (12)
131
Assert.
Throws
<ArgumentNullException>("c", () => new SubToolStripControlHost(null));
132
Assert.
Throws
<ArgumentNullException>("c", () => new SubToolStripControlHost(null, "name"));
251
Assert.
Throws
<InvalidEnumArgumentException>("value", () => item.AccessibleRole = value);
747
Assert.
Throws
<InvalidEnumArgumentException>("value", () => item.ControlAlign = value);
819
Assert.
Throws
<InvalidEnumArgumentException>("value", () => item.DisplayStyle = value);
1266
Assert.
Throws
<InvalidEnumArgumentException>("value", () => item.ImageAlign = value);
1637
Assert.
Throws
<InvalidEnumArgumentException>("value", () => item.RightToLeft = value);
2020
Assert.
Throws
<ArgumentNullException>("service", () => c.Site.GetService(null));
2123
Assert.
Throws
<ArgumentNullException>("key", () => iDictionaryService.GetValue(null));
2327
Assert.
Throws
<InvalidEnumArgumentException>("value", () => item.TextAlign = value);
2360
Assert.
Throws
<InvalidEnumArgumentException>("value", () => item.TextDirection = value);
2389
Assert.
Throws
<InvalidEnumArgumentException>("value", () => item.TextImageRelation = value);
System\Windows\Forms\ToolStripDropDownTests.cs (6)
1471
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.DefaultDropDownDirection = value);
1808
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.GripStyle = value);
1915
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.ImeMode = value);
2445
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.RightToLeft = value);
2568
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => control.TabIndex = -1);
2918
Assert.
Throws
<ArgumentException>("value", () => control.TopLevel = true);
System\Windows\Forms\ToolStripItemCollectionTests.cs (2)
99
Assert.
Throws
<ArgumentNullException>("key", () => collection.Find(key, searchAllChildren: true));
100
Assert.
Throws
<ArgumentNullException>("key", () => collection.Find(key, searchAllChildren: false));
System\Windows\Forms\ToolStripItemTests.cs (15)
375
Assert.
Throws
<InvalidEnumArgumentException>("value", () => item.AccessibleRole = value);
561
Assert.
Throws
<InvalidEnumArgumentException>("value", () => item.Alignment = value);
2034
Assert.
Throws
<InvalidEnumArgumentException>("value", () => item.BackgroundImageLayout = value);
2325
Assert.
Throws
<InvalidEnumArgumentException>("value", () => item.DisplayStyle = value);
2446
Assert.
Throws
<InvalidEnumArgumentException>("value", () => item.Dock = value);
4378
Assert.
Throws
<InvalidEnumArgumentException>("value", () => item.ImageAlign = value);
4732
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => item.ImageIndex = -2);
5596
Assert.
Throws
<InvalidEnumArgumentException>("value", () => item.ImageScaling = value);
6148
Assert.
Throws
<InvalidEnumArgumentException>("value", () => item.MergeAction = value);
6437
Assert.
Throws
<InvalidEnumArgumentException>("value", () => item.Overflow = value);
7410
Assert.
Throws
<InvalidEnumArgumentException>("value", () => item.RightToLeft = value);
8494
Assert.
Throws
<InvalidEnumArgumentException>("value", () => item.TextAlign = value);
8768
Assert.
Throws
<InvalidEnumArgumentException>("value", () => item.TextDirection = value);
9019
Assert.
Throws
<InvalidEnumArgumentException>("value", () => item.TextImageRelation = value);
10237
Assert.
Throws
<ArgumentNullException>("data", () => item.DoDragDrop(null, DragDropEffects.All));
System\Windows\Forms\ToolStripItemTextRenderEventArgsTests.cs (2)
68
Assert.
Throws
<ArgumentNullException>("item", () => new ToolStripItemTextRenderEventArgs(graphics, null, "", new Rectangle(1, 2, 3, 4), Color.Red, SystemFonts.DefaultFont, TextFormatFlags.Top));
69
Assert.
Throws
<ArgumentNullException>("item", () => new ToolStripItemTextRenderEventArgs(graphics, null, "", new Rectangle(1, 2, 3, 4), Color.Red, SystemFonts.DefaultFont, ContentAlignment.TopLeft));
System\Windows\Forms\ToolStripPanelTests.cs (1)
201
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => panel.AutoScrollMargin = value);
System\Windows\Forms\ToolStripRendererTests.cs (1)
25
Assert.
Throws
<ArgumentNullException>("normalImage", () => ToolStripRenderer.CreateDisabledImage(null));
System\Windows\Forms\ToolStripSeparatorTests.cs (5)
224
Assert.
Throws
<InvalidEnumArgumentException>("value", () => item.DisplayStyle = value);
469
Assert.
Throws
<InvalidEnumArgumentException>("value", () => item.ImageAlign = value);
646
Assert.
Throws
<InvalidEnumArgumentException>("value", () => item.TextAlign = value);
677
Assert.
Throws
<InvalidEnumArgumentException>("value", () => item.TextDirection = value);
704
Assert.
Throws
<InvalidEnumArgumentException>("value", () => item.TextImageRelation = value);
System\Windows\Forms\ToolStripTests.cs (9)
328
Assert.
Throws
<ArgumentNullException>("toolStripItems", () => new ToolStrip(null));
2244
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.DefaultDropDownDirection = value);
2669
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.Dock = value);
2866
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.GripStyle = value);
3435
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.RenderMode = value);
3567
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.RightToLeft = value);
4096
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.TextDirection = value);
4790
Assert.
Throws
<InvalidEnumArgumentException>("direction", () => toolStrip.GetNextItem(new SubToolStripItem(), direction));
4791
Assert.
Throws
<InvalidEnumArgumentException>("direction", () => toolStrip.GetNextItem(null, direction));
System\Windows\Forms\ToolTipTests.cs (7)
78
Assert.
Throws
<ArgumentNullException>("cont", () => new ToolTip(null));
230
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => toolTip.AutomaticDelay = -1);
277
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => toolTip.AutoPopDelay = -1);
355
Assert.
Throws
<ArgumentException>("value", () => toolTip.ForeColor = Color.Empty);
402
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => toolTip.InitialDelay = -1);
487
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => toolTip.ReshowDelay = -1);
563
Assert.
Throws
<InvalidEnumArgumentException>("value", () => toolTip.ToolTipIcon = value);
System\Windows\Forms\TreeNodeCollectionTests.cs (4)
67
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection[index]);
78
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection[index] = new TreeNode());
340
Assert.
Throws
<ArgumentNullException>("key", () => collection.Find(key, searchAllChildren: true));
341
Assert.
Throws
<ArgumentNullException>("key", () => collection.Find(key, searchAllChildren: false));
System\Windows\Forms\TreeNodeTests.cs (9)
236
Assert.
Throws
<ArgumentNullException>("nodes", () => new TreeNode("text", null));
237
Assert.
Throws
<ArgumentNullException>("nodes", () => new TreeNode("text", 0, 0, null));
251
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => new TreeNode("text", imageIndex, 0));
252
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => new TreeNode("text", imageIndex, 0, Array.Empty<TreeNode>()));
259
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => new TreeNode("text", 0, selectedImageIndex));
260
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => new TreeNode("text", 0, selectedImageIndex, Array.Empty<TreeNode>()));
1306
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => node.ImageIndex = value);
3290
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => node.SelectedImageIndex = value);
3981
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => node.StateImageIndex = value);
System\Windows\Forms\TreeViewImageIndexConverterTests.cs (1)
24
Assert.
Throws
<ArgumentNullException>("destinationType", () => converter.ConvertTo(context: null, culture: null, new object(), destinationType: (Type)null!));
System\Windows\Forms\TreeViewTests.cs (9)
907
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.BackgroundImageLayout = value);
1033
Assert.
Throws
<InvalidEnumArgumentException>("value", () => treeView.BorderStyle = value);
1456
Assert.
Throws
<InvalidEnumArgumentException>("value", () => treeView.DrawMode = value);
2218
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => treeView.ImageIndex = -2);
2686
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => treeView.Indent = value);
2699
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => treeView.Indent = indent);
2798
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => control.ItemHeight = value);
2812
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => control.ItemHeight = indent);
3578
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => treeView.SelectedImageIndex = -2);
System\Windows\Forms\UpDownBaseTests.cs (3)
808
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.BorderStyle = value);
1426
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.TextAlign = value);
1510
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.UpDownAlign = value);
System\Windows\Forms\UserControlTests.cs (4)
666
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.AutoSizeMode = value);
734
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.AutoValidate = value);
790
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.BorderStyle = value);
1683
Assert.
Throws
<InvalidEnumArgumentException>("validationConstraints", () => control.ValidateChildren(validationConstraints));
System\Windows\Forms\VisualStyles\VisualStyleElementTests.cs (1)
30
Assert.
Throws
<ArgumentNullException>("className", () => VisualStyleElement.CreateElement(null, 1, 2));
System\Windows\Forms\VisualStyles\VisualStyleRendererTests.cs (7)
41
Assert.
Throws
<ArgumentNullException>("className", () => new VisualStyleRenderer(null, 0, 0));
116
Assert.
Throws
<ArgumentNullException>("element", () => VisualStyleRenderer.IsElementDefined(null));
217
Assert.
Throws
<ArgumentNullException>("dc", () => renderer.DrawEdge(null, new Rectangle(1, 2, 3, 4), Edges.Top, EdgeStyle.Bump, EdgeEffects.FillInterior));
227
Assert.
Throws
<InvalidEnumArgumentException>("edges", () => renderer.DrawEdge(graphics, new Rectangle(1, 2, 3, 4), edges, EdgeStyle.Bump, EdgeEffects.FillInterior));
237
Assert.
Throws
<InvalidEnumArgumentException>("style", () => renderer.DrawEdge(graphics, new Rectangle(1, 2, 3, 4), Edges.Bottom, style, EdgeEffects.FillInterior));
247
Assert.
Throws
<InvalidEnumArgumentException>("effects", () => renderer.DrawEdge(graphics, new Rectangle(1, 2, 3, 4), Edges.Bottom, EdgeStyle.Bump, effects));
588
Assert.
Throws
<InvalidEnumArgumentException>("prop", () => renderer.GetFont(graphics, value));
System\Windows\Forms\WebBrowserTests.cs (1)
1313
Assert.
Throws
<ArgumentException>("value", () => control.ObjectForScripting = new PrivateClass());
TextBoxBaseTests.cs (6)
690
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.BorderStyle = value);
1590
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.ImeModeBase = value);
1790
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => control.MaxLength = -1);
2931
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => control.SelectionLength = -1);
3108
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => control.SelectionStart = -1);
4613
Assert.
Throws
<ArgumentOutOfRangeException>("lineNumber", () => control.GetFirstCharIndexFromLine(-1));
TrackBarTests.cs (6)
974
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.ImeMode = value);
1035
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => control.LargeChange = -1);
1463
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.Orientation = value);
1769
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => control.SmallChange = -1);
1962
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.TickStyle = value);
2195
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => control.Value = value);
System.Xaml.Tests (151)
System\Windows\Markup\ArrayExtensionTests.cs (2)
36
Assert.
Throws
<ArgumentNullException>("arrayType", () => new ArrayExtension((Type)null!));
64
Assert.
Throws
<ArgumentNullException>("elements", () => new ArrayExtension((Array)null!));
System\Windows\Markup\NameReferenceConverterTests.cs (2)
70
Assert.
Throws
<ArgumentNullException>("context", () => converter.ConvertFrom(null, CultureInfo.CurrentCulture, "name"));
162
Assert.
Throws
<ArgumentNullException>("context", () => converter.ConvertTo(null, CultureInfo.CurrentCulture, "value", typeof(string)));
System\Windows\Markup\ReferenceTests.cs (1)
66
Assert.
Throws
<ArgumentNullException>("serviceProvider", () => reference.ProvideValue(null));
System\Windows\Markup\StaticExtensionTests.cs (4)
35
Assert.
Throws
<ArgumentNullException>("member", () => new StaticExtension(null));
119
Assert.
Throws
<ArgumentNullException>("serviceProvider", () => extension.ProvideValue(null));
181
Assert.
Throws
<ArgumentNullException>("value", () => extension.Member = null);
196
Assert.
Throws
<ArgumentNullException>("value", () => extension.MemberType = null);
System\Windows\Markup\TypeExtensionTests.cs (5)
35
Assert.
Throws
<ArgumentNullException>("typeName", () => new TypeExtension((string)null!));
50
Assert.
Throws
<ArgumentNullException>("type", () => new TypeExtension((Type)null!));
90
Assert.
Throws
<ArgumentNullException>("serviceProvider", () => extension.ProvideValue(null));
141
Assert.
Throws
<ArgumentNullException>("value", () => extension.TypeName = null);
157
Assert.
Throws
<ArgumentNullException>("value", () => extension.Type = null);
System\Windows\Markup\ValueSerializerTests.cs (6)
206
Assert.
Throws
<ArgumentNullException>("typeName", () => ValueSerializer.GetSerializerFor(typeof(ClassWithNullStringTypeConverterAttribute)));
207
Assert.
Throws
<ArgumentNullException>("typeName", () => ValueSerializer.GetSerializerFor(typeof(ClassWithNullStringTypeConverterAttribute), null!));
228
Assert.
Throws
<ArgumentNullException>("type", () => ValueSerializer.GetSerializerFor((Type)null!));
229
Assert.
Throws
<ArgumentNullException>("type", () => ValueSerializer.GetSerializerFor((Type)null!, null));
293
Assert.
Throws
<ArgumentNullException>("descriptor", () => ValueSerializer.GetSerializerFor((PropertyDescriptor)null!));
294
Assert.
Throws
<ArgumentNullException>("descriptor", () => ValueSerializer.GetSerializerFor((PropertyDescriptor)null!, null));
System\Windows\Markup\XamlDeferLoadAttributeTests.cs (4)
26
Assert.
Throws
<ArgumentNullException>("loaderType", () => new XamlDeferLoadAttribute(null!, typeof(int)));
32
Assert.
Throws
<ArgumentNullException>("contentType", () => new XamlDeferLoadAttribute(typeof(int), null!));
50
Assert.
Throws
<ArgumentNullException>("loaderType", () => new XamlDeferLoadAttribute(null!, "contentType"));
56
Assert.
Throws
<ArgumentNullException>("contentType", () => new XamlDeferLoadAttribute("loaderType", null!));
System\Windows\Markup\XDataTests.cs (2)
43
Assert.
Throws
<ArgumentNullException>("s", () => data.XmlReader);
68
Assert.
Throws
<ArgumentNullException>("s", () => data.XmlReader);
System\Windows\Markup\XmlnsCompatibleWithAttributeTests.cs (2)
23
Assert.
Throws
<ArgumentNullException>("oldNamespace", () => new XmlnsCompatibleWithAttribute(null!, "newNamespace"));
29
Assert.
Throws
<ArgumentNullException>("newNamespace", () => new XmlnsCompatibleWithAttribute("oldNamespace", null!));
System\Windows\Markup\XmlnsDefinitionAttributeTests.cs (2)
24
Assert.
Throws
<ArgumentNullException>("xmlNamespace", () => new XmlnsDefinitionAttribute(null!, "clrNamespace"));
30
Assert.
Throws
<ArgumentNullException>("clrNamespace", () => new XmlnsDefinitionAttribute("xmlNamespace", null!));
System\Windows\Markup\XmlnsPrefixAttributeTests.cs (2)
23
Assert.
Throws
<ArgumentNullException>("xmlNamespace", () => new XmlnsPrefixAttribute(null!, "prefix"));
29
Assert.
Throws
<ArgumentNullException>("prefix", () => new XmlnsPrefixAttribute("xmlNamespace", null!));
System\Xaml\Replacements\DateTimeConverter2Tests.cs (1)
112
Assert.
Throws
<ArgumentNullException>("destinationType", () => converter.ConvertTo(DateTime.MinValue, null!));
System\Xaml\Replacements\DateTimeOffsetConverter2Tests.cs (1)
120
Assert.
Throws
<ArgumentNullException>("destinationType", () => converter.ConvertTo(DateTimeOffset.MinValue, null!));
System\Xaml\Replacements\EventConverterTests.cs (1)
184
Assert.
Throws
<ArgumentNullException>("destinationType", () => converter.ConvertTo(typeof(int), null!));
System\Xaml\Replacements\TypeListConverterTests.cs (1)
81
Assert.
Throws
<ArgumentNullException>("destinationType", () => converter.ConvertTo(Array.Empty<Type>(), null!));
System\Xaml\Replacements\TypeTypeConverterTests.cs (1)
279
Assert.
Throws
<ArgumentNullException>("destinationType", () => converter.ConvertTo(typeof(int), null!));
System\Xaml\Replacements\TypeUriConverterTests.cs (2)
60
Assert.
Throws
<ArgumentNullException>("sourceType", () => converter.CanConvertFrom(null!));
178
Assert.
Throws
<ArgumentNullException>("destinationType", () => converter.ConvertTo(new Uri("http://google.com"), null!));
System\Xaml\Schema\XamlMemberInvokerTests.cs (2)
45
Assert.
Throws
<ArgumentNullException>("member", () => new XamlMemberInvoker(null));
91
Assert.
Throws
<ArgumentNullException>("instance", () => XamlMemberInvoker.UnknownInvoker.GetValue(null));
System\Xaml\Schema\XamlTypeInvokerTests.cs (3)
36
Assert.
Throws
<ArgumentNullException>("type", () => new XamlTypeInvoker(null));
388
Assert.
Throws
<ArgumentNullException>("contentType", () => invoker.GetAddMethod(null));
521
Assert.
Throws
<ArgumentNullException>("instance", () => invoker.GetItems(null));
System\Xaml\Schema\XamlTypeNameTests.cs (11)
78
Assert.
Throws
<ArgumentNullException>("xamlType", () => new XamlTypeName(null));
225
Assert.
Throws
<ArgumentNullException>("typeNameList", () => XamlTypeName.ToString(null, new CustomNamespacePrefixLookup()));
231
Assert.
Throws
<ArgumentNullException>("prefixLookup", () => XamlTypeName.ToString(Array.Empty<XamlTypeName>(), null));
317
Assert.
Throws
<ArgumentNullException>("typeName", () => XamlTypeName.Parse(null, new CustomXamlNamespaceResolver()));
320
Assert.
Throws
<ArgumentNullException>("typeName", () => XamlTypeName.TryParse(null, new CustomXamlNamespaceResolver(), out result));
327
Assert.
Throws
<ArgumentNullException>("namespaceResolver", () => XamlTypeName.Parse("typeName", null));
330
Assert.
Throws
<ArgumentNullException>("namespaceResolver", () => XamlTypeName.TryParse("typeName", null, out result));
440
Assert.
Throws
<ArgumentNullException>("typeNameList", () => XamlTypeName.ParseList(null, new CustomXamlNamespaceResolver()));
443
Assert.
Throws
<ArgumentNullException>("typeNameList", () => XamlTypeName.TryParseList(null, new CustomXamlNamespaceResolver(), out result));
450
Assert.
Throws
<ArgumentNullException>("namespaceResolver", () => XamlTypeName.ParseList("typeNameList", null));
453
Assert.
Throws
<ArgumentNullException>("namespaceResolver", () => XamlTypeName.TryParseList("typeNameList", null, out result));
System\Xaml\Schema\XamlTypeTypeConverterTests.cs (1)
277
Assert.
Throws
<ArgumentNullException>("destinationType", () => converter.ConvertTo(type, null!));
System\Xaml\XamlBackgroundReaderTests.cs (2)
49
Assert.
Throws
<ArgumentNullException>("wrappedReader", () => new XamlBackgroundReader(null));
61
Assert.
Throws
<ArgumentNullException>("schemaContext", () => new XamlBackgroundReader(new SubXamlReaderWithLineInfo()));
System\Xaml\XamlDirectiveTests.cs (4)
42
Assert.
Throws
<ArgumentNullException>("xamlType", () => new XamlDirective(new string[] { "namespace"}, "name", null, null, AllowedMemberLocations.Any));
49
Assert.
Throws
<ArgumentNullException>("xamlNamespaces", () => new XamlDirective(null, "name", type, null, AllowedMemberLocations.Any));
56
Assert.
Throws
<ArgumentException>("xamlNamespaces", () => new XamlDirective(new string?[] { null }, "name", type, null, AllowedMemberLocations.Any));
76
Assert.
Throws
<ArgumentNullException>("xamlNamespace", () => new XamlDirective(null, "name"));
System\Xaml\XamlDuplicateMemberExceptionTests.cs (1)
85
Assert.
Throws
<ArgumentNullException>("info", () => new SubXamlDuplicateMemberException(null!, new StreamingContext()));
System\Xaml\XamlExceptionTests.cs (1)
75
Assert.
Throws
<ArgumentNullException>("info", () => new SubXamlException(null!, new StreamingContext()));
System\Xaml\XamlInternalExceptionTests.cs (1)
55
Assert.
Throws
<ArgumentNullException>("info", () => new SubXamlInternalException(null!, new StreamingContext()));
System\Xaml\XamlMemberTests.cs (34)
37
Assert.
Throws
<ArgumentNullException>("name", () => new XamlMember(null, type, false));
43
Assert.
Throws
<ArgumentNullException>("declaringType", () => new XamlMember("name", null, false));
98
Assert.
Throws
<ArgumentNullException>("propertyInfo", () => new XamlMember((PropertyInfo)null!, new XamlSchemaContext()));
99
Assert.
Throws
<ArgumentNullException>("propertyInfo", () => new XamlMember((PropertyInfo)null!, new XamlSchemaContext(), XamlMemberInvoker.UnknownInvoker));
154
Assert.
Throws
<ArgumentNullException>("eventInfo", () => new XamlMember((EventInfo)null!, new XamlSchemaContext()));
155
Assert.
Throws
<ArgumentNullException>("eventInfo", () => new XamlMember((EventInfo)null!, new XamlSchemaContext(), XamlMemberInvoker.UnknownInvoker));
215
Assert.
Throws
<ArgumentNullException>("attachablePropertyName", () => new XamlMember(null, getter, null, new XamlSchemaContext()));
216
Assert.
Throws
<ArgumentNullException>("attachablePropertyName", () => new XamlMember(null, getter, null, new XamlSchemaContext(), XamlMemberInvoker.UnknownInvoker));
233
Assert.
Throws
<ArgumentException>("getter", () => new XamlMember("name", getter, null, new XamlSchemaContext()));
234
Assert.
Throws
<ArgumentException>("getter", () => new XamlMember("name", getter, null, new XamlSchemaContext(), XamlMemberInvoker.UnknownInvoker));
243
Assert.
Throws
<ArgumentException>("setter", () => new XamlMember("name", null, setter, new XamlSchemaContext()));
244
Assert.
Throws
<ArgumentException>("setter", () => new XamlMember("name", null, setter, new XamlSchemaContext(), XamlMemberInvoker.UnknownInvoker));
300
Assert.
Throws
<ArgumentNullException>("attachableEventName", () => new XamlMember(null, adder, new XamlSchemaContext()));
301
Assert.
Throws
<ArgumentNullException>("attachableEventName", () => new XamlMember(null, adder, new XamlSchemaContext(), XamlMemberInvoker.UnknownInvoker));
307
Assert.
Throws
<ArgumentNullException>("adder", () => new XamlMember("name", null, new XamlSchemaContext()));
308
Assert.
Throws
<ArgumentNullException>("adder", () => new XamlMember("name", null, new XamlSchemaContext(), XamlMemberInvoker.UnknownInvoker));
317
Assert.
Throws
<ArgumentException>("adder", () => new XamlMember("name", adder, new XamlSchemaContext()));
318
Assert.
Throws
<ArgumentException>("adder", () => new XamlMember("name", adder, new XamlSchemaContext(), XamlMemberInvoker.UnknownInvoker));
326
Assert.
Throws
<ArgumentNullException>("schemaContext", () => new XamlMember(propertyInfo, null));
327
Assert.
Throws
<ArgumentNullException>("schemaContext", () => new XamlMember(eventInfo, null));
328
Assert.
Throws
<ArgumentNullException>("schemaContext", () => new XamlMember(propertyInfo, null, XamlMemberInvoker.UnknownInvoker));
329
Assert.
Throws
<ArgumentNullException>("schemaContext", () => new XamlMember(eventInfo, null, XamlMemberInvoker.UnknownInvoker));
330
Assert.
Throws
<ArgumentNullException>("schemaContext", () => new XamlMember(propertyInfo.Name, propertyInfo.GetGetMethod(), propertyInfo.GetSetMethod(), null));
331
Assert.
Throws
<ArgumentNullException>("schemaContext", () => new XamlMember(propertyInfo.Name, propertyInfo.GetGetMethod(), propertyInfo.GetSetMethod(), null, XamlMemberInvoker.UnknownInvoker));
332
Assert.
Throws
<ArgumentNullException>("schemaContext", () => new XamlMember(eventInfo.Name, eventInfo.GetAddMethod(), null));
333
Assert.
Throws
<ArgumentNullException>("schemaContext", () => new XamlMember(eventInfo.Name, eventInfo.GetAddMethod(), null, XamlMemberInvoker.UnknownInvoker));
535
Assert.
Throws
<ArgumentNullException>("typeName", () => member.LookupDeferringLoaderEntry());
536
Assert.
Throws
<ArgumentNullException>("typeName", () => member.DeferringLoader);
687
Assert.
Throws
<ArgumentNullException>("key", () => member.LookupDependsOnEntry());
688
Assert.
Throws
<ArgumentNullException>("key", () => member.DependsOn);
1823
Assert.
Throws
<ArgumentNullException>("typeName", () => member.LookupTypeConverterEntry());
1824
Assert.
Throws
<ArgumentNullException>("typeName", () => member.TypeConverter);
2172
Assert.
Throws
<ArgumentNullException>("typeName", () => member.LookupValueSerializerEntry());
2173
Assert.
Throws
<ArgumentNullException>("typeName", () => member.ValueSerializer);
System\Xaml\XamlNodeListTests.cs (3)
33
Assert.
Throws
<ArgumentNullException>("schemaContext", () => new XamlNodeList(null));
34
Assert.
Throws
<ArgumentNullException>("schemaContext", () => new XamlNodeList(null, 64));
41
Assert.
Throws
<ArgumentOutOfRangeException>("capacity", () => new XamlNodeList(context, -1));
System\Xaml\XamlNodeQueueTests.cs (1)
25
Assert.
Throws
<ArgumentNullException>("schemaContext", () => new XamlNodeQueue(null));
System\Xaml\XamlObjectEventArgsTests.cs (1)
24
Assert.
Throws
<ArgumentNullException>("instance", () => new XamlObjectEventArgs(null));
System\Xaml\XamlObjectReaderExceptionTests.cs (1)
55
Assert.
Throws
<ArgumentNullException>("info", () => new SubXamlObjectReaderException(null!, new StreamingContext()));
System\Xaml\XamlObjectWriterExceptionTests.cs (1)
55
Assert.
Throws
<ArgumentNullException>("info", () => new SubXamlObjectWriterException(null!, new StreamingContext()));
System\Xaml\XamlObjectWriterSettingsTests.cs (1)
73
Assert.
Throws
<ArgumentNullException>("settings", () => new XamlObjectWriterSettings(null));
System\Xaml\XamlParseExceptionTests.cs (1)
55
Assert.
Throws
<ArgumentNullException>("info", () => new SubXamlParseException(null!, new StreamingContext()));
System\Xaml\XamlSchemaContextTests.cs (7)
274
Assert.
Throws
<ArgumentNullException>("xmlns", () => context.GetPreferredPrefix(null));
950
Assert.
Throws
<ArgumentNullException>("xamlNamespace", () => context.GetXamlDirective(null, "name"));
957
Assert.
Throws
<ArgumentNullException>("name", () => context.GetXamlDirective("xamlNamespace", null));
964
Assert.
Throws
<ArgumentNullException>("xamlTypeName", () => context.GetXamlType((XamlTypeName)null!));
971
Assert.
Throws
<ArgumentException>("xamlTypeName", () => context.GetXamlType(new XamlTypeName(null, "name")));
978
Assert.
Throws
<ArgumentException>("xamlTypeName", () => context.GetXamlType(new XamlTypeName("xamlNamespace", null)));
1008
Assert.
Throws
<ArgumentNullException>("type", () => context.GetXamlType((Type)null!));
System\Xaml\XamlSchemaExceptionTests.cs (1)
55
Assert.
Throws
<ArgumentNullException>("info", () => new SubXamlSchemaException(null!, new StreamingContext()));
System\Xaml\XamlServicesTests.cs (6)
16
Assert.
Throws
<ArgumentNullException>("xaml", () => XamlServices.Parse(null));
22
Assert.
Throws
<ArgumentNullException>("fileName", () => XamlServices.Load((string)null!));
28
Assert.
Throws
<ArgumentNullException>("stream", () => XamlServices.Load((Stream)null!));
34
Assert.
Throws
<ArgumentNullException>("textReader", () => XamlServices.Load((TextReader)null!));
40
Assert.
Throws
<ArgumentNullException>("xmlReader", () => XamlServices.Load((XmlReader)null!));
46
Assert.
Throws
<ArgumentNullException>("xamlReader", () => XamlServices.Load((XamlReader)null!));
System\Xaml\XamlTypeTests.cs (28)
46
Assert.
Throws
<ArgumentNullException>("unknownTypeNamespace", () => new XamlType(null, "unknownTypeName", Array.Empty<XamlType>(), new XamlSchemaContext()));
52
Assert.
Throws
<ArgumentNullException>("unknownTypeName", () => new XamlType("unknownTypeNamespace", null, Array.Empty<XamlType>(), new XamlSchemaContext()));
76
Assert.
Throws
<ArgumentNullException>("typeName", () => new SubXamlType(null!, Array.Empty<XamlType>(), new XamlSchemaContext()));
130
Assert.
Throws
<ArgumentNullException>("underlyingType", () => new XamlType(null, new XamlSchemaContext()));
131
Assert.
Throws
<ArgumentNullException>("underlyingType", () => new XamlType(null, new XamlSchemaContext(), XamlTypeInvoker.UnknownInvoker));
145
Assert.
Throws
<ArgumentNullException>("schemaContext", () => new XamlType("unknownTypeNamespace", "unknownTypeName", Array.Empty<XamlType>(), null));
146
Assert.
Throws
<ArgumentNullException>("schemaContext", () => new XamlType(typeof(int), null));
147
Assert.
Throws
<ArgumentNullException>("schemaContext", () => new XamlType(typeof(int), null, XamlTypeInvoker.UnknownInvoker));
148
Assert.
Throws
<ArgumentNullException>("schemaContext", () => new SubXamlType("typeName", Array.Empty<XamlType>(), null));
622
Assert.
Throws
<ArgumentNullException>("key", () => type.LookupAliasedPropertyEntry(null!));
623
Assert.
Throws
<ArgumentNullException>("key", () => type.GetAliasedProperty(null));
1437
Assert.
Throws
<ArgumentNullException>("type", () => type.LookupAllowedContentTypesEntry());
1438
Assert.
Throws
<ArgumentNullException>("type", () => type.AllowedContentTypes);
1688
Assert.
Throws
<ArgumentNullException>("key", () => type.GetAttachableMember(null));
1696
Assert.
Throws
<ArgumentNullException>("key", () => type.GetAttachableMember(null));
2225
Assert.
Throws
<ArgumentNullException>("type", () => type.LookupContentWrappersEntry());
2226
Assert.
Throws
<ArgumentNullException>("type", () => type.ContentWrappers);
2494
Assert.
Throws
<ArgumentNullException>("typeName", () => type.LookupDeferringLoaderEntry());
2495
Assert.
Throws
<ArgumentNullException>("typeName", () => type.DeferringLoader);
3659
Assert.
Throws
<ArgumentNullException>("name", () => type.LookupMemberEntry(null!, false));
3660
Assert.
Throws
<ArgumentNullException>("key", () => type.GetMember(null));
3668
Assert.
Throws
<ArgumentNullException>("key", () => type.GetMember(null));
3892
Assert.
Throws
<ArgumentException>("target", () => type.LookupSetMarkupExtensionHandlerEntry());
4091
Assert.
Throws
<ArgumentException>("target", () => type.LookupSetTypeConverterHandlerEntry());
4388
Assert.
Throws
<ArgumentNullException>("typeName", () => type.LookupTypeConverterEntry());
4389
Assert.
Throws
<ArgumentNullException>("typeName", () => type.TypeConverter);
4794
Assert.
Throws
<ArgumentNullException>("typeName", () => type.LookupValueSerializerEntry());
4795
Assert.
Throws
<ArgumentNullException>("typeName", () => type.ValueSerializer);
System\Xaml\XamlXmlWriterExceptionTests.cs (1)
55
Assert.
Throws
<ArgumentNullException>("info", () => new SubXamlXmlWriterException(null!, new StreamingContext()));
WindowsBase.Tests (166)
System\ComponentModel\DependencyPropertyDescriptorTests.cs (3)
30
Assert.
Throws
<ArgumentNullException>("property", () => DependencyPropertyDescriptor.FromProperty(null));
60
Assert.
Throws
<ArgumentNullException>("dependencyProperty", () => DependencyPropertyDescriptor.FromProperty(null, typeof(object)));
67
Assert.
Throws
<ArgumentNullException>("targetType", () => DependencyPropertyDescriptor.FromProperty(property, null));
System\ComponentModel\SortDescriptionCollectionTests.cs (2)
116
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection[index]);
127
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection[index] = description);
System\ComponentModel\SortDescriptionTests.cs (2)
35
Assert.
Throws
<InvalidEnumArgumentException>("direction", () => new SortDescription("Name", direction));
60
Assert.
Throws
<InvalidEnumArgumentException>("value", () => description.Direction = value);
System\IO\Packaging\EncryptedPackageEnvelopeTests.cs (4)
13
Assert.
Throws
<ArgumentNullException>("envelopeStream", () => EncryptedPackageEnvelope.Open((Stream)null!));
33
Assert.
Throws
<ArgumentNullException>("envelopeFileName", () => EncryptedPackageEnvelope.Open((string)null!));
34
Assert.
Throws
<ArgumentNullException>("envelopeFileName", () => EncryptedPackageEnvelope.Open(null!, FileAccess.Read));
35
Assert.
Throws
<ArgumentNullException>("envelopeFileName", () => EncryptedPackageEnvelope.Open(null!, FileAccess.Read, FileShare.Read));
System\IO\Packaging\PackageDigitalSignatureManagerTests.cs (11)
43
Assert.
Throws
<ArgumentNullException>("package", () => new PackageDigitalSignatureManager(null));
63
Assert.
Throws
<ArgumentNullException>("certificate", () => PackageDigitalSignatureManager.VerifyCertificate(null));
72
Assert.
Throws
<ArgumentException>("handle", () => PackageDigitalSignatureManager.VerifyCertificate(c));
101
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => manager.CertificateOption = value);
128
Assert.
Throws
<ArgumentNullException>("value", () => manager.HashAlgorithm = null);
136
Assert.
Throws
<ArgumentException>("value", () => manager.HashAlgorithm = string.Empty);
190
Assert.
Throws
<ArgumentNullException>("value", () => manager.TimeFormat = null);
233
Assert.
Throws
<ArgumentNullException>("certificate", () => manager.Countersign(null));
234
Assert.
Throws
<ArgumentNullException>("certificate", () => manager.Countersign(null, Array.Empty<Uri>()));
246
Assert.
Throws
<ArgumentNullException>("signatures", () => manager.Countersign(c, null));
262
Assert.
Throws
<ArgumentNullException>("signatureUri", () => manager.GetSignature(null));
System\Security\RightsManagement\ContentGrantTests.cs (4)
69
Assert.
Throws
<ArgumentNullException>("user", () => new ContentGrant(null, ContentRight.View));
70
Assert.
Throws
<ArgumentNullException>("user", () => new ContentGrant(null, ContentRight.View, DateTime.MinValue, DateTime.MaxValue));
79
Assert.
Throws
<ArgumentOutOfRangeException>("right", () => new ContentGrant(user, right));
86
Assert.
Throws
<ArgumentOutOfRangeException>("validFrom", () => new ContentGrant(user, ContentRight.View, new DateTime(2023, 01, 01), new DateTime(2023, 01, 01).AddTicks(-1)));
System\Security\RightsManagement\ContentUserTests.cs (4)
30
Assert.
Throws
<ArgumentNullException>("name", () => new ContentUser(null!, AuthenticationType.Windows));
38
Assert.
Throws
<ArgumentOutOfRangeException>("name", () => new ContentUser(name, AuthenticationType.Windows));
46
Assert.
Throws
<ArgumentOutOfRangeException>("authenticationType", () => new ContentUser("name", authenticationType));
55
Assert.
Throws
<ArgumentOutOfRangeException>("name", () => new ContentUser(name, AuthenticationType.Internal));
System\Security\RightsManagement\PublishLicenseTests.cs (5)
100
Assert.
Throws
<ArgumentNullException>("signedPublishLicense", () => new PublishLicense(null!));
119
Assert.
Throws
<ArgumentNullException>("uriString", () => new PublishLicense(PublishLicenseTemplate));
327
Assert.
Throws
<ArgumentNullException>("secureEnvironment", () => license.AcquireUseLicense(null));
334
Assert.
Throws
<ArgumentNullException>("secureEnvironment", () => license.AcquireUseLicenseNoUI(null));
347
Assert.
Throws
<ArgumentNullException>("cryptoProvider", () => license.DecryptUnsignedPublishLicense(null));
System\Security\RightsManagement\RightsManagementExceptionTests.cs (1)
233
Assert.
Throws
<ArgumentNullException>("info", () => new SubRightsManagementException((SerializationInfo)null!, default));
System\Security\RightsManagement\SecureEnvironmentTests.cs (10)
32
Assert.
Throws
<ArgumentNullException>("applicationManifest", () => SecureEnvironment.Create(null!, AuthenticationType.Windows, UserActivationMode.Permanent));
33
Assert.
Throws
<ArgumentNullException>("applicationManifest", () => SecureEnvironment.Create(null!, new ContentUser("name", AuthenticationType.Windows)));
60
Assert.
Throws
<ArgumentOutOfRangeException>("authentication", () => SecureEnvironment.Create("manifest", authentication, UserActivationMode.Permanent));
68
Assert.
Throws
<ArgumentOutOfRangeException>("userActivationMode", () => SecureEnvironment.Create("manifest", AuthenticationType.Windows, userActivationMode));
74
Assert.
Throws
<ArgumentNullException>("user", () => SecureEnvironment.Create("manifest", null!));
95
Assert.
Throws
<ArgumentOutOfRangeException>("user", () => SecureEnvironment.Create("manifest", user));
104
Assert.
Throws
<ArgumentOutOfRangeException>("user", () => SecureEnvironment.Create("manifest", user));
145
Assert.
Throws
<ArgumentNullException>("user", () => SecureEnvironment.IsUserActivated(null!));
152
Assert.
Throws
<ArgumentOutOfRangeException>("user", () => SecureEnvironment.IsUserActivated(user));
161
Assert.
Throws
<ArgumentOutOfRangeException>("user", () => SecureEnvironment.IsUserActivated(user));
System\Security\RightsManagement\UnsignedPublishLicenseTests.cs (2)
35
Assert.
Throws
<ArgumentNullException>("publishLicenseTemplate", () => new UnsignedPublishLicense(null));
127
Assert.
Throws
<ArgumentNullException>("secureEnvironment", () => license.Sign(null!, out useLicense));
System\Security\RightsManagement\UseLicenseTests.cs (1)
11
Assert.
Throws
<ArgumentNullException>("useLicense", () => new UseLicense(null!));
System\Windows\AttachedPropertyBrowsableForTypeAttributeTests.cs (1)
23
Assert.
Throws
<ArgumentNullException>("targetType", () => new AttachedPropertyBrowsableForTypeAttribute(null!));
System\Windows\AttachedPropertyBrowsableWhenAttributePresentAttributeTests.cs (1)
22
Assert.
Throws
<ArgumentNullException>("attributeType", () => new AttachedPropertyBrowsableWhenAttributePresentAttribute(null!));
System\Windows\DependencyObjectTests.cs (2)
1603
Assert.
Throws
<ArgumentNullException>("dp", () => obj.GetValue(null!));
2014
Assert.
Throws
<ArgumentNullException>("dp", () => obj.ReadLocalValue(null!));
System\Windows\DependencyObjectTypeTests.cs (1)
44
Assert.
Throws
<ArgumentNullException>("systemType", () => DependencyObjectType.FromSystemType(null!));
System\Windows\DependencyPropertyTests.cs (36)
216
Assert.
Throws
<ArgumentNullException>("name", () => DependencyProperty.Register(null, typeof(int), typeof(DependencyPropertyTests)));
222
Assert.
Throws
<ArgumentException>("name", () => DependencyProperty.Register(string.Empty, typeof(int), typeof(DependencyPropertyTests)));
228
Assert.
Throws
<ArgumentNullException>("propertyType", () => DependencyProperty.Register(MethodBase.GetCurrentMethod()!.Name, null!, typeof(DependencyPropertyTests)));
229
Assert.
Throws
<ArgumentNullException>("propertyType", () => DependencyProperty.Register(MethodBase.GetCurrentMethod()!.Name, null!, typeof(DependencyPropertyTests), new PropertyMetadata()));
230
Assert.
Throws
<ArgumentNullException>("propertyType", () => DependencyProperty.Register(MethodBase.GetCurrentMethod()!.Name, null!, typeof(DependencyPropertyTests), new PropertyMetadata(), value => true));
256
Assert.
Throws
<ArgumentNullException>("ownerType", () => DependencyProperty.Register(MethodBase.GetCurrentMethod()!.Name, typeof(int), null!));
257
Assert.
Throws
<ArgumentNullException>("ownerType", () => DependencyProperty.Register(MethodBase.GetCurrentMethod()!.Name, typeof(int), null!, new PropertyMetadata()));
258
Assert.
Throws
<ArgumentNullException>("ownerType", () => DependencyProperty.Register(MethodBase.GetCurrentMethod()!.Name, typeof(int), null!, new PropertyMetadata(), value => true));
529
Assert.
Throws
<ArgumentNullException>("name", () => DependencyProperty.RegisterAttached(null, typeof(int), typeof(DependencyPropertyTests)));
530
Assert.
Throws
<ArgumentNullException>("name", () => DependencyProperty.RegisterAttached(null, typeof(int), typeof(DependencyPropertyTests), new PropertyMetadata()));
531
Assert.
Throws
<ArgumentNullException>("name", () => DependencyProperty.RegisterAttached(null, typeof(int), typeof(DependencyPropertyTests), new PropertyMetadata(), value => true));
537
Assert.
Throws
<ArgumentException>("name", () => DependencyProperty.RegisterAttached(string.Empty, typeof(int), typeof(DependencyPropertyTests)));
538
Assert.
Throws
<ArgumentException>("name", () => DependencyProperty.RegisterAttached(string.Empty, typeof(int), typeof(DependencyPropertyTests), new PropertyMetadata()));
539
Assert.
Throws
<ArgumentException>("name", () => DependencyProperty.RegisterAttached(string.Empty, typeof(int), typeof(DependencyPropertyTests), new PropertyMetadata(), value => true));
545
Assert.
Throws
<ArgumentNullException>("propertyType", () => DependencyProperty.RegisterAttached(MethodBase.GetCurrentMethod()!.Name, null!, typeof(DependencyPropertyTests)));
546
Assert.
Throws
<ArgumentNullException>("propertyType", () => DependencyProperty.RegisterAttached(MethodBase.GetCurrentMethod()!.Name, null!, typeof(DependencyPropertyTests), new PropertyMetadata()));
547
Assert.
Throws
<ArgumentNullException>("propertyType", () => DependencyProperty.RegisterAttached(MethodBase.GetCurrentMethod()!.Name, null!, typeof(DependencyPropertyTests), new PropertyMetadata(), value => true));
573
Assert.
Throws
<ArgumentNullException>("ownerType", () => DependencyProperty.RegisterAttached(MethodBase.GetCurrentMethod()!.Name, typeof(int), null!));
574
Assert.
Throws
<ArgumentNullException>("ownerType", () => DependencyProperty.RegisterAttached(MethodBase.GetCurrentMethod()!.Name, typeof(int), null!, new PropertyMetadata()));
575
Assert.
Throws
<ArgumentNullException>("ownerType", () => DependencyProperty.RegisterAttached(MethodBase.GetCurrentMethod()!.Name, typeof(int), null!, new PropertyMetadata(), value => true));
815
Assert.
Throws
<ArgumentNullException>("name", () => DependencyProperty.RegisterReadOnly(null, typeof(int), typeof(DependencyObject), new PropertyMetadata()));
816
Assert.
Throws
<ArgumentNullException>("name", () => DependencyProperty.RegisterReadOnly(null, typeof(int), typeof(DependencyObject), new PropertyMetadata(), value => true));
822
Assert.
Throws
<ArgumentException>("name", () => DependencyProperty.RegisterReadOnly(string.Empty, typeof(int), typeof(DependencyObject), new PropertyMetadata()));
823
Assert.
Throws
<ArgumentException>("name", () => DependencyProperty.RegisterReadOnly(string.Empty, typeof(int), typeof(DependencyObject), new PropertyMetadata(), value => true));
829
Assert.
Throws
<ArgumentNullException>("propertyType", () => DependencyProperty.RegisterReadOnly(MethodBase.GetCurrentMethod()!.Name, null!, typeof(DependencyProperty), new PropertyMetadata()));
830
Assert.
Throws
<ArgumentNullException>("propertyType", () => DependencyProperty.RegisterReadOnly(MethodBase.GetCurrentMethod()!.Name, null!, typeof(DependencyProperty), new PropertyMetadata(), value => true));
855
Assert.
Throws
<ArgumentNullException>("ownerType", () => DependencyProperty.RegisterReadOnly(MethodBase.GetCurrentMethod()!.Name, typeof(int), null!, new PropertyMetadata()));
856
Assert.
Throws
<ArgumentNullException>("ownerType", () => DependencyProperty.RegisterReadOnly(MethodBase.GetCurrentMethod()!.Name, typeof(int), null!, new PropertyMetadata(), value => true));
1110
Assert.
Throws
<ArgumentNullException>("name", () => DependencyProperty.RegisterAttachedReadOnly(null, typeof(int), typeof(DependencyPropertyTests), new PropertyMetadata()));
1111
Assert.
Throws
<ArgumentNullException>("name", () => DependencyProperty.RegisterAttachedReadOnly(null, typeof(int), typeof(DependencyPropertyTests), new PropertyMetadata(), value => true));
1117
Assert.
Throws
<ArgumentException>("name", () => DependencyProperty.RegisterAttachedReadOnly(string.Empty, typeof(int), typeof(DependencyPropertyTests), new PropertyMetadata()));
1118
Assert.
Throws
<ArgumentException>("name", () => DependencyProperty.RegisterAttachedReadOnly(string.Empty, typeof(int), typeof(DependencyPropertyTests), new PropertyMetadata(), value => true));
1124
Assert.
Throws
<ArgumentNullException>("propertyType", () => DependencyProperty.RegisterAttachedReadOnly(MethodBase.GetCurrentMethod()!.Name, null!, typeof(DependencyPropertyTests), new PropertyMetadata()));
1125
Assert.
Throws
<ArgumentNullException>("propertyType", () => DependencyProperty.RegisterAttachedReadOnly(MethodBase.GetCurrentMethod()!.Name, null!, typeof(DependencyPropertyTests), new PropertyMetadata(), value => true));
1150
Assert.
Throws
<ArgumentNullException>("ownerType", () => DependencyProperty.RegisterAttachedReadOnly(MethodBase.GetCurrentMethod()!.Name, typeof(int), null!, new PropertyMetadata()));
1151
Assert.
Throws
<ArgumentNullException>("ownerType", () => DependencyProperty.RegisterAttachedReadOnly(MethodBase.GetCurrentMethod()!.Name, typeof(int), null!, new PropertyMetadata(), value => true));
System\Windows\FreezableTests.cs (1)
6164
Assert.
Throws
<ArgumentNullException>("dp", () => obj.GetValue(null!));
System\Windows\Input\KeyConverterTests.cs (3)
223
Assert.
Throws
<ArgumentNullException>("destinationType", () => converter.ConvertTo(value, null!));
224
Assert.
Throws
<ArgumentNullException>("destinationType", () => converter.ConvertTo(null, null, Key.None, null!));
225
Assert.
Throws
<ArgumentNullException>("destinationType", () => converter.ConvertTo(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, Key.None, null!));
System\Windows\Input\ModifierKeysConverterTests.cs (6)
116
Assert.
Throws
<InvalidEnumArgumentException>("value", () => converter.ConvertTo(value, typeof(string)));
117
Assert.
Throws
<InvalidEnumArgumentException>("value", () => converter.ConvertTo(new CustomTypeDescriptorContext(), null, value, typeof(string)));
118
Assert.
Throws
<InvalidEnumArgumentException>("value", () => converter.ConvertTo(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, value, typeof(string)));
189
Assert.
Throws
<ArgumentNullException>("destinationType", () => converter.ConvertTo(value, null!));
190
Assert.
Throws
<ArgumentNullException>("destinationType", () => converter.ConvertTo(null, null, Key.None, null!));
191
Assert.
Throws
<ArgumentNullException>("destinationType", () => converter.ConvertTo(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, Key.None, null!));
System\Windows\Input\ModifierKeysValueSerializerTests.cs (2)
48
Assert.
Throws
<InvalidEnumArgumentException>("value", () => serializer.ConvertToString(key, null));
49
Assert.
Throws
<InvalidEnumArgumentException>("value", () => serializer.ConvertToString(key, new CustomValueSerializerContext()));
System\Windows\Input\TraversalRequestTests.cs (1)
31
Assert.
Throws
<InvalidEnumArgumentException>("focusNavigationDirection", () => new TraversalRequest(focusNavigationDirection));
System\Windows\Int32RectConverterTests.cs (3)
99
Assert.
Throws
<ArgumentNullException>("destinationType", () => converter.ConvertTo(value, null!));
100
Assert.
Throws
<ArgumentNullException>("destinationType", () => converter.ConvertTo(null, null, new Int32Rect(), null!));
101
Assert.
Throws
<ArgumentNullException>("destinationType", () => converter.ConvertTo(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, new Int32Rect(), null!));
System\Windows\Markup\ServiceProvidersTests.cs (2)
71
Assert.
Throws
<ArgumentNullException>("key", () => serviceProviders.GetService(null));
81
Assert.
Throws
<ArgumentNullException>("key", () => serviceProviders.GetService(null));
System\Windows\Media\MatrixConverterTests.cs (3)
99
Assert.
Throws
<ArgumentNullException>("destinationType", () => converter.ConvertTo(value, null!));
100
Assert.
Throws
<ArgumentNullException>("destinationType", () => converter.ConvertTo(null, null, new Matrix(), null!));
101
Assert.
Throws
<ArgumentNullException>("destinationType", () => converter.ConvertTo(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, new Matrix(), null!));
System\Windows\NameScopeTests.cs (9)
35
Assert.
Throws
<ArgumentNullException>("dependencyObject", () => NameScope.GetNameScope(null));
114
Assert.
Throws
<ArgumentNullException>("key", () => nameScope[null]);
208
Assert.
Throws
<ArgumentNullException>("value", () => nameScope["name"] = null);
614
Assert.
Throws
<ArgumentException>("item", () => nameScope.Contains(new KeyValuePair<string, object>(null!, new object())));
615
Assert.
Throws
<ArgumentException>("item", () => nameScope.Contains(default));
673
Assert.
Throws
<ArgumentNullException>("key", () => nameScope.ContainsKey(null!));
958
Assert.
Throws
<ArgumentNullException>("key", () => nameScope.Remove(null));
1018
Assert.
Throws
<ArgumentException>("item", () => nameScope.Remove(new KeyValuePair<string, object>(null!, new object())));
1122
Assert.
Throws
<ArgumentNullException>("key", () => nameScope.TryGetValue(null, out object value));
System\Windows\PointConverterTests.cs (3)
99
Assert.
Throws
<ArgumentNullException>("destinationType", () => converter.ConvertTo(value, null!));
100
Assert.
Throws
<ArgumentNullException>("destinationType", () => converter.ConvertTo(null, null, new Point(), null!));
101
Assert.
Throws
<ArgumentNullException>("destinationType", () => converter.ConvertTo(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, new Point(), null!));
System\Windows\RectConverterTests.cs (3)
99
Assert.
Throws
<ArgumentNullException>("destinationType", () => converter.ConvertTo(value, null!));
100
Assert.
Throws
<ArgumentNullException>("destinationType", () => converter.ConvertTo(null, null, new Rect(), null!));
101
Assert.
Throws
<ArgumentNullException>("destinationType", () => converter.ConvertTo(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, new Rect(), null!));
System\Windows\SizeConverterTests.cs (3)
99
Assert.
Throws
<ArgumentNullException>("destinationType", () => converter.ConvertTo(value, null!));
100
Assert.
Throws
<ArgumentNullException>("destinationType", () => converter.ConvertTo(null, null, new Size(), null!));
101
Assert.
Throws
<ArgumentNullException>("destinationType", () => converter.ConvertTo(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, new Size(), null!));
System\Windows\SplashScreenTests.cs (5)
39
Assert.
Throws
<ArgumentNullException>("resourceName", () => new SplashScreen(null));
40
Assert.
Throws
<ArgumentNullException>("resourceName", () => new SplashScreen(Assembly.GetEntryAssembly(), null));
46
Assert.
Throws
<ArgumentNullException>("resourceName", () => new SplashScreen(string.Empty));
47
Assert.
Throws
<ArgumentNullException>("resourceName", () => new SplashScreen(Assembly.GetEntryAssembly(), string.Empty));
53
Assert.
Throws
<ArgumentNullException>("resourceAssembly", () => new SplashScreen(null!, "resourceName"));
System\Windows\Threading\DispatcherOperationTests.cs (1)
99
Assert.
Throws
<InvalidEnumArgumentException>("value", () => operation.Priority = value);
System\Windows\Threading\DispatcherSynchronizationContextTests.cs (3)
42
Assert.
Throws
<ArgumentNullException>("dispatcher", () => new DispatcherSynchronizationContext(null));
43
Assert.
Throws
<ArgumentNullException>("dispatcher", () => new DispatcherSynchronizationContext(null, DispatcherPriority.Normal));
52
Assert.
Throws
<InvalidEnumArgumentException>("priority", () => new DispatcherSynchronizationContext(Dispatcher.CurrentDispatcher, priority));
System\Windows\Threading\DispatcherTests.cs (5)
120
Assert.
Throws
<InvalidEnumArgumentException>("priority", () => Dispatcher.Yield(priority));
144
Assert.
Throws
<InvalidEnumArgumentException>("priority", () => dispatcher.BeginInvoke(priority, (Action)(() => { })));
145
Assert.
Throws
<InvalidEnumArgumentException>("priority", () => dispatcher.BeginInvoke(priority, (Action<object>)((arg) => { }), new object()));
146
Assert.
Throws
<InvalidEnumArgumentException>("priority", () => dispatcher.BeginInvoke(priority, (Action<object, object>)((arg1, arg2) => { }), new object(), new object[] { new object() }));
147
Assert.
Throws
<InvalidEnumArgumentException>("priority", () => dispatcher.BeginInvoke(priority, (Action<object, object>)((arg1, arg2) => { }), new object[] { new object(), new object() }));
System\Windows\Threading\DispatcherTimerTests.cs (11)
92
Assert.
Throws
<InvalidEnumArgumentException>("priority", () => new DispatcherTimer(priority));
93
Assert.
Throws
<InvalidEnumArgumentException>("priority", () => new DispatcherTimer(priority, Dispatcher.CurrentDispatcher));
94
Assert.
Throws
<InvalidEnumArgumentException>("priority", () => new DispatcherTimer(TimeSpan.Zero, priority, (s, e) => {}, Dispatcher.CurrentDispatcher));
100
Assert.
Throws
<ArgumentException>("priority", () => new DispatcherTimer(DispatcherPriority.Inactive));
101
Assert.
Throws
<ArgumentException>("priority", () => new DispatcherTimer(DispatcherPriority.Inactive, Dispatcher.CurrentDispatcher));
102
Assert.
Throws
<ArgumentException>("priority", () => new DispatcherTimer(TimeSpan.Zero, DispatcherPriority.Inactive, (s, e) => {}, Dispatcher.CurrentDispatcher));
108
Assert.
Throws
<ArgumentNullException>("dispatcher", () => new DispatcherTimer(DispatcherPriority.Normal, null));
109
Assert.
Throws
<ArgumentNullException>("dispatcher", () => new DispatcherTimer(TimeSpan.Zero, DispatcherPriority.Normal, (s, e) => {}, null));
124
Assert.
Throws
<ArgumentOutOfRangeException>("interval", () => new DispatcherTimer(interval, DispatcherPriority.Normal, (s, e) => {}, Dispatcher.CurrentDispatcher));
130
Assert.
Throws
<ArgumentNullException>("callback", () => new DispatcherTimer(TimeSpan.Zero, DispatcherPriority.Normal, null, Dispatcher.CurrentDispatcher));
198
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => timer.Interval = value);
System\Windows\VectorConverterTests.cs (3)
99
Assert.
Throws
<ArgumentNullException>("destinationType", () => converter.ConvertTo(value, null!));
100
Assert.
Throws
<ArgumentNullException>("destinationType", () => converter.ConvertTo(null, null, new Vector(), null!));
101
Assert.
Throws
<ArgumentNullException>("destinationType", () => converter.ConvertTo(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, new Vector(), null!));
System\Windows\WeakEventManagerTests.cs (9)
750
Assert.
Throws
<ArgumentNullException>("key", () => SubWeakEventManager.GetCurrentManager(null!));
3379
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => list[index]);
3395
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => list[-1]);
3396
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => list[0]);
3397
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => list[1]);
3408
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => list[index]);
3425
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => list[-1]);
3426
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => list[1]);
3427
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => list[2]);