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