1130 references to Throws
Aspire.Hosting.Containers.Tests (3)
ContainerMountAnnotationTests.cs (3)
17Assert.Throws<ArgumentNullException>("source", () => new ContainerMountAnnotation(source, "/usr/foo", ContainerMountType.BindMount, false)); 24Assert.Throws<ArgumentException>("source", () => new ContainerMountAnnotation("usr/foo", "/usr/foo", ContainerMountType.BindMount, false)); 30Assert.Throws<ArgumentException>("isReadOnly", () => new ContainerMountAnnotation(null, "/usr/foo", ContainerMountType.Volume, true));
Microsoft.AspNetCore.Http.Results.Tests (38)
ResultsTests.cs (17)
344Assert.Throws<ArgumentNullException>("contents", () => Results.Bytes(null)); 350Assert.Throws<ArgumentNullException>("fileContents", () => Results.File(default(byte[]))); 356Assert.Throws<ArgumentNullException>("fileStream", () => Results.File(default(Stream))); 362Assert.Throws<ArgumentNullException>("stream", () => Results.Stream(default(Stream))); 368Assert.Throws<ArgumentNullException>("pipeReader", () => Results.Stream(default(PipeReader))); 374Assert.Throws<ArgumentNullException>("streamWriterCallback", () => TypedResults.Stream(default(Func<Stream, Task>))); 478Assert.Throws<ArgumentNullException>("principal", () => Results.SignIn(null)); 1039Assert.Throws<ArgumentNullException>("context", () => Results.Json<object>(null, context: null)); 1045Assert.Throws<ArgumentNullException>("context", () => Results.Json(null, type: typeof(object), context: null)); 1065Assert.Throws<ArgumentNullException>("jsonTypeInfo", () => Results.Json(null, jsonTypeInfo: null)); 1071Assert.Throws<ArgumentNullException>("jsonTypeInfo", () => Results.Json<object>(null, jsonTypeInfo: null)); 1077Assert.Throws<ArgumentNullException>("localUrl", () => Results.LocalRedirect(default(string))); 1083Assert.Throws<ArgumentException>("localUrl", () => Results.LocalRedirect(string.Empty)); 1244Assert.Throws<ArgumentNullException>("problemDetails", () => Results.Problem(default(ProblemDetails))); 1392Assert.Throws<ArgumentNullException>("errors", () => Results.ValidationProblem(default(IDictionary<string, string[]>))); 1460Assert.Throws<ArgumentNullException>("url", () => Results.Redirect(default(string))); 1466Assert.Throws<ArgumentException>("url", () => Results.Redirect(string.Empty));
TypedResultsTests.cs (21)
99Assert.Throws<ArgumentNullException>("uri", () => TypedResults.Accepted(default(Uri))); 105Assert.Throws<ArgumentNullException>("uri", () => TypedResults.Accepted(default(Uri), default(object))); 318Assert.Throws<ArgumentNullException>("contents", () => TypedResults.Bytes(null)); 324Assert.Throws<ArgumentNullException>("fileContents", () => TypedResults.File(default(byte[]))); 330Assert.Throws<ArgumentNullException>("fileStream", () => TypedResults.File(default(Stream))); 336Assert.Throws<ArgumentNullException>("stream", () => TypedResults.Stream(default(Stream))); 342Assert.Throws<ArgumentNullException>("pipeReader", () => TypedResults.Stream(default(PipeReader))); 348Assert.Throws<ArgumentNullException>("streamWriterCallback", () => TypedResults.Stream(default(Func<Stream, Task>))); 354Assert.Throws<ArgumentNullException>("path", () => TypedResults.PhysicalFile(default(string))); 360Assert.Throws<ArgumentException>("path", () => TypedResults.PhysicalFile(string.Empty)); 366Assert.Throws<ArgumentNullException>("path", () => TypedResults.VirtualFile(default(string))); 372Assert.Throws<ArgumentException>("path", () => TypedResults.VirtualFile(string.Empty)); 488Assert.Throws<ArgumentNullException>("principal", () => TypedResults.SignIn(null)); 899Assert.Throws<ArgumentNullException>("context", () => TypedResults.Json(data, context: null)); 915Assert.Throws<ArgumentNullException>("jsonTypeInfo", () => TypedResults.Json(data, jsonTypeInfo: null)); 921Assert.Throws<ArgumentNullException>("localUrl", () => TypedResults.LocalRedirect(default(string))); 927Assert.Throws<ArgumentException>("localUrl", () => TypedResults.LocalRedirect(string.Empty)); 1060Assert.Throws<ArgumentNullException>("problemDetails", () => TypedResults.Problem(default(ProblemDetails))); 1184Assert.Throws<ArgumentNullException>("errors", () => TypedResults.ValidationProblem(default(IDictionary<string, string[]>))); 1242Assert.Throws<ArgumentNullException>("url", () => TypedResults.Redirect(default(string))); 1248Assert.Throws<ArgumentException>("url", () => TypedResults.Redirect(string.Empty));
Microsoft.AspNetCore.Http.Tests (1)
HttpServiceCollectionExtensionsTests.cs (1)
28Assert.Throws<ArgumentNullException>("services", () => HttpServiceCollectionExtensions.AddHttpContextAccessor(null));
Microsoft.AspNetCore.Identity.EntityFrameworkCore.Test (1)
UserStoreTest.cs (1)
99Assert.Throws<ArgumentNullException>("context", () => new UserStore(null));
Microsoft.AspNetCore.Identity.Test (6)
RoleManagerTest.cs (1)
123Assert.Throws<ArgumentNullException>("store",
SignInManagerTest.cs (3)
21Assert.Throws<ArgumentNullException>("userManager", () => new SignInManager<PocoUser>(null, null, null, null, null, null, null)); 23Assert.Throws<ArgumentNullException>("contextAccessor", () => new SignInManager<PocoUser>(userManager, null, null, null, null, null, null)); 27Assert.Throws<ArgumentNullException>("claimsFactory", () => new SignInManager<PocoUser>(userManager, contextAccessor.Object, null, null, null, null, null));
UserClaimsPrincipalFactoryTest.cs (1)
18Assert.Throws<ArgumentException>("optionsAccessor",
UserManagerTest.cs (1)
1018Assert.Throws<ArgumentNullException>("store",
Microsoft.AspNetCore.Mvc.Core.Test (4)
Formatters\FormatterMappingsTest.cs (1)
20Assert.Throws<ArgumentException>("format", () => options.GetMediaTypeMappingForFormat(format));
Formatters\MediaTypeTest.cs (3)
108Assert.Throws<ArgumentNullException>("mediaType", () => new MediaType(null, 0, 2)); 117Assert.Throws<ArgumentOutOfRangeException>("offset", () => new MediaType("media", offset, 5)); 124Assert.Throws<ArgumentOutOfRangeException>("length", () => new MediaType("media", 0, -1));
Microsoft.AspNetCore.Razor.Test (2)
TagHelpers\ReadOnlyTagHelperAttributeListTest.cs (1)
115var exception = Assert.Throws<ArgumentOutOfRangeException>("index", () => attributes[index]);
TagHelpers\TagHelperAttributeListTest.cs (1)
86var exception = Assert.Throws<ArgumentOutOfRangeException>("index", () => attributes[index]);
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (6)
RequestBodyTests.cs (6)
129Assert.Throws<ArgumentNullException>("buffer", () => httpContext.Request.Body.Read(null, 0, 1)); 130Assert.Throws<ArgumentOutOfRangeException>("offset", () => httpContext.Request.Body.Read(input, -1, 1)); 131Assert.Throws<ArgumentOutOfRangeException>("count", () => httpContext.Request.Body.Read(input, input.Length + 1, 1)); 132Assert.Throws<ArgumentOutOfRangeException>("count", () => httpContext.Request.Body.Read(input, 10, -1)); 133Assert.Throws<ArgumentOutOfRangeException>("count", () => httpContext.Request.Body.Read(input, 1, input.Length)); 134Assert.Throws<ArgumentOutOfRangeException>("count", () => httpContext.Request.Body.Read(input, 0, input.Length + 1));
Microsoft.AspNetCore.WebUtilities.Tests (1)
QueryHelpersTests.cs (1)
107Assert.Throws<ArgumentNullException>("value", () => QueryHelpers.AddQueryString("http://contoso.com/", "hello", null!));
Microsoft.Build.Engine.UnitTests (9)
Evaluation\SimpleVersion_Tests.cs (9)
67Assert.Throws<ArgumentOutOfRangeException>("major", () => new SimpleVersion(-1, 0)); 68Assert.Throws<ArgumentOutOfRangeException>("major", () => new SimpleVersion(-1, 0, 0)); 69Assert.Throws<ArgumentOutOfRangeException>("major", () => new SimpleVersion(-1, 0, 0, 0)); 75Assert.Throws<ArgumentOutOfRangeException>("minor", () => new SimpleVersion(0, -1)); 76Assert.Throws<ArgumentOutOfRangeException>("minor", () => new SimpleVersion(0, -1, 0)); 77Assert.Throws<ArgumentOutOfRangeException>("minor", () => new SimpleVersion(0, -1, 0, 0)); 83Assert.Throws<ArgumentOutOfRangeException>("build", () => new SimpleVersion(0, 0, -1)); 84Assert.Throws<ArgumentOutOfRangeException>("build", () => new SimpleVersion(0, 0, -1, 0)); 90Assert.Throws<ArgumentOutOfRangeException>("revision", () => new SimpleVersion(0, 0, 0, -1));
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (2)
IOperation\IOperationTests_ICompoundAssignmentOperation.cs (2)
24Assert.Throws<ArgumentNullException>("compoundAssignment", () => nullAssignment.GetInConversion()); 25Assert.Throws<ArgumentNullException>("compoundAssignment", () => nullAssignment.GetOutConversion());
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (12)
Compilation\CompilationAPITests.cs (7)
446Assert.Throws<ArgumentNullException>("peStream", () => comp.Emit(peStream: null)); 447Assert.Throws<ArgumentException>("peStream", () => comp.Emit(peStream: new TestStream(canRead: true, canWrite: false, canSeek: true))); 448Assert.Throws<ArgumentException>("pdbStream", () => comp.Emit(peStream: new MemoryStream(), pdbStream: new TestStream(canRead: true, canWrite: false, canSeek: true))); 457Assert.Throws<ArgumentException>("embeddedTexts", () => comp.Emit( 469Assert.Throws<ArgumentException>("win32Resources", () => comp.Emit( 473Assert.Throws<ArgumentException>("win32Resources", () => comp.Emit( 2961Assert.Throws<ArgumentException>(null, () => compilation.CreateBuiltinOperator(
Symbols\FunctionPointerTypeSymbolTests.cs (5)
1532Assert.Throws<ArgumentNullException>("returnType", () => comp.CreateFunctionPointerTypeSymbol(returnType: null!, returnRefKind: RefKind.None, parameterTypes: ImmutableArray<ITypeSymbol>.Empty, parameterRefKinds: ImmutableArray<RefKind>.Empty)); 1533Assert.Throws<ArgumentNullException>("parameterTypes", () => comp.CreateFunctionPointerTypeSymbol(returnType: @string, returnRefKind: RefKind.None, parameterTypes: default, parameterRefKinds: ImmutableArray<RefKind>.Empty)); 1534Assert.Throws<ArgumentNullException>("parameterTypes[0]", () => comp.CreateFunctionPointerTypeSymbol(returnType: @string, returnRefKind: RefKind.None, parameterTypes: ImmutableArray.Create((ITypeSymbol?)null)!, parameterRefKinds: ImmutableArray.Create(RefKind.None))); 1535Assert.Throws<ArgumentNullException>("parameterRefKinds", () => comp.CreateFunctionPointerTypeSymbol(returnType: @string, returnRefKind: RefKind.None, parameterTypes: ImmutableArray<ITypeSymbol>.Empty, parameterRefKinds: default)); 1536Assert.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)
41Assert.Throws<ArgumentNullException>("references", () => options.AddReferences((MetadataReference[])null)); 42Assert.Throws<ArgumentNullException>("references[0]", () => options.AddReferences(new MetadataReference[] { null })); 44Assert.Throws<ArgumentNullException>("references", () => options.AddReferences((IEnumerable<MetadataReference>)null)); 45Assert.Throws<ArgumentNullException>("references[0]", () => options.AddReferences((IEnumerable<MetadataReference>)new MetadataReference[] { null })); 47Assert.Throws<ArgumentNullException>("references", () => options.AddReferences((Assembly[])null)); 48Assert.Throws<ArgumentNullException>("references[0]", () => options.AddReferences(new Assembly[] { null })); 50Assert.Throws<ArgumentNullException>("references", () => options.AddReferences((IEnumerable<Assembly>)null)); 51Assert.Throws<ArgumentNullException>("references[0]", () => options.AddReferences((IEnumerable<Assembly>)new Assembly[] { null })); 53Assert.Throws<ArgumentNullException>("references", () => options.AddReferences((string[])null)); 54Assert.Throws<ArgumentNullException>("references[0]", () => options.AddReferences(new string[] { null })); 56Assert.Throws<ArgumentNullException>("references", () => options.AddReferences((IEnumerable<string>)null)); 57Assert.Throws<ArgumentNullException>("references[0]", () => options.AddReferences((IEnumerable<string>)new string[] { null })); 83Assert.Throws<ArgumentNullException>("references", () => options.WithReferences((MetadataReference[])null)); 84Assert.Throws<ArgumentNullException>("references", () => options.WithReferences((IEnumerable<MetadataReference>)null)); 85Assert.Throws<ArgumentNullException>("references", () => options.WithReferences(default(ImmutableArray<MetadataReference>))); 86Assert.Throws<ArgumentNullException>("references[0]", () => options.WithReferences(new MetadataReference[] { null })); 87Assert.Throws<ArgumentNullException>("references[0]", () => options.WithReferences(ImmutableArray.Create((MetadataReference)null))); 89Assert.Throws<ArgumentNullException>("references", () => options.WithReferences((Assembly[])null)); 90Assert.Throws<ArgumentNullException>("references", () => options.WithReferences((IEnumerable<Assembly>)null)); 91Assert.Throws<ArgumentNullException>("references", () => options.WithReferences(default(ImmutableArray<Assembly>))); 92Assert.Throws<ArgumentNullException>("references[0]", () => options.WithReferences(new Assembly[] { null })); 93Assert.Throws<ArgumentNullException>("references[0]", () => options.WithReferences(ImmutableArray.Create((Assembly)null))); 95Assert.Throws<ArgumentNullException>("references", () => options.WithReferences((string[])null)); 96Assert.Throws<ArgumentNullException>("references", () => options.WithReferences((IEnumerable<string>)null)); 97Assert.Throws<ArgumentNullException>("references", () => options.WithReferences(default(ImmutableArray<string>))); 98Assert.Throws<ArgumentNullException>("references[0]", () => options.WithReferences(new string[] { null })); 99Assert.Throws<ArgumentNullException>("references[0]", () => options.WithReferences(ImmutableArray.Create((string)null))); 122Assert.Throws<ArgumentNullException>("imports", () => options.AddImports((string[])null)); 125Assert.Throws<ArgumentNullException>("imports", () => options.AddImports((IEnumerable<string>)null)); 126Assert.Throws<ArgumentNullException>("imports[0]", () => options.AddImports((IEnumerable<string>)new string[] { null })); 128Assert.Throws<ArgumentNullException>("imports", () => options.AddImports(default(ImmutableArray<string>))); 129Assert.Throws<ArgumentNullException>("imports[0]", () => options.AddImports(ImmutableArray.Create((string)null))); 143Assert.Throws<ArgumentNullException>("imports", () => options.WithImports((string[])null)); 146Assert.Throws<ArgumentNullException>("imports", () => options.WithImports((IEnumerable<string>)null)); 147Assert.Throws<ArgumentNullException>("imports[0]", () => options.WithImports((IEnumerable<string>)new string[] { null })); 149Assert.Throws<ArgumentNullException>("imports", () => options.WithImports(default(ImmutableArray<string>))); 150Assert.Throws<ArgumentNullException>("imports[0]", () => options.WithImports(ImmutableArray.Create((string)null)));
Microsoft.CodeAnalysis.Test.Utilities (4)
Compilation\TestOperationVisitor.cs (4)
1178Assert.Throws<ArgumentException>("compoundAssignment", () => VisualBasic.VisualBasicExtensions.GetInConversion(operation)); 1179Assert.Throws<ArgumentException>("compoundAssignment", () => VisualBasic.VisualBasicExtensions.GetOutConversion(operation)); 1185Assert.Throws<ArgumentException>("compoundAssignment", () => CSharp.CSharpExtensions.GetInConversion(operation)); 1186Assert.Throws<ArgumentException>("compoundAssignment", () => CSharp.CSharpExtensions.GetOutConversion(operation));
Microsoft.CodeAnalysis.UnitTests (21)
Analyzers\AnalyzerFileReferenceTests.cs (1)
48Assert.Throws<ArgumentNullException>("assemblyLoader", () => new AnalyzerFileReference(TempRoot.Root, null!));
Collections\ImmutableDictionaryTestBase.cs (2)
288Assert.Throws<ArgumentException>(null, () => map1.Add(key, value2)); 289Assert.Throws<ArgumentException>(null, () => map2.Add(key, value1));
Collections\List\ICollection.Generic.Tests.cs (1)
468Assert.Throws<ArgumentNullException>("item", () => collection.Contains(default(T)!));
EmbeddedTextTests.cs (16)
25Assert.Throws<ArgumentNullException>("filePath", () => EmbeddedText.FromBytes(null, default(ArraySegment<byte>))); 26Assert.Throws<ArgumentException>("filePath", () => EmbeddedText.FromBytes("", default(ArraySegment<byte>))); 27Assert.Throws<ArgumentNullException>("bytes", () => EmbeddedText.FromBytes("path", default(ArraySegment<byte>))); 28Assert.Throws<ArgumentException>("checksumAlgorithm", () => EmbeddedText.FromBytes("path", new ArraySegment<byte>(new byte[0], 0, 0), SourceHashAlgorithm.None)); 34Assert.Throws<ArgumentNullException>("filePath", () => EmbeddedText.FromSource(null, null)); 35Assert.Throws<ArgumentException>("filePath", () => EmbeddedText.FromSource("", null)); 36Assert.Throws<ArgumentNullException>("text", () => EmbeddedText.FromSource("path", null)); 39Assert.Throws<ArgumentException>("text", () => EmbeddedText.FromSource("path", SourceText.From("source"))); 42Assert.Throws<ArgumentException>("text", () => EmbeddedText.FromSource("path", SourceText.From(new byte[0], 0, Encoding.UTF8, canBeEmbedded: false))); 43Assert.Throws<ArgumentException>("text", () => EmbeddedText.FromSource("path", SourceText.From(new MemoryStream(new byte[0]), Encoding.UTF8, canBeEmbedded: false))); 49Assert.Throws<ArgumentNullException>("filePath", () => EmbeddedText.FromStream(null, null)); 50Assert.Throws<ArgumentException>("filePath", () => EmbeddedText.FromStream("", null)); 51Assert.Throws<ArgumentNullException>("stream", () => EmbeddedText.FromStream("path", null)); 52Assert.Throws<ArgumentException>("stream", () => EmbeddedText.FromStream("path", new CannotReadStream())); 53Assert.Throws<ArgumentException>("stream", () => EmbeddedText.FromStream("path", new CannotSeekStream())); 54Assert.Throws<ArgumentException>("checksumAlgorithm", () => EmbeddedText.FromStream("path", new MemoryStream(), SourceHashAlgorithm.None));
Emit\SemanticEditTests.cs (1)
29Assert.Throws<ArgumentOutOfRangeException>("kind", () => new SemanticEdit(SemanticEditKind.None, oldSymbol: null, newSymbol: null));
Microsoft.CodeAnalysis.Workspaces.UnitTests (37)
Simplifier\SimplifierTests.cs (1)
53Assert.Throws<ArgumentNullException>("workspace", () => Simplifier.Expand(token: default, semanticModel: null!, workspace: null!));
SolutionTests\ProjectDependencyGraphTests.cs (2)
117Assert.Throws<ArgumentNullException>("projectId", 339Assert.Throws<ArgumentNullException>("projectId",
SolutionTests\SolutionTests.cs (34)
1449Assert.Throws<ArgumentNullException>("assemblyName", () => solution.WithProjectAssemblyName(projectId, null!)); 1450Assert.Throws<ArgumentNullException>("projectId", () => solution.WithProjectAssemblyName(null!, "x.dll")); 1473Assert.Throws<ArgumentNullException>("projectId", () => solution.WithProjectOutputFilePath(null!, "x.dll")); 1474Assert.Throws<ArgumentNullException>("projectId", () => solution.WithProjectOutputFilePath(null!, "x.dll")); 1528Assert.Throws<ArgumentNullException>("projectId", () => solution.WithProjectOutputRefFilePath(null!, "x.dll")); 1551Assert.Throws<ArgumentNullException>("projectId", () => solution.WithProjectCompilationOutputInfo(null!, info)); 1574Assert.Throws<ArgumentNullException>("projectId", () => solution.WithProjectDefaultNamespace(null!, "x")); 1688Assert.Throws<ArgumentNullException>("projectId", () => solution.WithProjectName(null!, "x")); 1711Assert.Throws<ArgumentNullException>("projectId", () => solution.WithProjectFilePath(null!, "x")); 1726Assert.Throws<ArgumentNullException>("projectId", () => solution.WithProjectCompilationOptions(null!, options)); 1727Assert.Throws<ArgumentNullException>("options", () => solution.WithProjectCompilationOptions(projectId, options: null!)); 1775Assert.Throws<ArgumentNullException>("projectId", () => solution.WithProjectParseOptions(null!, options)); 1776Assert.Throws<ArgumentNullException>("options", () => solution.WithProjectParseOptions(projectId, options: null!)); 1987Assert.Throws<ArgumentNullException>("projectReferences", () => solution.AddProjectReferences(projectId, null!)); 2025Assert.Throws<ArgumentNullException>("projectId", () => solution.RemoveProjectReference(null!, projectRef2)); 2026Assert.Throws<ArgumentNullException>("projectReference", () => solution.RemoveProjectReference(projectId, null!)); 2029Assert.Throws<ArgumentException>("projectReference", () => solution.RemoveProjectReference(projectId, new ProjectReference(ProjectId.CreateNewId()))); 2106Assert.Throws<ArgumentNullException>("metadataReferences", () => solution.AddMetadataReferences(projectId, null!)); 2131Assert.Throws<ArgumentNullException>("projectId", () => solution.RemoveMetadataReference(null!, metadataRef1)); 2132Assert.Throws<ArgumentNullException>("metadataReference", () => solution.RemoveMetadataReference(projectId, null!)); 2179Assert.Throws<ArgumentNullException>("analyzerReferences", () => solution.AddAnalyzerReferences(projectId, null!)); 2205Assert.Throws<ArgumentNullException>("analyzerReference", () => solution.RemoveAnalyzerReference(projectId, null!)); 2246Assert.Throws<ArgumentNullException>("analyzerReferences", () => solution.AddAnalyzerReferences(null!)); 2270Assert.Throws<ArgumentNullException>("analyzerReference", () => solution.RemoveAnalyzerReference(null!)); 2377Assert.Throws<ArgumentNullException>("loader", () => solution.AddDocument(documentId, "name", loader: null!)); 2406Assert.Throws<ArgumentNullException>("documentId", () => solution.AddDocument(documentId: null!, "name", "text")); 2407Assert.Throws<ArgumentNullException>("name", () => solution.AddDocument(documentId, name: null!, "text")); 2408Assert.Throws<ArgumentNullException>("text", () => solution.AddDocument(documentId, "name", text: (string)null!)); 2434Assert.Throws<ArgumentNullException>("documentId", () => solution.AddDocument(documentId: null!, "name", sourceText)); 2435Assert.Throws<ArgumentNullException>("name", () => solution.AddDocument(documentId, name: null!, sourceText)); 2436Assert.Throws<ArgumentNullException>("text", () => solution.AddDocument(documentId, "name", text: (SourceText)null!)); 2463Assert.Throws<ArgumentNullException>("documentId", () => solution.AddDocument(documentId: null!, "name", root)); 2464Assert.Throws<ArgumentNullException>("name", () => solution.AddDocument(documentId, name: null!, root)); 2465Assert.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.TimeProvider.Testing.Tests (8)
TimerTests.cs (8)
171Assert.Throws<ArgumentOutOfRangeException>("dueTime", () => t.Change(TimeSpan.FromMilliseconds(-2), TimeSpan.FromMilliseconds(1))); 172Assert.Throws<ArgumentOutOfRangeException>("dueTime", () => t.Change(TimeSpan.FromMilliseconds(-2), TimeSpan.FromSeconds(1))); 173Assert.Throws<ArgumentOutOfRangeException>("dueTime", () => t.Change(TimeSpan.FromMilliseconds(0xFFFFFFFFL), TimeSpan.FromMilliseconds(1))); 174Assert.Throws<ArgumentOutOfRangeException>("dueTime", () => t.Change(TimeSpan.FromMilliseconds(0xFFFFFFFFL), TimeSpan.FromSeconds(1))); 183Assert.Throws<ArgumentOutOfRangeException>("period", () => t.Change(TimeSpan.FromMilliseconds(1), TimeSpan.FromMilliseconds(-2))); 184Assert.Throws<ArgumentOutOfRangeException>("period", () => t.Change(TimeSpan.FromSeconds(1), TimeSpan.FromMilliseconds(-2))); 185Assert.Throws<ArgumentOutOfRangeException>("period", () => t.Change(TimeSpan.FromMilliseconds(1), TimeSpan.FromMilliseconds(0xFFFFFFFFL))); 186Assert.Throws<ArgumentOutOfRangeException>("period", () => t.Change(TimeSpan.FromSeconds(1), TimeSpan.FromMilliseconds(0xFFFFFFFFL)));
System.Drawing.Common.Tests (3)
System\Drawing\BufferedGraphicsContextTests.cs (1)
139Assert.Throws<ArgumentNullException>("hdc", () => context.Allocate(null, new Rectangle(0, 0, 10, 10)));
System\Drawing\FontConverterTests.cs (1)
71Assert.Throws<InvalidEnumArgumentException>(paramName, () => converter.ConvertFrom(input));
System\Drawing\Printing\PrinterResolutionTests.cs (1)
82Assert.Throws<InvalidEnumArgumentException>("value", () => resolution.Kind = value);
System.Windows.Forms.Design.Tests (74)
System\ComponentModel\Design\ArrayEditorTests.cs (2)
212Assert.Throws<ArgumentNullException>("elementType", () => editor.SetItems(null, Array.Empty<object>())); 213Assert.Throws<ArgumentNullException>("elementType", () => editor.SetItems(Array.Empty<object>(), Array.Empty<object>()));
System\ComponentModel\Design\CollectionEditorTests.cs (7)
44Assert.Throws<ArgumentNullException>("type", () => editor.CollectionItemType); 49Assert.Throws<ArgumentNullException>("type", () => editor.NewItemTypes); 113Assert.Throws<ArgumentNullException>("type", editor.CreateCollectionForm); 138Assert.Throws<ArgumentNullException>("type", editor.CreateCollectionItemType); 361Assert.Throws<ArgumentNullException>("itemType", () => editor.CreateInstance(null)); 386Assert.Throws<ArgumentNullException>("type", editor.CreateNewItemTypes); 745Assert.Throws<ArgumentNullException>("type", () => editor.EditValue(mockContext.Object, mockServiceProvider.Object, value));
System\ComponentModel\Design\CollectionFormTests.cs (3)
33Assert.Throws<ArgumentNullException>("editor", () => new SubCollectionForm(null)); 710Assert.Throws<ArgumentNullException>("itemType", () => form.CreateInstance(null)); 822Assert.Throws<ArgumentNullException>("edSvc", () => form.ShowEditorDialog(null));
System\ComponentModel\Design\DesignerActionItemCollectionTests.cs (2)
38Assert.Throws<ArgumentNullException>("value", () => collection.Add(null)); 112Assert.Throws<ArgumentNullException>("value", () => collection[0] = null);
System\ComponentModel\Design\DesignerActionListCollectionTests.cs (1)
32Assert.Throws<ArgumentNullException>("value", () => new DesignerActionListCollection(null));
System\ComponentModel\Design\DesignerActionServiceTests.cs (3)
246Assert.Throws<ArgumentNullException>("comp", () => service.Contains(null)); 386Assert.Throws<ArgumentNullException>("component", () => service.GetComponentActions(null)); 387Assert.Throws<ArgumentNullException>("component", () => service.GetComponentActions(null, ComponentActionsType.All));
System\ComponentModel\Design\DesignerHostTests.cs (7)
978Assert.Throws<ArgumentNullException>("key", () => service.GetValue(null)); 996Assert.Throws<ArgumentNullException>("key", () => service.GetValue(null)); 1593Assert.Throws<ArgumentNullException>("service", () => component.Site.GetService(null)); 1863Assert.Throws<ArgumentNullException>("componentType", () => host.CreateComponent(null)); 2273Assert.Throws<ArgumentNullException>("component", () => host.GetDesigner(null)); 2373Assert.Throws<ArgumentNullException>("service", () => host.GetService(null)); 2428Assert.Throws<ArgumentNullException>("typeName", () => host.GetType(null));
System\ComponentModel\Design\DesignerVerbCollectionTests.cs (1)
32Assert.Throws<ArgumentNullException>("value", () => new DesignerVerbCollection(null));
System\ComponentModel\Design\DesignSurfaceTests.cs (8)
169Assert.Throws<ArgumentNullException>("rootComponentType", () => new DesignSurface((Type)null)); 170Assert.Throws<ArgumentNullException>("rootComponentType", () => new DesignSurface(mockServiceProvider.Object, null)); 1008Assert.Throws<ArgumentNullException>("component", () => surface.CreateDesigner(null, true)); 1009Assert.Throws<ArgumentNullException>("component", () => surface.CreateDesigner(null, false)); 1069Assert.Throws<ArgumentNullException>("type", () => surface.CreateComponent(null)); 1125Assert.Throws<ArgumentNullException>("type", () => surface.CreateInstance(null)); 1153Assert.Throws<ArgumentNullException>("owningComponent", () => surface.CreateNestedContainer(null)); 1154Assert.Throws<ArgumentNullException>("owningComponent", () => surface.CreateNestedContainer(null, "name"));
System\ComponentModel\Design\Serialization\CodeDomSerializerExceptionTests.cs (2)
83Assert.Throws<ArgumentNullException>("manager", () => new CodeDomSerializerException("message", (IDesignerSerializationManager)null)); 84Assert.Throws<ArgumentNullException>("manager", () => new CodeDomSerializerException(new InvalidOperationException(), (IDesignerSerializationManager)null));
System\ComponentModel\Design\Serialization\DesignerSerializationManagerTests.cs (10)
73Assert.Throws<ArgumentNullException>("provider", () => new DesignerSerializationManager(null)); 259Assert.Throws<ArgumentNullException>("property", () => iManager.Properties); 262Assert.Throws<ArgumentNullException>("property", () => iManager.Properties); 859Assert.Throws<ArgumentNullException>("name", () => iManager.GetInstance(null)); 958Assert.Throws<ArgumentNullException>("value", () => iManager.GetName(null)); 1147Assert.Throws<ArgumentNullException>("typeName", () => manager.GetRuntimeType(null)); 1292Assert.Throws<ArgumentNullException>("serializerType", () => manager.GetSerializer(objectType, null)); 1413Assert.Throws<ArgumentNullException>("serializerType", () => iManager.GetSerializer(objectType, null)); 1552Assert.Throws<ArgumentNullException>("typeName", () => manager.GetType(null)); 1640Assert.Throws<ArgumentNullException>("typeName", () => iManager.GetType(null));
System\ComponentModel\Design\Serialization\ExpressionContextTests.cs (3)
46Assert.Throws<ArgumentNullException>("expression", () => new ExpressionContext(null, typeof(int), new object(), new object())); 52Assert.Throws<ArgumentNullException>("expressionType", () => new ExpressionContext(new CodeExpression(), null, new object(), new object())); 58Assert.Throws<ArgumentNullException>("owner", () => new ExpressionContext(new CodeExpression(), typeof(int), null, new object()));
System\ComponentModel\Design\Serialization\RootContextTests.cs (2)
23Assert.Throws<ArgumentNullException>("expression", () => new RootContext(null, new object())); 30Assert.Throws<ArgumentNullException>("value", () => new RootContext(expression, null));
System\ComponentModel\Design\UndoUnitTests.cs (1)
45Assert.Throws<ArgumentNullException>("engine", () => new UndoUnit(null, "name"));
System\Drawing\Design\BitmapEditorTests.cs (1)
97Assert.Throws<ArgumentNullException>("stream", () => editor.LoadFromStream(null));
System\Drawing\Design\ImageEditorTests.cs (2)
51Assert.Throws<ArgumentNullException>("e", () => SubImageEditor.CreateFilterEntry(null)); 153Assert.Throws<ArgumentNullException>("stream", () => editor.LoadFromStream(null));
System\Drawing\Design\MetafileEditorTests.cs (1)
76Assert.Throws<ArgumentNullException>("stream", () => editor.LoadFromStream(null));
System\Drawing\Design\ToolboxItemCollectionTests.cs (2)
22Assert.Throws<ArgumentNullException>("c", () => new ToolboxItemCollection((ToolboxItem[])null)); 40Assert.Throws<ArgumentNullException>("c", () => new ToolboxItemCollection((ToolboxItemCollection)null));
System\Drawing\Design\ToolboxItemTests.cs (4)
1309Assert.Throws<ArgumentNullException>("typeName", () => item.GetType(mockDesignerHost.Object, null, null, false)); 1310Assert.Throws<ArgumentNullException>("typeName", () => item.GetType(null, null, null, false)); 1582Assert.Throws<ArgumentNullException>("value", () => item.ValidatePropertyValue(propertyName, null)); 1598Assert.Throws<ArgumentException>("value", () => item.ValidatePropertyValue(propertyName, new object()));
System\Resources\Tools\StronglyTypedResourceBuilderTests.cs (12)
29Assert.Throws<ArgumentNullException>( 39Assert.Throws<ArgumentNullException>( 51Assert.Throws<ArgumentNullException>( 61Assert.Throws<ArgumentNullException>( 77Assert.Throws<ArgumentNullException>( 87Assert.Throws<ArgumentNullException>( 99Assert.Throws<ArgumentNullException>( 109Assert.Throws<ArgumentNullException>( 125Assert.Throws<ArgumentNullException>( 135Assert.Throws<ArgumentNullException>( 150Assert.Throws<ArgumentNullException>( 160Assert.Throws<ArgumentNullException>(
System.Windows.Forms.Primitives.Tests (4)
System\Windows\Forms\NonNullCollectionTests.cs (4)
13Assert.Throws<ArgumentNullException>("items", () => new TestCollection(null!)); 19Assert.Throws<ArgumentNullException>("items", () => new TestCollection(new object[] { null! })); 43Assert.Throws<ArgumentNullException>("value", () => ((IList)collection).Add(null)); 77Assert.Throws<ArgumentNullException>("value", () => ((IList)collection)[0] = null);
System.Windows.Forms.Tests (803)
CheckedListBoxTests.cs (1)
119Assert.Throws<InvalidEnumArgumentException>("value", () => control.SelectionMode = value);
System\Drawing\Design\PropertyValueUIItemTests.cs (2)
31Assert.Throws<ArgumentNullException>("uiItemImage", () => new PropertyValueUIItem(null, Dummy_PropertyValueUIItemInvokeHandler, "tooltip")); 38Assert.Throws<ArgumentNullException>("handler", () => new PropertyValueUIItem(uiItemImage, null, "tooltip"));
System\Windows\Forms\AccessibleObjects\Control.ControlAccessibleObjectTests.cs (1)
109Assert.Throws<ArgumentNullException>("ownerControl", () => new Control.ControlAccessibleObject(null));
System\Windows\Forms\AccessibleObjects\DataGridViewRowAccessibleObjectTests.cs (1)
271Assert.Throws<ArgumentOutOfRangeException>("index", () => accessibleObject.GetChild(index));
System\Windows\Forms\AccessibleObjects\ToolStripItemAccessibleObjectTests.cs (1)
39Assert.Throws<ArgumentNullException>("ownerItem", () => new ToolStripItem.ToolStripItemAccessibleObject(null));
System\Windows\Forms\ApplicationTests.cs (2)
72Assert.Throws<ArgumentNullException>("value", () => Application.CurrentCulture = null); 358Assert.Throws<InvalidEnumArgumentException>("highDpiMode", () => Application.SetHighDpiMode(value));
System\Windows\Forms\AxHostTests.cs (6)
216Assert.Throws<ArgumentNullException>("g", () => new SubAxHost(null)); 217Assert.Throws<ArgumentNullException>("g", () => new SubAxHost(null, 0)); 342Assert.Throws<InvalidEnumArgumentException>("value", () => control.BackgroundImageLayout = value); 568Assert.Throws<InvalidEnumArgumentException>("value", () => control.ImeMode = value); 1510Assert.Throws<ArgumentException>("font", () => SubAxHost.GetIFontDispFromFont(font)); 1571Assert.Throws<ArgumentException>("font", () => SubAxHost.GetIFontFromFont(font));
System\Windows\Forms\BindingContextTests.cs (8)
396Assert.Throws<ArgumentNullException>("dataSource", () => context.Contains(null)); 397Assert.Throws<ArgumentNullException>("dataSource", () => context.Contains(null, null)); 398Assert.Throws<ArgumentNullException>("dataSource", () => context.Contains(null, string.Empty)); 470Assert.Throws<ArgumentNullException>("dataSource", () => context[mockIListSource.Object]); 682Assert.Throws<ArgumentNullException>("dataSource", () => context[dataSource, "Property"]); 734Assert.Throws<ArgumentNullException>("dataSource", () => context[null]); 735Assert.Throws<ArgumentNullException>("dataSource", () => context[null, null]); 736Assert.Throws<ArgumentNullException>("dataSource", () => context[null, string.Empty]);
System\Windows\Forms\BindingSourceTests.cs (1)
524Assert.Throws<ArgumentNullException>("container", () => new SubBindingSource(null));
System\Windows\Forms\ButtonBaseTests.cs (6)
1373Assert.Throws<InvalidEnumArgumentException>("value", () => control.FlatStyle = value); 2050Assert.Throws<InvalidEnumArgumentException>("value", () => control.ImageAlign = value); 2211Assert.Throws<ArgumentOutOfRangeException>("value", () => control.ImageIndex = value); 2704Assert.Throws<InvalidEnumArgumentException>("value", () => control.ImeMode = value); 3493Assert.Throws<InvalidEnumArgumentException>("value", () => control.TextAlign = value); 3723Assert.Throws<InvalidEnumArgumentException>("value", () => control.TextImageRelation = value);
System\Windows\Forms\ButtonTests.cs (2)
609Assert.Throws<InvalidEnumArgumentException>("value", () => control.AutoSizeMode = value); 663Assert.Throws<InvalidEnumArgumentException>("value", () => control.DialogResult = value);
System\Windows\Forms\CheckBoxTests.cs (4)
168Assert.Throws<InvalidEnumArgumentException>("value", () => control.Appearance = value); 205Assert.Throws<InvalidEnumArgumentException>("value", () => control.CheckAlign = value); 287Assert.Throws<InvalidEnumArgumentException>("value", () => control.CheckState = value); 442Assert.Throws<InvalidEnumArgumentException>("value", () => control.TextAlign = value);
System\Windows\Forms\ColumnHeaderCollectionTests.cs (10)
22Assert.Throws<ArgumentNullException>("owner", () => new ListView.ColumnHeaderCollection(null)); 59Assert.Throws<ArgumentOutOfRangeException>("index", () => collection[index]); 84Assert.Throws<ArgumentOutOfRangeException>("index", () => collection[index]); 144Assert.Throws<ArgumentException>("ch", () => collection.Add(header)); 156Assert.Throws<ArgumentException>("ch", () => collection.Add(header)); 318Assert.Throws<ArgumentNullException>("ch", () => collection.Add((ColumnHeader)null)); 327Assert.Throws<InvalidEnumArgumentException>("value", () => collection.Add("text", 1, textAlign)); 328Assert.Throws<InvalidEnumArgumentException>("value", () => collection.Add("name", "text", 1, textAlign, "imageKey")); 329Assert.Throws<InvalidEnumArgumentException>("value", () => collection.Add("name", "text", 1, textAlign, 1)); 350Assert.Throws<ArgumentException>("value", () => collection.Add(value));
System\Windows\Forms\ColumnHeaderConverterTests.cs (1)
123Assert.Throws<ArgumentNullException>("destinationType", () => converter.ConvertTo(new object(), null));
System\Windows\Forms\ColumnHeaderTests.cs (3)
233Assert.Throws<ArgumentOutOfRangeException>("DisplayIndex", () => header.DisplayIndex = value); 486Assert.Throws<ArgumentOutOfRangeException>("value", () => header.ImageIndex = value); 1213Assert.Throws<InvalidEnumArgumentException>("value", () => header.TextAlign = value);
System\Windows\Forms\ColumnStyleTests.cs (2)
42Assert.Throws<ArgumentOutOfRangeException>("value", () => new ColumnStyle(SizeType.AutoSize, -1)); 139Assert.Throws<ArgumentOutOfRangeException>("value", () => style.Width = -1);
System\Windows\Forms\Combobox.ObjectCollectionTests.cs (4)
95Assert.Throws<ArgumentNullException>("item", () => comboBoxObjectCollection.Add(null)); 1318Assert.Throws<ArgumentNullException>("value", () => comboBoxObjectCollection[0] = null); 1335Assert.Throws<ArgumentOutOfRangeException>("index", () => comboBoxObjectCollection[-1] = 1); 1352Assert.Throws<ArgumentOutOfRangeException>("index", () => comboBoxObjectCollection[3] = 1);
System\Windows\Forms\ComboBoxTests.cs (7)
160Assert.Throws<InvalidEnumArgumentException>("value", () => control.AutoCompleteMode = value); 613Assert.Throws<InvalidEnumArgumentException>("value", () => control.BackgroundImageLayout = value); 887Assert.Throws<InvalidEnumArgumentException>("value", () => control.AutoCompleteSource = source); 981Assert.Throws<InvalidEnumArgumentException>("value", () => control.DropDownStyle = value); 1316Assert.Throws<InvalidEnumArgumentException>("value", () => control.RightToLeft = value); 1590Assert.Throws<ArgumentOutOfRangeException>("startIndex", () => control.FindString("s", startIndex)); 1714Assert.Throws<ArgumentOutOfRangeException>("startIndex", () => control.FindStringExact("s", startIndex));
System\Windows\Forms\ContainerControlTests.cs (6)
175Assert.Throws<ArgumentException>("value", () => control.ActiveControl = control); 176Assert.Throws<ArgumentException>("value", () => control.ActiveControl = new Control()); 217Assert.Throws<ArgumentOutOfRangeException>("value", () => control.AutoScaleDimensions = value); 273Assert.Throws<InvalidEnumArgumentException>("value", () => control.AutoScaleMode = value); 341Assert.Throws<InvalidEnumArgumentException>("value", () => control.AutoValidate = value); 1215Assert.Throws<InvalidEnumArgumentException>("validationConstraints", () => control.ValidateChildren(validationConstraints));
System\Windows\Forms\ControlBindingsCollectionTests.cs (18)
228Assert.Throws<ArgumentNullException>("dataSource", () => collection.Add("propertyName", null, "dataMember")); 229Assert.Throws<ArgumentNullException>("dataSource", () => collection.Add("propertyName", null, "dataMember", true)); 230Assert.Throws<ArgumentNullException>("dataSource", () => collection.Add("propertyName", null, "dataMember", true, DataSourceUpdateMode.OnPropertyChanged)); 231Assert.Throws<ArgumentNullException>("dataSource", () => collection.Add("propertyName", null, "dataMember", true, DataSourceUpdateMode.OnPropertyChanged, "null")); 232Assert.Throws<ArgumentNullException>("dataSource", () => collection.Add("propertyName", null, "dataMember", true, DataSourceUpdateMode.OnPropertyChanged, "null", "formatString")); 233Assert.Throws<ArgumentNullException>("dataSource", () => collection.Add("propertyName", null, "dataMember", true, DataSourceUpdateMode.OnPropertyChanged, "null", "formatString", CultureInfo.CurrentCulture)); 242Assert.Throws<ArgumentException>("PropertyName", () => collection.Add("NoSuchProperty", new object(), "dataMember")); 243Assert.Throws<ArgumentException>("PropertyName", () => collection.Add("NoSuchProperty", new object(), "dataMember", true)); 244Assert.Throws<ArgumentException>("PropertyName", () => collection.Add("NoSuchProperty", new object(), "dataMember", true, DataSourceUpdateMode.OnPropertyChanged)); 245Assert.Throws<ArgumentException>("PropertyName", () => collection.Add("NoSuchProperty", new object(), "dataMember", true, DataSourceUpdateMode.OnPropertyChanged, "null")); 246Assert.Throws<ArgumentException>("PropertyName", () => collection.Add("NoSuchProperty", new object(), "dataMember", true, DataSourceUpdateMode.OnPropertyChanged, "null", "formatString")); 247Assert.Throws<ArgumentException>("PropertyName", () => collection.Add("NoSuchProperty", new object(), "dataMember", true, DataSourceUpdateMode.OnPropertyChanged, "null", "formatString", CultureInfo.CurrentCulture)); 259Assert.Throws<ArgumentException>("binding", () => collection.Add(nameof(Control.Text), new object(), "dataMember")); 260Assert.Throws<ArgumentException>("binding", () => collection.Add(nameof(Control.Text), new object(), "dataMember", true)); 261Assert.Throws<ArgumentException>("binding", () => collection.Add(nameof(Control.Text), new object(), "dataMember", true, DataSourceUpdateMode.OnPropertyChanged)); 262Assert.Throws<ArgumentException>("binding", () => collection.Add(nameof(Control.Text), new object(), "dataMember", true, DataSourceUpdateMode.OnPropertyChanged, "null")); 263Assert.Throws<ArgumentException>("binding", () => collection.Add(nameof(Control.Text), new object(), "dataMember", true, DataSourceUpdateMode.OnPropertyChanged, "null", "formatString")); 264Assert.Throws<ArgumentException>("binding", () => collection.Add(nameof(Control.Text), new object(), "dataMember", true, DataSourceUpdateMode.OnPropertyChanged, "null", "formatString", CultureInfo.CurrentCulture));
System\Windows\Forms\ControlPaintTests.cs (1)
261Assert.Throws<ArgumentNullException>("bitmap", () => ControlPaint.CreateHBitmapTransparencyMask(null));
System\Windows\Forms\ControlTests.ControlCollection.cs (10)
28Assert.Throws<ArgumentNullException>("owner", () => new Control.ControlCollection(null)); 1516Assert.Throws<ArgumentNullException>("key", () => collection.Find(key, searchAllChildren: true)); 1517Assert.Throws<ArgumentNullException>("key", () => collection.Find(key, searchAllChildren: false)); 1728Assert.Throws<ArgumentOutOfRangeException>("index", () => enumerator.Current); 1731Assert.Throws<ArgumentOutOfRangeException>("index", () => enumerator.Current); 1735Assert.Throws<ArgumentOutOfRangeException>("index", () => enumerator.Current); 1892Assert.Throws<ArgumentOutOfRangeException>("index", () => collection[index]); 1907Assert.Throws<ArgumentOutOfRangeException>("index", () => collection[index]); 3507Assert.Throws<ArgumentException>("control", () => collection.Add(new object())); 3508Assert.Throws<ArgumentException>("control", () => collection.Add(null));
System\Windows\Forms\ControlTests.Methods.cs (1)
2095Assert.Throws<InvalidEnumArgumentException>("skipValue", () => control.GetChildAtPoint(new Point(5, 5), skipValue));
System\Windows\Forms\ControlTests.Properties.cs (7)
176Assert.Throws<InvalidEnumArgumentException>("value", () => control.AccessibleRole = value); 2135Assert.Throws<InvalidEnumArgumentException>("value", () => control.BackgroundImageLayout = value); 4423Assert.Throws<InvalidEnumArgumentException>("value", () => control.Dock = value); 6445Assert.Throws<InvalidEnumArgumentException>("value", () => control.ImeMode = value); 6552Assert.Throws<InvalidEnumArgumentException>("value", () => control.ImeModeBase = value); 10436Assert.Throws<InvalidEnumArgumentException>("value", () => control.RightToLeft = value); 11859Assert.Throws<ArgumentOutOfRangeException>("value", () => control.TabIndex = -1);
System\Windows\Forms\CursorConverterTests.cs (2)
59Assert.Throws<ArgumentException>("stream", () => converter.ConvertFrom(Array.Empty<byte>())); 169Assert.Throws<ArgumentNullException>("destinationType", () => converter.ConvertTo(new object(), null));
System\Windows\Forms\CursorTests.cs (9)
53Assert.Throws<ArgumentException>("handle", () => new Cursor(IntPtr.Zero)); 86Assert.Throws<ArgumentException>("stream", () => new Cursor(new MemoryStream())); 92Assert.Throws<ArgumentNullException>("stream", () => new Cursor((Stream)null)); 111Assert.Throws<ArgumentException>("stream", () => new Cursor(stream)); 128Assert.Throws<ArgumentNullException>("path", () => new Cursor((string)null)); 136Assert.Throws<ArgumentException>("path", () => new Cursor(fileName)); 149Assert.Throws<ArgumentException>("fileName", () => new Cursor(fileName)); 165Assert.Throws<ArgumentNullException>("type", () => new Cursor((Type)null, "resource")); 174Assert.Throws<ArgumentNullException>("stream", () => new Cursor(type, resource));
System\Windows\Forms\DataFormatsTests.cs (2)
108Assert.Throws<ArgumentException>("format", () => DataFormats.GetFormat("")); 109Assert.Throws<ArgumentNullException>("format", () => DataFormats.GetFormat(null));
System\Windows\Forms\DataGridView.DataGridViewControlCollectionTests.cs (1)
22Assert.Throws<ArgumentNullException>("owner", () => new DataGridView.DataGridViewControlCollection(null));
System\Windows\Forms\DataGridViewCellCancelEventArgsTests.cs (2)
24Assert.Throws<ArgumentOutOfRangeException>("columnIndex", () => new DataGridViewCellCancelEventArgs(-2, 0)); 30Assert.Throws<ArgumentOutOfRangeException>("rowIndex", () => new DataGridViewCellCancelEventArgs(0, -2));
System\Windows\Forms\DataGridViewCellContextMenuStripNeededEventArgsTests.cs (2)
24Assert.Throws<ArgumentOutOfRangeException>("columnIndex", () => new DataGridViewCellContextMenuStripNeededEventArgs(-2, 0)); 30Assert.Throws<ArgumentOutOfRangeException>("rowIndex", () => new DataGridViewCellContextMenuStripNeededEventArgs(0, -2));
System\Windows\Forms\DataGridViewCellEventArgsTests.cs (2)
23Assert.Throws<ArgumentOutOfRangeException>("columnIndex", () => new DataGridViewCellEventArgs(-2, 0)); 29Assert.Throws<ArgumentOutOfRangeException>("rowIndex", () => new DataGridViewCellEventArgs(0, -2));
System\Windows\Forms\DataGridViewCellFormattingEventArgsTests.cs (2)
32Assert.Throws<ArgumentOutOfRangeException>("columnIndex", () => new DataGridViewCellFormattingEventArgs(-2, 0, "value", typeof(string), null)); 38Assert.Throws<ArgumentOutOfRangeException>("rowIndex", () => new DataGridViewCellFormattingEventArgs(0, -2, "value", typeof(string), null));
System\Windows\Forms\DataGridViewCellMouseEventArgsTests.cs (5)
33Assert.Throws<ArgumentOutOfRangeException>("columnIndex", () => new DataGridViewCellMouseEventArgs(-2, 0, 1, 2, null)); 34Assert.Throws<ArgumentOutOfRangeException>("columnIndex", () => new DataGridViewCellMouseEventArgs(-2, 0, 1, 2, new MouseEventArgs(MouseButtons.Left, 1, 2, 3, 4))); 40Assert.Throws<ArgumentOutOfRangeException>("rowIndex", () => new DataGridViewCellMouseEventArgs(0, -2, 1, 2, null)); 41Assert.Throws<ArgumentOutOfRangeException>("rowIndex", () => new DataGridViewCellMouseEventArgs(0, -2, 1, 2, new MouseEventArgs(MouseButtons.Left, 1, 2, 3, 4))); 47Assert.Throws<ArgumentNullException>("e", () => new DataGridViewCellMouseEventArgs(1, 2, 1, 2, null));
System\Windows\Forms\DataGridViewCellPaintingEventArgsTests.cs (4)
46Assert.Throws<ArgumentNullException>("dataGridView", () => new DataGridViewCellPaintingEventArgs(null, graphics, Rectangle.Empty, Rectangle.Empty, -2, -2, DataGridViewElementStates.Displayed, null, null, null, new DataGridViewCellStyle(), null, DataGridViewPaintParts.All)); 53Assert.Throws<ArgumentNullException>("graphics", () => new DataGridViewCellPaintingEventArgs(dataGridView, null, Rectangle.Empty, Rectangle.Empty, -2, -2, DataGridViewElementStates.Displayed, null, null, null, new DataGridViewCellStyle(), null, DataGridViewPaintParts.All)); 62Assert.Throws<ArgumentNullException>("cellStyle", () => new DataGridViewCellPaintingEventArgs(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, -2, -2, DataGridViewElementStates.Displayed, null, null, null, null, null, DataGridViewPaintParts.All)); 72Assert.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)
23Assert.Throws<ArgumentNullException>("dataGridViewCell", () => new DataGridViewCellStateChangedEventArgs(null, DataGridViewElementStates.None));
System\Windows\Forms\DataGridViewCellStyleTests.cs (3)
105Assert.Throws<ArgumentNullException>("dataGridViewCellStyle", () => new DataGridViewCellStyle(null)); 128Assert.Throws<InvalidEnumArgumentException>("value", () => style.Alignment = value); 610Assert.Throws<InvalidEnumArgumentException>("value", () => style.WrapMode = value);
System\Windows\Forms\DataGridViewCellTests.cs (46)
103Assert.Throws<ArgumentOutOfRangeException>("rowIndex", () => cell.ContentBounds); 675Assert.Throws<ArgumentOutOfRangeException>("rowIndex", () => cell.EditedFormattedValue); 728Assert.Throws<ArgumentOutOfRangeException>("rowIndex", () => cell.ErrorIconBounds); 1323Assert.Throws<ArgumentOutOfRangeException>("rowIndex", () => cell.FormattedValue); 1503Assert.Throws<ArgumentOutOfRangeException>("rowIndex", () => cell.InheritedState); 3109Assert.Throws<ArgumentNullException>("dataGridViewAdvancedBorderStyleInput", () => cell.AdjustCellBorderStyle(null, controlAdvancedBorderStylePlaceholder, true, true, true, true)); 3141Assert.Throws<ArgumentNullException>("dataGridViewAdvancedBorderStylePlaceholder", () => cell.AdjustCellBorderStyle(controlAdvancedBorderStyleInput, null, true, true, true, true)); 3303Assert.Throws<ArgumentNullException>("advancedBorderStyle", () => cell.BorderWidths(null)); 3649Assert.Throws<ArgumentOutOfRangeException>("rowIndex", () => cell.GetContentBounds(rowIndex)); 3801Assert.Throws<ArgumentOutOfRangeException>("rowIndex", () => cell.GetEditedFormattedValue(rowIndex, DataGridViewDataErrorContexts.Formatting)); 4131Assert.Throws<ArgumentOutOfRangeException>("e.RowIndex", () => cell.GetErrorText(1)); 4394Assert.Throws<ArgumentOutOfRangeException>("rowIndex", () => cell.GetInheritedContextMenuStrip(rowIndex)); 4411Assert.Throws<ArgumentOutOfRangeException>("rowIndex", () => cell.GetInheritedContextMenuStrip(rowIndex)); 4627Assert.Throws<ArgumentOutOfRangeException>("rowIndex", () => cell.GetInheritedState(-1)); 4658Assert.Throws<ArgumentOutOfRangeException>("rowIndex", () => cell.GetInheritedState(rowIndex)); 4675Assert.Throws<ArgumentOutOfRangeException>("rowIndex", () => cell.GetInheritedState(rowIndex)); 4692Assert.Throws<ArgumentOutOfRangeException>("rowIndex", () => cell.GetInheritedState(rowIndex)); 4741Assert.Throws<ArgumentOutOfRangeException>("rowIndex", () => cell.GetInheritedStyle(new DataGridViewCellStyle(), rowIndex, true)); 4905Assert.Throws<ArgumentOutOfRangeException>("rowIndex", () => cell.GetSize(rowIndex)); 5050Assert.Throws<ArgumentOutOfRangeException>("rowIndex", () => cell.Value = value); 5186Assert.Throws<ArgumentOutOfRangeException>("rowIndex", () => cell.GetValue(rowIndex)); 5203Assert.Throws<ArgumentOutOfRangeException>("rowIndex", () => cell.GetValue(rowIndex)); 5281Assert.Throws<ArgumentNullException>("graphics", () => DataGridViewCell.MeasureTextHeight(null, "text", SystemFonts.DefaultFont, 10, TextFormatFlags.Default)); 5282Assert.Throws<ArgumentNullException>("graphics", () => DataGridViewCell.MeasureTextHeight(null, "text", SystemFonts.DefaultFont, 10, TextFormatFlags.Default, out widthTruncated)); 5292Assert.Throws<ArgumentNullException>("font", () => DataGridViewCell.MeasureTextHeight(graphics, "text", null, 10, TextFormatFlags.Default)); 5293Assert.Throws<ArgumentNullException>("font", () => DataGridViewCell.MeasureTextHeight(graphics, "text", null, 10, TextFormatFlags.Default, out widthTruncated)); 5305Assert.Throws<ArgumentOutOfRangeException>("maxWidth", () => DataGridViewCell.MeasureTextHeight(graphics, "text", SystemFonts.DefaultFont, maxWidth, TextFormatFlags.Default)); 5306Assert.Throws<ArgumentOutOfRangeException>("maxWidth", () => DataGridViewCell.MeasureTextHeight(graphics, "text", SystemFonts.DefaultFont, maxWidth, TextFormatFlags.Default, out widthTruncated)); 5317Assert.Throws<InvalidEnumArgumentException>("flags", () => DataGridViewCell.MeasureTextHeight(graphics, "text", SystemFonts.DefaultFont, 10, flags)); 5318Assert.Throws<InvalidEnumArgumentException>("flags", () => DataGridViewCell.MeasureTextHeight(graphics, "text", SystemFonts.DefaultFont, 10, flags, out widthTruncated)); 5348Assert.Throws<ArgumentNullException>("graphics", () => DataGridViewCell.MeasureTextPreferredSize(null, "text", SystemFonts.DefaultFont, 0.2f, TextFormatFlags.Default)); 5356Assert.Throws<ArgumentNullException>("font", () => DataGridViewCell.MeasureTextPreferredSize(graphics, "text", null, 0.2f, TextFormatFlags.Default)); 5366Assert.Throws<ArgumentOutOfRangeException>("maxRatio", () => DataGridViewCell.MeasureTextPreferredSize(graphics, "text", SystemFonts.DefaultFont, maxRatio, TextFormatFlags.Default)); 5375Assert.Throws<InvalidEnumArgumentException>("flags", () => DataGridViewCell.MeasureTextPreferredSize(graphics, "text", SystemFonts.DefaultFont, 0.2f, flags)); 5404Assert.Throws<ArgumentNullException>("graphics", () => DataGridViewCell.MeasureTextSize(null, "text", SystemFonts.DefaultFont, TextFormatFlags.Default)); 5412Assert.Throws<ArgumentNullException>("font", () => DataGridViewCell.MeasureTextSize(graphics, "text", null, TextFormatFlags.Default)); 5421Assert.Throws<InvalidEnumArgumentException>("flags", () => DataGridViewCell.MeasureTextSize(graphics, "text", SystemFonts.DefaultFont, flags)); 5450Assert.Throws<ArgumentNullException>("graphics", () => DataGridViewCell.MeasureTextWidth(null, "text", SystemFonts.DefaultFont, 10, TextFormatFlags.Default)); 5458Assert.Throws<ArgumentNullException>("font", () => DataGridViewCell.MeasureTextWidth(graphics, "text", null, 10, TextFormatFlags.Default)); 5468Assert.Throws<ArgumentOutOfRangeException>("maxHeight", () => DataGridViewCell.MeasureTextWidth(graphics, "text", SystemFonts.DefaultFont, maxHeight, TextFormatFlags.Default)); 5477Assert.Throws<InvalidEnumArgumentException>("flags", () => DataGridViewCell.MeasureTextWidth(graphics, "text", SystemFonts.DefaultFont, 10, flags)); 6162Assert.Throws<ArgumentNullException>("cellStyle", () => cell.ParseFormattedValue(1, null, new Int32Converter(), new Int32Converter())); 6215Assert.Throws<ArgumentException>("formattedValue", () => cell.ParseFormattedValue(formattedValue, new DataGridViewCellStyle(), new Int32Converter(), new Int32Converter())); 6347Assert.Throws<ArgumentOutOfRangeException>("rowIndex", () => cell.SetValue(rowIndex, "value")); 6364Assert.Throws<ArgumentOutOfRangeException>("rowIndex", () => cell.SetValue(rowIndex, "value")); 6381Assert.Throws<ArgumentOutOfRangeException>("rowIndex", () => cell.SetValue(rowIndex, "value"));
System\Windows\Forms\DataGridViewCellValueEventArgsTests.cs (2)
25Assert.Throws<ArgumentOutOfRangeException>("columnIndex", () => new DataGridViewCellValueEventArgs(columnIndex, 0)); 33Assert.Throws<ArgumentOutOfRangeException>("rowIndex", () => new DataGridViewCellValueEventArgs(0, rowIndex));
System\Windows\Forms\DataGridViewColumnCollectionTests.cs (1)
330Assert.Throws<ArgumentNullException>("dataGridViewColumn", () => collection.Add(null));
System\Windows\Forms\DataGridViewColumnDividerDoubleClickEventArgsTests.cs (3)
33Assert.Throws<ArgumentOutOfRangeException>("columnIndex", () => new DataGridViewColumnDividerDoubleClickEventArgs(-2, null)); 34Assert.Throws<ArgumentOutOfRangeException>("columnIndex", () => new DataGridViewColumnDividerDoubleClickEventArgs(-2, new HandledMouseEventArgs(MouseButtons.Left, 1, 2, 3, 4, true))); 40Assert.Throws<ArgumentNullException>("e", () => new DataGridViewColumnDividerDoubleClickEventArgs(1, null));
System\Windows\Forms\DataGridViewColumnEventArgsTests.cs (1)
20Assert.Throws<ArgumentNullException>("dataGridViewColumn", () => new DataGridViewColumnEventArgs(null));
System\Windows\Forms\DataGridViewColumnTests.cs (6)
491Assert.Throws<InvalidEnumArgumentException>("value", () => column.AutoSizeMode = value); 1000Assert.Throws<ArgumentException>("value", () => column.DefaultHeaderCellType = value); 1011Assert.Throws<ArgumentException>("value", () => column.DefaultHeaderCellType = value); 1118Assert.Throws<ArgumentOutOfRangeException>("value", () => column.DividerWidth = value); 1781Assert.Throws<InvalidEnumArgumentException>("autoSizeColumnMode", () => column.GetPreferredWidth(autoSizeColumnMode, fixedHeight: true)); 1782Assert.Throws<InvalidEnumArgumentException>("autoSizeColumnMode", () => column.GetPreferredWidth(autoSizeColumnMode, fixedHeight: false));
System\Windows\Forms\DataGridViewDataErrorEventArgsTests.cs (2)
32Assert.Throws<ArgumentOutOfRangeException>("columnIndex", () => new DataGridViewDataErrorEventArgs(null, -2, 0, DataGridViewDataErrorContexts.Formatting)); 38Assert.Throws<ArgumentOutOfRangeException>("rowIndex", () => new DataGridViewDataErrorEventArgs(null, 0, -2, DataGridViewDataErrorContexts.Formatting));
System\Windows\Forms\DataGridViewEditingControlShowingEventArgsTests.cs (1)
37Assert.Throws<ArgumentNullException>("value", () => e.CellStyle = null);
System\Windows\Forms\DataGridViewHeaderCellTests.cs (26)
3003Assert.Throws<ArgumentException>("rowIndex", () => cell.GetInheritedState(-1)); 3014Assert.Throws<ArgumentException>("rowIndex", () => cell.GetInheritedState(rowIndex)); 3025Assert.Throws<ArgumentException>("rowIndex", () => cell.GetInheritedState(rowIndex)); 3036Assert.Throws<ArgumentOutOfRangeException>("rowIndex", () => cell.GetInheritedState(rowIndex)); 3053Assert.Throws<ArgumentException>("rowIndex", () => cell.GetInheritedState(rowIndex)); 3073Assert.Throws<ArgumentException>("rowIndex", () => cell.GetInheritedState(rowIndex)); 3091Assert.Throws<ArgumentOutOfRangeException>("rowIndex", () => cell.GetInheritedState(rowIndex)); 3102Assert.Throws<ArgumentOutOfRangeException>("rowIndex", () => cell.GetInheritedState(rowIndex)); 3119Assert.Throws<ArgumentException>("rowIndex", () => cell.GetInheritedState(rowIndex)); 3271Assert.Throws<ArgumentOutOfRangeException>("rowIndex", () => cell.GetSize(rowIndex)); 3283Assert.Throws<ArgumentOutOfRangeException>("rowIndex", () => cell.GetSize(rowIndex)); 3295Assert.Throws<ArgumentOutOfRangeException>("rowIndex", () => cell.GetSize(rowIndex)); 3307Assert.Throws<ArgumentOutOfRangeException>("rowIndex", () => cell.GetSize(rowIndex)); 3324Assert.Throws<ArgumentOutOfRangeException>("rowIndex", () => cell.GetSize(rowIndex)); 3341Assert.Throws<ArgumentOutOfRangeException>("rowIndex", () => cell.GetSize(rowIndex)); 3464Assert.Throws<ArgumentOutOfRangeException>("rowIndex", () => cell.Value = value); 3605Assert.Throws<ArgumentOutOfRangeException>("rowIndex", () => cell.Value = value1); 3643Assert.Throws<ArgumentOutOfRangeException>("rowIndex", () => cell.Value = value1); 3684Assert.Throws<ArgumentOutOfRangeException>("rowIndex", () => cell.Value = value1); 3713Assert.Throws<ArgumentOutOfRangeException>("rowIndex", () => cell.GetValue(rowIndex)); 3725Assert.Throws<ArgumentOutOfRangeException>("rowIndex", () => cell.GetValue(rowIndex)); 3737Assert.Throws<ArgumentOutOfRangeException>("rowIndex", () => cell.GetValue(rowIndex)); 3754Assert.Throws<ArgumentOutOfRangeException>("rowIndex", () => cell.GetValue(rowIndex)); 3772Assert.Throws<ArgumentOutOfRangeException>("rowIndex", () => cell.GetValue(rowIndex)); 3786Assert.Throws<ArgumentOutOfRangeException>("rowIndex", () => cell.GetValue(rowIndex)); 3803Assert.Throws<ArgumentOutOfRangeException>("rowIndex", () => cell.GetValue(rowIndex));
System\Windows\Forms\DataGridViewRowContextMenuStripNeededEventArgsTests.cs (1)
23Assert.Throws<ArgumentOutOfRangeException>("rowIndex", () => new DataGridViewRowContextMenuStripNeededEventArgs(-2));
System\Windows\Forms\DataGridViewRowDividerDoubleClickEventArgsTests.cs (3)
33Assert.Throws<ArgumentNullException>("e", () => new DataGridViewRowDividerDoubleClickEventArgs(-2, null)); 34Assert.Throws<ArgumentOutOfRangeException>("rowIndex", () => new DataGridViewRowDividerDoubleClickEventArgs(-2, new HandledMouseEventArgs(MouseButtons.Left, 1, 2, 3, 4, true))); 40Assert.Throws<ArgumentNullException>("e", () => new DataGridViewRowDividerDoubleClickEventArgs(1, null));
System\Windows\Forms\DataGridViewRowEventArgsTests.cs (1)
20Assert.Throws<ArgumentNullException>("dataGridViewRow", () => new DataGridViewRowEventArgs(null));
System\Windows\Forms\DataGridViewRowHeightInfoNeededEventArgsTests.cs (2)
50Assert.Throws<ArgumentOutOfRangeException>("value", () => e.Height = value); 106Assert.Throws<ArgumentOutOfRangeException>("value", () => e.MinimumHeight = value);
System\Windows\Forms\DataGridViewRowPostPaintEventArgsTests.cs (3)
42Assert.Throws<ArgumentNullException>("dataGridView", () => new DataGridViewRowPostPaintEventArgs(null, graphics, Rectangle.Empty, Rectangle.Empty, -2, DataGridViewElementStates.Displayed, null, new DataGridViewCellStyle(), false, false)); 49Assert.Throws<ArgumentNullException>("graphics", () => new DataGridViewRowPostPaintEventArgs(dataGridView, null, Rectangle.Empty, Rectangle.Empty, -2, DataGridViewElementStates.Displayed, null, new DataGridViewCellStyle(), false, false)); 58Assert.Throws<ArgumentNullException>("inheritedRowStyle", () => new DataGridViewRowPostPaintEventArgs(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, -2, DataGridViewElementStates.Displayed, null, null, false, false));
System\Windows\Forms\DataGridViewRowPrePaintEventArgsTests.cs (4)
43Assert.Throws<ArgumentNullException>("dataGridView", () => new DataGridViewRowPrePaintEventArgs(null, graphics, Rectangle.Empty, Rectangle.Empty, -2, DataGridViewElementStates.Displayed, null, new DataGridViewCellStyle(), false, false)); 50Assert.Throws<ArgumentNullException>("graphics", () => new DataGridViewRowPrePaintEventArgs(dataGridView, null, Rectangle.Empty, Rectangle.Empty, -2, DataGridViewElementStates.Displayed, null, new DataGridViewCellStyle(), false, false)); 59Assert.Throws<ArgumentNullException>("inheritedRowStyle", () => new DataGridViewRowPrePaintEventArgs(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, -2, DataGridViewElementStates.Displayed, null, null, false, false)); 106Assert.Throws<ArgumentException>("value", () => e.PaintParts = value);
System\Windows\Forms\DataGridViewRowsRemovedEventArgsTests.cs (2)
24Assert.Throws<ArgumentOutOfRangeException>("rowIndex", () => new DataGridViewRowsRemovedEventArgs(rowIndex, 1)); 33Assert.Throws<ArgumentOutOfRangeException>("rowCount", () => new DataGridViewRowsRemovedEventArgs(1, rowCount));
System\Windows\Forms\DataGridViewRowTests.cs (13)
722Assert.Throws<ArgumentException>("value", () => row.DefaultHeaderCellType = value); 733Assert.Throws<ArgumentException>("value", () => row.DefaultHeaderCellType = value); 874Assert.Throws<ArgumentOutOfRangeException>("value", () => row.DividerHeight = value); 1109Assert.Throws<ArgumentOutOfRangeException>("rowIndex", () => row.ErrorText = "value"); 1776Assert.Throws<ArgumentException>("value", () => row.HeaderCellCore = value); 2015Assert.Throws<ArgumentOutOfRangeException>("value", () => row.Height = value); 2485Assert.Throws<ArgumentOutOfRangeException>("value", () => row.MinimumHeight = value); 2900Assert.Throws<InvalidEnumArgumentException>("value", () => row.Resizable = value); 4369Assert.Throws<ArgumentOutOfRangeException>("rowIndex", () => row.GetContextMenuStrip(rowIndex)); 4493Assert.Throws<ArgumentOutOfRangeException>("rowIndex", () => row.GetErrorText(rowIndex)); 4549Assert.Throws<ArgumentException>("rowIndex", () => row.GetState(rowIndex)); 4563Assert.Throws<ArgumentOutOfRangeException>("rowIndex", () => row.GetState(rowIndex)); 5725Assert.Throws<ArgumentNullException>("values", () => row.SetValues(null));
System\Windows\Forms\DataGridViewSelectedCellCollectionTests.cs (4)
67Assert.Throws<ArgumentOutOfRangeException>("index", () => collection[index]); 86Assert.Throws<ArgumentOutOfRangeException>("index", () => collection[index]); 243Assert.Throws<ArgumentOutOfRangeException>("index", () => iList[index]); 263Assert.Throws<ArgumentOutOfRangeException>("index", () => iList[index]);
System\Windows\Forms\DataGridViewSelectedColumnCollectionTests.cs (4)
75Assert.Throws<ArgumentOutOfRangeException>("index", () => collection[index]); 98Assert.Throws<ArgumentOutOfRangeException>("index", () => collection[index]); 271Assert.Throws<ArgumentOutOfRangeException>("index", () => iList[index]); 295Assert.Throws<ArgumentOutOfRangeException>("index", () => iList[index]);
System\Windows\Forms\DataGridViewSelectedRowCollectionTests.cs (4)
65Assert.Throws<ArgumentOutOfRangeException>("index", () => collection[index]); 83Assert.Throws<ArgumentOutOfRangeException>("index", () => collection[index]); 236Assert.Throws<ArgumentOutOfRangeException>("index", () => iList[index]); 255Assert.Throws<ArgumentOutOfRangeException>("index", () => iList[index]);
System\Windows\Forms\DataGridViewTests.cs (4)
491Assert.Throws<ArgumentOutOfRangeException>("value", () => control.ColumnHeadersHeight = value); 784Assert.Throws<InvalidEnumArgumentException>("value", () => control.ColumnHeadersHeightSizeMode = value); 1419Assert.Throws<ArgumentOutOfRangeException>("value", () => control.RowHeadersWidth = value); 1725Assert.Throws<InvalidEnumArgumentException>("value", () => control.RowHeadersWidthSizeMode = value);
System\Windows\Forms\DateTimePickerTests.cs (1)
168Assert.Throws<InvalidEnumArgumentException>("value", () => control.Format = value);
System\Windows\Forms\Design\WindowsFormsComponentEditorTests.cs (3)
85Assert.Throws<ArgumentException>("component", () => editor.EditComponent(component, null)); 86Assert.Throws<ArgumentException>("component", () => editor.EditComponent(null, component)); 87Assert.Throws<ArgumentException>("component", () => editor.EditComponent(null, component, null));
System\Windows\Forms\DrawItemEventArgsTests.cs (2)
65Assert.Throws<ArgumentNullException>("graphics", () => new DrawItemEventArgs(null, SystemFonts.DefaultFont, new Rectangle(1, 2, 3, 4), 0, DrawItemState.None)); 66Assert.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)
40Assert.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)
38Assert.Throws<ArgumentNullException>("graphics", () => new DrawListViewItemEventArgs(null, new ListViewItem(), new Rectangle(1, 2, 3, 4), 0, ListViewItemStates.Default)); 46Assert.Throws<ArgumentNullException>("item", () => new DrawListViewItemEventArgs(graphics, null, new Rectangle(1, 2, 3, 4), 0, ListViewItemStates.Default));
System\Windows\Forms\DrawListViewSubItemEventArgsTests.cs (3)
41Assert.Throws<ArgumentNullException>("graphics", () => new DrawListViewSubItemEventArgs(null, new Rectangle(1, 2, 3, 4), new ListViewItem(), new ListViewItem.ListViewSubItem(), -1, 0, new ColumnHeader(), ListViewItemStates.Default)); 49Assert.Throws<ArgumentNullException>("item", () => new DrawListViewSubItemEventArgs(graphics, new Rectangle(1, 2, 3, 4), null, new ListViewItem.ListViewSubItem(), -1, 0, new ColumnHeader(), ListViewItemStates.Default)); 59Assert.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)
59Assert.Throws<ArgumentNullException>("parentControl", () => new ErrorProvider((ContainerControl)null)); 86Assert.Throws<ArgumentNullException>("container", () => new ErrorProvider((IContainer)null)); 117Assert.Throws<ArgumentOutOfRangeException>("value", () => provider.BlinkRate = -1); 179Assert.Throws<InvalidEnumArgumentException>("value", () => provider.BlinkStyle = value); 585Assert.Throws<ArgumentNullException>("value", () => provider.Icon = null); 964Assert.Throws<ArgumentNullException>("control", () => provider.GetError(null)); 982Assert.Throws<ArgumentNullException>("control", () => provider.GetIconAlignment(null)); 1000Assert.Throws<ArgumentNullException>("control", () => provider.GetIconPadding(null));
System\Windows\Forms\FileDialogTests.cs (1)
332Assert.Throws<ArgumentException>("value", () => dialog.Filter = value);
System\Windows\Forms\FlowLayoutPanelTests.cs (2)
175Assert.Throws<InvalidEnumArgumentException>("value", () => control.FlowDirection = value); 259Assert.Throws<ArgumentNullException>("control", () => control.GetFlowBreak(null));
System\Windows\Forms\FlowLayoutSettingsTests.cs (2)
52Assert.Throws<InvalidEnumArgumentException>("value", () => settings.FlowDirection = value); 111Assert.Throws<ArgumentNullException>("child", () => settings.GetFlowBreak(null));
System\Windows\Forms\Form.ControlCollectionTests.cs (1)
22Assert.Throws<ArgumentNullException>("owner", () => new Form.ControlCollection(null));
System\Windows\Forms\FormTests.cs (1)
1221Assert.Throws<ArgumentException>("value", () => control.Parent = parent);
System\Windows\Forms\GroupBoxTests.cs (1)
561Assert.Throws<InvalidEnumArgumentException>("value", () => control.AutoSizeMode = value);
System\Windows\Forms\HelpProviderTests.cs (4)
97Assert.Throws<ArgumentNullException>("ctl", () => provider.GetHelpKeyword(null)); 111Assert.Throws<ArgumentNullException>("ctl", () => provider.GetHelpNavigator(null)); 125Assert.Throws<ArgumentNullException>("ctl", () => provider.GetHelpString(null)); 139Assert.Throws<ArgumentNullException>("ctl", () => provider.GetShowHelp(null));
System\Windows\Forms\HScrollBarTests.cs (1)
197Assert.Throws<InvalidEnumArgumentException>("value", () => control.RightToLeft = value);
System\Windows\Forms\ImageList.ImageCollectionTests.cs (12)
223Assert.Throws<ArgumentOutOfRangeException>("index", () => collection[index]); 235Assert.Throws<ArgumentOutOfRangeException>("index", () => collection[index]); 305Assert.Throws<ArgumentOutOfRangeException>("index", () => collection[index] = null); 317Assert.Throws<ArgumentOutOfRangeException>("index", () => collection[index] = null); 328Assert.Throws<ArgumentNullException>("value", () => collection[0] = null); 794Assert.Throws<ArgumentNullException>("value", () => collection.Add(null, Color.Transparent)); 941Assert.Throws<ArgumentNullException>("value", () => collection.AddStrip(null)); 953Assert.Throws<ArgumentException>("value", () => collection.AddStrip(image)); 965Assert.Throws<ArgumentException>("value", () => collection.AddStrip(image)); 1680Assert.Throws<ArgumentOutOfRangeException>("index", () => collection[index] = value); 1694Assert.Throws<ArgumentOutOfRangeException>("index", () => collection[index] = image); 1712Assert.Throws<ArgumentException>("value", () => collection[0] = value);
System\Windows\Forms\ImageListTests.cs (5)
51Assert.Throws<ArgumentNullException>("container", () => new ImageList(null)); 223Assert.Throws<InvalidEnumArgumentException>("value", () => list.ColorDepth = value); 402Assert.Throws<ArgumentException>("value", () => list.ImageSize = Size.Empty); 417Assert.Throws<ArgumentOutOfRangeException>("value", () => list.ImageSize = new Size(width, 1)); 425Assert.Throws<ArgumentOutOfRangeException>("value", () => list.ImageSize = new Size(1, height));
System\Windows\Forms\InputLanguageChangedEventArgsTests.cs (3)
30Assert.Throws<ArgumentNullException>("culture", () => new InputLanguageChangedEventArgs((CultureInfo)null, 0)); 43Assert.Throws<ArgumentException>("culture", () => new InputLanguageChangedEventArgs(culture, 0)); 71Assert.Throws<ArgumentNullException>("inputLanguage", () => new InputLanguageChangedEventArgs((InputLanguage)null, 0));
System\Windows\Forms\InputLanguageChangingEventArgsTests.cs (3)
31Assert.Throws<ArgumentNullException>("culture", () => new InputLanguageChangingEventArgs((CultureInfo)null, true)); 44Assert.Throws<ArgumentException>("culture", () => new InputLanguageChangingEventArgs(culture, true)); 72Assert.Throws<ArgumentNullException>("inputLanguage", () => new InputLanguageChangingEventArgs((InputLanguage)null, true));
System\Windows\Forms\InputLanguageTests.cs (2)
66Assert.Throws<ArgumentException>("value", () => InputLanguage.CurrentInputLanguage = language); 103Assert.Throws<ArgumentNullException>("culture", () => InputLanguage.FromCulture(null));
System\Windows\Forms\LabelTests.cs (1)
246Assert.Throws<InvalidEnumArgumentException>("value", () => control.ImageAlign = value);
System\Windows\Forms\Layout\FlowLayoutTests.cs (1)
289Assert.Throws<ArgumentNullException>("container", () => engine.Layout(null, new LayoutEventArgs(control, "affectedProperty")));
System\Windows\Forms\Layout\LayoutEngineTests.cs (1)
49Assert.Throws<ArgumentNullException>("container", () => engine.Layout(null, new LayoutEventArgs(new Component(), "affectedProperty")));
System\Windows\Forms\Layout\TableLayoutSettingsTests.cs (18)
79Assert.Throws<ArgumentOutOfRangeException>("value", () => settings.ColumnCount = -1); 117Assert.Throws<InvalidEnumArgumentException>("value", () => settings.GrowStyle = value); 153Assert.Throws<ArgumentOutOfRangeException>("value", () => settings.RowCount = -1); 179Assert.Throws<ArgumentNullException>("control", () => settings.GetCellPosition(null)); 187Assert.Throws<ArgumentNullException>("control", () => settings.GetCellPosition(null)); 213Assert.Throws<ArgumentOutOfRangeException>("column", () => settings.GetCellPosition(child)); 223Assert.Throws<ArgumentOutOfRangeException>("column", () => settings.GetCellPosition(child)); 233Assert.Throws<ArgumentOutOfRangeException>("row", () => settings.GetCellPosition(child)); 243Assert.Throws<ArgumentOutOfRangeException>("row", () => settings.GetCellPosition(child)); 269Assert.Throws<ArgumentNullException>("control", () => settings.GetColumn(null)); 277Assert.Throws<ArgumentNullException>("control", () => settings.GetColumn(null)); 320Assert.Throws<ArgumentNullException>("control", () => settings.GetColumnSpan(null)); 328Assert.Throws<ArgumentNullException>("control", () => settings.GetColumnSpan(null)); 370Assert.Throws<ArgumentNullException>("control", () => settings.GetRow(null)); 378Assert.Throws<ArgumentNullException>("control", () => settings.GetRow(null)); 420Assert.Throws<ArgumentNullException>("control", () => settings.GetRowSpan(null)); 428Assert.Throws<ArgumentNullException>("control", () => settings.GetRowSpan(null)); 1112Assert.Throws<ArgumentNullException>("control", () => settings.GetColumnSpan(null));
System\Windows\Forms\Layout\TableLayoutSettingsTypeConverterTests.cs (1)
288Assert.Throws<ArgumentNullException>("destinationType", () => converter.ConvertTo(new object(), null));
System\Windows\Forms\LinkAreaConverterTests.cs (3)
94Assert.Throws<ArgumentNullException>("destinationType", () => converter.ConvertTo(new object(), null)); 130Assert.Throws<ArgumentNullException>("propertyValues", () => converter.CreateInstance(null, null)); 189Assert.Throws<ArgumentException>("propertyValues", () => converter.CreateInstance(null, propertyValues));
System\Windows\Forms\LinkConverterTests.cs (1)
103Assert.Throws<ArgumentNullException>("destinationType", () => converter.ConvertTo(new object(), null));
System\Windows\Forms\ListBox.IntegerCollectionTests.cs (9)
22Assert.Throws<ArgumentNullException>("owner", () => new ListBox.IntegerCollection(null)); 67Assert.Throws<ArgumentOutOfRangeException>("index", () => collection[index]); 81Assert.Throws<ArgumentOutOfRangeException>("index", () => collection[index]); 228Assert.Throws<ArgumentOutOfRangeException>("index", () => collection[index] = 2); 242Assert.Throws<ArgumentOutOfRangeException>("index", () => collection[index] = 2); 1535Assert.Throws<ArgumentOutOfRangeException>("index", () => collection[index]); 1549Assert.Throws<ArgumentOutOfRangeException>("index", () => collection[index]); 1712Assert.Throws<ArgumentOutOfRangeException>("index", () => collection[index] = 2); 1726Assert.Throws<ArgumentOutOfRangeException>("index", () => collection[index] = 2);
System\Windows\Forms\ListBox.ObjectCollectionTests.cs (23)
49Assert.Throws<ArgumentNullException>("owner", () => new ListBox.ObjectCollection(null)); 50Assert.Throws<ArgumentNullException>("owner", () => new ListBox.ObjectCollection(null, new ListBox.ObjectCollection(owner))); 51Assert.Throws<ArgumentNullException>("owner", () => new ListBox.ObjectCollection(null, Array.Empty<object>())); 78Assert.Throws<ArgumentNullException>("value", () => new ListBox.ObjectCollection(owner, (object[])null)); 79Assert.Throws<ArgumentNullException>("value", () => new ListBox.ObjectCollection(owner, (ListBox.ObjectCollection)null)); 141Assert.Throws<ArgumentOutOfRangeException>("index", () => collection[index]); 155Assert.Throws<ArgumentOutOfRangeException>("index", () => collection[index]); 1253Assert.Throws<ArgumentNullException>("value", () => collection[index] = null); 1268Assert.Throws<ArgumentNullException>("value", () => collection[index] = null); 1279Assert.Throws<ArgumentOutOfRangeException>("index", () => collection[index] = 2); 1293Assert.Throws<ArgumentOutOfRangeException>("index", () => collection[index] = 2); 2184Assert.Throws<ArgumentNullException>("item", () => collection.Add(null)); 3978Assert.Throws<ArgumentNullException>("value", () => collection.Contains(null)); 4116Assert.Throws<ArgumentNullException>("value", () => collection.IndexOf(null)); 6926Assert.Throws<ArgumentOutOfRangeException>("index", () => collection[index]); 6940Assert.Throws<ArgumentOutOfRangeException>("index", () => collection[index]); 8058Assert.Throws<ArgumentNullException>("value", () => collection[index] = null); 8073Assert.Throws<ArgumentNullException>("value", () => collection[index] = null); 8084Assert.Throws<ArgumentOutOfRangeException>("index", () => collection[index] = 2); 8098Assert.Throws<ArgumentOutOfRangeException>("index", () => collection[index] = 2); 8989Assert.Throws<ArgumentNullException>("item", () => collection.Add(null)); 9300Assert.Throws<ArgumentNullException>("value", () => collection.Contains(null)); 9438Assert.Throws<ArgumentNullException>("value", () => collection.IndexOf(null));
System\Windows\Forms\ListBox.SelectedIndexCollectionTests.cs (1)
23Assert.Throws<ArgumentNullException>("owner", () => new ListBox.SelectedIndexCollection(null));
System\Windows\Forms\ListBox.SelectedObjectCollectionTests.cs (1)
23Assert.Throws<ArgumentNullException>("owner", () => new ListBox.SelectedObjectCollection(null));
System\Windows\Forms\ListBoxTests.cs (28)
588Assert.Throws<InvalidEnumArgumentException>("value", () => control.BackgroundImageLayout = value); 648Assert.Throws<InvalidEnumArgumentException>("value", () => control.BorderStyle = value); 777Assert.Throws<ArgumentOutOfRangeException>("value", () => control.ColumnWidth = -1); 1027Assert.Throws<InvalidEnumArgumentException>("value", () => control.DrawMode = value); 1037Assert.Throws<ArgumentException>("value", () => control.DrawMode = DrawMode.OwnerDrawVariable); 1810Assert.Throws<ArgumentOutOfRangeException>("value", () => control.ItemHeight = value); 1961Assert.Throws<ArgumentException>("value", () => control.MultiColumn = true); 2230Assert.Throws<InvalidEnumArgumentException>("value", () => control.RightToLeft = value); 2733Assert.Throws<ArgumentOutOfRangeException>("value", () => control.SelectedIndex = value); 2743Assert.Throws<ArgumentOutOfRangeException>("value", () => control.SelectedIndex = value); 2753Assert.Throws<ArgumentException>("value", () => control.SelectedIndex = -1); 3905Assert.Throws<InvalidEnumArgumentException>("value", () => control.SelectionMode = value); 5034Assert.Throws<ArgumentOutOfRangeException>("startIndex", () => control.FindString("s", startIndex)); 5138Assert.Throws<ArgumentOutOfRangeException>("startIndex", () => control.FindStringExact("s", startIndex)); 5309Assert.Throws<ArgumentOutOfRangeException>("index", () => control.GetItemHeight(index)); 5320Assert.Throws<ArgumentOutOfRangeException>("index", () => control.GetItemHeight(index)); 5453Assert.Throws<ArgumentOutOfRangeException>("index", () => control.GetItemRectangle(-1)); 5454Assert.Throws<ArgumentOutOfRangeException>("index", () => control.GetItemRectangle(0)); 5455Assert.Throws<ArgumentOutOfRangeException>("index", () => control.GetItemRectangle(1)); 5464Assert.Throws<ArgumentOutOfRangeException>("index", () => control.GetItemRectangle(-1)); 5465Assert.Throws<ArgumentOutOfRangeException>("index", () => control.GetItemRectangle(1)); 5466Assert.Throws<ArgumentOutOfRangeException>("index", () => control.GetItemRectangle(2)); 5473Assert.Throws<ArgumentOutOfRangeException>("index", () => control.GetItemRectangle(-1)); 5474Assert.Throws<ArgumentOutOfRangeException>("index", () => control.GetItemRectangle(0)); 5475Assert.Throws<ArgumentOutOfRangeException>("index", () => control.GetItemRectangle(1)); 5485Assert.Throws<ArgumentOutOfRangeException>("index", () => control.GetItemRectangle(-1)); 5486Assert.Throws<ArgumentOutOfRangeException>("index", () => control.GetItemRectangle(1)); 5487Assert.Throws<ArgumentOutOfRangeException>("index", () => control.GetItemRectangle(2));
System\Windows\Forms\ListControlTests.cs (4)
1065Assert.Throws<ArgumentException>("value", () => control.DataSource = new object()); 1796Assert.Throws<ArgumentException>("newDisplayMember", (() => control.ValueMember = "NoSuchValue")); 1845Assert.Throws<ArgumentException>("value", (() => control.ValueMember = "NoSuchValue")); 2067Assert.Throws<ArgumentNullException>("key", () => control.SelectedValue = null);
System\Windows\Forms\ListView.ListViewItemCollectionTests.cs (2)
98Assert.Throws<ArgumentNullException>("key", () => collection.Find(key, searchAllSubItems: true)); 99Assert.Throws<ArgumentNullException>("key", () => collection.Find(key, searchAllSubItems: false));
System\Windows\Forms\ListViewGroupCollectionTests.cs (8)
41Assert.Throws<ArgumentOutOfRangeException>("index", () => collection[index]); 175Assert.Throws<ArgumentNullException>("value", () => collection[0] = null); 186Assert.Throws<ArgumentOutOfRangeException>("index", () => collection[index] = new ListViewGroup()); 208Assert.Throws<ArgumentOutOfRangeException>("index", () => collection[index]); 246Assert.Throws<ArgumentOutOfRangeException>("index", () => collection[index] = new ListViewGroup()); 364Assert.Throws<ArgumentNullException>("value", () => collection["key"] = null); 480Assert.Throws<ArgumentNullException>("group", () => collection.Add(null)); 532Assert.Throws<ArgumentException>("value", () => collection.Add(value));
System\Windows\Forms\ListViewGroupConverterTests.cs (1)
221Assert.Throws<ArgumentNullException>("destinationType", () => converter.ConvertTo(new object(), null));
System\Windows\Forms\ListViewGroupTests.cs (4)
251Assert.Throws<ArgumentOutOfRangeException>("value", () => group.TitleImageIndex = value); 783Assert.Throws<InvalidEnumArgumentException>("value", () => group.FooterAlignment = value); 1035Assert.Throws<InvalidEnumArgumentException>("value", () => group.HeaderAlignment = value); 1171Assert.Throws<InvalidEnumArgumentException>("value", () => group.CollapsedState = value);
System\Windows\Forms\ListViewItemConverterTests.cs (1)
276Assert.Throws<ArgumentNullException>("destinationType", () => converter.ConvertTo(new object(), null));
System\Windows\Forms\ListViewItemTests.cs (8)
831Assert.Throws<ArgumentNullException>("subItems", () => new ListViewItem((ListViewItem.ListViewSubItem[])null, "imageKey")); 832Assert.Throws<ArgumentNullException>("subItems", () => new ListViewItem((ListViewItem.ListViewSubItem[])null, 1)); 833Assert.Throws<ArgumentNullException>("subItems", () => new ListViewItem((ListViewItem.ListViewSubItem[])null, "imageKey", new ListViewGroup())); 834Assert.Throws<ArgumentNullException>("subItems", () => new ListViewItem((ListViewItem.ListViewSubItem[])null, 0, new ListViewGroup())); 841Assert.Throws<ArgumentNullException>("subItems", () => new ListViewItem(subItems, "imageKey")); 842Assert.Throws<ArgumentNullException>("subItems", () => new ListViewItem(subItems, 1)); 843Assert.Throws<ArgumentNullException>("subItems", () => new ListViewItem(subItems, "imageKey", new ListViewGroup())); 844Assert.Throws<ArgumentNullException>("subItems", () => new ListViewItem(subItems, 1, new ListViewGroup()));
System\Windows\Forms\ListViewSubItemCollectionTests.cs (9)
23Assert.Throws<ArgumentNullException>("owner", () => new ListViewItem.ListViewSubItemCollection(null)); 59Assert.Throws<ArgumentOutOfRangeException>("index", () => collection[index]); 86Assert.Throws<ArgumentOutOfRangeException>("index", () => collection[index] = new ListViewItem.ListViewSubItem()); 97Assert.Throws<ArgumentNullException>("value", () => collection[0] = null); 121Assert.Throws<ArgumentOutOfRangeException>("index", () => collection[index]); 148Assert.Throws<ArgumentOutOfRangeException>("index", () => collection[index]); 158Assert.Throws<ArgumentException>("value", () => collection[0] = value); 284Assert.Throws<ArgumentNullException>("item", () => collection.Add((ListViewItem.ListViewSubItem)null)); 305Assert.Throws<ArgumentException>("item", () => collection.Add(value));
System\Windows\Forms\ListViewSubItemConverterTests.cs (1)
89Assert.Throws<ArgumentNullException>("destinationType", () => converter.ConvertTo(new object(), null));
System\Windows\Forms\ListViewTests.cs (21)
246Assert.Throws<InvalidEnumArgumentException>("value", () => listView.Activation = value); 257Assert.Throws<InvalidEnumArgumentException>("value", () => listView.Activation = value); 269Assert.Throws<ArgumentException>("value", () => listView.Activation = value); 327Assert.Throws<InvalidEnumArgumentException>("value", () => listView.Alignment = value); 612Assert.Throws<InvalidEnumArgumentException>("value", () => control.BackgroundImageLayout = value); 790Assert.Throws<InvalidEnumArgumentException>("value", () => listView.BorderStyle = value); 2122Assert.Throws<InvalidEnumArgumentException>("value", () => listView.HeaderStyle = value); 2356Assert.Throws<ArgumentException>("value", () => listView.HoverSelection = false); 4189Assert.Throws<ArgumentOutOfRangeException>("index", () => control.GetItemRect(0)); 4214Assert.Throws<ArgumentOutOfRangeException>("index", () => control.GetItemRect(-1)); 4215Assert.Throws<ArgumentOutOfRangeException>("index", () => control.GetItemRect(0)); 4216Assert.Throws<ArgumentOutOfRangeException>("index", () => control.GetItemRect(1)); 4226Assert.Throws<ArgumentOutOfRangeException>("index", () => control.GetItemRect(-1)); 4227Assert.Throws<ArgumentOutOfRangeException>("index", () => control.GetItemRect(1)); 4228Assert.Throws<ArgumentOutOfRangeException>("index", () => control.GetItemRect(2)); 4235Assert.Throws<ArgumentOutOfRangeException>("index", () => control.GetItemRect(-1)); 4236Assert.Throws<ArgumentOutOfRangeException>("index", () => control.GetItemRect(0)); 4237Assert.Throws<ArgumentOutOfRangeException>("index", () => control.GetItemRect(1)); 4248Assert.Throws<ArgumentOutOfRangeException>("index", () => control.GetItemRect(-1)); 4249Assert.Throws<ArgumentOutOfRangeException>("index", () => control.GetItemRect(1)); 4250Assert.Throws<ArgumentOutOfRangeException>("index", () => control.GetItemRect(2));
System\Windows\Forms\MdiClient.ControlCollectionTests.cs (1)
22Assert.Throws<ArgumentNullException>("owner", () => new MdiClient.ControlCollection(null));
System\Windows\Forms\MonthCalendarTests.cs (25)
490Assert.Throws<InvalidEnumArgumentException>("value", () => control.BackgroundImageLayout = value); 730Assert.Throws<ArgumentOutOfRangeException>("x", () => calendar.CalendarDimensions = new Size(x, 1)); 739Assert.Throws<ArgumentOutOfRangeException>("y", () => calendar.CalendarDimensions = new Size(1, y)); 916Assert.Throws<InvalidEnumArgumentException>("FirstDayOfWeek", () => calendar.FirstDayOfWeek = value); 1306Assert.Throws<InvalidEnumArgumentException>("value", () => control.ImeMode = value); 1376Assert.Throws<ArgumentOutOfRangeException>("value", () => calendar.MaxDate = calendar.MinDate.AddTicks(-1)); 1440Assert.Throws<ArgumentOutOfRangeException>("value", () => calendar.MaxSelectionCount = value); 1509Assert.Throws<ArgumentOutOfRangeException>("value", () => calendar.MinDate = calendar.MaxDate.AddTicks(1)); 1516Assert.Throws<ArgumentOutOfRangeException>("value", () => calendar.MinDate = calendar.MinDate.AddTicks(-1)); 1938Assert.Throws<ArgumentOutOfRangeException>("value", () => calendar.ScrollChange = value); 2011Assert.Throws<ArgumentOutOfRangeException>("value", () => calendar.SelectionStart = calendar.MinDate.AddTicks(-1)); 2022Assert.Throws<ArgumentOutOfRangeException>("value", () => calendar.SelectionStart = calendar.MaxDate.AddTicks(1)); 2089Assert.Throws<ArgumentOutOfRangeException>("value", () => calendar.SelectionEnd = calendar.MinDate.AddTicks(-1)); 2092Assert.Throws<ArgumentOutOfRangeException>("value", () => calendar.SelectionEnd = calendar.MinDate.AddTicks(-1)); 2099Assert.Throws<ArgumentOutOfRangeException>("value", () => calendar.SelectionEnd = calendar.MaxDate.AddTicks(1)); 2102Assert.Throws<ArgumentOutOfRangeException>("value", () => calendar.SelectionEnd = calendar.MaxDate.AddTicks(1)); 2207Assert.Throws<ArgumentOutOfRangeException>("date1", () => calendar.SelectionRange = new SelectionRange(calendar.MinDate.AddTicks(-1), calendar.MinDate)); 2208Assert.Throws<ArgumentOutOfRangeException>("date1", () => calendar.SelectionRange = new SelectionRange(calendar.MinDate, calendar.MinDate.AddTicks(-1))); 2224Assert.Throws<ArgumentOutOfRangeException>("date2", () => calendar.SelectionRange = new SelectionRange(calendar.MaxDate.AddDays(1), calendar.MaxDate)); 2225Assert.Throws<ArgumentOutOfRangeException>("date2", () => calendar.SelectionRange = new SelectionRange(calendar.MaxDate, calendar.MaxDate.AddDays(1))); 2768Assert.Throws<ArgumentException>("value", () => calendar.TitleBackColor = Color.Empty); 2827Assert.Throws<ArgumentException>("value", () => calendar.TitleForeColor = Color.Empty); 2911Assert.Throws<ArgumentOutOfRangeException>("value", () => calendar.TodayDate = calendar.MinDate.AddTicks(-1)); 2922Assert.Throws<ArgumentOutOfRangeException>("value", () => calendar.TodayDate = calendar.MaxDate.AddDays(1)); 2981Assert.Throws<ArgumentException>("value", () => calendar.TrailingForeColor = Color.Empty);
System\Windows\Forms\NotifyIconTests.cs (2)
48Assert.Throws<ArgumentNullException>("container", () => new NotifyIcon(null)); 71Assert.Throws<InvalidEnumArgumentException>("value", () => notifyIcon.BalloonTipIcon = value);
System\Windows\Forms\OpacityConverterTests.cs (1)
96Assert.Throws<ArgumentNullException>("destinationType", () => converter.ConvertTo(new object(), null));
System\Windows\Forms\PaddingConverterTests.cs (4)
59Assert.Throws<ArgumentException>("value", () => converter.ConvertFrom(value)); 106Assert.Throws<ArgumentNullException>("destinationType", () => converter.ConvertTo(new object(), null)); 178Assert.Throws<ArgumentNullException>("propertyValues", () => converter.CreateInstance(new Mock<ITypeDescriptorContext>(MockBehavior.Strict).Object, null)); 362Assert.Throws<ArgumentException>("propertyValues", () => converter.CreateInstance(mockContext.Object, propertyValues));
System\Windows\Forms\PaintEventArgsTests.cs (1)
33Assert.Throws<ArgumentNullException>("graphics", () => new PaintEventArgs((Graphics)null, new Rectangle(1, 2, 3, 4)));
System\Windows\Forms\PanelTests.cs (2)
549Assert.Throws<InvalidEnumArgumentException>("value", () => control.AutoSizeMode = value); 605Assert.Throws<InvalidEnumArgumentException>("value", () => control.BorderStyle = value);
System\Windows\Forms\PictureBoxTests.cs (5)
174Assert.Throws<InvalidEnumArgumentException>("value", () => pictureBox.BorderStyle = value); 1004Assert.Throws<InvalidEnumArgumentException>("value", () => control.ImeMode = value); 1274Assert.Throws<InvalidEnumArgumentException>("value", () => control.RightToLeft = value); 1389Assert.Throws<InvalidEnumArgumentException>("value", () => pictureBox.SizeMode = value); 1453Assert.Throws<ArgumentOutOfRangeException>("value", () => control.TabIndex = -1);
System\Windows\Forms\ProgressBarTests.cs (7)
335Assert.Throws<InvalidEnumArgumentException>("value", () => control.BackgroundImageLayout = value); 757Assert.Throws<InvalidEnumArgumentException>("value", () => control.ImeMode = value); 897Assert.Throws<ArgumentOutOfRangeException>("value", () => control.MarqueeAnimationSpeed = -1); 996Assert.Throws<ArgumentOutOfRangeException>("value", () => control.Maximum = -1); 1095Assert.Throws<ArgumentOutOfRangeException>("value", () => control.Minimum = -1); 1505Assert.Throws<InvalidEnumArgumentException>("value", () => control.Style = value); 1755Assert.Throws<ArgumentOutOfRangeException>("value", () => control.Value = value);
System\Windows\Forms\PropertyGridTests.cs (2)
527Assert.Throws<InvalidEnumArgumentException>("value", () => control.BackgroundImageLayout = value); 2387Assert.Throws<ArgumentNullException>("items", () => control.SelectedGridItem = null);
System\Windows\Forms\RadioButtonTests.cs (2)
172Assert.Throws<InvalidEnumArgumentException>("value", () => control.CheckAlign = value); 393Assert.Throws<InvalidEnumArgumentException>("value", () => control.TextAlign = value);
System\Windows\Forms\RichTextBoxTests.cs (50)
952Assert.Throws<ArgumentOutOfRangeException>("value", () => control.BulletIndent = value); 2054Assert.Throws<ArgumentOutOfRangeException>("value", () => control.MaxLength = -1); 2595Assert.Throws<ArgumentOutOfRangeException>("value", () => control.RightMargin = -1); 3152Assert.Throws<InvalidEnumArgumentException>("value", () => control.ScrollBars = value); 3790Assert.Throws<InvalidEnumArgumentException>("value", () => control.SelectionAlignment = value); 4442Assert.Throws<ArgumentOutOfRangeException>("value", () => control.SelectionCharOffset = value); 5560Assert.Throws<ArgumentOutOfRangeException>("value", () => control.SelectionLength = -1); 5939Assert.Throws<ArgumentOutOfRangeException>("value", () => control.SelectionRightIndent = -1); 6394Assert.Throws<ArgumentOutOfRangeException>("value", () => control.SelectionTabs = new int[33]); 7836Assert.Throws<ArgumentOutOfRangeException>("value", () => control.ZoomFactor = value); 8431Assert.Throws<ArgumentNullException>("str", () => control.Find((string)null)); 8432Assert.Throws<ArgumentNullException>("str", () => control.Find(null, RichTextBoxFinds.None)); 8433Assert.Throws<ArgumentNullException>("str", () => control.Find(null, 0, RichTextBoxFinds.None)); 8434Assert.Throws<ArgumentNullException>("str", () => control.Find(null, -1, RichTextBoxFinds.None)); 8435Assert.Throws<ArgumentNullException>("str", () => control.Find(null, 1, RichTextBoxFinds.None)); 8436Assert.Throws<ArgumentNullException>("str", () => control.Find(null, 0, 0, RichTextBoxFinds.None)); 8437Assert.Throws<ArgumentNullException>("str", () => control.Find(null, -1, 0, RichTextBoxFinds.None)); 8438Assert.Throws<ArgumentNullException>("str", () => control.Find(null, 1, 0, RichTextBoxFinds.None)); 8439Assert.Throws<ArgumentNullException>("str", () => control.Find(null, 0, -2, RichTextBoxFinds.None)); 8449Assert.Throws<ArgumentNullException>("str", () => control.Find((string)null)); 8450Assert.Throws<ArgumentNullException>("str", () => control.Find(null, RichTextBoxFinds.None)); 8451Assert.Throws<ArgumentNullException>("str", () => control.Find(null, 0, RichTextBoxFinds.None)); 8452Assert.Throws<ArgumentNullException>("str", () => control.Find(null, -1, RichTextBoxFinds.None)); 8453Assert.Throws<ArgumentNullException>("str", () => control.Find(null, 2, RichTextBoxFinds.None)); 8454Assert.Throws<ArgumentNullException>("str", () => control.Find(null, 0, 0, RichTextBoxFinds.None)); 8455Assert.Throws<ArgumentNullException>("str", () => control.Find(null, -1, 0, RichTextBoxFinds.None)); 8456Assert.Throws<ArgumentNullException>("str", () => control.Find(null, 2, 0, RichTextBoxFinds.None)); 8457Assert.Throws<ArgumentNullException>("str", () => control.Find(null, 0, -2, RichTextBoxFinds.None)); 8464Assert.Throws<ArgumentNullException>("characterSet", () => control.Find((char[])null)); 8465Assert.Throws<ArgumentNullException>("characterSet", () => control.Find(null, 0)); 8466Assert.Throws<ArgumentNullException>("characterSet", () => control.Find(null, -1)); 8467Assert.Throws<ArgumentNullException>("characterSet", () => control.Find(null, 1)); 8468Assert.Throws<ArgumentNullException>("characterSet", () => control.Find(null, 0, 0)); 8469Assert.Throws<ArgumentNullException>("characterSet", () => control.Find(null, -1, 0)); 8470Assert.Throws<ArgumentNullException>("characterSet", () => control.Find(null, 1, 0)); 8471Assert.Throws<ArgumentNullException>("characterSet", () => control.Find(null, 0, -2)); 8481Assert.Throws<ArgumentNullException>("characterSet", () => control.Find((char[])null)); 8482Assert.Throws<ArgumentNullException>("characterSet", () => control.Find(null, 0)); 8483Assert.Throws<ArgumentNullException>("characterSet", () => control.Find(null, -1)); 8484Assert.Throws<ArgumentNullException>("characterSet", () => control.Find(null, 2)); 8485Assert.Throws<ArgumentNullException>("characterSet", () => control.Find(null, 0, 0)); 8486Assert.Throws<ArgumentNullException>("characterSet", () => control.Find(null, -1, 0)); 8487Assert.Throws<ArgumentNullException>("characterSet", () => control.Find(null, 2, 0)); 8488Assert.Throws<ArgumentNullException>("characterSet", () => control.Find(null, 0, -2)); 8497Assert.Throws<ArgumentOutOfRangeException>("start", () => control.Find("s", start, RichTextBoxFinds.NoHighlight)); 8498Assert.Throws<ArgumentOutOfRangeException>("start", () => control.Find("s", start, 0, RichTextBoxFinds.NoHighlight)); 8512Assert.Throws<ArgumentOutOfRangeException>("start", () => control.Find("s", start, RichTextBoxFinds.NoHighlight)); 8513Assert.Throws<ArgumentOutOfRangeException>("start", () => control.Find("s", start, 0, RichTextBoxFinds.NoHighlight)); 8522Assert.Throws<ArgumentOutOfRangeException>("end", () => control.Find("s", 0, -2, RichTextBoxFinds.NoHighlight)); 8533Assert.Throws<ArgumentOutOfRangeException>("end", () => control.Find("s", 0, -2, RichTextBoxFinds.NoHighlight));
System\Windows\Forms\RowStyleTests.cs (2)
42Assert.Throws<ArgumentOutOfRangeException>("value", () => new RowStyle(SizeType.AutoSize, -1)); 139Assert.Throws<ArgumentOutOfRangeException>("value", () => style.Height = -1);
System\Windows\Forms\ScreenTests.cs (3)
85Assert.Throws<ArgumentNullException>("control", () => Screen.FromControl(null)); 166Assert.Throws<ArgumentNullException>("control", () => Screen.GetBounds(null)); 196Assert.Throws<ArgumentNullException>("control", () => Screen.GetWorkingArea(null));
System\Windows\Forms\ScrollableControlTests.cs (1)
468Assert.Throws<ArgumentOutOfRangeException>("value", () => control.AutoScrollMargin = new Size(x, y));
System\Windows\Forms\ScrollBarTests.cs (6)
360Assert.Throws<InvalidEnumArgumentException>("value", () => control.BackgroundImageLayout = value); 679Assert.Throws<InvalidEnumArgumentException>("value", () => control.ImeMode = value); 822Assert.Throws<ArgumentOutOfRangeException>("value", () => control.LargeChange = -1); 1237Assert.Throws<InvalidEnumArgumentException>("value", () => control.RightToLeft = value); 1373Assert.Throws<ArgumentOutOfRangeException>("value", () => control.SmallChange = -1); 1751ArgumentOutOfRangeException ex = Assert.Throws<ArgumentOutOfRangeException>(paramName, () => control.Value = value);
System\Windows\Forms\ScrollPropertiesTests.cs (4)
152Assert.Throws<ArgumentOutOfRangeException>("value", () => properties.LargeChange = -1); 219Assert.Throws<ArgumentOutOfRangeException>("value", () => properties.SmallChange = -1); 427Assert.Throws<ArgumentOutOfRangeException>("value", () => properties.Minimum = -1); 513Assert.Throws<ArgumentOutOfRangeException>("value", () => properties.Value = value);
System\Windows\Forms\SplitterPanelTests.cs (3)
379Assert.Throws<InvalidEnumArgumentException>("value", () => control.BorderStyle = value); 442Assert.Throws<InvalidEnumArgumentException>("value", () => control.Dock = value); 926Assert.Throws<ArgumentOutOfRangeException>("value", () => control.TabIndex = -1);
System\Windows\Forms\SplitterTests.cs (2)
369Assert.Throws<InvalidEnumArgumentException>("value", () => control.BorderStyle = value); 985Assert.Throws<InvalidEnumArgumentException>("value", () => control.ImeMode = value);
System\Windows\Forms\StatusStripTests.cs (1)
607Assert.Throws<InvalidEnumArgumentException>("value", () => control.RenderMode = value);
System\Windows\Forms\TabControl.ControlCollectionTests.cs (1)
26Assert.Throws<ArgumentNullException>("owner", () => new TabControl.ControlCollection(null));
System\Windows\Forms\TabControl.TabPageCollectionTests.cs (13)
1181Assert.Throws<ArgumentNullException>("owner", () => new TabControl.TabPageCollection(null)); 1571Assert.Throws<ArgumentNullException>("page", () => collection.Contains(null)); 1876Assert.Throws<ArgumentNullException>("page", () => collection.IndexOf(null)); 3336Assert.Throws<ArgumentOutOfRangeException>("index", () => collection[index]); 3351Assert.Throws<ArgumentOutOfRangeException>("index", () => collection[index]); 3671Assert.Throws<ArgumentNullException>("value", () => collection[0] = null); 3683Assert.Throws<ArgumentNullException>("value", () => collection[0] = null); 3695Assert.Throws<ArgumentOutOfRangeException>("index", () => collection[index] = page); 3711Assert.Throws<ArgumentOutOfRangeException>("index", () => collection[index] = page2); 3737Assert.Throws<ArgumentOutOfRangeException>("index", () => iList[index]); 3751Assert.Throws<ArgumentOutOfRangeException>("index", () => iList[index]); 3955Assert.Throws<ArgumentOutOfRangeException>("index", () => iList[index] = page); 3970Assert.Throws<ArgumentOutOfRangeException>("index", () => iList[index] = page2);
System\Windows\Forms\TabControlTests.cs (27)
446Assert.Throws<InvalidEnumArgumentException>("value", () => control.Alignment = value); 523Assert.Throws<InvalidEnumArgumentException>("value", () => control.Appearance = value); 735Assert.Throws<InvalidEnumArgumentException>("value", () => control.BackgroundImageLayout = value); 917Assert.Throws<InvalidEnumArgumentException>("value", () => control.DrawMode = value); 1606Assert.Throws<ArgumentOutOfRangeException>("value", () => control.ItemSize = new Size(-1, 1)); 1613Assert.Throws<ArgumentOutOfRangeException>("value", () => control.ItemSize = new Size(1, -1)); 1815Assert.Throws<ArgumentOutOfRangeException>("value", () => control.Padding = new Point(-1, 1)); 1822Assert.Throws<ArgumentOutOfRangeException>("value", () => control.Padding = new Point(1, -1)); 2507Assert.Throws<ArgumentOutOfRangeException>("value", () => control.SelectedIndex = -2); 2845Assert.Throws<InvalidEnumArgumentException>("value", () => control.SizeMode = value); 3633Assert.Throws<ArgumentOutOfRangeException>("index", () => control.GetControl(index)); 3647Assert.Throws<ArgumentOutOfRangeException>("index", () => control.GetControl(index)); 3783Assert.Throws<ArgumentOutOfRangeException>("index", () => control.GetTabRect(-1)); 3784Assert.Throws<ArgumentOutOfRangeException>("index", () => control.GetTabRect(0)); 3785Assert.Throws<ArgumentOutOfRangeException>("index", () => control.GetTabRect(1)); 3795Assert.Throws<ArgumentOutOfRangeException>("index", () => control.GetTabRect(-1)); 3796Assert.Throws<ArgumentOutOfRangeException>("index", () => control.GetTabRect(1)); 3797Assert.Throws<ArgumentOutOfRangeException>("index", () => control.GetTabRect(2)); 3804Assert.Throws<ArgumentOutOfRangeException>("index", () => control.GetTabRect(-1)); 3805Assert.Throws<ArgumentOutOfRangeException>("index", () => control.GetTabRect(0)); 3806Assert.Throws<ArgumentOutOfRangeException>("index", () => control.GetTabRect(1)); 3817Assert.Throws<ArgumentOutOfRangeException>("index", () => control.GetTabRect(-1)); 3818Assert.Throws<ArgumentOutOfRangeException>("index", () => control.GetTabRect(1)); 3819Assert.Throws<ArgumentOutOfRangeException>("index", () => control.GetTabRect(2)); 3895Assert.Throws<ArgumentNullException>("elementType", () => control.GetItems(null)); 3980Assert.Throws<ArgumentNullException>("item", () => control.GetToolTipText(null)); 3987Assert.Throws<ArgumentException>("item", () => control.GetToolTipText(new object()));
System\Windows\Forms\TableLayoutCellPaintEventArgsTests.cs (1)
37Assert.Throws<ArgumentNullException>("graphics", () => new TableLayoutCellPaintEventArgs(
System\Windows\Forms\TableLayoutControlCollectionTests.cs (1)
21Assert.Throws<ArgumentNullException>("container", () => new TableLayoutControlCollection(null));
System\Windows\Forms\TableLayoutPanelCellPositionTests.cs (10)
35Assert.Throws<ArgumentOutOfRangeException>("column", () => new TableLayoutPanelCellPosition(-2, 0)); 41Assert.Throws<ArgumentOutOfRangeException>("row", () => new TableLayoutPanelCellPosition(0, -2)); 142Assert.Throws<ArgumentException>("value", () => converter.ConvertFrom(value)); 149Assert.Throws<ArgumentOutOfRangeException>("column", () => converter.ConvertFrom("-2,2")); 156Assert.Throws<ArgumentOutOfRangeException>("row", () => converter.ConvertFrom("1,-2")); 185Assert.Throws<ArgumentNullException>("destinationType", () => converter.ConvertTo(new object(), null)); 220Assert.Throws<ArgumentNullException>("propertyValues", () => converter.CreateInstance(null, null)); 279Assert.Throws<ArgumentException>("propertyValues", () => converter.CreateInstance(null, propertyValues)); 286Assert.Throws<ArgumentOutOfRangeException>("column", () => converter.CreateInstance(null, new Dictionary<string, object> 297Assert.Throws<ArgumentOutOfRangeException>("row", () => converter.CreateInstance(null, new Dictionary<string, object>
System\Windows\Forms\TableLayoutPanelTests.cs (14)
203Assert.Throws<InvalidEnumArgumentException>("value", () => control.BorderStyle = value); 296Assert.Throws<InvalidEnumArgumentException>("value", () => control.CellBorderStyle = value); 330Assert.Throws<ArgumentOutOfRangeException>("value", () => control.ColumnCount = -1); 406Assert.Throws<InvalidEnumArgumentException>("value", () => control.GrowStyle = value); 622Assert.Throws<ArgumentOutOfRangeException>("value", () => control.RowCount = -1); 655Assert.Throws<ArgumentNullException>("control", () => control.GetCellPosition(null)); 664Assert.Throws<ArgumentOutOfRangeException>("column", () => control.GetCellPosition(child)); 673Assert.Throws<ArgumentOutOfRangeException>("row", () => control.GetCellPosition(child)); 688Assert.Throws<ArgumentNullException>("control", () => control.GetColumn(null)); 703Assert.Throws<ArgumentNullException>("control", () => control.GetColumnSpan(null)); 871Assert.Throws<ArgumentOutOfRangeException>("column", () => control.GetControlFromPosition(column, 0)); 880Assert.Throws<ArgumentOutOfRangeException>("row", () => control.GetControlFromPosition(0, row)); 941Assert.Throws<ArgumentNullException>("control", () => control.GetRow(null)); 1149Assert.Throws<ArgumentNullException>("control", () => control.GetRowSpan(null));
System\Windows\Forms\TableLayoutStyleCollectionTests.cs (8)
53Assert.Throws<ArgumentNullException>("style", () => collection.Add(null)); 54Assert.Throws<ArgumentNullException>("style", () => ((IList)collection).Add(null)); 74Assert.Throws<ArgumentException>("style", () => collection.Add(style)); 75Assert.Throws<ArgumentException>("style", () => ((IList)collection).Add(style)); 158Assert.Throws<ArgumentNullException>("value", () => collection[index] = null); 159Assert.Throws<ArgumentNullException>("value", () => ((IList)collection)[index] = null); 180Assert.Throws<ArgumentException>("style", () => collection[0] = style); 181Assert.Throws<ArgumentException>("style", () => ((IList)collection)[0] = style);
System\Windows\Forms\TableLayoutStyleTests.cs (1)
156Assert.Throws<ArgumentNullException>("destinationType", () => converter.ConvertTo(new object(), null));
System\Windows\Forms\TabPageTests.cs (3)
992Assert.Throws<InvalidEnumArgumentException>("value", () => control.Dock = value); 1490Assert.Throws<ArgumentOutOfRangeException>("value", () => control.ImageIndex = -2); 2680Assert.Throws<ArgumentOutOfRangeException>("value", () => control.TabIndex = -1);
System\Windows\Forms\TabPageTests.TabPageControlCollection.cs (1)
21Assert.Throws<ArgumentNullException>("owner", () => new TabPage.TabPageControlCollection(null));
System\Windows\Forms\TextRendererTests.cs (3)
564Assert.Throws<ArgumentNullException>("dc", () => TextRenderer.MeasureText(null, string.Empty, SystemFonts.MenuFont)); 565Assert.Throws<ArgumentNullException>("dc", () => TextRenderer.MeasureText(null, string.Empty, SystemFonts.MenuFont, new Size(300, 400))); 566Assert.Throws<ArgumentNullException>("dc", () => TextRenderer.MeasureText(null, string.Empty, SystemFonts.MenuFont, new Size(300, 400), TextFormatFlags.Default));
System\Windows\Forms\TimerTests.cs (2)
39Assert.Throws<ArgumentNullException>("container", () => new Timer(null)); 226Assert.Throws<ArgumentOutOfRangeException>("value", () => timer.Interval = value);
System\Windows\Forms\ToolStripButtonTests.cs (1)
996Assert.Throws<InvalidEnumArgumentException>("value", () => item.CheckState = value);
System\Windows\Forms\ToolStripContentPanelTests.cs (4)
773Assert.Throws<InvalidEnumArgumentException>("value", () => control.BorderStyle = value); 896Assert.Throws<InvalidEnumArgumentException>("value", () => control.Dock = value); 1422Assert.Throws<InvalidEnumArgumentException>("value", () => control.RenderMode = value); 1549Assert.Throws<ArgumentOutOfRangeException>("value", () => control.TabIndex = -1);
System\Windows\Forms\ToolStripControlHostTests.cs (12)
129Assert.Throws<ArgumentNullException>("c", () => new SubToolStripControlHost(null)); 130Assert.Throws<ArgumentNullException>("c", () => new SubToolStripControlHost(null, "name")); 249Assert.Throws<InvalidEnumArgumentException>("value", () => item.AccessibleRole = value); 745Assert.Throws<InvalidEnumArgumentException>("value", () => item.ControlAlign = value); 817Assert.Throws<InvalidEnumArgumentException>("value", () => item.DisplayStyle = value); 1264Assert.Throws<InvalidEnumArgumentException>("value", () => item.ImageAlign = value); 1635Assert.Throws<InvalidEnumArgumentException>("value", () => item.RightToLeft = value); 2018Assert.Throws<ArgumentNullException>("service", () => c.Site.GetService(null)); 2121Assert.Throws<ArgumentNullException>("key", () => iDictionaryService.GetValue(null)); 2325Assert.Throws<InvalidEnumArgumentException>("value", () => item.TextAlign = value); 2358Assert.Throws<InvalidEnumArgumentException>("value", () => item.TextDirection = value); 2387Assert.Throws<InvalidEnumArgumentException>("value", () => item.TextImageRelation = value);
System\Windows\Forms\ToolStripDropDownTests.cs (6)
1469Assert.Throws<InvalidEnumArgumentException>("value", () => control.DefaultDropDownDirection = value); 1806Assert.Throws<InvalidEnumArgumentException>("value", () => control.GripStyle = value); 1913Assert.Throws<InvalidEnumArgumentException>("value", () => control.ImeMode = value); 2443Assert.Throws<InvalidEnumArgumentException>("value", () => control.RightToLeft = value); 2566Assert.Throws<ArgumentOutOfRangeException>("value", () => control.TabIndex = -1); 2916Assert.Throws<ArgumentException>("value", () => control.TopLevel = true);
System\Windows\Forms\ToolStripItemCollectionTests.cs (2)
101Assert.Throws<ArgumentNullException>("key", () => collection.Find(key, searchAllChildren: true)); 102Assert.Throws<ArgumentNullException>("key", () => collection.Find(key, searchAllChildren: false));
System\Windows\Forms\ToolStripItemTests.cs (15)
373Assert.Throws<InvalidEnumArgumentException>("value", () => item.AccessibleRole = value); 559Assert.Throws<InvalidEnumArgumentException>("value", () => item.Alignment = value); 2032Assert.Throws<InvalidEnumArgumentException>("value", () => item.BackgroundImageLayout = value); 2323Assert.Throws<InvalidEnumArgumentException>("value", () => item.DisplayStyle = value); 2444Assert.Throws<InvalidEnumArgumentException>("value", () => item.Dock = value); 4376Assert.Throws<InvalidEnumArgumentException>("value", () => item.ImageAlign = value); 4730Assert.Throws<ArgumentOutOfRangeException>("value", () => item.ImageIndex = -2); 5594Assert.Throws<InvalidEnumArgumentException>("value", () => item.ImageScaling = value); 6146Assert.Throws<InvalidEnumArgumentException>("value", () => item.MergeAction = value); 6435Assert.Throws<InvalidEnumArgumentException>("value", () => item.Overflow = value); 7408Assert.Throws<InvalidEnumArgumentException>("value", () => item.RightToLeft = value); 8492Assert.Throws<InvalidEnumArgumentException>("value", () => item.TextAlign = value); 8766Assert.Throws<InvalidEnumArgumentException>("value", () => item.TextDirection = value); 9017Assert.Throws<InvalidEnumArgumentException>("value", () => item.TextImageRelation = value); 10235Assert.Throws<ArgumentNullException>("data", () => item.DoDragDrop(null, DragDropEffects.All));
System\Windows\Forms\ToolStripItemTextRenderEventArgsTests.cs (2)
66Assert.Throws<ArgumentNullException>("item", () => new ToolStripItemTextRenderEventArgs(graphics, null, "", new Rectangle(1, 2, 3, 4), Color.Red, SystemFonts.DefaultFont, TextFormatFlags.Top)); 67Assert.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)
199Assert.Throws<ArgumentOutOfRangeException>("value", () => panel.AutoScrollMargin = value);
System\Windows\Forms\ToolStripRendererTests.cs (1)
23Assert.Throws<ArgumentNullException>("normalImage", () => ToolStripRenderer.CreateDisabledImage(null));
System\Windows\Forms\ToolStripSeparatorTests.cs (5)
222Assert.Throws<InvalidEnumArgumentException>("value", () => item.DisplayStyle = value); 467Assert.Throws<InvalidEnumArgumentException>("value", () => item.ImageAlign = value); 644Assert.Throws<InvalidEnumArgumentException>("value", () => item.TextAlign = value); 675Assert.Throws<InvalidEnumArgumentException>("value", () => item.TextDirection = value); 702Assert.Throws<InvalidEnumArgumentException>("value", () => item.TextImageRelation = value);
System\Windows\Forms\ToolStripTests.cs (9)
326Assert.Throws<ArgumentNullException>("toolStripItems", () => new ToolStrip(null)); 2242Assert.Throws<InvalidEnumArgumentException>("value", () => control.DefaultDropDownDirection = value); 2667Assert.Throws<InvalidEnumArgumentException>("value", () => control.Dock = value); 2864Assert.Throws<InvalidEnumArgumentException>("value", () => control.GripStyle = value); 3433Assert.Throws<InvalidEnumArgumentException>("value", () => control.RenderMode = value); 3565Assert.Throws<InvalidEnumArgumentException>("value", () => control.RightToLeft = value); 4094Assert.Throws<InvalidEnumArgumentException>("value", () => control.TextDirection = value); 4788Assert.Throws<InvalidEnumArgumentException>("direction", () => toolStrip.GetNextItem(new SubToolStripItem(), direction)); 4789Assert.Throws<InvalidEnumArgumentException>("direction", () => toolStrip.GetNextItem(null, direction));
System\Windows\Forms\ToolTipTests.cs (7)
76Assert.Throws<ArgumentNullException>("cont", () => new ToolTip(null)); 228Assert.Throws<ArgumentOutOfRangeException>("value", () => toolTip.AutomaticDelay = -1); 275Assert.Throws<ArgumentOutOfRangeException>("value", () => toolTip.AutoPopDelay = -1); 353Assert.Throws<ArgumentException>("value", () => toolTip.ForeColor = Color.Empty); 400Assert.Throws<ArgumentOutOfRangeException>("value", () => toolTip.InitialDelay = -1); 485Assert.Throws<ArgumentOutOfRangeException>("value", () => toolTip.ReshowDelay = -1); 561Assert.Throws<InvalidEnumArgumentException>("value", () => toolTip.ToolTipIcon = value);
System\Windows\Forms\TreeNodeCollectionTests.cs (4)
65Assert.Throws<ArgumentOutOfRangeException>("index", () => collection[index]); 76Assert.Throws<ArgumentOutOfRangeException>("index", () => collection[index] = new TreeNode()); 338Assert.Throws<ArgumentNullException>("key", () => collection.Find(key, searchAllChildren: true)); 339Assert.Throws<ArgumentNullException>("key", () => collection.Find(key, searchAllChildren: false));
System\Windows\Forms\TreeNodeTests.cs (9)
234Assert.Throws<ArgumentNullException>("nodes", () => new TreeNode("text", null)); 235Assert.Throws<ArgumentNullException>("nodes", () => new TreeNode("text", 0, 0, null)); 249Assert.Throws<ArgumentOutOfRangeException>("value", () => new TreeNode("text", imageIndex, 0)); 250Assert.Throws<ArgumentOutOfRangeException>("value", () => new TreeNode("text", imageIndex, 0, Array.Empty<TreeNode>())); 257Assert.Throws<ArgumentOutOfRangeException>("value", () => new TreeNode("text", 0, selectedImageIndex)); 258Assert.Throws<ArgumentOutOfRangeException>("value", () => new TreeNode("text", 0, selectedImageIndex, Array.Empty<TreeNode>())); 1304Assert.Throws<ArgumentOutOfRangeException>("value", () => node.ImageIndex = value); 3288Assert.Throws<ArgumentOutOfRangeException>("value", () => node.SelectedImageIndex = value); 3979Assert.Throws<ArgumentOutOfRangeException>("value", () => node.StateImageIndex = value);
System\Windows\Forms\TreeViewImageIndexConverterTests.cs (1)
22Assert.Throws<ArgumentNullException>("destinationType", () => converter.ConvertTo(context: null, culture: null, new object(), destinationType: null));
System\Windows\Forms\TreeViewTests.cs (9)
905Assert.Throws<InvalidEnumArgumentException>("value", () => control.BackgroundImageLayout = value); 1031Assert.Throws<InvalidEnumArgumentException>("value", () => treeView.BorderStyle = value); 1454Assert.Throws<InvalidEnumArgumentException>("value", () => treeView.DrawMode = value); 2216Assert.Throws<ArgumentOutOfRangeException>("value", () => treeView.ImageIndex = -2); 2684Assert.Throws<ArgumentOutOfRangeException>("value", () => treeView.Indent = value); 2697Assert.Throws<ArgumentOutOfRangeException>("value", () => treeView.Indent = indent); 2796Assert.Throws<ArgumentOutOfRangeException>("value", () => control.ItemHeight = value); 2810Assert.Throws<ArgumentOutOfRangeException>("value", () => control.ItemHeight = indent); 3576Assert.Throws<ArgumentOutOfRangeException>("value", () => treeView.SelectedImageIndex = -2);
System\Windows\Forms\UpDownBaseTests.cs (3)
806Assert.Throws<InvalidEnumArgumentException>("value", () => control.BorderStyle = value); 1424Assert.Throws<InvalidEnumArgumentException>("value", () => control.TextAlign = value); 1508Assert.Throws<InvalidEnumArgumentException>("value", () => control.UpDownAlign = value);
System\Windows\Forms\UserControlTests.cs (4)
664Assert.Throws<InvalidEnumArgumentException>("value", () => control.AutoSizeMode = value); 732Assert.Throws<InvalidEnumArgumentException>("value", () => control.AutoValidate = value); 788Assert.Throws<InvalidEnumArgumentException>("value", () => control.BorderStyle = value); 1681Assert.Throws<InvalidEnumArgumentException>("validationConstraints", () => control.ValidateChildren(validationConstraints));
System\Windows\Forms\VisualStyles\VisualStyleElementTests.cs (1)
28Assert.Throws<ArgumentNullException>("className", () => VisualStyleElement.CreateElement(null, 1, 2));
System\Windows\Forms\VisualStyles\VisualStyleRendererTests.cs (7)
39Assert.Throws<ArgumentNullException>("className", () => new VisualStyleRenderer(null, 0, 0)); 114Assert.Throws<ArgumentNullException>("element", () => VisualStyleRenderer.IsElementDefined(null)); 215Assert.Throws<ArgumentNullException>("dc", () => renderer.DrawEdge(null, new Rectangle(1, 2, 3, 4), Edges.Top, EdgeStyle.Bump, EdgeEffects.FillInterior)); 225Assert.Throws<InvalidEnumArgumentException>("edges", () => renderer.DrawEdge(graphics, new Rectangle(1, 2, 3, 4), edges, EdgeStyle.Bump, EdgeEffects.FillInterior)); 235Assert.Throws<InvalidEnumArgumentException>("style", () => renderer.DrawEdge(graphics, new Rectangle(1, 2, 3, 4), Edges.Bottom, style, EdgeEffects.FillInterior)); 245Assert.Throws<InvalidEnumArgumentException>("effects", () => renderer.DrawEdge(graphics, new Rectangle(1, 2, 3, 4), Edges.Bottom, EdgeStyle.Bump, effects)); 586Assert.Throws<InvalidEnumArgumentException>("prop", () => renderer.GetFont(graphics, value));
System\Windows\Forms\WebBrowserTests.cs (1)
1311Assert.Throws<ArgumentException>("value", () => control.ObjectForScripting = new PrivateClass());
TextBoxBaseTests.cs (6)
688Assert.Throws<InvalidEnumArgumentException>("value", () => control.BorderStyle = value); 1588Assert.Throws<InvalidEnumArgumentException>("value", () => control.ImeModeBase = value); 1788Assert.Throws<ArgumentOutOfRangeException>("value", () => control.MaxLength = -1); 2929Assert.Throws<ArgumentOutOfRangeException>("value", () => control.SelectionLength = -1); 3106Assert.Throws<ArgumentOutOfRangeException>("value", () => control.SelectionStart = -1); 4611Assert.Throws<ArgumentOutOfRangeException>("lineNumber", () => control.GetFirstCharIndexFromLine(-1));
TrackBarTests.cs (6)
972Assert.Throws<InvalidEnumArgumentException>("value", () => control.ImeMode = value); 1033Assert.Throws<ArgumentOutOfRangeException>("value", () => control.LargeChange = -1); 1461Assert.Throws<InvalidEnumArgumentException>("value", () => control.Orientation = value); 1767Assert.Throws<ArgumentOutOfRangeException>("value", () => control.SmallChange = -1); 1960Assert.Throws<InvalidEnumArgumentException>("value", () => control.TickStyle = value); 2193Assert.Throws<ArgumentOutOfRangeException>("value", () => control.Value = value);
System.Xaml.Tests (32)
System\Windows\Markup\ArrayExtensionTests.cs (2)
36Assert.Throws<ArgumentNullException>("arrayType", () => new ArrayExtension((Type)null!)); 64Assert.Throws<ArgumentNullException>("elements", () => new ArrayExtension((Array)null!));
System\Windows\Markup\NameReferenceConverterTests.cs (2)
70Assert.Throws<ArgumentNullException>("context", () => converter.ConvertFrom(null, CultureInfo.CurrentCulture, "name")); 162Assert.Throws<ArgumentNullException>("context", () => converter.ConvertTo(null, CultureInfo.CurrentCulture, "value", typeof(string)));
System\Windows\Markup\ReferenceTests.cs (1)
66Assert.Throws<ArgumentNullException>("serviceProvider", () => reference.ProvideValue(null));
System\Windows\Markup\StaticExtensionTests.cs (4)
35Assert.Throws<ArgumentNullException>("member", () => new StaticExtension(null)); 119Assert.Throws<ArgumentNullException>("serviceProvider", () => extension.ProvideValue(null)); 181Assert.Throws<ArgumentNullException>("value", () => extension.Member = null); 196Assert.Throws<ArgumentNullException>("value", () => extension.MemberType = null);
System\Windows\Markup\TypeExtensionTests.cs (5)
35Assert.Throws<ArgumentNullException>("typeName", () => new TypeExtension((string)null!)); 50Assert.Throws<ArgumentNullException>("type", () => new TypeExtension((Type)null!)); 90Assert.Throws<ArgumentNullException>("serviceProvider", () => extension.ProvideValue(null)); 141Assert.Throws<ArgumentNullException>("value", () => extension.TypeName = null); 157Assert.Throws<ArgumentNullException>("value", () => extension.Type = null);
System\Windows\Markup\ValueSerializerTests.cs (6)
206Assert.Throws<ArgumentNullException>("typeName", () => ValueSerializer.GetSerializerFor(typeof(ClassWithNullStringTypeConverterAttribute))); 207Assert.Throws<ArgumentNullException>("typeName", () => ValueSerializer.GetSerializerFor(typeof(ClassWithNullStringTypeConverterAttribute), null!)); 228Assert.Throws<ArgumentNullException>("type", () => ValueSerializer.GetSerializerFor((Type)null!)); 229Assert.Throws<ArgumentNullException>("type", () => ValueSerializer.GetSerializerFor((Type)null!, null)); 293Assert.Throws<ArgumentNullException>("descriptor", () => ValueSerializer.GetSerializerFor((PropertyDescriptor)null!)); 294Assert.Throws<ArgumentNullException>("descriptor", () => ValueSerializer.GetSerializerFor((PropertyDescriptor)null!, null));
System\Windows\Markup\XamlDeferLoadAttributeTests.cs (4)
26Assert.Throws<ArgumentNullException>("loaderType", () => new XamlDeferLoadAttribute(null!, typeof(int))); 32Assert.Throws<ArgumentNullException>("contentType", () => new XamlDeferLoadAttribute(typeof(int), null!)); 50Assert.Throws<ArgumentNullException>("loaderType", () => new XamlDeferLoadAttribute(null!, "contentType")); 56Assert.Throws<ArgumentNullException>("contentType", () => new XamlDeferLoadAttribute("loaderType", null!));
System\Windows\Markup\XDataTests.cs (2)
43Assert.Throws<ArgumentNullException>("s", () => data.XmlReader); 68Assert.Throws<ArgumentNullException>("s", () => data.XmlReader);
System\Windows\Markup\XmlnsCompatibleWithAttributeTests.cs (2)
23Assert.Throws<ArgumentNullException>("oldNamespace", () => new XmlnsCompatibleWithAttribute(null!, "newNamespace")); 29Assert.Throws<ArgumentNullException>("newNamespace", () => new XmlnsCompatibleWithAttribute("oldNamespace", null!));
System\Windows\Markup\XmlnsDefinitionAttributeTests.cs (2)
24Assert.Throws<ArgumentNullException>("xmlNamespace", () => new XmlnsDefinitionAttribute(null!, "clrNamespace")); 30Assert.Throws<ArgumentNullException>("clrNamespace", () => new XmlnsDefinitionAttribute("xmlNamespace", null!));
System\Windows\Markup\XmlnsPrefixAttributeTests.cs (2)
23Assert.Throws<ArgumentNullException>("xmlNamespace", () => new XmlnsPrefixAttribute(null!, "prefix")); 29Assert.Throws<ArgumentNullException>("prefix", () => new XmlnsPrefixAttribute("xmlNamespace", null!));