561 references to Throws
Microsoft.AspNetCore.Http.Results.Tests (54)
AcceptedAtRouteOfTResultTests.cs (2)
154Assert.Throws<ArgumentNullException>("method", () => PopulateMetadata<AcceptedAtRoute<object>>(null, new RouteEndpointBuilder(requestDelegate: null, RoutePatternFactory.Parse("/"), order: 0))); 155Assert.Throws<ArgumentNullException>("builder", () => PopulateMetadata<AcceptedAtRoute<object>>(((Delegate)PopulateMetadata_ThrowsArgumentNullException_WhenMethodOrBuilderAreNull).GetMethodInfo(), null));
AcceptedAtRouteResultTests.cs (2)
107Assert.Throws<ArgumentNullException>("method", () => PopulateMetadata<AcceptedAtRoute>(null, new RouteEndpointBuilder(requestDelegate: null, RoutePatternFactory.Parse("/"), order: 0))); 108Assert.Throws<ArgumentNullException>("builder", () => PopulateMetadata<AcceptedAtRoute>(((Delegate)PopulateMetadata_ThrowsArgumentNullException_WhenMethodOrBuilderAreNull).GetMethodInfo(), null));
AcceptedOfTResultTests.cs (2)
95Assert.Throws<ArgumentNullException>("method", () => PopulateMetadata<Accepted<object>>(null, new RouteEndpointBuilder(requestDelegate: null, RoutePatternFactory.Parse("/"), order: 0))); 96Assert.Throws<ArgumentNullException>("builder", () => PopulateMetadata<Accepted<object>>(((Delegate)PopulateMetadata_ThrowsArgumentNullException_WhenMethodOrBuilderAreNull).GetMethodInfo(), null));
AcceptedResultTests.cs (2)
64Assert.Throws<ArgumentNullException>("method", () => PopulateMetadata<Accepted>(null, new RouteEndpointBuilder(requestDelegate: null, RoutePatternFactory.Parse("/"), order: 0))); 65Assert.Throws<ArgumentNullException>("builder", () => PopulateMetadata<Accepted>(((Delegate)PopulateMetadata_ThrowsArgumentNullException_WhenMethodOrBuilderAreNull).GetMethodInfo(), null));
BadRequestOfTResultTests.cs (2)
138Assert.Throws<ArgumentNullException>("method", () => PopulateMetadata<BadRequest<object>>(null, new RouteEndpointBuilder(requestDelegate: null, RoutePatternFactory.Parse("/"), order: 0))); 139Assert.Throws<ArgumentNullException>("builder", () => PopulateMetadata<BadRequest<object>>(((Delegate)PopulateMetadata_ThrowsArgumentNullException_WhenMethodOrBuilderAreNull).GetMethodInfo(), null));
BadRequestResultTests.cs (2)
77Assert.Throws<ArgumentNullException>("method", () => PopulateMetadata<BadRequest>(null, new RouteEndpointBuilder(requestDelegate: null, RoutePatternFactory.Parse("/"), order: 0))); 78Assert.Throws<ArgumentNullException>("builder", () => PopulateMetadata<BadRequest>(((Delegate)PopulateMetadata_ThrowsArgumentNullException_WhenMethodOrBuilderAreNull).GetMethodInfo(), null));
ConflictOfTResultTests.cs (2)
116Assert.Throws<ArgumentNullException>("method", () => PopulateMetadata<Conflict<object>>(null, new RouteEndpointBuilder(requestDelegate: null, RoutePatternFactory.Parse("/"), order: 0))); 117Assert.Throws<ArgumentNullException>("builder", () => PopulateMetadata<Conflict<object>>(((Delegate)PopulateMetadata_ThrowsArgumentNullException_WhenMethodOrBuilderAreNull).GetMethodInfo(), null));
ConflictResultTests.cs (2)
78Assert.Throws<ArgumentNullException>("method", () => PopulateMetadata<Conflict>(null, new RouteEndpointBuilder(requestDelegate: null, RoutePatternFactory.Parse("/"), order: 0))); 79Assert.Throws<ArgumentNullException>("builder", () => PopulateMetadata<Conflict>(((Delegate)PopulateMetadata_ThrowsArgumentNullException_WhenMethodOrBuilderAreNull).GetMethodInfo(), null));
CreatedAtRouteOfTResultTests.cs (2)
124Assert.Throws<ArgumentNullException>("method", () => PopulateMetadata<CreatedAtRoute<object>>(null, new RouteEndpointBuilder(requestDelegate: null, RoutePatternFactory.Parse("/"), order: 0))); 125Assert.Throws<ArgumentNullException>("builder", () => PopulateMetadata<CreatedAtRoute<object>>(((Delegate)PopulateMetadata_ThrowsArgumentNullException_WhenMethodOrBuilderAreNull).GetMethodInfo(), null));
CreatedAtRouteResultTests.cs (2)
105Assert.Throws<ArgumentNullException>("method", () => PopulateMetadata<CreatedAtRoute>(null, new RouteEndpointBuilder(requestDelegate: null, RoutePatternFactory.Parse("/"), order: 0))); 106Assert.Throws<ArgumentNullException>("builder", () => PopulateMetadata<CreatedAtRoute>(((Delegate)PopulateMetadata_ThrowsArgumentNullException_WhenMethodOrBuilderAreNull).GetMethodInfo(), null));
CreatedOfTResultTests.cs (2)
130Assert.Throws<ArgumentNullException>("method", () => PopulateMetadata<Created<object>>(null, new RouteEndpointBuilder(requestDelegate: null, RoutePatternFactory.Parse("/"), order: 0))); 131Assert.Throws<ArgumentNullException>("builder", () => PopulateMetadata<Created<object>>(((Delegate)PopulateMetadata_ThrowsArgumentNullException_WhenMethodOrBuilderAreNull).GetMethodInfo(), null));
CreatedResultTests.cs (2)
95Assert.Throws<ArgumentNullException>("method", () => PopulateMetadata<Created>(null, new RouteEndpointBuilder(requestDelegate: null, RoutePatternFactory.Parse("/"), order: 0))); 96Assert.Throws<ArgumentNullException>("builder", () => PopulateMetadata<Created>(((Delegate)PopulateMetadata_ThrowsArgumentNullException_WhenMethodOrBuilderAreNull).GetMethodInfo(), null));
InternalServerErrorOfTResultTests.cs (2)
138Assert.Throws<ArgumentNullException>("method", () => PopulateMetadata<InternalServerError<object>>(null, new RouteEndpointBuilder(requestDelegate: null, RoutePatternFactory.Parse("/"), order: 0))); 139Assert.Throws<ArgumentNullException>("builder", () => PopulateMetadata<InternalServerError<object>>(((Delegate)PopulateMetadata_ThrowsArgumentNullException_WhenMethodOrBuilderAreNull).GetMethodInfo(), null));
InternalServerErrorResultTests.cs (2)
77Assert.Throws<ArgumentNullException>("method", () => PopulateMetadata<InternalServerError>(null, new RouteEndpointBuilder(requestDelegate: null, RoutePatternFactory.Parse("/"), order: 0))); 78Assert.Throws<ArgumentNullException>("builder", () => PopulateMetadata<InternalServerError>(((Delegate)PopulateMetadata_ThrowsArgumentNullException_WhenMethodOrBuilderAreNull).GetMethodInfo(), null));
NoContentResultTests.cs (2)
74Assert.Throws<ArgumentNullException>("method", () => PopulateMetadata<NoContent>(null, new RouteEndpointBuilder(requestDelegate: null, RoutePatternFactory.Parse("/"), order: 0))); 75Assert.Throws<ArgumentNullException>("builder", () => PopulateMetadata<NoContent>(((Delegate)PopulateMetadata_ThrowsArgumentNullException_WhenMethodOrBuilderAreNull).GetMethodInfo(), null));
NotFoundOfTResultTests.cs (2)
98Assert.Throws<ArgumentNullException>("method", () => PopulateMetadata<NotFound<object>>(null, new RouteEndpointBuilder(requestDelegate: null, RoutePatternFactory.Parse("/"), order: 0))); 99Assert.Throws<ArgumentNullException>("builder", () => PopulateMetadata<NotFound<object>>(((Delegate)PopulateMetadata_ThrowsArgumentNullException_WhenMethodOrBuilderAreNull).GetMethodInfo(), null));
NotFoundResultTests.cs (2)
73Assert.Throws<ArgumentNullException>("method", () => PopulateMetadata<NotFound>(null, new RouteEndpointBuilder(requestDelegate: null, RoutePatternFactory.Parse("/"), order: 0))); 74Assert.Throws<ArgumentNullException>("builder", () => PopulateMetadata<NotFound>(((Delegate)PopulateMetadata_ThrowsArgumentNullException_WhenMethodOrBuilderAreNull).GetMethodInfo(), null));
OkOfTResultTests.cs (2)
115Assert.Throws<ArgumentNullException>("method", () => PopulateMetadata<Ok<object>>(null, new RouteEndpointBuilder(requestDelegate: null, RoutePatternFactory.Parse("/"), order: 0))); 116Assert.Throws<ArgumentNullException>("builder", () => PopulateMetadata<Ok<object>>(((Delegate)PopulateMetadata_ThrowsArgumentNullException_WhenMethodOrBuilderAreNull).GetMethodInfo(), null));
OkResultTests.cs (2)
76Assert.Throws<ArgumentNullException>("method", () => PopulateMetadata<Ok>(null, new RouteEndpointBuilder(requestDelegate: null, RoutePatternFactory.Parse("/"), order: 0))); 77Assert.Throws<ArgumentNullException>("builder", () => PopulateMetadata<Ok>(((Delegate)PopulateMetadata_ThrowsArgumentNullException_WhenMethodOrBuilderAreNull).GetMethodInfo(), null));
ResultsOfTTests.Generated.cs (10)
223Assert.Throws<ArgumentNullException>("method", () => PopulateMetadata<Results<ProvidesMetadataResult1, ProvidesMetadataResult2>>(null, new RouteEndpointBuilder(requestDelegate: null, RoutePatternFactory.Parse("/"), order: 0))); 224Assert.Throws<ArgumentNullException>("builder", () => PopulateMetadata<Results<ProvidesMetadataResult1, ProvidesMetadataResult2>>(((Delegate)GeneratedCodeIsUpToDate).GetMethodInfo(), null)); 503Assert.Throws<ArgumentNullException>("method", () => PopulateMetadata<Results<ProvidesMetadataResult1, ProvidesMetadataResult2, ProvidesMetadataResult3>>(null, new RouteEndpointBuilder(requestDelegate: null, RoutePatternFactory.Parse("/"), order: 0))); 504Assert.Throws<ArgumentNullException>("builder", () => PopulateMetadata<Results<ProvidesMetadataResult1, ProvidesMetadataResult2, ProvidesMetadataResult3>>(((Delegate)GeneratedCodeIsUpToDate).GetMethodInfo(), null)); 860Assert.Throws<ArgumentNullException>("method", () => PopulateMetadata<Results<ProvidesMetadataResult1, ProvidesMetadataResult2, ProvidesMetadataResult3, ProvidesMetadataResult4>>(null, new RouteEndpointBuilder(requestDelegate: null, RoutePatternFactory.Parse("/"), order: 0))); 861Assert.Throws<ArgumentNullException>("builder", () => PopulateMetadata<Results<ProvidesMetadataResult1, ProvidesMetadataResult2, ProvidesMetadataResult3, ProvidesMetadataResult4>>(((Delegate)GeneratedCodeIsUpToDate).GetMethodInfo(), null)); 1302Assert.Throws<ArgumentNullException>("method", () => PopulateMetadata<Results<ProvidesMetadataResult1, ProvidesMetadataResult2, ProvidesMetadataResult3, ProvidesMetadataResult4, ProvidesMetadataResult5>>(null, new RouteEndpointBuilder(requestDelegate: null, RoutePatternFactory.Parse("/"), order: 0))); 1303Assert.Throws<ArgumentNullException>("builder", () => PopulateMetadata<Results<ProvidesMetadataResult1, ProvidesMetadataResult2, ProvidesMetadataResult3, ProvidesMetadataResult4, ProvidesMetadataResult5>>(((Delegate)GeneratedCodeIsUpToDate).GetMethodInfo(), null)); 1837Assert.Throws<ArgumentNullException>("method", () => PopulateMetadata<Results<ProvidesMetadataResult1, ProvidesMetadataResult2, ProvidesMetadataResult3, ProvidesMetadataResult4, ProvidesMetadataResult5, ProvidesMetadataResult6>>(null, new RouteEndpointBuilder(requestDelegate: null, RoutePatternFactory.Parse("/"), order: 0))); 1838Assert.Throws<ArgumentNullException>("builder", () => PopulateMetadata<Results<ProvidesMetadataResult1, ProvidesMetadataResult2, ProvidesMetadataResult3, ProvidesMetadataResult4, ProvidesMetadataResult5, ProvidesMetadataResult6>>(((Delegate)GeneratedCodeIsUpToDate).GetMethodInfo(), null));
UnprocessableEntityOfTResultTests.cs (2)
115Assert.Throws<ArgumentNullException>("method", () => PopulateMetadata<UnprocessableEntity<object>>(null, new RouteEndpointBuilder(requestDelegate: null, RoutePatternFactory.Parse("/"), order: 0))); 116Assert.Throws<ArgumentNullException>("builder", () => PopulateMetadata<UnprocessableEntity<object>>(((Delegate)PopulateMetadata_ThrowsArgumentNullException_WhenMethodOrBuilderAreNull).GetMethodInfo(), null));
UnprocessableEntityResultTests.cs (2)
77Assert.Throws<ArgumentNullException>("method", () => PopulateMetadata<UnprocessableEntity>(null, new RouteEndpointBuilder(requestDelegate: null, RoutePatternFactory.Parse("/"), order: 0))); 78Assert.Throws<ArgumentNullException>("builder", () => PopulateMetadata<UnprocessableEntity>(((Delegate)PopulateMetadata_ThrowsArgumentNullException_WhenMethodOrBuilderAreNull).GetMethodInfo(), null));
ValidationProblemResultTests.cs (2)
126Assert.Throws<ArgumentNullException>("method", () => PopulateMetadata<ValidationProblem>(null, new RouteEndpointBuilder(requestDelegate: null, RoutePatternFactory.Parse("/"), order: 0))); 127Assert.Throws<ArgumentNullException>("builder", () => PopulateMetadata<ValidationProblem>(((Delegate)PopulateMetadata_ThrowsArgumentNullException_WhenMethodOrBuilderAreNull).GetMethodInfo(), null));
Microsoft.AspNetCore.Identity.Test (1)
UserManagerTest.cs (1)
1040Assert.Throws<ArgumentNullException>("provider", () => manager.RegisterTokenProvider("whatever", null));
Microsoft.AspNetCore.Mvc.Core.Test (2)
AcceptedAtActionResultTests.cs (2)
224Assert.Throws<ArgumentNullException>("provider", () => result.OnFormatting(context)); 234Assert.Throws<ArgumentNullException>("context", () => result.OnFormatting(null));
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (3)
Buffers\PagedBufferedTextWriterTest.cs (1)
109Assert.Throws<ArgumentNullException>("buffer", () => writer.Write(null, 0, 0));
Rendering\HtmlHelperTest.cs (2)
324var exception = Assert.Throws<ArgumentException>("viewContext", () => helperToContextualize.Contextualize(viewContext)); 345var exception = Assert.Throws<ArgumentException>("viewContext", () => helperToContextualize.Contextualize(viewContext));
Microsoft.AspNetCore.Razor.Test (4)
TagHelpers\TagHelperAttributeListTest.cs (4)
103var exception = Assert.Throws<ArgumentOutOfRangeException>("index", () => 209var exception = Assert.Throws<ArgumentOutOfRangeException>("index", () => 321var exception = Assert.Throws<ArgumentOutOfRangeException>("index", 574var exception = Assert.Throws<ArgumentOutOfRangeException>("index",
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (4)
SourceGeneration\GeneratorDriverTests.cs (4)
463Assert.Throws<ArgumentException>("hintName", () => sgc.AddSource("test", SourceText.From("public class D{}", Encoding.UTF8))); 466Assert.Throws<ArgumentException>("hintName", () => sgc.AddSource("test.cs", SourceText.From("public class D{}", Encoding.UTF8))); 494Assert.Throws<ArgumentException>("hintName", () => spc.AddSource("test", SourceText.From("public class D{}", Encoding.UTF8))); 497Assert.Throws<ArgumentException>("hintName", () => spc.AddSource("test.cs", SourceText.From("public class D{}", Encoding.UTF8)));
Microsoft.CodeAnalysis.UnitTests (4)
Collections\ImmutableDictionaryBuilderTestBase.cs (2)
55Assert.Throws<ArgumentException>(null, () => builder.Add("five", 6)); 116Assert.Throws<ArgumentNullException>("array", () => builder.CopyTo(null!, 0));
Collections\ImmutableDictionaryTestBase.nonnetstandard.cs (1)
299Assert.Throws<ArgumentNullException>("array", () => nonGeneric.CopyTo(null!, 0));
Collections\List\SegmentedList.Generic.Tests.Misc.cs (1)
118Assert.Throws<ArgumentException>("value", () => _ilist.Insert(0, new LinkedListNode<string>("blargh"))); //"ArgumentException expected."
Microsoft.DotNet.XUnitAssert.Tests (53)
AsyncCollectionAssertsTests.cs (16)
21 Assert.Throws<ArgumentNullException>("collection", () => Assert.All(default(IAsyncEnumerable<object>)!, _ => { })); 22 Assert.Throws<ArgumentNullException>("action", () => Assert.All(new object[0].ToAsyncEnumerable(), (Action<object>)null!)); 23 Assert.Throws<ArgumentNullException>("action", () => Assert.All(new object[0].ToAsyncEnumerable(), (Action<object, int>)null!)); 283 Assert.Throws<ArgumentNullException>("collection", () => Assert.Contains(14, default(IAsyncEnumerable<int>)!)); 334 Assert.Throws<ArgumentNullException>("collection", () => Assert.Contains(14, default(IAsyncEnumerable<int>)!, comparer)); 335 Assert.Throws<ArgumentNullException>("comparer", () => Assert.Contains(14, new int[0].ToAsyncEnumerable(), null!)); 359 Assert.Throws<ArgumentNullException>("collection", () => Assert.Contains(default(IAsyncEnumerable<int>)!, item => true)); 360 Assert.Throws<ArgumentNullException>("filter", () => Assert.Contains(new int[0].ToAsyncEnumerable(), (Predicate<int>)null!)); 392 Assert.Throws<ArgumentNullException>("collection", () => Assert.Distinct(default(IAsyncEnumerable<int>)!)); 393 Assert.Throws<ArgumentNullException>("comparer", () => Assert.Distinct(new object[0].ToAsyncEnumerable(), null!)); 467 Assert.Throws<ArgumentNullException>("collection", () => Assert.DoesNotContain(14, default(IAsyncEnumerable<int>)!)); 519 Assert.Throws<ArgumentNullException>("collection", () => Assert.DoesNotContain(14, default(IAsyncEnumerable<int>)!, comparer)); 520 Assert.Throws<ArgumentNullException>("comparer", () => Assert.DoesNotContain(14, new int[0].ToAsyncEnumerable(), null!)); 544 Assert.Throws<ArgumentNullException>("collection", () => Assert.DoesNotContain(default(IAsyncEnumerable<int>)!, item => true)); 545 Assert.Throws<ArgumentNullException>("filter", () => Assert.DoesNotContain(new int[0].ToAsyncEnumerable(), (Predicate<int>)null!)); 578 Assert.Throws<ArgumentNullException>("collection", () => Assert.Empty(default(IAsyncEnumerable<int>)!));
CollectionAssertsTests.cs (17)
19 Assert.Throws<ArgumentNullException>("collection", () => Assert.All(default(IEnumerable<object>)!, _ => { })); 20 Assert.Throws<ArgumentNullException>("action", () => Assert.All(new object[0], (Action<object>)null!)); 21 Assert.Throws<ArgumentNullException>("action", () => Assert.All(new object[0], (Action<object, int>)null!)); 283 Assert.Throws<ArgumentNullException>("collection", () => Assert.Contains(14, default(IEnumerable<int>)!)); 352 Assert.Throws<ArgumentNullException>("collection", () => Assert.Contains(14, default(IEnumerable<int>)!, comparer)); 353 Assert.Throws<ArgumentNullException>("comparer", () => Assert.Contains(14, new int[0], null!)); 393 Assert.Throws<ArgumentNullException>("collection", () => Assert.Contains(default(IEnumerable<int>)!, item => true)); 394 Assert.Throws<ArgumentNullException>("filter", () => Assert.Contains(new int[0], (Predicate<int>)null!)); 426 Assert.Throws<ArgumentNullException>("collection", () => Assert.Distinct(default(IEnumerable<int>)!)); 427 Assert.Throws<ArgumentNullException>("comparer", () => Assert.Distinct(new object[0], null!)); 501 Assert.Throws<ArgumentNullException>("collection", () => Assert.DoesNotContain(14, default(IEnumerable<int>)!)); 589 Assert.Throws<ArgumentNullException>("collection", () => Assert.DoesNotContain(14, default(IEnumerable<int>)!, comparer)); 590 Assert.Throws<ArgumentNullException>("comparer", () => Assert.DoesNotContain(14, new int[0], null!)); 622 Assert.Throws<ArgumentNullException>("collection", () => Assert.DoesNotContain(default(IEnumerable<int>)!, item => true)); 623 Assert.Throws<ArgumentNullException>("filter", () => Assert.DoesNotContain(new int[0], (Predicate<int>)null!)); 656 Assert.Throws<ArgumentNullException>("collection", () => Assert.Empty(default(IEnumerable)!)); 2341 Assert.Throws<ArgumentNullException>("collection", () => Assert.Single(null!, null));
EqualityAssertsTests.cs (4)
66 Assert.Throws<ArgumentNullException>("comparer", () => Assert.Equal(1, 2, default(IEqualityComparer<int>)!)); 155 Assert.Throws<ArgumentNullException>("comparer", () => Assert.Equal(1, 2, default(Func<int, int, bool>)!)); 2350 Assert.Throws<ArgumentNullException>("comparer", () => Assert.NotEqual(1, 2, default(IEqualityComparer<int>)!)); 2462 Assert.Throws<ArgumentNullException>("comparer", () => Assert.NotEqual(1, 2, default(Func<int, int, bool>)!));
ExceptionAssertsTests.cs (5)
335 var ex = Record.Exception(() => Assert.Throws<ArgumentException>("paramName", testCode)); 351 Assert.Throws<ArgumentException>("paramName", testCode); 359 var ex = Record.Exception(() => Assert.Throws<ArgumentException>("paramName2", testCode)); 377 var ex = Record.Exception(() => Assert.Throws<ArgumentException>("paramName", testCode)); 395 var ex = Record.Exception(() => Assert.Throws<ArgumentException>("paramName", testCode));
PropertyAssertsTests.cs (2)
15 Assert.Throws<ArgumentNullException>("object", () => Assert.PropertyChanged(null!, "propertyName", delegate { })); 16 Assert.Throws<ArgumentNullException>("testCode", () => Assert.PropertyChanged(Substitute.For<INotifyPropertyChanged>(), "propertyName", (Action)null!));
SetAssertsTests.cs (4)
117 Assert.Throws<ArgumentNullException>("expectedSubset", () => Assert.ProperSubset(null!, new HashSet<int>())); 183 Assert.Throws<ArgumentNullException>("expectedSuperset", () => Assert.ProperSuperset(null!, new HashSet<int>())); 249 Assert.Throws<ArgumentNullException>("expectedSubset", () => Assert.Subset(null!, new HashSet<int>())); 307 Assert.Throws<ArgumentNullException>("expectedSuperset", () => Assert.Superset(null!, new HashSet<int>()));
StringAssertsTests.cs (5)
343 Assert.Throws<ArgumentNullException>("expectedRegexPattern", () => Assert.DoesNotMatch((string?)null!, "Hello, world!")); 373 Assert.Throws<ArgumentNullException>("expectedRegex", () => Assert.DoesNotMatch((Regex?)null!, "Hello, world!")); 403 Assert.Throws<ArgumentNullException>("value", () => Assert.Empty(default(string)!)); 741 Assert.Throws<ArgumentNullException>("expectedRegexPattern", () => Assert.Matches((string?)null!, "Hello, world!")); 784 Assert.Throws<ArgumentNullException>("expectedRegex", () => Assert.Matches((Regex?)null!, "Hello, world!"));
System.ServiceModel.Primitives.Tests (11)
ServiceModel\DuplexChannelFactoryTest.cs (3)
72Assert.Throws<ArgumentException>("via", () => 87Assert.Throws<ArgumentException>("via", () => 119Assert.Throws<ArgumentNullException>("uri", () =>
ServiceModel\DuplexClientBaseTest.cs (4)
47Assert.Throws<ArgumentNullException>("callbackInstance", () => { MyDuplexClientBase<IWcfDuplexService> duplexClientBase = new MyDuplexClientBase<IWcfDuplexService>(null, binding, endpoint); }); 55Assert.Throws<ArgumentNullException>("binding", () => { MyDuplexClientBase<IWcfDuplexService> duplexClientBase = new MyDuplexClientBase<IWcfDuplexService>(context, null, endpoint); }); 63Assert.Throws<ArgumentNullException>("remoteAddress", () => { MyDuplexClientBase<IWcfDuplexService> duplexClientBase = new MyDuplexClientBase<IWcfDuplexService>(context, binding, null); }); 72Assert.Throws<ArgumentException>("via", () =>
ServiceModel\SynchronizedCollection.cs (4)
76Assert.Throws<ArgumentNullException>("syncRoot", () => 81Assert.Throws<ArgumentNullException>("list", () => 86Assert.Throws<ArgumentNullException>("syncRoot", () => 91Assert.Throws<ArgumentNullException>("syncRoot", () =>
System.Windows.Forms.Design.Tests (62)
System\ComponentModel\Design\ByteViewerTests.cs (6)
612Assert.Throws<ArgumentNullException>("path", () => control.SaveToFile(null)); 622Assert.Throws<ArgumentException>("path", () => control.SaveToFile(path)); 717Assert.Throws<ArgumentNullException>("bytes", () => control.SetBytes(null)); 853Assert.Throws<InvalidEnumArgumentException>("mode", () => control.SetDisplayMode(value)); 881Assert.Throws<ArgumentNullException>("path", () => control.SetFile(null)); 891Assert.Throws<ArgumentException>("path", () => control.SetFile(path));
System\ComponentModel\Design\DesignerActionItemCollectionTests.cs (2)
64Assert.Throws<ArgumentNullException>("value", () => collection.Insert(0, null)); 85Assert.Throws<ArgumentNullException>("value", () => collection.Remove(null));
System\ComponentModel\Design\DesignerActionListCollectionTests.cs (2)
89Assert.Throws<ArgumentNullException>("value", () => collection.AddRange((DesignerActionList[])null)); 90Assert.Throws<ArgumentNullException>("value", () => collection.AddRange((DesignerActionListCollection)null));
System\ComponentModel\Design\DesignerActionMethodItemTests.cs (1)
227Assert.Throws<ArgumentNullException>("name", item.Invoke);
System\ComponentModel\Design\DesignerActionServiceTests.cs (11)
103Assert.Throws<ArgumentNullException>("comp", () => service.Add(null, (DesignerActionListCollection)null)); 104Assert.Throws<ArgumentNullException>("comp", () => service.Add(null, (DesignerActionList)null)); 159Assert.Throws<ArgumentNullException>("designerActionListCollection", () => service.Add(new Component(), (DesignerActionListCollection)null)); 612Assert.Throws<ArgumentNullException>("component", () => service.GetComponentDesignerActions(null, null)); 619Assert.Throws<ArgumentNullException>("actionLists", () => service.GetComponentDesignerActions(new Component(), null)); 647Assert.Throws<ArgumentNullException>("component", () => service.GetComponentServiceActions(null, null)); 654Assert.Throws<ArgumentNullException>("actionLists", () => service.GetComponentServiceActions(new Component(), null)); 1029Assert.Throws<ArgumentNullException>("comp", () => service.Remove((IComponent)null)); 1030Assert.Throws<ArgumentNullException>("comp", () => service.Remove(null, null)); 1037Assert.Throws<ArgumentNullException>("actionList", () => service.Remove((DesignerActionList)null)); 1038Assert.Throws<ArgumentNullException>("actionList", () => service.Remove(new Component(), null));
System\ComponentModel\Design\DesignerHostTests.cs (1)
1043Assert.Throws<ArgumentNullException>("key", () => service.SetValue(null, new object()));
System\ComponentModel\Design\DesignerVerbCollectionTests.cs (2)
89Assert.Throws<ArgumentNullException>("value", () => collection.AddRange((DesignerVerb[])null)); 90Assert.Throws<ArgumentNullException>("value", () => collection.AddRange((DesignerVerbCollection)null));
System\ComponentModel\Design\DesignSurfaceTests.cs (3)
319Assert.Throws<ArgumentNullException>("serviceType", () => container.RemoveService(null)); 922Assert.Throws<ArgumentNullException>("loader", () => surface.BeginLoad((DesignerLoader)null)); 944Assert.Throws<ArgumentNullException>("rootComponentType", () => surface.BeginLoad((Type)null));
System\ComponentModel\Design\ExtenderProviderServiceTests.cs (3)
43Assert.Throws<ArgumentNullException>("provider", () => providerService.AddExtenderProvider(null)); 56Assert.Throws<ArgumentException>("provider", () => providerService.AddExtenderProvider(mockExtenderProvider.Object)); 102Assert.Throws<ArgumentNullException>("provider", () => providerService.RemoveExtenderProvider(null));
System\ComponentModel\Design\Serialization\CodeDomComponentSerializationServiceTests.cs (11)
679Assert.Throws<ArgumentNullException>("info", () => serializable.GetObjectData(null, default)); 888Assert.Throws<ArgumentNullException>("store", () => service.Serialize(null, new object())); 896Assert.Throws<ArgumentNullException>("value", () => service.Serialize(mockStore.Object, null)); 1096Assert.Throws<ArgumentNullException>("store", () => service.SerializeAbsolute(null, new object())); 1104Assert.Throws<ArgumentNullException>("value", () => service.SerializeAbsolute(mockStore.Object, null)); 1364Assert.Throws<ArgumentNullException>("store", () => service.SerializeMember(null, new DataClass(), member)); 1373Assert.Throws<ArgumentNullException>("owningObject", () => service.SerializeMember(store, null, member)); 1381Assert.Throws<ArgumentNullException>("member", () => service.SerializeMember(store, new DataClass(), null)); 1643Assert.Throws<ArgumentNullException>("store", () => service.SerializeMemberAbsolute(null, new DataClass(), member)); 1652Assert.Throws<ArgumentNullException>("owningObject", () => service.SerializeMemberAbsolute(store, null, member)); 1660Assert.Throws<ArgumentNullException>("member", () => service.SerializeMemberAbsolute(store, new DataClass(), null));
System\ComponentModel\Design\Serialization\DesignerSerializationManagerTests.cs (5)
1935Assert.Throws<ArgumentNullException>("instance", () => iManager.SetName(null, "name")); 1944Assert.Throws<ArgumentNullException>("name", () => iManager.SetName(new object(), null)); 1956Assert.Throws<ArgumentException>("name", () => iManager.SetName(new object(), name)); 1969Assert.Throws<ArgumentException>("name", () => iManager.SetName(instance, name)); 1970Assert.Throws<ArgumentException>("instance", () => iManager.SetName(instance, "OtherName"));
System\ComponentModel\Design\SiteNestedContainerTests.cs (1)
417Assert.Throws<ArgumentException>("provider", () => container.Add(component));
System\Drawing\Design\ToolboxItemTests.cs (13)
95Assert.Throws<ArgumentException>("value", () => item.Properties.Add("AssemblyName", new object())); 125Assert.Throws<ArgumentException>("value", () => item.Properties.Add("Bitmap", new object())); 149Assert.Throws<ArgumentException>("value", () => item.Properties.Add("Company", new object())); 201Assert.Throws<ArgumentException>("value", () => item.Properties.Add("DependentAssemblies", new object())); 225Assert.Throws<ArgumentException>("value", () => item.Properties.Add("Description", new object())); 249Assert.Throws<ArgumentException>("value", () => item.Properties.Add("DisplayName", new object())); 281Assert.Throws<ArgumentException>("value", () => item.Properties.Add("Filter", new object())); 305Assert.Throws<ArgumentNullException>("value", () => item.Properties.Add("IsTransient", null)); 312Assert.Throws<ArgumentException>("value", () => item.Properties.Add("IsTransient", new object())); 336Assert.Throws<ArgumentException>("value", () => item.Properties.Add("OriginalBitmap", new object())); 360Assert.Throws<ArgumentException>("value", () => item.Properties.Add("TypeName", new object())); 1607Assert.Throws<ArgumentNullException>("value", () => item.ValidatePropertyType(propertyName, null, expectedType, allowNull: false)); 1634Assert.Throws<ArgumentException>("value", () => item.ValidatePropertyType(propertyName, new object(), typeof(int), allowNull));
System\Windows\Forms\Design\FileNameEditorTests.cs (1)
57Assert.Throws<ArgumentNullException>("openFileDialog", () => editor.InitializeDialog(null));
System.Windows.Forms.Primitives.Tests (1)
System\Windows\Forms\NonNullCollectionTests.cs (1)
111Assert.Throws<ArgumentNullException>("value", () => ((IList)collection).Insert(0, null));
System.Windows.Forms.Tests (362)
CheckedListBoxTests.cs (1)
387Assert.Throws<InvalidEnumArgumentException>("value", () => control.SetItemCheckState(0, value));
System\Drawing\Design\UITypeEditorTests.cs (1)
145Assert.Throws<ArgumentNullException>("graphics", () => editor.PaintValue(new object(), null, Rectangle.Empty));
System\Windows\Forms\ApplicationTests.cs (1)
241Assert.Throws<ArgumentNullException>("font", () => Application.SetDefaultFont(null));
System\Windows\Forms\AutoCompleteStringCollectionTests.cs (5)
35Assert.Throws<ArgumentNullException>("value", () => collection.AddRange(null)); 50Assert.Throws<ArgumentNullException>("value", () => collection.AddRange(null!)); 168Assert.Throws<ArgumentOutOfRangeException>("index", () => collection.Insert(index, "value")); 186Assert.Throws<ArgumentOutOfRangeException>("index", () => collection.Insert(-1, null)); 196Assert.Throws<ArgumentOutOfRangeException>("index", () => collection.Insert(index, "value"));
System\Windows\Forms\AxHost.AxPropertyDescriptorTests.cs (2)
1206Assert.Throws<ArgumentException>("value", () => property.SetValue(control, new object())); 1215Assert.Throws<ArgumentException>("value", () => property.SetValue(control, new object()));
System\Windows\Forms\BindingContextTests.cs (8)
61Assert.Throws<ArgumentNullException>("dataSource", () => context.Add(null, source.CurrencyManager)); 106Assert.Throws<ArgumentNullException>("listManager", () => context.Add(1, null)); 152Assert.Throws<ArgumentNullException>("dataSource", () => context.AddCore(null, source.CurrencyManager)); 159Assert.Throws<ArgumentNullException>("listManager", () => context.AddCore(1, null)); 266Assert.Throws<ArgumentNullException>("dataSource", () => context.Remove(null)); 299Assert.Throws<ArgumentNullException>("dataSource", () => context.RemoveCore(null)); 980Assert.Throws<ArgumentException>("dataBinding", () => BindingContext.UpdateBinding(context, binding)); 1008Assert.Throws<ArgumentException>("dataBinding", () => BindingContext.UpdateBinding(context, binding));
System\Windows\Forms\BindingsCollectionTests.cs (1)
150Assert.Throws<ArgumentNullException>("dataBinding", () => collection.AddCore(null));
System\Windows\Forms\ColumnHeaderCollectionTests.cs (6)
418Assert.Throws<ArgumentNullException>("values", () => collection.AddRange(null)); 821Assert.Throws<ArgumentNullException>("ch", () => collection.Insert(1, (ColumnHeader)null)); 831Assert.Throws<ArgumentOutOfRangeException>("index", () => collection.Insert(index, (ColumnHeader)null)); 865Assert.Throws<ArgumentOutOfRangeException>("index", () => collection.Insert(index, new ColumnHeader())); 1051Assert.Throws<ArgumentOutOfRangeException>("index", () => collection.RemoveAt(index)); 1061Assert.Throws<ArgumentOutOfRangeException>("index", () => collection.RemoveAt(index));
System\Windows\Forms\ColumnHeaderTests.cs (1)
1450Assert.Throws<InvalidEnumArgumentException>("headerAutoResize", () => header.AutoResize(headerAutoResize));
System\Windows\Forms\Combobox.ObjectCollectionTests.cs (9)
375Assert.Throws<ArgumentNullException>("items", () => comboBoxObjectCollection.AddRange(null)); 533Assert.Throws<ArgumentNullException>("destination", () => comboBoxObjectCollection.CopyTo(null, 1)); 550Assert.Throws<ArgumentOutOfRangeException>("arrayIndex", () => comboBoxObjectCollection.CopyTo(new object[1], -1)); 567Assert.Throws<ArgumentOutOfRangeException>("arrayIndex", () => comboBoxObjectCollection.CopyTo(new object[1], 3)); 771Assert.Throws<ArgumentNullException>("item", () => comboBoxObjectCollection.Insert(0, null)); 788Assert.Throws<ArgumentOutOfRangeException>("index", () => comboBoxObjectCollection.Insert(-1, 1)); 805Assert.Throws<ArgumentOutOfRangeException>("index", () => comboBoxObjectCollection.Insert(3, 1)); 889Assert.Throws<ArgumentOutOfRangeException>("index", () => comboBoxObjectCollection.RemoveAt(-1)); 906Assert.Throws<ArgumentOutOfRangeException>("index", () => comboBoxObjectCollection.RemoveAt(3));
System\Windows\Forms\ControlBindingsCollectionTests.cs (8)
241Assert.Throws<ArgumentException>("PropertyName", () => collection.Add(new Binding("NoSuchProperty", new object(), "dataMember"))); 258Assert.Throws<ArgumentException>("binding", () => collection.Add(new Binding(nameof(Control.Text), new object(), "dataMember"))); 272Assert.Throws<ArgumentNullException>("dataBinding", () => collection.Add(null)); 283Assert.Throws<ArgumentException>("dataBinding", () => collection.Add(binding)); 296Assert.Throws<ArgumentException>("dataBinding", () => collection2.Add(binding)); 343Assert.Throws<ArgumentNullException>("dataBinding", () => collection.Remove(null)); 356Assert.Throws<ArgumentException>("dataBinding", () => collection.Remove(binding2)); 372Assert.Throws<ArgumentException>("dataBinding", () => collection2.Remove(binding1));
System\Windows\Forms\ControlPaintTests.cs (70)
675Assert.Throws<ArgumentNullException>("graphics", () => ControlPaint.DrawBorder(null, new Rectangle(1, 2, 3, 4), Color.Red, style)); 683Assert.Throws<ArgumentNullException>("graphics", () => ControlPaint.DrawBorder(null, new Rectangle(1, 2, 3, 4), Color.Red, 1, style, Color.Red, 1, style, Color.Red, 1, style, Color.Red, 1, style)); 802Assert.Throws<ArgumentNullException>("graphics", () => ControlPaint.DrawBorder3D(null, new Rectangle(1, 2, 3, 4))); 803Assert.Throws<ArgumentNullException>("graphics", () => ControlPaint.DrawBorder3D(null, new Rectangle(1, 2, 3, 4), style)); 804Assert.Throws<ArgumentNullException>("graphics", () => ControlPaint.DrawBorder3D(null, new Rectangle(1, 2, 3, 4), style, Border3DSide.All)); 805Assert.Throws<ArgumentNullException>("graphics", () => ControlPaint.DrawBorder3D(null, 1, 2, 3, 4)); 806Assert.Throws<ArgumentNullException>("graphics", () => ControlPaint.DrawBorder3D(null, 1, 2, 3, 4, style)); 807Assert.Throws<ArgumentNullException>("graphics", () => ControlPaint.DrawBorder3D(null, 1, 2, 3, 4, style, Border3DSide.All)); 850Assert.Throws<ArgumentNullException>("graphics", () => ControlPaint.DrawButton(null, new Rectangle(1, 2, 3, 4), state)); 851Assert.Throws<ArgumentNullException>("graphics", () => ControlPaint.DrawButton(null, 1, 2, 3, 4, state)); 876Assert.Throws<ArgumentOutOfRangeException>("width", () => ControlPaint.DrawButton(graphics, new Rectangle(0, 0, -3, 4), state)); 877Assert.Throws<ArgumentOutOfRangeException>("width", () => ControlPaint.DrawButton(graphics, 0, 0, -3, 4, state)); 887Assert.Throws<ArgumentOutOfRangeException>("height", () => ControlPaint.DrawButton(graphics, new Rectangle(0, 0, 3, -4), state)); 888Assert.Throws<ArgumentOutOfRangeException>("height", () => ControlPaint.DrawButton(graphics, 0, 0, 3, -4, state)); 934Assert.Throws<ArgumentNullException>("graphics", () => ControlPaint.DrawCaptionButton(null, new Rectangle(1, 2, 3, 4), CaptionButton.Close, state)); 935Assert.Throws<ArgumentNullException>("graphics", () => ControlPaint.DrawCaptionButton(null, 1, 2, 3, 4, CaptionButton.Close, state)); 959Assert.Throws<ArgumentOutOfRangeException>("width", () => ControlPaint.DrawCaptionButton(graphics, new Rectangle(0, 0, -3, 4), CaptionButton.Close, state)); 960Assert.Throws<ArgumentOutOfRangeException>("width", () => ControlPaint.DrawCaptionButton(graphics, 0, 0, -3, 4, CaptionButton.Close, state)); 970Assert.Throws<ArgumentOutOfRangeException>("height", () => ControlPaint.DrawCaptionButton(graphics, new Rectangle(0, 0, 3, -4), CaptionButton.Close, state)); 971Assert.Throws<ArgumentOutOfRangeException>("height", () => ControlPaint.DrawCaptionButton(graphics, 0, 0, 3, -4, CaptionButton.Close, state)); 1014Assert.Throws<ArgumentNullException>("graphics", () => ControlPaint.DrawCheckBox(null, new Rectangle(1, 2, 3, 4), state)); 1015Assert.Throws<ArgumentNullException>("graphics", () => ControlPaint.DrawCheckBox(null, 1, 2, 3, 4, state)); 1040Assert.Throws<ArgumentOutOfRangeException>(expectedParamName, () => ControlPaint.DrawCheckBox(graphics, new Rectangle(0, 0, -3, 4), state)); 1041Assert.Throws<ArgumentOutOfRangeException>(expectedParamName, () => ControlPaint.DrawCheckBox(graphics, 0, 0, -3, 4, state)); 1051Assert.Throws<ArgumentOutOfRangeException>(expectedParamName, () => ControlPaint.DrawCheckBox(graphics, new Rectangle(0, 0, 3, -4), state)); 1052Assert.Throws<ArgumentOutOfRangeException>(expectedParamName, () => ControlPaint.DrawCheckBox(graphics, 0, 0, 3, -4, state)); 1095Assert.Throws<ArgumentNullException>("graphics", () => ControlPaint.DrawComboButton(null, new Rectangle(1, 2, 3, 4), state)); 1096Assert.Throws<ArgumentNullException>("graphics", () => ControlPaint.DrawComboButton(null, 1, 2, 3, 4, state)); 1120Assert.Throws<ArgumentOutOfRangeException>("width", () => ControlPaint.DrawComboButton(graphics, new Rectangle(0, 0, -3, 4), state)); 1121Assert.Throws<ArgumentOutOfRangeException>("width", () => ControlPaint.DrawComboButton(graphics, 0, 0, -3, 4, state)); 1131Assert.Throws<ArgumentOutOfRangeException>("height", () => ControlPaint.DrawComboButton(graphics, new Rectangle(0, 0, 3, -4), state)); 1132Assert.Throws<ArgumentOutOfRangeException>("height", () => ControlPaint.DrawComboButton(graphics, 0, 0, 3, -4, state)); 1160Assert.Throws<ArgumentNullException>("graphics", () => ControlPaint.DrawContainerGrabHandle(null, new Rectangle(1, 2, 3, 4))); 1219Assert.Throws<ArgumentNullException>("graphics", () => ControlPaint.DrawFocusRectangle(null, new Rectangle(1, 2, 3, 4))); 1220Assert.Throws<ArgumentNullException>("graphics", () => ControlPaint.DrawFocusRectangle(null, new Rectangle(1, 2, 3, 4), Color.Red, Color.Blue)); 1258Assert.Throws<ArgumentNullException>("graphics", () => ControlPaint.DrawGrabHandle(null, new Rectangle(1, 2, 3, 4), primary, enabled)); 1291Assert.Throws<ArgumentNullException>("graphics", () => ControlPaint.DrawGrid(null, new Rectangle(1, 2, 3, 4), new Size(1, 1), Color.Red)); 1303Assert.Throws<ArgumentOutOfRangeException>("pixelsBetweenDots", () => ControlPaint.DrawGrid(graphics, new Rectangle(0, 0, width, height), new Size(width, height), Color.Red)); 1341Assert.Throws<ArgumentNullException>("graphics", () => ControlPaint.DrawImageDisabled(null, image, 0, 0, Color.Red)); 1382Assert.Throws<ArgumentNullException>("graphics", () => ControlPaint.DrawLockedFrame(null, new Rectangle(1, 2, 3, 4), primary)); 1470Assert.Throws<ArgumentNullException>("graphics", () => ControlPaint.DrawMenuGlyph(null, new Rectangle(1, 2, 3, 4), glyph)); 1471Assert.Throws<ArgumentNullException>("graphics", () => ControlPaint.DrawMenuGlyph(null, 1, 2, 3, 4, glyph)); 1500Assert.Throws<ArgumentOutOfRangeException>("width", () => ControlPaint.DrawMenuGlyph(graphics, new Rectangle(0, 0, -3, 4), glyph)); 1501Assert.Throws<ArgumentOutOfRangeException>("width", () => ControlPaint.DrawMenuGlyph(graphics, 0, 0, -3, 4, glyph)); 1512Assert.Throws<ArgumentOutOfRangeException>("height", () => ControlPaint.DrawMenuGlyph(graphics, new Rectangle(0, 0, 3, -4), glyph)); 1513Assert.Throws<ArgumentOutOfRangeException>("height", () => ControlPaint.DrawMenuGlyph(graphics, 0, 0, 3, -4, glyph)); 1556Assert.Throws<ArgumentNullException>("graphics", () => ControlPaint.DrawMixedCheckBox(null, new Rectangle(1, 2, 3, 4), state)); 1557Assert.Throws<ArgumentNullException>("graphics", () => ControlPaint.DrawMixedCheckBox(null, 1, 2, 3, 4, state)); 1581Assert.Throws<ArgumentOutOfRangeException>("width", () => ControlPaint.DrawMixedCheckBox(graphics, new Rectangle(0, 0, -3, 4), state)); 1582Assert.Throws<ArgumentOutOfRangeException>("width", () => ControlPaint.DrawMixedCheckBox(graphics, 0, 0, -3, 4, state)); 1592Assert.Throws<ArgumentOutOfRangeException>("height", () => ControlPaint.DrawMixedCheckBox(graphics, new Rectangle(0, 0, 3, -4), state)); 1593Assert.Throws<ArgumentOutOfRangeException>("height", () => ControlPaint.DrawMixedCheckBox(graphics, 0, 0, 3, -4, state)); 1636Assert.Throws<ArgumentNullException>("graphics", () => ControlPaint.DrawRadioButton(null, new Rectangle(1, 2, 3, 4), state)); 1637Assert.Throws<ArgumentNullException>("graphics", () => ControlPaint.DrawRadioButton(null, 1, 2, 3, 4, state)); 1661Assert.Throws<ArgumentOutOfRangeException>("width", () => ControlPaint.DrawRadioButton(graphics, new Rectangle(0, 0, -3, 4), state)); 1662Assert.Throws<ArgumentOutOfRangeException>("width", () => ControlPaint.DrawRadioButton(graphics, 0, 0, -3, 4, state)); 1672Assert.Throws<ArgumentOutOfRangeException>("height", () => ControlPaint.DrawRadioButton(graphics, new Rectangle(0, 0, 3, -4), state)); 1673Assert.Throws<ArgumentOutOfRangeException>("height", () => ControlPaint.DrawRadioButton(graphics, 0, 0, 3, -4, state)); 1774Assert.Throws<ArgumentNullException>("graphics", () => ControlPaint.DrawScrollButton(null, new Rectangle(1, 2, 3, 4), ScrollButton.Up, state)); 1775Assert.Throws<ArgumentNullException>("graphics", () => ControlPaint.DrawScrollButton(null, 1, 2, 3, 4, ScrollButton.Up, state)); 1799Assert.Throws<ArgumentOutOfRangeException>("width", () => ControlPaint.DrawScrollButton(graphics, new Rectangle(0, 0, -3, 4), ScrollButton.Up, state)); 1800Assert.Throws<ArgumentOutOfRangeException>("width", () => ControlPaint.DrawScrollButton(graphics, 0, 0, -3, 4, ScrollButton.Up, state)); 1810Assert.Throws<ArgumentOutOfRangeException>("height", () => ControlPaint.DrawScrollButton(graphics, new Rectangle(0, 0, 3, -4), ScrollButton.Up, state)); 1811Assert.Throws<ArgumentOutOfRangeException>("height", () => ControlPaint.DrawScrollButton(graphics, 0, 0, 3, -4, ScrollButton.Up, state)); 1847Assert.Throws<ArgumentNullException>("graphics", () => ControlPaint.DrawSelectionFrame(null, active, new Rectangle(1, 2, 3, 4), new Rectangle(1, 2, 3, 4), Color.Red)); 1892Assert.Throws<ArgumentNullException>("graphics", () => ControlPaint.DrawSizeGrip(null, Color.Red, new Rectangle(1, 2, 3, 4))); 1893Assert.Throws<ArgumentNullException>("graphics", () => ControlPaint.DrawSizeGrip(null, Color.Red, 1, 2, 3, 4)); 1941Assert.Throws<ArgumentNullException>("graphics", () => ControlPaint.DrawStringDisabled(null, s, SystemFonts.MenuFont, Color.Red, new RectangleF(1, 2, 3, 4), new StringFormat())); 1977Assert.Throws<ArgumentNullException>("dc", () => ControlPaint.DrawStringDisabled(null, s, SystemFonts.MenuFont, Color.Red, new Rectangle(1, 2, 3, 4), TextFormatFlags.Default)); 2005Assert.Throws<ArgumentNullException>("graphics", () => ControlPaint.DrawVisualStyleBorder(null, new Rectangle(1, 2, 3, 4)));
System\Windows\Forms\ControlTests.ControlCollection.cs (5)
1279Assert.Throws<ArgumentNullException>("controls", () => collection.AddRange(null)); 2905Assert.Throws<ArgumentOutOfRangeException>("index", () => collection.RemoveAt(index)); 2920Assert.Throws<ArgumentOutOfRangeException>("index", () => collection.RemoveAt(index)); 3413Assert.Throws<ArgumentNullException>("child", () => collection.SetChildIndex(null, 0)); 3425Assert.Throws<ArgumentOutOfRangeException>("index", () => collection.SetChildIndex(child, -2));
System\Windows\Forms\ControlTests.Handlers.cs (1)
4771Assert.Throws<ArgumentNullException>("e", () => control.OnPrint(null));
System\Windows\Forms\ControlTests.Methods.cs (2)
1881Assert.Throws<ArgumentNullException>("bitmap", () => control.DrawToBitmap(null, new Rectangle(1, 2, 3, 4))); 10089Assert.Throws<ArgumentException>("value", () => control.SetTopLevel(true));
System\Windows\Forms\CursorTests.cs (2)
398Assert.Throws<ArgumentNullException>("graphics", () => cursor.Draw(null, new Rectangle(Point.Empty, cursor.Size))); 435Assert.Throws<ArgumentNullException>("graphics", () => cursor.DrawStretched(null, new Rectangle(Point.Empty, cursor.Size)));
System\Windows\Forms\DataGridViewCellPaintingEventArgsTests.cs (3)
96Assert.Throws<ArgumentNullException>("advancedBorderStyle", () => e.Paint(new Rectangle(1, 2, 3, 4), DataGridViewPaintParts.None)); 146Assert.Throws<ArgumentNullException>("advancedBorderStyle", () => e.PaintBackground(new Rectangle(1, 2, 3, 4), true)); 196Assert.Throws<ArgumentNullException>("advancedBorderStyle", () => e.PaintContent(new Rectangle(1, 2, 3, 4)));
System\Windows\Forms\DataGridViewCellStyleTests.cs (1)
701Assert.Throws<ArgumentNullException>("dataGridViewCellStyle", () => style.ApplyStyle(null));
System\Windows\Forms\DataGridViewCellTests.cs (3)
6036Assert.Throws<ArgumentNullException>("graphics", () => cell.PaintBorder(null, new Rectangle(1, 2, 3, 4), new Rectangle(1, 2, 3, 4), new DataGridViewCellStyle(), new DataGridViewAdvancedBorderStyle())); 6045Assert.Throws<ArgumentNullException>("cellStyle", () => cell.PaintBorder(graphics, new Rectangle(1, 2, 3, 4), new Rectangle(1, 2, 3, 4), null, new DataGridViewAdvancedBorderStyle())); 6081Assert.Throws<ArgumentNullException>("graphics", () => cell.PaintErrorIcon(null, new Rectangle(1, 2, 3, 4), new Rectangle(1, 2, cellValueBoundsWidth, cellValueBoundsHeight), errorText));
System\Windows\Forms\DataGridViewHeaderCellTests.cs (4)
4211Assert.Throws<ArgumentOutOfRangeException>("rowIndex", () => cell.OnMouseDown(e)); 4426Assert.Throws<ArgumentOutOfRangeException>("rowIndex", () => cell.OnMouseLeave(rowIndex)); 4594Assert.Throws<ArgumentOutOfRangeException>("rowIndex", () => cell.OnMouseUp(e)); 4620Assert.Throws<ArgumentNullException>("cellStyle", () => cell.Paint(graphics, Rectangle.Empty, Rectangle.Empty, -1, DataGridViewElementStates.None, null, null, null, null, null, DataGridViewPaintParts.All));
System\Windows\Forms\DataGridViewRowTests.cs (27)
4111Assert.Throws<ArgumentNullException>("dataGridView", () => row.CreateCells(null)); 4112Assert.Throws<ArgumentNullException>("dataGridView", () => row.CreateCells(null, Array.Empty<object>())); 4145Assert.Throws<ArgumentNullException>("values", () => row.CreateCells(control, null)); 4229Assert.Throws<ArgumentNullException>("graphics", () => row.DrawFocus(null, new Rectangle(1, 2, 3, 4), new Rectangle(1, 2, 3, 4), -1, DataGridViewElementStates.None, new DataGridViewCellStyle(), true)); 4245Assert.Throws<ArgumentNullException>("cellStyle", () => row.DrawFocus(graphics, new Rectangle(1, 2, 3, 4), new Rectangle(1, 2, 3, 4), -1, DataGridViewElementStates.None, null, true)); 4857Assert.Throws<ArgumentNullException>("graphics", () => row.Paint(null, new Rectangle(1, 2, 3, 4), new Rectangle(2, 3, 4, 5), 1, DataGridViewElementStates.Frozen, true, false)); 4861Assert.Throws<ArgumentNullException>("graphics", () => row.Paint(null, new Rectangle(1, 2, 3, 4), new Rectangle(2, 3, 4, 5), 1, DataGridViewElementStates.Frozen, true, false)); 4866Assert.Throws<ArgumentNullException>("graphics", () => row.Paint(null, new Rectangle(1, 2, 3, 4), new Rectangle(2, 3, 4, 5), 1, DataGridViewElementStates.Frozen, true, false)); 4927Assert.Throws<ArgumentNullException>("graphics", () => row.Paint(null, new Rectangle(1, 2, 3, 4), new Rectangle(2, 3, 4, 5), 1, DataGridViewElementStates.Frozen, true, false)); 4931Assert.Throws<ArgumentNullException>("graphics", () => row.Paint(null, new Rectangle(1, 2, 3, 4), new Rectangle(2, 3, 4, 5), 1, DataGridViewElementStates.Frozen, true, false)); 4935Assert.Throws<ArgumentNullException>("graphics", () => row.Paint(null, Rectangle.Empty, new Rectangle(2, 3, 4, 5), 1, DataGridViewElementStates.Frozen, true, false)); 4940Assert.Throws<ArgumentNullException>("graphics", () => row.Paint(null, Rectangle.Empty, new Rectangle(2, 3, 4, 5), 1, DataGridViewElementStates.Frozen, true, false)); 4955Assert.Throws<ArgumentNullException>("graphics", () => row.Paint(null, Rectangle.Empty, Rectangle.Empty, 1, DataGridViewElementStates.None, true, true)); 4969Assert.Throws<ArgumentNullException>("graphics", () => row.Paint(null, Rectangle.Empty, new Rectangle(1, 2, 100, 100), 1, DataGridViewElementStates.None, true, true)); 4983Assert.Throws<ArgumentNullException>("graphics", () => row.Paint(null, new Rectangle(1, 2, 3, 4), new Rectangle(1, 2, 100, 100), 1, DataGridViewElementStates.None, true, true)); 5009Assert.Throws<ArgumentOutOfRangeException>("index", () => row.Paint(graphics, new Rectangle(1, 2, 100, 100), new Rectangle(1, 2, 100, 100), rowIndex, DataGridViewElementStates.None, true, true)); 5250Assert.Throws<ArgumentNullException>("graphics", () => row.PaintCells(null, Rectangle.Empty, Rectangle.Empty, -1, DataGridViewElementStates.None, true, true, DataGridViewPaintParts.All)); 5264Assert.Throws<ArgumentNullException>("graphics", () => row.PaintCells(null, Rectangle.Empty, new Rectangle(1, 2, 100, 100), 1, DataGridViewElementStates.None, true, true, DataGridViewPaintParts.All)); 5278Assert.Throws<ArgumentNullException>("graphics", () => row.PaintCells(null, new Rectangle(1, 2, 3, 4), new Rectangle(1, 2, 100, 100), -1, DataGridViewElementStates.None, true, true, DataGridViewPaintParts.All)); 5292Assert.Throws<ArgumentNullException>("graphics", () => row.PaintCells(null, new Rectangle(1, 2, 1000, 10000), new Rectangle(1, 2, 1000, 1000), 1, DataGridViewElementStates.None, true, true, DataGridViewPaintParts.All)); 5319Assert.Throws<ArgumentOutOfRangeException>("rowIndex", () => row.PaintCells(graphics, new Rectangle(1, 2, 100, 100), new Rectangle(1, 2, 100, 100), rowIndex, DataGridViewElementStates.None, true, true, DataGridViewPaintParts.All)); 5571Assert.Throws<ArgumentNullException>("graphics", () => row.PaintHeader(null, Rectangle.Empty, Rectangle.Empty, -1, DataGridViewElementStates.None, true, true, DataGridViewPaintParts.All)); 5586Assert.Throws<ArgumentNullException>("graphics", () => row.PaintHeader(null, Rectangle.Empty, new Rectangle(1, 2, 100, 100), -1, DataGridViewElementStates.None, true, true, DataGridViewPaintParts.All)); 5601Assert.Throws<ArgumentNullException>("graphics", () => row.PaintHeader(null, new Rectangle(1, 2, 3, 4), new Rectangle(1, 2, 100, 100), 1, DataGridViewElementStates.None, true, true, DataGridViewPaintParts.All)); 5616Assert.Throws<ArgumentNullException>("graphics", () => row.PaintHeader(null, new Rectangle(1, 2, 100, 100), new Rectangle(1, 2, 100, 100), -1, DataGridViewElementStates.None, true, true, DataGridViewPaintParts.All)); 5641Assert.Throws<ArgumentOutOfRangeException>("rowIndex", () => row.PaintHeader(graphics, new Rectangle(1, 2, 100, 100), new Rectangle(1, 2, 100, 100), rowIndex, DataGridViewElementStates.None, true, true, DataGridViewPaintParts.All)); 5675Assert.Throws<InvalidEnumArgumentException>("paintParts", () => row.PaintHeader(graphics, Rectangle.Empty, Rectangle.Empty, -1, DataGridViewElementStates.None, true, true, paintParts));
System\Windows\Forms\DataGridViewTests.cs (2)
2200Assert.Throws<ArgumentOutOfRangeException>("value", () => control.OnColumnHeadersHeightSizeModeChanged(eventArgs)); 2681Assert.Throws<ArgumentOutOfRangeException>("value", () => control.OnRowHeadersWidthSizeModeChanged(eventArgs));
System\Windows\Forms\DataGridViewTextBoxEditingControlTests.cs (1)
969Assert.Throws<ArgumentNullException>("dataGridViewCellStyle", () => control.ApplyCellStyleToEditingControl(null));
System\Windows\Forms\ErrorProviderTests.cs (4)
1064Assert.Throws<ArgumentNullException>("control", () => provider.SetError(null, value)); 1088Assert.Throws<ArgumentNullException>("control", () => provider.SetIconAlignment(null, value)); 1097Assert.Throws<InvalidEnumArgumentException>("value", () => provider.SetIconAlignment(control, value)); 1119Assert.Throws<ArgumentNullException>("control", () => provider.SetIconPadding(null, 0));
System\Windows\Forms\FlowLayoutPanelTests.cs (1)
417Assert.Throws<ArgumentNullException>("control", () => control.SetFlowBreak(null, value));
System\Windows\Forms\FlowLayoutSettingsTests.cs (1)
237Assert.Throws<ArgumentNullException>("child", () => settings.SetFlowBreak(null, value));
System\Windows\Forms\HelpProviderTests.cs (7)
168Assert.Throws<ArgumentNullException>("ctl", () => provider.ResetShowHelp(null)); 280Assert.Throws<ArgumentNullException>("ctl", () => provider.SetHelpKeyword(null, "keyword")); 342Assert.Throws<ArgumentNullException>("ctl", () => provider.SetHelpNavigator(null, navigator)); 350Assert.Throws<InvalidEnumArgumentException>("navigator", () => provider.SetHelpNavigator(new Control(), navigator)); 416Assert.Throws<ArgumentNullException>("ctl", () => provider.SetHelpString(null, "keyword")); 483Assert.Throws<ArgumentNullException>("ctl", () => provider.SetShowHelp(null, true)); 550Assert.Throws<ArgumentException>("url", () => control.OnHelpRequested(e));
System\Windows\Forms\ImageList.ImageCollectionTests.cs (5)
793Assert.Throws<ArgumentNullException>("value", () => collection.Add((Image)null)); 796Assert.Throws<ArgumentNullException>("value", () => collection.Add((Icon)null)); 866Assert.Throws<ArgumentNullException>("images", () => collection.AddRange(null)); 1383Assert.Throws<ArgumentOutOfRangeException>("index", () => collection.RemoveAt(index)); 1395Assert.Throws<ArgumentOutOfRangeException>("index", () => collection.RemoveAt(index));
System\Windows\Forms\ImageListTests.cs (6)
1039Assert.Throws<ArgumentOutOfRangeException>("index", () => list.Draw(graphics, Point.Empty, index)); 1040Assert.Throws<ArgumentOutOfRangeException>("index", () => list.Draw(graphics, 0, 0, index)); 1041Assert.Throws<ArgumentOutOfRangeException>("index", () => list.Draw(graphics, 0, 0, 10, 10, index)); 1055Assert.Throws<ArgumentOutOfRangeException>("index", () => list.Draw(graphics, Point.Empty, index)); 1056Assert.Throws<ArgumentOutOfRangeException>("index", () => list.Draw(graphics, 0, 0, index)); 1057Assert.Throws<ArgumentOutOfRangeException>("index", () => list.Draw(graphics, 0, 0, 10, 10, index));
System\Windows\Forms\Layout\FlowLayoutTests.cs (1)
32Assert.Throws<ArgumentNullException>("child", () => engine.InitLayout(null, BoundsSpecified.All));
System\Windows\Forms\Layout\LayoutEngineTests.cs (1)
28Assert.Throws<ArgumentNullException>("child", () => engine.InitLayout(null, BoundsSpecified.All));
System\Windows\Forms\Layout\TableLayoutSettingsTests.cs (18)
648Assert.Throws<ArgumentNullException>("control", () => settings.SetCellPosition(null, default)); 656Assert.Throws<ArgumentNullException>("control", () => settings.SetCellPosition(null, default)); 870Assert.Throws<ArgumentNullException>("control", () => settings.SetColumn(null, value)); 880Assert.Throws<ArgumentNullException>("control", () => settings.SetColumn(null, value)); 905Assert.Throws<ArgumentOutOfRangeException>("column", () => settings.SetColumn("control", -2)); 913Assert.Throws<ArgumentOutOfRangeException>("column", () => settings.SetColumn("control", -2)); 1101Assert.Throws<ArgumentNullException>("control", () => settings.SetColumnSpan(null, value)); 1111Assert.Throws<ArgumentNullException>("control", () => settings.SetColumnSpan(null, value)); 1139Assert.Throws<ArgumentOutOfRangeException>("value", () => settings.SetColumnSpan("control", value)); 1149Assert.Throws<ArgumentOutOfRangeException>("value", () => settings.SetColumnSpan("control", value)); 1346Assert.Throws<ArgumentNullException>("control", () => settings.SetRow(null, value)); 1356Assert.Throws<ArgumentNullException>("control", () => settings.SetRow(null, value)); 1381Assert.Throws<ArgumentOutOfRangeException>("row", () => settings.SetRow("control", -2)); 1389Assert.Throws<ArgumentOutOfRangeException>("row", () => settings.SetRow("control", -2)); 1577Assert.Throws<ArgumentNullException>("control", () => settings.SetRowSpan(null, value)); 1587Assert.Throws<ArgumentNullException>("control", () => settings.SetRowSpan(null, value)); 1614Assert.Throws<ArgumentOutOfRangeException>("value", () => settings.SetRowSpan("control", value)); 1624Assert.Throws<ArgumentOutOfRangeException>("value", () => settings.SetRowSpan("control", value));
System\Windows\Forms\Layout\TableLayoutSettingsTypeConverterTests.cs (1)
250Assert.Throws<ArgumentNullException>("control", () => settings.SetColumnSpan(null, 1));
System\Windows\Forms\ListBox.IntegerCollectionTests.cs (8)
748Assert.Throws<ArgumentNullException>("items", () => collection.AddRange((int[])null)); 749Assert.Throws<ArgumentNullException>("items", () => collection.AddRange((ListBox.IntegerCollection)null)); 1045Assert.Throws<ArgumentNullException>("destination", () => collection.CopyTo(null, 0)); 1056Assert.Throws<ArgumentNullException>("destination", () => collection.CopyTo(null, 0)); 1493Assert.Throws<ArgumentOutOfRangeException>("index", () => collection.RemoveAt(index)); 1507Assert.Throws<ArgumentOutOfRangeException>("index", () => collection.RemoveAt(index)); 2767Assert.Throws<ArgumentOutOfRangeException>("index", () => collection.RemoveAt(index)); 2781Assert.Throws<ArgumentOutOfRangeException>("index", () => collection.RemoveAt(index));
System\Windows\Forms\ListBox.ObjectCollectionTests.cs (16)
3648Assert.Throws<ArgumentNullException>("items", () => collection.AddRange((object[])null)); 3649Assert.Throws<ArgumentNullException>("value", () => collection.AddRange((ListBox.ObjectCollection)null)); 4010Assert.Throws<ArgumentNullException>("destination", () => collection.CopyTo(null, 0)); 4021Assert.Throws<ArgumentNullException>("destination", () => collection.CopyTo(null, 0)); 5000Assert.Throws<ArgumentOutOfRangeException>("index", () => collection.Insert(index, 1)); 5014Assert.Throws<ArgumentOutOfRangeException>("index", () => collection.Insert(index, 1)); 5022Assert.Throws<ArgumentNullException>("item", () => collection.Insert(0, null)); 6840Assert.Throws<ArgumentOutOfRangeException>("index", () => collection.RemoveAt(index)); 6854Assert.Throws<ArgumentOutOfRangeException>("index", () => collection.RemoveAt(index)); 9332Assert.Throws<ArgumentNullException>("destination", () => collection.CopyTo(null, 0)); 9343Assert.Throws<ArgumentNullException>("destination", () => collection.CopyTo(null, 0)); 10322Assert.Throws<ArgumentOutOfRangeException>("index", () => collection.Insert(index, 1)); 10336Assert.Throws<ArgumentOutOfRangeException>("index", () => collection.Insert(index, 1)); 10344Assert.Throws<ArgumentNullException>("item", () => collection.Insert(0, null)); 12162Assert.Throws<ArgumentOutOfRangeException>("index", () => collection.RemoveAt(index)); 12176Assert.Throws<ArgumentOutOfRangeException>("index", () => collection.RemoveAt(index));
System\Windows\Forms\ListBoxTests.cs (2)
6063Assert.Throws<ArgumentNullException>("value", () => control.SetItemsCore(null)); 6073Assert.Throws<ArgumentNullException>("value", () => control.SetItemsCore(null));
System\Windows\Forms\ListView.CheckedIndexCollectionTests.cs (1)
11Assert.Throws<ArgumentNullException>("owner", () => { new ListView.CheckedIndexCollection(null); });
System\Windows\Forms\ListView.CheckedListViewItemCollectionTests.cs (1)
11Assert.Throws<ArgumentNullException>("owner", () => { new ListView.CheckedListViewItemCollection(null); });
System\Windows\Forms\ListView.SelectedListViewItemCollectionTests.cs (1)
11Assert.Throws<ArgumentNullException>("owner", () => { new ListView.SelectedListViewItemCollection(null); });
System\Windows\Forms\ListViewGroupCollectionTests.cs (6)
578Assert.Throws<ArgumentNullException>("groups", () => collection.AddRange((ListViewGroup[])null)); 579Assert.Throws<ArgumentNullException>("groups", () => collection.AddRange((ListViewGroupCollection)null)); 864Assert.Throws<ArgumentNullException>("group", () => collection.Insert(index, null)); 874Assert.Throws<ArgumentOutOfRangeException>("index", () => collection.Insert(index, new ListViewGroup())); 909Assert.Throws<ArgumentOutOfRangeException>("index", () => collection.Insert(index, new ListViewGroup())); 1026Assert.Throws<ArgumentOutOfRangeException>("index", () => collection.RemoveAt(index));
System\Windows\Forms\ListViewGroupTests.cs (1)
1422Assert.Throws<ArgumentNullException>("info", () => iSerializable.GetObjectData(null, context));
System\Windows\Forms\ListViewSubItemCollectionTests.cs (9)
417Assert.Throws<ArgumentNullException>("items", () => collection.AddRange((ListViewItem.ListViewSubItem[])null)); 418Assert.Throws<ArgumentNullException>("items", () => collection.AddRange((string[])null)); 419Assert.Throws<ArgumentNullException>("items", () => collection.AddRange((string[])null, Color.Red, Color.Blue, SystemFonts.MenuFont)); 652Assert.Throws<ArgumentNullException>("item", () => collection.Insert(1, null)); 662Assert.Throws<ArgumentOutOfRangeException>("index", () => collection.Insert(index, null)); 685Assert.Throws<ArgumentException>("item", () => collection.Insert(0, value)); 695Assert.Throws<ArgumentOutOfRangeException>("index", () => collection.Insert(index, new ListViewItem.ListViewSubItem())); 809Assert.Throws<ArgumentOutOfRangeException>("index", () => collection.RemoveAt(index)); 819Assert.Throws<ArgumentOutOfRangeException>("index", () => collection.RemoveAt(index));
System\Windows\Forms\MonthCalendarTests.cs (6)
4027Assert.Throws<ArgumentOutOfRangeException>("date", () => calendar.SetDate(calendar.MinDate.AddTicks(-1))); 4039Assert.Throws<ArgumentOutOfRangeException>("date", () => calendar.SetDate(calendar.MaxDate.AddDays(1))); 4138Assert.Throws<ArgumentOutOfRangeException>("date1", () => calendar.SetSelectionRange(calendar.MinDate.AddTicks(-1), calendar.MinDate)); 4139Assert.Throws<ArgumentOutOfRangeException>("date2", () => calendar.SetSelectionRange(calendar.MinDate, calendar.MinDate.AddTicks(-1))); 4155Assert.Throws<ArgumentOutOfRangeException>("date1", () => calendar.SetSelectionRange(calendar.MaxDate.AddDays(1), calendar.MaxDate)); 4156Assert.Throws<ArgumentOutOfRangeException>("date2", () => calendar.SetSelectionRange(calendar.MaxDate, calendar.MaxDate.AddDays(1)));
System\Windows\Forms\NotifyIconTests.cs (3)
953Assert.Throws<ArgumentOutOfRangeException>("timeout", () => notifyIcon.ShowBalloonTip(-1)); 954Assert.Throws<ArgumentOutOfRangeException>("timeout", () => notifyIcon.ShowBalloonTip(-1, "Title", "Text", ToolTipIcon.Error)); 974Assert.Throws<InvalidEnumArgumentException>("tipIcon", () => notifyIcon.ShowBalloonTip(0, "Title", "Text", tipIcon));
System\Windows\Forms\RichTextBoxTests.cs (3)
8760Assert.Throws<ArgumentNullException>("data", () => control.LoadFile((Stream)null, RichTextBoxStreamType.RichText)); 8769Assert.Throws<InvalidEnumArgumentException>("fileType", () => control.LoadFile(stream, fileType)); 9733Assert.Throws<InvalidEnumArgumentException>("fileType", () => control.SaveFile(stream, fileType));
System\Windows\Forms\TabControl.TabPageCollectionTests.cs (33)
883Assert.Throws<ArgumentNullException>("value", () => collection.Add((TabPage)null)); 1161Assert.Throws<ArgumentNullException>("pages", () => collection.AddRange(null)); 1222Assert.Throws<ArgumentNullException>("destinationArray", () => iList.CopyTo(null, 0)); 1235Assert.Throws<ArgumentOutOfRangeException>("destinationIndex", () => iList.CopyTo(array, -1)); 1276Assert.Throws<ArgumentNullException>("sourceArray", () => iList.CopyTo(array, 1)); 2907Assert.Throws<ArgumentNullException>("tabPage", () => collection.Insert(0, (TabPage)null)); 2916Assert.Throws<ArgumentOutOfRangeException>("index", () => collection.Insert(-1, value)); 2917Assert.Throws<ArgumentOutOfRangeException>("index", () => collection.Insert(-1, "text")); 2918Assert.Throws<ArgumentOutOfRangeException>("index", () => collection.Insert(-1, "key", "text")); 2919Assert.Throws<ArgumentOutOfRangeException>("index", () => collection.Insert(-1, "key", "text", 1)); 2920Assert.Throws<ArgumentOutOfRangeException>("index", () => collection.Insert(-1, "key", "text", "imageKey")); 2932Assert.Throws<ArgumentOutOfRangeException>("index", () => collection.Insert(-1, value)); 2933Assert.Throws<ArgumentOutOfRangeException>("index", () => collection.Insert(-1, "text")); 2934Assert.Throws<ArgumentOutOfRangeException>("index", () => collection.Insert(-1, "key", "text")); 2935Assert.Throws<ArgumentOutOfRangeException>("index", () => collection.Insert(-1, "key", "text", 1)); 2936Assert.Throws<ArgumentOutOfRangeException>("index", () => collection.Insert(-1, "key", "text", "imageKey")); 2977Assert.Throws<ArgumentOutOfRangeException>("index", () => collection.Insert(index, value)); 2978Assert.Throws<ArgumentOutOfRangeException>("index", () => collection.Insert(index, "text")); 2979Assert.Throws<ArgumentOutOfRangeException>("index", () => collection.Insert(index, "key", "text")); 2980Assert.Throws<ArgumentOutOfRangeException>("index", () => collection.Insert(index, "key", "text", 1)); 2981Assert.Throws<ArgumentOutOfRangeException>("index", () => collection.Insert(index, "key", "text", "imageKey")); 3000Assert.Throws<ArgumentOutOfRangeException>("index", () => collection.Insert(index, value)); 3001Assert.Throws<ArgumentOutOfRangeException>("index", () => collection.Insert(index, "text")); 3002Assert.Throws<ArgumentOutOfRangeException>("index", () => collection.Insert(index, "key", "text")); 3003Assert.Throws<ArgumentOutOfRangeException>("index", () => collection.Insert(index, "key", "text", 1)); 3004Assert.Throws<ArgumentOutOfRangeException>("index", () => collection.Insert(index, "key", "text", "imageKey")); 3153Assert.Throws<ArgumentOutOfRangeException>("index", () => iList.Insert(-1, value)); 3166Assert.Throws<ArgumentOutOfRangeException>("index", () => iList.Insert(-1, value)); 3208Assert.Throws<ArgumentOutOfRangeException>("index", () => iList.Insert(index, value)); 3226Assert.Throws<ArgumentOutOfRangeException>("index", () => iList.Insert(index, value)); 4691Assert.Throws<ArgumentNullException>("value", () => collection.Remove(null)); 4871Assert.Throws<ArgumentOutOfRangeException>("index", () => collection.RemoveAt(index)); 4886Assert.Throws<ArgumentOutOfRangeException>("index", () => collection.RemoveAt(index));
System\Windows\Forms\TabControlTests.cs (15)
3175Assert.Throws<ArgumentOutOfRangeException>("index", () => control.DeselectTab(page)); 3187Assert.Throws<ArgumentOutOfRangeException>("index", () => control.DeselectTab(page3)); 3365Assert.Throws<ArgumentNullException>("tabPageName", () => control.DeselectTab((string)null)); 3374Assert.Throws<ArgumentNullException>("tabPage", () => control.DeselectTab(tabPageName)); 3387Assert.Throws<ArgumentNullException>("tabPage", () => control.DeselectTab(tabPageName)); 3556Assert.Throws<ArgumentOutOfRangeException>("index", () => control.DeselectTab(index)); 3570Assert.Throws<ArgumentOutOfRangeException>("index", () => control.DeselectTab(index)); 5323Assert.Throws<ArgumentNullException>("tabPage", () => control.SelectTab((TabPage)null)); 5331Assert.Throws<ArgumentOutOfRangeException>("index", () => control.SelectTab(page)); 5343Assert.Throws<ArgumentOutOfRangeException>("index", () => control.SelectTab(page3)); 5490Assert.Throws<ArgumentNullException>("tabPageName", () => control.SelectTab((string)null)); 5499Assert.Throws<ArgumentNullException>("tabPage", () => control.SelectTab(tabPageName)); 5513Assert.Throws<ArgumentNullException>("tabPage", () => control.SelectTab(tabPageName)); 5651Assert.Throws<ArgumentOutOfRangeException>("index", () => control.SelectTab(index)); 5665Assert.Throws<ArgumentOutOfRangeException>("index", () => control.SelectTab(index));
System\Windows\Forms\TableLayoutControlCollectionTests.cs (3)
45Assert.Throws<ArgumentOutOfRangeException>("column", () => collection.Add(child, -2, 2)); 57Assert.Throws<ArgumentOutOfRangeException>("row", () => collection.Add(child, 1, -2)); 68Assert.Throws<ArgumentNullException>("control", () => collection.Add(null, 1, 2));
System\Windows\Forms\TableLayoutPanelTests.cs (9)
1655Assert.Throws<ArgumentNullException>("control", () => control.SetCellPosition(null, default)); 1761Assert.Throws<ArgumentNullException>("control", () => control.SetColumn(null, 1)); 1768Assert.Throws<ArgumentOutOfRangeException>("column", () => control.SetColumn(new Control(), -2)); 1873Assert.Throws<ArgumentNullException>("control", () => control.SetColumnSpan(null, value)); 1882Assert.Throws<ArgumentOutOfRangeException>("value", () => control.SetColumnSpan(new Control(), value)); 1988Assert.Throws<ArgumentNullException>("control", () => control.SetRow(null, 1)); 1995Assert.Throws<ArgumentOutOfRangeException>("row", () => control.SetRow(new Control(), -2)); 2099Assert.Throws<ArgumentNullException>("control", () => control.SetRowSpan(null, value)); 2108Assert.Throws<ArgumentOutOfRangeException>("value", () => control.SetRowSpan(new Control(), value));
System\Windows\Forms\TableLayoutStyleCollectionTests.cs (2)
98Assert.Throws<ArgumentNullException>("style", () => ((IList)collection).Insert(index, null)); 118Assert.Throws<ArgumentException>("style", () => ((IList)collection).Insert(0, style));
System\Windows\Forms\TextRendererTests.cs (2)
391Assert.Throws<ArgumentNullException>("dc", () => TextRenderer.DrawText(null, "text", SystemFonts.MenuFont, Point.Empty, Color.Red)); 608Assert.Throws<ArgumentOutOfRangeException>("flags", action);
System\Windows\Forms\ToolStripControlHostTests.cs (1)
2172Assert.Throws<ArgumentNullException>("key", () => iDictionaryService.SetValue(null, "value"));
System\Windows\Forms\ToolStripRendererTests.cs (10)
72Assert.Throws<ArgumentNullException>("e", () => renderer.DrawArrow(null)); 232Assert.Throws<ArgumentNullException>("e", () => renderer.DrawItemCheck(null)); 265Assert.Throws<ArgumentNullException>("e", () => renderer.DrawItemImage(null)); 340Assert.Throws<ArgumentNullException>("e", () => renderer.DrawItemText(null)); 513Assert.Throws<ArgumentNullException>("e", () => renderer.DrawStatusStripSizingGrip(null)); 739Assert.Throws<ArgumentNullException>("e", () => renderer.OnRenderArrow(null)); 814Assert.Throws<ArgumentNullException>("e", () => renderer.OnRenderItemCheck(null)); 834Assert.Throws<ArgumentNullException>("e", () => renderer.OnRenderItemImage(null)); 856Assert.Throws<ArgumentNullException>("e", () => renderer.OnRenderItemText(null)); 933Assert.Throws<ArgumentNullException>("e", () => renderer.OnRenderStatusStripSizingGrip(null));
System\Windows\Forms\ToolStripTests.cs (1)
7097Assert.Throws<ArgumentNullException>("item", () => control.SetItemLocation(null, Point.Empty));
System\Windows\Forms\ToolTipTests.cs (4)
713Assert.Throws<ArgumentNullException>("control", () => toolTip.SetToolTip(null, caption)); 766Assert.Throws<ArgumentNullException>("window", () => toolTip.Show("text", null)); 767Assert.Throws<ArgumentNullException>("window", () => toolTip.Show("text", null, 1)); 775Assert.Throws<ArgumentOutOfRangeException>("duration", () => toolTip.Show("text", mockWindow.Object, -1));
System\Windows\Forms\VisualStyles\VisualStyleRendererTests.cs (14)
180Assert.Throws<ArgumentNullException>("dc", () => renderer.DrawBackground(null, new Rectangle(1, 2, 3, 4))); 181Assert.Throws<ArgumentNullException>("dc", () => renderer.DrawBackground(null, new Rectangle(1, 2, 3, 4), new Rectangle(1, 2, 3, 4))); 295Assert.Throws<ArgumentNullException>("g", () => renderer.DrawImage(null, new Rectangle(1, 2, 3, 4), image)); 296Assert.Throws<ArgumentNullException>("g", () => renderer.DrawImage(null, new Rectangle(1, 2, 3, 4), imageList, 0)); 306Assert.Throws<ArgumentNullException>("image", () => renderer.DrawImage(graphics, new Rectangle(1, 2, 3, 4), null)); 316Assert.Throws<ArgumentNullException>("imageList", () => renderer.DrawImage(graphics, new Rectangle(1, 2, 3, 4), null, 0)); 330Assert.Throws<ArgumentOutOfRangeException>("imageIndex", () => renderer.DrawImage(graphics, new Rectangle(1, 2, 3, 4), imageList, imageIndex)); 393Assert.Throws<ArgumentNullException>("dc", () => renderer.DrawParentBackground(null, new Rectangle(1, 2, 3, 4), childControl)); 491Assert.Throws<ArgumentNullException>("dc", () => renderer.DrawText(null, new Rectangle(1, 2, 3, 4), "text")); 492Assert.Throws<ArgumentNullException>("dc", () => renderer.DrawText(null, new Rectangle(1, 2, 3, 4), "text", true)); 493Assert.Throws<ArgumentNullException>("dc", () => renderer.DrawText(null, new Rectangle(1, 2, 3, 4), "text", false)); 494Assert.Throws<ArgumentNullException>("dc", () => renderer.DrawText(null, new Rectangle(1, 2, 3, 4), "text", true, TextFormatFlags.Default)); 495Assert.Throws<ArgumentNullException>("dc", () => renderer.DrawText(null, new Rectangle(1, 2, 3, 4), "text", false, TextFormatFlags.Default)); 549Assert.Throws<ArgumentNullException>("element", () => renderer.SetParameters(null));
TextBoxBaseTests.cs (1)
6314Assert.Throws<ArgumentOutOfRangeException>("start", () => control.Select(-1, 0));
WebBrowserBaseTests.cs (1)
706Assert.Throws<ArgumentNullException>("bitmap", () => control.DrawToBitmap(null, new Rectangle(1, 2, 3, 4)));