674 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 (5)
SourceGeneration\GeneratorDriverTests.cs (5)
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)));
2556
Assert.
Throws
<ArgumentException>("hintName", () => c.AddEmbeddedAttributeDefinition());
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!"));
Microsoft.Extensions.AI.Abstractions.Tests (12)
ChatCompletion\ChatClientExtensionsTests.cs (4)
75
Assert.
Throws
<ArgumentNullException>("client", () =>
80
Assert.
Throws
<ArgumentNullException>("chatMessage", () =>
89
Assert.
Throws
<ArgumentNullException>("client", () =>
94
Assert.
Throws
<ArgumentNullException>("chatMessage", () =>
Utilities\AIJsonUtilitiesTests.cs (8)
390
Assert.
Throws
<ArgumentException>("contentType", () => options.AddAIContentType(typeof(int), "discriminator"));
391
Assert.
Throws
<ArgumentException>("contentType", () => options.AddAIContentType(typeof(object), "discriminator"));
392
Assert.
Throws
<ArgumentException>("contentType", () => options.AddAIContentType(typeof(ChatMessage), "discriminator"));
418
Assert.
Throws
<ArgumentNullException>("options", () => ((JsonSerializerOptions)null!).AddAIContentType<DerivedAIContent>("discriminator"));
419
Assert.
Throws
<ArgumentNullException>("options", () => ((JsonSerializerOptions)null!).AddAIContentType(typeof(DerivedAIContent), "discriminator"));
420
Assert.
Throws
<ArgumentNullException>("typeDiscriminatorId", () => options.AddAIContentType<DerivedAIContent>(null!));
421
Assert.
Throws
<ArgumentNullException>("typeDiscriminatorId", () => options.AddAIContentType(typeof(DerivedAIContent), null!));
422
Assert.
Throws
<ArgumentNullException>("contentType", () => options.AddAIContentType(null!, "discriminator"));
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 (61)
System\ComponentModel\Design\ByteViewerTests.cs (6)
614
Assert.
Throws
<ArgumentNullException>("path", () => control.SaveToFile(null));
624
Assert.
Throws
<ArgumentException>("path", () => control.SaveToFile(path));
719
Assert.
Throws
<ArgumentNullException>("bytes", () => control.SetBytes(null));
855
Assert.
Throws
<InvalidEnumArgumentException>("mode", () => control.SetDisplayMode(value));
883
Assert.
Throws
<ArgumentNullException>("path", () => control.SetFile(null));
893
Assert.
Throws
<ArgumentException>("path", () => control.SetFile(path));
System\ComponentModel\Design\DesignerActionItemCollectionTests.cs (2)
66
Assert.
Throws
<ArgumentNullException>("value", () => collection.Insert(0, null));
87
Assert.
Throws
<ArgumentNullException>("value", () => collection.Remove(null));
System\ComponentModel\Design\DesignerActionListCollectionTests.cs (2)
91
Assert.
Throws
<ArgumentNullException>("value", () => collection.AddRange((DesignerActionList[])null));
92
Assert.
Throws
<ArgumentNullException>("value", () => collection.AddRange((DesignerActionListCollection)null));
System\ComponentModel\Design\DesignerActionServiceTests.cs (11)
105
Assert.
Throws
<ArgumentNullException>("comp", () => service.Add(null, (DesignerActionListCollection)null));
106
Assert.
Throws
<ArgumentNullException>("comp", () => service.Add(null, (DesignerActionList)null));
161
Assert.
Throws
<ArgumentNullException>("designerActionListCollection", () => service.Add(new Component(), (DesignerActionListCollection)null));
614
Assert.
Throws
<ArgumentNullException>("component", () => service.GetComponentDesignerActions(null, null));
621
Assert.
Throws
<ArgumentNullException>("actionLists", () => service.GetComponentDesignerActions(new Component(), null));
649
Assert.
Throws
<ArgumentNullException>("component", () => service.GetComponentServiceActions(null, null));
656
Assert.
Throws
<ArgumentNullException>("actionLists", () => service.GetComponentServiceActions(new Component(), null));
1031
Assert.
Throws
<ArgumentNullException>("comp", () => service.Remove((IComponent)null));
1032
Assert.
Throws
<ArgumentNullException>("comp", () => service.Remove(null, null));
1039
Assert.
Throws
<ArgumentNullException>("actionList", () => service.Remove((DesignerActionList)null));
1040
Assert.
Throws
<ArgumentNullException>("actionList", () => service.Remove(new Component(), null));
System\ComponentModel\Design\DesignerHostTests.cs (1)
1045
Assert.
Throws
<ArgumentNullException>("key", () => service.SetValue(null, new object()));
System\ComponentModel\Design\DesignerVerbCollectionTests.cs (2)
91
Assert.
Throws
<ArgumentNullException>("value", () => collection.AddRange((DesignerVerb[])null));
92
Assert.
Throws
<ArgumentNullException>("value", () => collection.AddRange((DesignerVerbCollection)null));
System\ComponentModel\Design\DesignSurfaceTests.cs (3)
321
Assert.
Throws
<ArgumentNullException>("serviceType", () => container.RemoveService(null));
924
Assert.
Throws
<ArgumentNullException>("loader", () => surface.BeginLoad((DesignerLoader)null));
946
Assert.
Throws
<ArgumentNullException>("rootComponentType", () => surface.BeginLoad((Type)null));
System\ComponentModel\Design\ExtenderProviderServiceTests.cs (3)
45
Assert.
Throws
<ArgumentNullException>("provider", () => providerService.AddExtenderProvider(null));
58
Assert.
Throws
<ArgumentException>("provider", () => providerService.AddExtenderProvider(mockExtenderProvider.Object));
104
Assert.
Throws
<ArgumentNullException>("provider", () => providerService.RemoveExtenderProvider(null));
System\ComponentModel\Design\Serialization\CodeDomComponentSerializationServiceTests.cs (11)
683
Assert.
Throws
<ArgumentNullException>("info", () => serializable.GetObjectData(null, default));
892
Assert.
Throws
<ArgumentNullException>("store", () => service.Serialize(null, new object()));
900
Assert.
Throws
<ArgumentNullException>("value", () => service.Serialize(mockStore.Object, null));
1100
Assert.
Throws
<ArgumentNullException>("store", () => service.SerializeAbsolute(null, new object()));
1108
Assert.
Throws
<ArgumentNullException>("value", () => service.SerializeAbsolute(mockStore.Object, null));
1368
Assert.
Throws
<ArgumentNullException>("store", () => service.SerializeMember(null, new DataClass(), member));
1377
Assert.
Throws
<ArgumentNullException>("owningObject", () => service.SerializeMember(store, null, member));
1385
Assert.
Throws
<ArgumentNullException>("member", () => service.SerializeMember(store, new DataClass(), null));
1647
Assert.
Throws
<ArgumentNullException>("store", () => service.SerializeMemberAbsolute(null, new DataClass(), member));
1656
Assert.
Throws
<ArgumentNullException>("owningObject", () => service.SerializeMemberAbsolute(store, null, member));
1664
Assert.
Throws
<ArgumentNullException>("member", () => service.SerializeMemberAbsolute(store, new DataClass(), null));
System\ComponentModel\Design\Serialization\DesignerSerializationManagerTests.cs (5)
1937
Assert.
Throws
<ArgumentNullException>("instance", () => iManager.SetName(null, "name"));
1946
Assert.
Throws
<ArgumentNullException>("name", () => iManager.SetName(new object(), null));
1958
Assert.
Throws
<ArgumentException>("name", () => iManager.SetName(new object(), name));
1971
Assert.
Throws
<ArgumentException>("name", () => iManager.SetName(instance, name));
1972
Assert.
Throws
<ArgumentException>("instance", () => iManager.SetName(instance, "OtherName"));
System\ComponentModel\Design\SiteNestedContainerTests.cs (1)
419
Assert.
Throws
<ArgumentException>("provider", () => container.Add(component));
System\Drawing\Design\ToolboxItemTests.cs (13)
97
Assert.
Throws
<ArgumentException>("value", () => item.Properties.Add("AssemblyName", new object()));
127
Assert.
Throws
<ArgumentException>("value", () => item.Properties.Add("Bitmap", new object()));
151
Assert.
Throws
<ArgumentException>("value", () => item.Properties.Add("Company", new object()));
203
Assert.
Throws
<ArgumentException>("value", () => item.Properties.Add("DependentAssemblies", new object()));
227
Assert.
Throws
<ArgumentException>("value", () => item.Properties.Add("Description", new object()));
251
Assert.
Throws
<ArgumentException>("value", () => item.Properties.Add("DisplayName", new object()));
283
Assert.
Throws
<ArgumentException>("value", () => item.Properties.Add("Filter", new object()));
307
Assert.
Throws
<ArgumentNullException>("value", () => item.Properties.Add("IsTransient", null));
314
Assert.
Throws
<ArgumentException>("value", () => item.Properties.Add("IsTransient", new object()));
338
Assert.
Throws
<ArgumentException>("value", () => item.Properties.Add("OriginalBitmap", new object()));
362
Assert.
Throws
<ArgumentException>("value", () => item.Properties.Add("TypeName", new object()));
1609
Assert.
Throws
<ArgumentNullException>("value", () => item.ValidatePropertyType(propertyName, null, expectedType, allowNull: false));
1636
Assert.
Throws
<ArgumentException>("value", () => item.ValidatePropertyType(propertyName, new object(), typeof(int), allowNull));
System\Windows\Forms\Design\FileNameEditorTests.cs (1)
59
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)
389
Assert.
Throws
<InvalidEnumArgumentException>("value", () => control.SetItemCheckState(0, value));
System\Drawing\Design\UITypeEditorTests.cs (1)
147
Assert.
Throws
<ArgumentNullException>("graphics", () => editor.PaintValue(new object(), null, Rectangle.Empty));
System\Windows\Forms\ApplicationTests.cs (1)
243
Assert.
Throws
<ArgumentNullException>("font", () => Application.SetDefaultFont(null));
System\Windows\Forms\AutoCompleteStringCollectionTests.cs (5)
35
Assert.
Throws
<ArgumentNullException>("value", () => collection.AddRange(null!));
49
Assert.
Throws
<ArgumentNullException>("value", () => collection.AddRange(null!));
167
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection.Insert(index, "value"));
185
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection.Insert(-1, null));
195
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection.Insert(index, "value"));
System\Windows\Forms\AxHost.AxPropertyDescriptorTests.cs (2)
1208
Assert.
Throws
<ArgumentException>("value", () => property.SetValue(control, new object()));
1217
Assert.
Throws
<ArgumentException>("value", () => property.SetValue(control, new object()));
System\Windows\Forms\BindingContextTests.cs (8)
63
Assert.
Throws
<ArgumentNullException>("dataSource", () => context.Add(null, source.CurrencyManager));
108
Assert.
Throws
<ArgumentNullException>("listManager", () => context.Add(1, null));
154
Assert.
Throws
<ArgumentNullException>("dataSource", () => context.AddCore(null, source.CurrencyManager));
161
Assert.
Throws
<ArgumentNullException>("listManager", () => context.AddCore(1, null));
268
Assert.
Throws
<ArgumentNullException>("dataSource", () => context.Remove(null));
301
Assert.
Throws
<ArgumentNullException>("dataSource", () => context.RemoveCore(null));
982
Assert.
Throws
<ArgumentException>("dataBinding", () => BindingContext.UpdateBinding(context, binding));
1010
Assert.
Throws
<ArgumentException>("dataBinding", () => BindingContext.UpdateBinding(context, binding));
System\Windows\Forms\BindingsCollectionTests.cs (1)
152
Assert.
Throws
<ArgumentNullException>("dataBinding", () => collection.AddCore(null));
System\Windows\Forms\ColumnHeaderCollectionTests.cs (6)
420
Assert.
Throws
<ArgumentNullException>("values", () => collection.AddRange(null));
823
Assert.
Throws
<ArgumentNullException>("ch", () => collection.Insert(1, (ColumnHeader)null));
833
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection.Insert(index, (ColumnHeader)null));
867
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection.Insert(index, new ColumnHeader()));
1053
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection.RemoveAt(index));
1063
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection.RemoveAt(index));
System\Windows\Forms\ColumnHeaderTests.cs (1)
1452
Assert.
Throws
<InvalidEnumArgumentException>("headerAutoResize", () => header.AutoResize(headerAutoResize));
System\Windows\Forms\Combobox.ObjectCollectionTests.cs (9)
377
Assert.
Throws
<ArgumentNullException>("items", () => comboBoxObjectCollection.AddRange(null));
535
Assert.
Throws
<ArgumentNullException>("destination", () => comboBoxObjectCollection.CopyTo(null, 1));
552
Assert.
Throws
<ArgumentOutOfRangeException>("arrayIndex", () => comboBoxObjectCollection.CopyTo(new object[1], -1));
569
Assert.
Throws
<ArgumentOutOfRangeException>("arrayIndex", () => comboBoxObjectCollection.CopyTo(new object[1], 3));
773
Assert.
Throws
<ArgumentNullException>("item", () => comboBoxObjectCollection.Insert(0, null));
790
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => comboBoxObjectCollection.Insert(-1, 1));
807
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => comboBoxObjectCollection.Insert(3, 1));
891
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => comboBoxObjectCollection.RemoveAt(-1));
908
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => comboBoxObjectCollection.RemoveAt(3));
System\Windows\Forms\ControlBindingsCollectionTests.cs (8)
243
Assert.
Throws
<ArgumentException>("PropertyName", () => collection.Add(new Binding("NoSuchProperty", new object(), "dataMember")));
260
Assert.
Throws
<ArgumentException>("binding", () => collection.Add(new Binding(nameof(Control.Text), new object(), "dataMember")));
274
Assert.
Throws
<ArgumentNullException>("dataBinding", () => collection.Add(null));
285
Assert.
Throws
<ArgumentException>("dataBinding", () => collection.Add(binding));
298
Assert.
Throws
<ArgumentException>("dataBinding", () => collection2.Add(binding));
345
Assert.
Throws
<ArgumentNullException>("dataBinding", () => collection.Remove(null));
358
Assert.
Throws
<ArgumentException>("dataBinding", () => collection.Remove(binding2));
374
Assert.
Throws
<ArgumentException>("dataBinding", () => collection2.Remove(binding1));
System\Windows\Forms\ControlPaintTests.cs (70)
677
Assert.
Throws
<ArgumentNullException>("graphics", () => ControlPaint.DrawBorder(null, new Rectangle(1, 2, 3, 4), Color.Red, style));
685
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));
804
Assert.
Throws
<ArgumentNullException>("graphics", () => ControlPaint.DrawBorder3D(null, new Rectangle(1, 2, 3, 4)));
805
Assert.
Throws
<ArgumentNullException>("graphics", () => ControlPaint.DrawBorder3D(null, new Rectangle(1, 2, 3, 4), style));
806
Assert.
Throws
<ArgumentNullException>("graphics", () => ControlPaint.DrawBorder3D(null, new Rectangle(1, 2, 3, 4), style, Border3DSide.All));
807
Assert.
Throws
<ArgumentNullException>("graphics", () => ControlPaint.DrawBorder3D(null, 1, 2, 3, 4));
808
Assert.
Throws
<ArgumentNullException>("graphics", () => ControlPaint.DrawBorder3D(null, 1, 2, 3, 4, style));
809
Assert.
Throws
<ArgumentNullException>("graphics", () => ControlPaint.DrawBorder3D(null, 1, 2, 3, 4, style, Border3DSide.All));
852
Assert.
Throws
<ArgumentNullException>("graphics", () => ControlPaint.DrawButton(null, new Rectangle(1, 2, 3, 4), state));
853
Assert.
Throws
<ArgumentNullException>("graphics", () => ControlPaint.DrawButton(null, 1, 2, 3, 4, state));
878
Assert.
Throws
<ArgumentOutOfRangeException>("width", () => ControlPaint.DrawButton(graphics, new Rectangle(0, 0, -3, 4), state));
879
Assert.
Throws
<ArgumentOutOfRangeException>("width", () => ControlPaint.DrawButton(graphics, 0, 0, -3, 4, state));
889
Assert.
Throws
<ArgumentOutOfRangeException>("height", () => ControlPaint.DrawButton(graphics, new Rectangle(0, 0, 3, -4), state));
890
Assert.
Throws
<ArgumentOutOfRangeException>("height", () => ControlPaint.DrawButton(graphics, 0, 0, 3, -4, state));
936
Assert.
Throws
<ArgumentNullException>("graphics", () => ControlPaint.DrawCaptionButton(null, new Rectangle(1, 2, 3, 4), CaptionButton.Close, state));
937
Assert.
Throws
<ArgumentNullException>("graphics", () => ControlPaint.DrawCaptionButton(null, 1, 2, 3, 4, CaptionButton.Close, state));
961
Assert.
Throws
<ArgumentOutOfRangeException>("width", () => ControlPaint.DrawCaptionButton(graphics, new Rectangle(0, 0, -3, 4), CaptionButton.Close, state));
962
Assert.
Throws
<ArgumentOutOfRangeException>("width", () => ControlPaint.DrawCaptionButton(graphics, 0, 0, -3, 4, CaptionButton.Close, state));
972
Assert.
Throws
<ArgumentOutOfRangeException>("height", () => ControlPaint.DrawCaptionButton(graphics, new Rectangle(0, 0, 3, -4), CaptionButton.Close, state));
973
Assert.
Throws
<ArgumentOutOfRangeException>("height", () => ControlPaint.DrawCaptionButton(graphics, 0, 0, 3, -4, CaptionButton.Close, state));
1016
Assert.
Throws
<ArgumentNullException>("graphics", () => ControlPaint.DrawCheckBox(null, new Rectangle(1, 2, 3, 4), state));
1017
Assert.
Throws
<ArgumentNullException>("graphics", () => ControlPaint.DrawCheckBox(null, 1, 2, 3, 4, state));
1042
Assert.
Throws
<ArgumentOutOfRangeException>(expectedParamName, () => ControlPaint.DrawCheckBox(graphics, new Rectangle(0, 0, -3, 4), state));
1043
Assert.
Throws
<ArgumentOutOfRangeException>(expectedParamName, () => ControlPaint.DrawCheckBox(graphics, 0, 0, -3, 4, state));
1053
Assert.
Throws
<ArgumentOutOfRangeException>(expectedParamName, () => ControlPaint.DrawCheckBox(graphics, new Rectangle(0, 0, 3, -4), state));
1054
Assert.
Throws
<ArgumentOutOfRangeException>(expectedParamName, () => ControlPaint.DrawCheckBox(graphics, 0, 0, 3, -4, state));
1097
Assert.
Throws
<ArgumentNullException>("graphics", () => ControlPaint.DrawComboButton(null, new Rectangle(1, 2, 3, 4), state));
1098
Assert.
Throws
<ArgumentNullException>("graphics", () => ControlPaint.DrawComboButton(null, 1, 2, 3, 4, state));
1122
Assert.
Throws
<ArgumentOutOfRangeException>("width", () => ControlPaint.DrawComboButton(graphics, new Rectangle(0, 0, -3, 4), state));
1123
Assert.
Throws
<ArgumentOutOfRangeException>("width", () => ControlPaint.DrawComboButton(graphics, 0, 0, -3, 4, state));
1133
Assert.
Throws
<ArgumentOutOfRangeException>("height", () => ControlPaint.DrawComboButton(graphics, new Rectangle(0, 0, 3, -4), state));
1134
Assert.
Throws
<ArgumentOutOfRangeException>("height", () => ControlPaint.DrawComboButton(graphics, 0, 0, 3, -4, state));
1162
Assert.
Throws
<ArgumentNullException>("graphics", () => ControlPaint.DrawContainerGrabHandle(null, new Rectangle(1, 2, 3, 4)));
1221
Assert.
Throws
<ArgumentNullException>("graphics", () => ControlPaint.DrawFocusRectangle(null, new Rectangle(1, 2, 3, 4)));
1222
Assert.
Throws
<ArgumentNullException>("graphics", () => ControlPaint.DrawFocusRectangle(null, new Rectangle(1, 2, 3, 4), Color.Red, Color.Blue));
1260
Assert.
Throws
<ArgumentNullException>("graphics", () => ControlPaint.DrawGrabHandle(null, new Rectangle(1, 2, 3, 4), primary, enabled));
1293
Assert.
Throws
<ArgumentNullException>("graphics", () => ControlPaint.DrawGrid(null, new Rectangle(1, 2, 3, 4), new Size(1, 1), Color.Red));
1305
Assert.
Throws
<ArgumentOutOfRangeException>("pixelsBetweenDots", () => ControlPaint.DrawGrid(graphics, new Rectangle(0, 0, width, height), new Size(width, height), Color.Red));
1343
Assert.
Throws
<ArgumentNullException>("graphics", () => ControlPaint.DrawImageDisabled(null, image, 0, 0, Color.Red));
1384
Assert.
Throws
<ArgumentNullException>("graphics", () => ControlPaint.DrawLockedFrame(null, new Rectangle(1, 2, 3, 4), primary));
1472
Assert.
Throws
<ArgumentNullException>("graphics", () => ControlPaint.DrawMenuGlyph(null, new Rectangle(1, 2, 3, 4), glyph));
1473
Assert.
Throws
<ArgumentNullException>("graphics", () => ControlPaint.DrawMenuGlyph(null, 1, 2, 3, 4, glyph));
1502
Assert.
Throws
<ArgumentOutOfRangeException>("width", () => ControlPaint.DrawMenuGlyph(graphics, new Rectangle(0, 0, -3, 4), glyph));
1503
Assert.
Throws
<ArgumentOutOfRangeException>("width", () => ControlPaint.DrawMenuGlyph(graphics, 0, 0, -3, 4, glyph));
1514
Assert.
Throws
<ArgumentOutOfRangeException>("height", () => ControlPaint.DrawMenuGlyph(graphics, new Rectangle(0, 0, 3, -4), glyph));
1515
Assert.
Throws
<ArgumentOutOfRangeException>("height", () => ControlPaint.DrawMenuGlyph(graphics, 0, 0, 3, -4, glyph));
1558
Assert.
Throws
<ArgumentNullException>("graphics", () => ControlPaint.DrawMixedCheckBox(null, new Rectangle(1, 2, 3, 4), state));
1559
Assert.
Throws
<ArgumentNullException>("graphics", () => ControlPaint.DrawMixedCheckBox(null, 1, 2, 3, 4, state));
1583
Assert.
Throws
<ArgumentOutOfRangeException>("width", () => ControlPaint.DrawMixedCheckBox(graphics, new Rectangle(0, 0, -3, 4), state));
1584
Assert.
Throws
<ArgumentOutOfRangeException>("width", () => ControlPaint.DrawMixedCheckBox(graphics, 0, 0, -3, 4, state));
1594
Assert.
Throws
<ArgumentOutOfRangeException>("height", () => ControlPaint.DrawMixedCheckBox(graphics, new Rectangle(0, 0, 3, -4), state));
1595
Assert.
Throws
<ArgumentOutOfRangeException>("height", () => ControlPaint.DrawMixedCheckBox(graphics, 0, 0, 3, -4, state));
1638
Assert.
Throws
<ArgumentNullException>("graphics", () => ControlPaint.DrawRadioButton(null, new Rectangle(1, 2, 3, 4), state));
1639
Assert.
Throws
<ArgumentNullException>("graphics", () => ControlPaint.DrawRadioButton(null, 1, 2, 3, 4, state));
1663
Assert.
Throws
<ArgumentOutOfRangeException>("width", () => ControlPaint.DrawRadioButton(graphics, new Rectangle(0, 0, -3, 4), state));
1664
Assert.
Throws
<ArgumentOutOfRangeException>("width", () => ControlPaint.DrawRadioButton(graphics, 0, 0, -3, 4, state));
1674
Assert.
Throws
<ArgumentOutOfRangeException>("height", () => ControlPaint.DrawRadioButton(graphics, new Rectangle(0, 0, 3, -4), state));
1675
Assert.
Throws
<ArgumentOutOfRangeException>("height", () => ControlPaint.DrawRadioButton(graphics, 0, 0, 3, -4, state));
1776
Assert.
Throws
<ArgumentNullException>("graphics", () => ControlPaint.DrawScrollButton(null, new Rectangle(1, 2, 3, 4), ScrollButton.Up, state));
1777
Assert.
Throws
<ArgumentNullException>("graphics", () => ControlPaint.DrawScrollButton(null, 1, 2, 3, 4, ScrollButton.Up, state));
1801
Assert.
Throws
<ArgumentOutOfRangeException>("width", () => ControlPaint.DrawScrollButton(graphics, new Rectangle(0, 0, -3, 4), ScrollButton.Up, state));
1802
Assert.
Throws
<ArgumentOutOfRangeException>("width", () => ControlPaint.DrawScrollButton(graphics, 0, 0, -3, 4, ScrollButton.Up, state));
1812
Assert.
Throws
<ArgumentOutOfRangeException>("height", () => ControlPaint.DrawScrollButton(graphics, new Rectangle(0, 0, 3, -4), ScrollButton.Up, state));
1813
Assert.
Throws
<ArgumentOutOfRangeException>("height", () => ControlPaint.DrawScrollButton(graphics, 0, 0, 3, -4, ScrollButton.Up, state));
1849
Assert.
Throws
<ArgumentNullException>("graphics", () => ControlPaint.DrawSelectionFrame(null, active, new Rectangle(1, 2, 3, 4), new Rectangle(1, 2, 3, 4), Color.Red));
1894
Assert.
Throws
<ArgumentNullException>("graphics", () => ControlPaint.DrawSizeGrip(null, Color.Red, new Rectangle(1, 2, 3, 4)));
1895
Assert.
Throws
<ArgumentNullException>("graphics", () => ControlPaint.DrawSizeGrip(null, Color.Red, 1, 2, 3, 4));
1943
Assert.
Throws
<ArgumentNullException>("graphics", () => ControlPaint.DrawStringDisabled(null, s, SystemFonts.MenuFont, Color.Red, new RectangleF(1, 2, 3, 4), new StringFormat()));
1979
Assert.
Throws
<ArgumentNullException>("dc", () => ControlPaint.DrawStringDisabled(null, s, SystemFonts.MenuFont, Color.Red, new Rectangle(1, 2, 3, 4), TextFormatFlags.Default));
2007
Assert.
Throws
<ArgumentNullException>("graphics", () => ControlPaint.DrawVisualStyleBorder(null, new Rectangle(1, 2, 3, 4)));
System\Windows\Forms\ControlTests.ControlCollection.cs (5)
1281
Assert.
Throws
<ArgumentNullException>("controls", () => collection.AddRange(null));
2907
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection.RemoveAt(index));
2922
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection.RemoveAt(index));
3415
Assert.
Throws
<ArgumentNullException>("child", () => collection.SetChildIndex(null, 0));
3427
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection.SetChildIndex(child, -2));
System\Windows\Forms\ControlTests.Handlers.cs (1)
4773
Assert.
Throws
<ArgumentNullException>("e", () => control.OnPrint(null));
System\Windows\Forms\ControlTests.Methods.cs (2)
1883
Assert.
Throws
<ArgumentNullException>("bitmap", () => control.DrawToBitmap(null, new Rectangle(1, 2, 3, 4)));
10091
Assert.
Throws
<ArgumentException>("value", () => control.SetTopLevel(true));
System\Windows\Forms\CursorTests.cs (2)
400
Assert.
Throws
<ArgumentNullException>("graphics", () => cursor.Draw(null, new Rectangle(Point.Empty, cursor.Size)));
437
Assert.
Throws
<ArgumentNullException>("graphics", () => cursor.DrawStretched(null, new Rectangle(Point.Empty, cursor.Size)));
System\Windows\Forms\DataGridViewCellPaintingEventArgsTests.cs (3)
98
Assert.
Throws
<ArgumentNullException>("advancedBorderStyle", () => e.Paint(new Rectangle(1, 2, 3, 4), DataGridViewPaintParts.None));
148
Assert.
Throws
<ArgumentNullException>("advancedBorderStyle", () => e.PaintBackground(new Rectangle(1, 2, 3, 4), true));
198
Assert.
Throws
<ArgumentNullException>("advancedBorderStyle", () => e.PaintContent(new Rectangle(1, 2, 3, 4)));
System\Windows\Forms\DataGridViewCellStyleTests.cs (1)
703
Assert.
Throws
<ArgumentNullException>("dataGridViewCellStyle", () => style.ApplyStyle(null));
System\Windows\Forms\DataGridViewCellTests.cs (3)
6038
Assert.
Throws
<ArgumentNullException>("graphics", () => cell.PaintBorder(null, new Rectangle(1, 2, 3, 4), new Rectangle(1, 2, 3, 4), new DataGridViewCellStyle(), new DataGridViewAdvancedBorderStyle()));
6047
Assert.
Throws
<ArgumentNullException>("cellStyle", () => cell.PaintBorder(graphics, new Rectangle(1, 2, 3, 4), new Rectangle(1, 2, 3, 4), null, new DataGridViewAdvancedBorderStyle()));
6083
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)
4213
Assert.
Throws
<ArgumentOutOfRangeException>("rowIndex", () => cell.OnMouseDown(e));
4428
Assert.
Throws
<ArgumentOutOfRangeException>("rowIndex", () => cell.OnMouseLeave(rowIndex));
4596
Assert.
Throws
<ArgumentOutOfRangeException>("rowIndex", () => cell.OnMouseUp(e));
4622
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)
4113
Assert.
Throws
<ArgumentNullException>("dataGridView", () => row.CreateCells(null));
4114
Assert.
Throws
<ArgumentNullException>("dataGridView", () => row.CreateCells(null, Array.Empty<object>()));
4147
Assert.
Throws
<ArgumentNullException>("values", () => row.CreateCells(control, null));
4231
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));
4247
Assert.
Throws
<ArgumentNullException>("cellStyle", () => row.DrawFocus(graphics, new Rectangle(1, 2, 3, 4), new Rectangle(1, 2, 3, 4), -1, DataGridViewElementStates.None, null, true));
4859
Assert.
Throws
<ArgumentNullException>("graphics", () => row.Paint(null, new Rectangle(1, 2, 3, 4), new Rectangle(2, 3, 4, 5), 1, DataGridViewElementStates.Frozen, true, false));
4863
Assert.
Throws
<ArgumentNullException>("graphics", () => row.Paint(null, new Rectangle(1, 2, 3, 4), new Rectangle(2, 3, 4, 5), 1, DataGridViewElementStates.Frozen, true, false));
4868
Assert.
Throws
<ArgumentNullException>("graphics", () => row.Paint(null, new Rectangle(1, 2, 3, 4), new Rectangle(2, 3, 4, 5), 1, DataGridViewElementStates.Frozen, true, false));
4929
Assert.
Throws
<ArgumentNullException>("graphics", () => row.Paint(null, new Rectangle(1, 2, 3, 4), new Rectangle(2, 3, 4, 5), 1, DataGridViewElementStates.Frozen, true, false));
4933
Assert.
Throws
<ArgumentNullException>("graphics", () => row.Paint(null, new Rectangle(1, 2, 3, 4), new Rectangle(2, 3, 4, 5), 1, DataGridViewElementStates.Frozen, true, false));
4937
Assert.
Throws
<ArgumentNullException>("graphics", () => row.Paint(null, Rectangle.Empty, new Rectangle(2, 3, 4, 5), 1, DataGridViewElementStates.Frozen, true, false));
4942
Assert.
Throws
<ArgumentNullException>("graphics", () => row.Paint(null, Rectangle.Empty, new Rectangle(2, 3, 4, 5), 1, DataGridViewElementStates.Frozen, true, false));
4957
Assert.
Throws
<ArgumentNullException>("graphics", () => row.Paint(null, Rectangle.Empty, Rectangle.Empty, 1, DataGridViewElementStates.None, true, true));
4971
Assert.
Throws
<ArgumentNullException>("graphics", () => row.Paint(null, Rectangle.Empty, new Rectangle(1, 2, 100, 100), 1, DataGridViewElementStates.None, true, true));
4985
Assert.
Throws
<ArgumentNullException>("graphics", () => row.Paint(null, new Rectangle(1, 2, 3, 4), new Rectangle(1, 2, 100, 100), 1, DataGridViewElementStates.None, true, true));
5011
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => row.Paint(graphics, new Rectangle(1, 2, 100, 100), new Rectangle(1, 2, 100, 100), rowIndex, DataGridViewElementStates.None, true, true));
5252
Assert.
Throws
<ArgumentNullException>("graphics", () => row.PaintCells(null, Rectangle.Empty, Rectangle.Empty, -1, DataGridViewElementStates.None, true, true, DataGridViewPaintParts.All));
5266
Assert.
Throws
<ArgumentNullException>("graphics", () => row.PaintCells(null, Rectangle.Empty, new Rectangle(1, 2, 100, 100), 1, DataGridViewElementStates.None, true, true, DataGridViewPaintParts.All));
5280
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));
5294
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));
5321
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));
5573
Assert.
Throws
<ArgumentNullException>("graphics", () => row.PaintHeader(null, Rectangle.Empty, Rectangle.Empty, -1, DataGridViewElementStates.None, true, true, DataGridViewPaintParts.All));
5588
Assert.
Throws
<ArgumentNullException>("graphics", () => row.PaintHeader(null, Rectangle.Empty, new Rectangle(1, 2, 100, 100), -1, DataGridViewElementStates.None, true, true, DataGridViewPaintParts.All));
5603
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));
5618
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));
5643
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));
5677
Assert.
Throws
<InvalidEnumArgumentException>("paintParts", () => row.PaintHeader(graphics, Rectangle.Empty, Rectangle.Empty, -1, DataGridViewElementStates.None, true, true, paintParts));
System\Windows\Forms\DataGridViewTests.cs (2)
2202
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => control.OnColumnHeadersHeightSizeModeChanged(eventArgs));
2683
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => control.OnRowHeadersWidthSizeModeChanged(eventArgs));
System\Windows\Forms\DataGridViewTextBoxEditingControlTests.cs (1)
971
Assert.
Throws
<ArgumentNullException>("dataGridViewCellStyle", () => control.ApplyCellStyleToEditingControl(null));
System\Windows\Forms\ErrorProviderTests.cs (4)
1066
Assert.
Throws
<ArgumentNullException>("control", () => provider.SetError(null, value));
1090
Assert.
Throws
<ArgumentNullException>("control", () => provider.SetIconAlignment(null, value));
1099
Assert.
Throws
<InvalidEnumArgumentException>("value", () => provider.SetIconAlignment(control, value));
1121
Assert.
Throws
<ArgumentNullException>("control", () => provider.SetIconPadding(null, 0));
System\Windows\Forms\FlowLayoutPanelTests.cs (1)
419
Assert.
Throws
<ArgumentNullException>("control", () => control.SetFlowBreak(null, value));
System\Windows\Forms\FlowLayoutSettingsTests.cs (1)
239
Assert.
Throws
<ArgumentNullException>("child", () => settings.SetFlowBreak(null, value));
System\Windows\Forms\HelpProviderTests.cs (7)
170
Assert.
Throws
<ArgumentNullException>("ctl", () => provider.ResetShowHelp(null));
282
Assert.
Throws
<ArgumentNullException>("ctl", () => provider.SetHelpKeyword(null, "keyword"));
344
Assert.
Throws
<ArgumentNullException>("ctl", () => provider.SetHelpNavigator(null, navigator));
352
Assert.
Throws
<InvalidEnumArgumentException>("navigator", () => provider.SetHelpNavigator(new Control(), navigator));
418
Assert.
Throws
<ArgumentNullException>("ctl", () => provider.SetHelpString(null, "keyword"));
485
Assert.
Throws
<ArgumentNullException>("ctl", () => provider.SetShowHelp(null, true));
552
Assert.
Throws
<ArgumentException>("url", () => control.OnHelpRequested(e));
System\Windows\Forms\ImageList.ImageCollectionTests.cs (5)
795
Assert.
Throws
<ArgumentNullException>("value", () => collection.Add((Image)null));
798
Assert.
Throws
<ArgumentNullException>("value", () => collection.Add((Icon)null));
868
Assert.
Throws
<ArgumentNullException>("images", () => collection.AddRange(null));
1385
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection.RemoveAt(index));
1397
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection.RemoveAt(index));
System\Windows\Forms\ImageListTests.cs (6)
1041
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => list.Draw(graphics, Point.Empty, index));
1042
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => list.Draw(graphics, 0, 0, index));
1043
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => list.Draw(graphics, 0, 0, 10, 10, index));
1057
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => list.Draw(graphics, Point.Empty, index));
1058
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => list.Draw(graphics, 0, 0, index));
1059
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => list.Draw(graphics, 0, 0, 10, 10, index));
System\Windows\Forms\Layout\FlowLayoutTests.cs (1)
34
Assert.
Throws
<ArgumentNullException>("child", () => engine.InitLayout(null, BoundsSpecified.All));
System\Windows\Forms\Layout\LayoutEngineTests.cs (1)
30
Assert.
Throws
<ArgumentNullException>("child", () => engine.InitLayout(null, BoundsSpecified.All));
System\Windows\Forms\Layout\TableLayoutSettingsTests.cs (18)
650
Assert.
Throws
<ArgumentNullException>("control", () => settings.SetCellPosition(null, default));
658
Assert.
Throws
<ArgumentNullException>("control", () => settings.SetCellPosition(null, default));
872
Assert.
Throws
<ArgumentNullException>("control", () => settings.SetColumn(null, value));
882
Assert.
Throws
<ArgumentNullException>("control", () => settings.SetColumn(null, value));
907
Assert.
Throws
<ArgumentOutOfRangeException>("column", () => settings.SetColumn("control", -2));
915
Assert.
Throws
<ArgumentOutOfRangeException>("column", () => settings.SetColumn("control", -2));
1103
Assert.
Throws
<ArgumentNullException>("control", () => settings.SetColumnSpan(null, value));
1113
Assert.
Throws
<ArgumentNullException>("control", () => settings.SetColumnSpan(null, value));
1141
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => settings.SetColumnSpan("control", value));
1151
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => settings.SetColumnSpan("control", value));
1348
Assert.
Throws
<ArgumentNullException>("control", () => settings.SetRow(null, value));
1358
Assert.
Throws
<ArgumentNullException>("control", () => settings.SetRow(null, value));
1383
Assert.
Throws
<ArgumentOutOfRangeException>("row", () => settings.SetRow("control", -2));
1391
Assert.
Throws
<ArgumentOutOfRangeException>("row", () => settings.SetRow("control", -2));
1579
Assert.
Throws
<ArgumentNullException>("control", () => settings.SetRowSpan(null, value));
1589
Assert.
Throws
<ArgumentNullException>("control", () => settings.SetRowSpan(null, value));
1616
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => settings.SetRowSpan("control", value));
1626
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => settings.SetRowSpan("control", value));
System\Windows\Forms\Layout\TableLayoutSettingsTypeConverterTests.cs (1)
252
Assert.
Throws
<ArgumentNullException>("control", () => settings.SetColumnSpan(null, 1));
System\Windows\Forms\ListBox.IntegerCollectionTests.cs (8)
750
Assert.
Throws
<ArgumentNullException>("items", () => collection.AddRange((int[])null));
751
Assert.
Throws
<ArgumentNullException>("items", () => collection.AddRange((ListBox.IntegerCollection)null));
1047
Assert.
Throws
<ArgumentNullException>("destination", () => collection.CopyTo(null, 0));
1058
Assert.
Throws
<ArgumentNullException>("destination", () => collection.CopyTo(null, 0));
1495
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection.RemoveAt(index));
1509
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection.RemoveAt(index));
2769
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection.RemoveAt(index));
2783
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection.RemoveAt(index));
System\Windows\Forms\ListBox.ObjectCollectionTests.cs (16)
3650
Assert.
Throws
<ArgumentNullException>("items", () => collection.AddRange((object[])null));
3651
Assert.
Throws
<ArgumentNullException>("value", () => collection.AddRange((ListBox.ObjectCollection)null));
4012
Assert.
Throws
<ArgumentNullException>("destination", () => collection.CopyTo(null, 0));
4023
Assert.
Throws
<ArgumentNullException>("destination", () => collection.CopyTo(null, 0));
5002
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection.Insert(index, 1));
5016
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection.Insert(index, 1));
5024
Assert.
Throws
<ArgumentNullException>("item", () => collection.Insert(0, null));
6842
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection.RemoveAt(index));
6856
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection.RemoveAt(index));
9334
Assert.
Throws
<ArgumentNullException>("destination", () => collection.CopyTo(null, 0));
9345
Assert.
Throws
<ArgumentNullException>("destination", () => collection.CopyTo(null, 0));
10324
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection.Insert(index, 1));
10338
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection.Insert(index, 1));
10346
Assert.
Throws
<ArgumentNullException>("item", () => collection.Insert(0, null));
12164
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection.RemoveAt(index));
12178
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection.RemoveAt(index));
System\Windows\Forms\ListBoxTests.cs (2)
6065
Assert.
Throws
<ArgumentNullException>("value", () => control.SetItemsCore(null));
6075
Assert.
Throws
<ArgumentNullException>("value", () => control.SetItemsCore(null));
System\Windows\Forms\ListView.CheckedIndexCollectionTests.cs (1)
13
Assert.
Throws
<ArgumentNullException>("owner", () => { new ListView.CheckedIndexCollection(null); });
System\Windows\Forms\ListView.CheckedListViewItemCollectionTests.cs (1)
13
Assert.
Throws
<ArgumentNullException>("owner", () => { new ListView.CheckedListViewItemCollection(null); });
System\Windows\Forms\ListView.SelectedListViewItemCollectionTests.cs (1)
13
Assert.
Throws
<ArgumentNullException>("owner", () => { new ListView.SelectedListViewItemCollection(null); });
System\Windows\Forms\ListViewGroupCollectionTests.cs (6)
580
Assert.
Throws
<ArgumentNullException>("groups", () => collection.AddRange((ListViewGroup[])null));
581
Assert.
Throws
<ArgumentNullException>("groups", () => collection.AddRange((ListViewGroupCollection)null));
866
Assert.
Throws
<ArgumentNullException>("group", () => collection.Insert(index, null));
876
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection.Insert(index, new ListViewGroup()));
911
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection.Insert(index, new ListViewGroup()));
1028
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection.RemoveAt(index));
System\Windows\Forms\ListViewGroupTests.cs (1)
1424
Assert.
Throws
<ArgumentNullException>("info", () => iSerializable.GetObjectData(null, context));
System\Windows\Forms\ListViewSubItemCollectionTests.cs (9)
419
Assert.
Throws
<ArgumentNullException>("items", () => collection.AddRange((ListViewItem.ListViewSubItem[])null));
420
Assert.
Throws
<ArgumentNullException>("items", () => collection.AddRange((string[])null));
421
Assert.
Throws
<ArgumentNullException>("items", () => collection.AddRange((string[])null, Color.Red, Color.Blue, SystemFonts.MenuFont));
654
Assert.
Throws
<ArgumentNullException>("item", () => collection.Insert(1, null));
664
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection.Insert(index, null));
687
Assert.
Throws
<ArgumentException>("item", () => collection.Insert(0, value));
697
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection.Insert(index, new ListViewItem.ListViewSubItem()));
811
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection.RemoveAt(index));
821
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection.RemoveAt(index));
System\Windows\Forms\MonthCalendarTests.cs (6)
4029
Assert.
Throws
<ArgumentOutOfRangeException>("date", () => calendar.SetDate(calendar.MinDate.AddTicks(-1)));
4041
Assert.
Throws
<ArgumentOutOfRangeException>("date", () => calendar.SetDate(calendar.MaxDate.AddDays(1)));
4140
Assert.
Throws
<ArgumentOutOfRangeException>("date1", () => calendar.SetSelectionRange(calendar.MinDate.AddTicks(-1), calendar.MinDate));
4141
Assert.
Throws
<ArgumentOutOfRangeException>("date2", () => calendar.SetSelectionRange(calendar.MinDate, calendar.MinDate.AddTicks(-1)));
4157
Assert.
Throws
<ArgumentOutOfRangeException>("date1", () => calendar.SetSelectionRange(calendar.MaxDate.AddDays(1), calendar.MaxDate));
4158
Assert.
Throws
<ArgumentOutOfRangeException>("date2", () => calendar.SetSelectionRange(calendar.MaxDate, calendar.MaxDate.AddDays(1)));
System\Windows\Forms\NotifyIconTests.cs (3)
955
Assert.
Throws
<ArgumentOutOfRangeException>("timeout", () => notifyIcon.ShowBalloonTip(-1));
956
Assert.
Throws
<ArgumentOutOfRangeException>("timeout", () => notifyIcon.ShowBalloonTip(-1, "Title", "Text", ToolTipIcon.Error));
976
Assert.
Throws
<InvalidEnumArgumentException>("tipIcon", () => notifyIcon.ShowBalloonTip(0, "Title", "Text", tipIcon));
System\Windows\Forms\RichTextBoxTests.cs (3)
8762
Assert.
Throws
<ArgumentNullException>("data", () => control.LoadFile((Stream)null, RichTextBoxStreamType.RichText));
8771
Assert.
Throws
<InvalidEnumArgumentException>("fileType", () => control.LoadFile(stream, fileType));
9735
Assert.
Throws
<InvalidEnumArgumentException>("fileType", () => control.SaveFile(stream, fileType));
System\Windows\Forms\TabControl.TabPageCollectionTests.cs (33)
885
Assert.
Throws
<ArgumentNullException>("value", () => collection.Add((TabPage)null));
1163
Assert.
Throws
<ArgumentNullException>("pages", () => collection.AddRange(null));
1224
Assert.
Throws
<ArgumentNullException>("destinationArray", () => iList.CopyTo(null, 0));
1237
Assert.
Throws
<ArgumentOutOfRangeException>("destinationIndex", () => iList.CopyTo(array, -1));
1278
Assert.
Throws
<ArgumentNullException>("sourceArray", () => iList.CopyTo(array, 1));
2909
Assert.
Throws
<ArgumentNullException>("tabPage", () => collection.Insert(0, (TabPage)null));
2918
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection.Insert(-1, value));
2919
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection.Insert(-1, "text"));
2920
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection.Insert(-1, "key", "text"));
2921
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection.Insert(-1, "key", "text", 1));
2922
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection.Insert(-1, "key", "text", "imageKey"));
2934
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection.Insert(-1, value));
2935
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection.Insert(-1, "text"));
2936
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection.Insert(-1, "key", "text"));
2937
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection.Insert(-1, "key", "text", 1));
2938
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection.Insert(-1, "key", "text", "imageKey"));
2979
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection.Insert(index, value));
2980
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection.Insert(index, "text"));
2981
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection.Insert(index, "key", "text"));
2982
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection.Insert(index, "key", "text", 1));
2983
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection.Insert(index, "key", "text", "imageKey"));
3002
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection.Insert(index, value));
3003
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection.Insert(index, "text"));
3004
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection.Insert(index, "key", "text"));
3005
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection.Insert(index, "key", "text", 1));
3006
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection.Insert(index, "key", "text", "imageKey"));
3155
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => iList.Insert(-1, value));
3168
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => iList.Insert(-1, value));
3210
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => iList.Insert(index, value));
3228
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => iList.Insert(index, value));
4693
Assert.
Throws
<ArgumentNullException>("value", () => collection.Remove(null));
4873
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection.RemoveAt(index));
4888
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection.RemoveAt(index));
System\Windows\Forms\TabControlTests.cs (15)
3177
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => control.DeselectTab(page));
3189
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => control.DeselectTab(page3));
3367
Assert.
Throws
<ArgumentNullException>("tabPageName", () => control.DeselectTab((string)null));
3376
Assert.
Throws
<ArgumentNullException>("tabPage", () => control.DeselectTab(tabPageName));
3389
Assert.
Throws
<ArgumentNullException>("tabPage", () => control.DeselectTab(tabPageName));
3558
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => control.DeselectTab(index));
3572
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => control.DeselectTab(index));
5325
Assert.
Throws
<ArgumentNullException>("tabPage", () => control.SelectTab((TabPage)null));
5333
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => control.SelectTab(page));
5345
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => control.SelectTab(page3));
5492
Assert.
Throws
<ArgumentNullException>("tabPageName", () => control.SelectTab((string)null));
5501
Assert.
Throws
<ArgumentNullException>("tabPage", () => control.SelectTab(tabPageName));
5515
Assert.
Throws
<ArgumentNullException>("tabPage", () => control.SelectTab(tabPageName));
5653
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => control.SelectTab(index));
5667
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => control.SelectTab(index));
System\Windows\Forms\TableLayoutControlCollectionTests.cs (3)
47
Assert.
Throws
<ArgumentOutOfRangeException>("column", () => collection.Add(child, -2, 2));
59
Assert.
Throws
<ArgumentOutOfRangeException>("row", () => collection.Add(child, 1, -2));
70
Assert.
Throws
<ArgumentNullException>("control", () => collection.Add(null, 1, 2));
System\Windows\Forms\TableLayoutPanelTests.cs (9)
1657
Assert.
Throws
<ArgumentNullException>("control", () => control.SetCellPosition(null, default));
1763
Assert.
Throws
<ArgumentNullException>("control", () => control.SetColumn(null, 1));
1770
Assert.
Throws
<ArgumentOutOfRangeException>("column", () => control.SetColumn(new Control(), -2));
1875
Assert.
Throws
<ArgumentNullException>("control", () => control.SetColumnSpan(null, value));
1884
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => control.SetColumnSpan(new Control(), value));
1990
Assert.
Throws
<ArgumentNullException>("control", () => control.SetRow(null, 1));
1997
Assert.
Throws
<ArgumentOutOfRangeException>("row", () => control.SetRow(new Control(), -2));
2101
Assert.
Throws
<ArgumentNullException>("control", () => control.SetRowSpan(null, value));
2110
Assert.
Throws
<ArgumentOutOfRangeException>("value", () => control.SetRowSpan(new Control(), value));
System\Windows\Forms\TableLayoutStyleCollectionTests.cs (2)
100
Assert.
Throws
<ArgumentNullException>("style", () => ((IList)collection).Insert(index, null));
120
Assert.
Throws
<ArgumentException>("style", () => ((IList)collection).Insert(0, style));
System\Windows\Forms\TextRendererTests.cs (2)
393
Assert.
Throws
<ArgumentNullException>("dc", () => TextRenderer.DrawText(null, "text", SystemFonts.MenuFont, Point.Empty, Color.Red));
610
Assert.
Throws
<ArgumentOutOfRangeException>("flags", action);
System\Windows\Forms\ToolStripControlHostTests.cs (1)
2174
Assert.
Throws
<ArgumentNullException>("key", () => iDictionaryService.SetValue(null, "value"));
System\Windows\Forms\ToolStripRendererTests.cs (10)
74
Assert.
Throws
<ArgumentNullException>("e", () => renderer.DrawArrow(null));
234
Assert.
Throws
<ArgumentNullException>("e", () => renderer.DrawItemCheck(null));
267
Assert.
Throws
<ArgumentNullException>("e", () => renderer.DrawItemImage(null));
342
Assert.
Throws
<ArgumentNullException>("e", () => renderer.DrawItemText(null));
515
Assert.
Throws
<ArgumentNullException>("e", () => renderer.DrawStatusStripSizingGrip(null));
741
Assert.
Throws
<ArgumentNullException>("e", () => renderer.OnRenderArrow(null));
816
Assert.
Throws
<ArgumentNullException>("e", () => renderer.OnRenderItemCheck(null));
836
Assert.
Throws
<ArgumentNullException>("e", () => renderer.OnRenderItemImage(null));
858
Assert.
Throws
<ArgumentNullException>("e", () => renderer.OnRenderItemText(null));
935
Assert.
Throws
<ArgumentNullException>("e", () => renderer.OnRenderStatusStripSizingGrip(null));
System\Windows\Forms\ToolStripTests.cs (1)
7099
Assert.
Throws
<ArgumentNullException>("item", () => control.SetItemLocation(null, Point.Empty));
System\Windows\Forms\ToolTipTests.cs (4)
715
Assert.
Throws
<ArgumentNullException>("control", () => toolTip.SetToolTip(null, caption));
768
Assert.
Throws
<ArgumentNullException>("window", () => toolTip.Show("text", null));
769
Assert.
Throws
<ArgumentNullException>("window", () => toolTip.Show("text", null, 1));
777
Assert.
Throws
<ArgumentOutOfRangeException>("duration", () => toolTip.Show("text", mockWindow.Object, -1));
System\Windows\Forms\VisualStyles\VisualStyleRendererTests.cs (14)
182
Assert.
Throws
<ArgumentNullException>("dc", () => renderer.DrawBackground(null, new Rectangle(1, 2, 3, 4)));
183
Assert.
Throws
<ArgumentNullException>("dc", () => renderer.DrawBackground(null, new Rectangle(1, 2, 3, 4), new Rectangle(1, 2, 3, 4)));
297
Assert.
Throws
<ArgumentNullException>("g", () => renderer.DrawImage(null, new Rectangle(1, 2, 3, 4), image));
298
Assert.
Throws
<ArgumentNullException>("g", () => renderer.DrawImage(null, new Rectangle(1, 2, 3, 4), imageList, 0));
308
Assert.
Throws
<ArgumentNullException>("image", () => renderer.DrawImage(graphics, new Rectangle(1, 2, 3, 4), null));
318
Assert.
Throws
<ArgumentNullException>("imageList", () => renderer.DrawImage(graphics, new Rectangle(1, 2, 3, 4), null, 0));
332
Assert.
Throws
<ArgumentOutOfRangeException>("imageIndex", () => renderer.DrawImage(graphics, new Rectangle(1, 2, 3, 4), imageList, imageIndex));
395
Assert.
Throws
<ArgumentNullException>("dc", () => renderer.DrawParentBackground(null, new Rectangle(1, 2, 3, 4), childControl));
493
Assert.
Throws
<ArgumentNullException>("dc", () => renderer.DrawText(null, new Rectangle(1, 2, 3, 4), "text"));
494
Assert.
Throws
<ArgumentNullException>("dc", () => renderer.DrawText(null, new Rectangle(1, 2, 3, 4), "text", true));
495
Assert.
Throws
<ArgumentNullException>("dc", () => renderer.DrawText(null, new Rectangle(1, 2, 3, 4), "text", false));
496
Assert.
Throws
<ArgumentNullException>("dc", () => renderer.DrawText(null, new Rectangle(1, 2, 3, 4), "text", true, TextFormatFlags.Default));
497
Assert.
Throws
<ArgumentNullException>("dc", () => renderer.DrawText(null, new Rectangle(1, 2, 3, 4), "text", false, TextFormatFlags.Default));
551
Assert.
Throws
<ArgumentNullException>("element", () => renderer.SetParameters(null));
TextBoxBaseTests.cs (1)
6316
Assert.
Throws
<ArgumentOutOfRangeException>("start", () => control.Select(-1, 0));
WebBrowserBaseTests.cs (1)
708
Assert.
Throws
<ArgumentNullException>("bitmap", () => control.DrawToBitmap(null, new Rectangle(1, 2, 3, 4)));
System.Xaml.Tests (22)
System\Xaml\Schema\XamlMemberInvokerTests.cs (1)
137
Assert.
Throws
<ArgumentNullException>("instance", () => XamlMemberInvoker.UnknownInvoker.SetValue(null, "value"));
System\Xaml\Schema\XamlTypeInvokerTests.cs (2)
72
Assert.
Throws
<ArgumentNullException>("instance", () => invoker.AddToCollection(null, 1));
128
Assert.
Throws
<ArgumentNullException>("instance", () => invoker.AddToDictionary(null, 1, 2));
System\Xaml\XamlDuplicateMemberExceptionTests.cs (1)
92
Assert.
Throws
<ArgumentNullException>("info", () => exception.GetObjectData(null, new StreamingContext()));
System\Xaml\XamlExceptionTests.cs (1)
82
Assert.
Throws
<ArgumentNullException>("info", () => exception.GetObjectData(null, new StreamingContext()));
System\Xaml\XamlInternalExceptionTests.cs (1)
62
Assert.
Throws
<ArgumentNullException>("info", () => exception.GetObjectData(null, new StreamingContext()));
System\Xaml\XamlObjectReaderExceptionTests.cs (1)
62
Assert.
Throws
<ArgumentNullException>("info", () => exception.GetObjectData(null, new StreamingContext()));
System\Xaml\XamlObjectWriterExceptionTests.cs (1)
62
Assert.
Throws
<ArgumentNullException>("info", () => exception.GetObjectData(null, new StreamingContext()));
System\Xaml\XamlParseExceptionTests.cs (1)
62
Assert.
Throws
<ArgumentNullException>("info", () => exception.GetObjectData(null, new StreamingContext()));
System\Xaml\XamlSchemaExceptionTests.cs (1)
62
Assert.
Throws
<ArgumentNullException>("info", () => exception.GetObjectData(null, new StreamingContext()));
System\Xaml\XamlServicesTests.cs (10)
52
Assert.
Throws
<ArgumentNullException>("xamlReader", () => XamlServices.Transform((XamlReader)null!, new XamlObjectWriter(new XamlSchemaContext())));
53
Assert.
Throws
<ArgumentNullException>("xamlReader", () => XamlServices.Transform((XamlReader)null!, new XamlObjectWriter(new XamlSchemaContext()), false));
59
Assert.
Throws
<ArgumentNullException>("xamlWriter", () => XamlServices.Transform(new XamlObjectReader(1), null));
60
Assert.
Throws
<ArgumentNullException>("xamlWriter", () => XamlServices.Transform(new XamlObjectReader(1), null, false));
66
Assert.
Throws
<ArgumentNullException>("fileName", () => XamlServices.Save((string)null!, 1));
72
Assert.
Throws
<ArgumentException>("fileName", () => XamlServices.Save("", 1));
78
Assert.
Throws
<ArgumentNullException>("stream", () => XamlServices.Save((Stream)null!, 1));
84
Assert.
Throws
<ArgumentNullException>("writer", () => XamlServices.Save((TextWriter)null!, 1));
90
Assert.
Throws
<ArgumentNullException>("writer", () => XamlServices.Save((XmlWriter)null!, 1));
96
Assert.
Throws
<ArgumentNullException>("writer", () => XamlServices.Save((XamlWriter)null!, 1));
System\Xaml\XamlWriterTests.cs (1)
83
Assert.
Throws
<ArgumentNullException>("reader", () => writer.WriteNode(null));
System\Xaml\XamlXmlWriterExceptionTests.cs (1)
62
Assert.
Throws
<ArgumentNullException>("info", () => exception.GetObjectData(null, new StreamingContext()));
WindowsBase.Tests (79)
System\Collections\Specialized\CollectionChangedEventManagerTests.cs (7)
177
Assert.
Throws
<ArgumentNullException>("handler", () => CollectionChangedEventManager.AddHandler(null, null));
178
Assert.
Throws
<ArgumentNullException>("handler", () => CollectionChangedEventManager.AddHandler(source, null));
341
Assert.
Throws
<ArgumentNullException>("source", () => CollectionChangedEventManager.AddListener(null, listener));
348
Assert.
Throws
<ArgumentNullException>("listener", () => CollectionChangedEventManager.AddListener(source, null));
443
Assert.
Throws
<ArgumentNullException>("handler", () => CollectionChangedEventManager.RemoveHandler(null, null));
444
Assert.
Throws
<ArgumentNullException>("handler", () => CollectionChangedEventManager.RemoveHandler(source, null));
537
Assert.
Throws
<ArgumentNullException>("listener", () => CollectionChangedEventManager.RemoveListener(source, null));
System\ComponentModel\CurrentChangedEventManagerTests.cs (7)
190
Assert.
Throws
<ArgumentNullException>("handler", () => CurrentChangedEventManager.AddHandler(null, null));
191
Assert.
Throws
<ArgumentNullException>("handler", () => CurrentChangedEventManager.AddHandler(source, null));
354
Assert.
Throws
<ArgumentNullException>("source", () => CurrentChangedEventManager.AddListener(null, listener));
361
Assert.
Throws
<ArgumentNullException>("listener", () => CurrentChangedEventManager.AddListener(source, null));
464
Assert.
Throws
<ArgumentNullException>("handler", () => CurrentChangedEventManager.RemoveHandler(null, null));
465
Assert.
Throws
<ArgumentNullException>("handler", () => CurrentChangedEventManager.RemoveHandler(source, null));
557
Assert.
Throws
<ArgumentNullException>("listener", () => CurrentChangedEventManager.RemoveListener(source, null));
System\ComponentModel\CurrentChangingEventManagerTests.cs (7)
181
Assert.
Throws
<ArgumentNullException>("handler", () => CurrentChangingEventManager.AddHandler(null, null));
182
Assert.
Throws
<ArgumentNullException>("handler", () => CurrentChangingEventManager.AddHandler(source, null));
345
Assert.
Throws
<ArgumentNullException>("source", () => CurrentChangingEventManager.AddListener(null, listener));
352
Assert.
Throws
<ArgumentNullException>("listener", () => CurrentChangingEventManager.AddListener(source, null));
447
Assert.
Throws
<ArgumentNullException>("handler", () => CurrentChangingEventManager.RemoveHandler(null, null));
448
Assert.
Throws
<ArgumentNullException>("handler", () => CurrentChangingEventManager.RemoveHandler(source, null));
539
Assert.
Throws
<ArgumentNullException>("listener", () => CurrentChangingEventManager.RemoveListener(source, null));
System\ComponentModel\ErrorsChangedEventManagerTests.cs (4)
163
Assert.
Throws
<ArgumentNullException>("source", () => ErrorsChangedEventManager.AddHandler(null, handler));
170
Assert.
Throws
<ArgumentNullException>("handler", () => ErrorsChangedEventManager.AddHandler(source, null));
248
Assert.
Throws
<ArgumentNullException>("source", () => ErrorsChangedEventManager.RemoveHandler(null, handler));
255
Assert.
Throws
<ArgumentNullException>("handler", () => ErrorsChangedEventManager.RemoveHandler(source, null));
System\ComponentModel\PropertyChangedEventManagerTests.cs (9)
408
Assert.
Throws
<ArgumentNullException>("handler", () => PropertyChangedEventManager.AddHandler(source, null, "propertyName"));
418
Assert.
Throws
<ArgumentNullException>("key", () => PropertyChangedEventManager.AddHandler(source, handler, null));
823
Assert.
Throws
<ArgumentNullException>("source", () => PropertyChangedEventManager.AddListener(null, listener, "propertyName"));
826
Assert.
Throws
<ArgumentNullException>("source", () => PropertyChangedEventManager.AddListener(null, listener, "propertyName"));
833
Assert.
Throws
<ArgumentNullException>("listener", () => PropertyChangedEventManager.AddListener(source, null, "propertyName"));
1016
Assert.
Throws
<ArgumentNullException>("key", () => PropertyChangedEventManager.RemoveHandler(source, handler, null));
1022
Assert.
Throws
<ArgumentNullException>("key", () => PropertyChangedEventManager.RemoveHandler(source, handler, null));
1031
Assert.
Throws
<ArgumentNullException>("handler", () => PropertyChangedEventManager.RemoveHandler(source, null, "propertyName"));
1248
Assert.
Throws
<ArgumentNullException>("listener", () => PropertyChangedEventManager.RemoveListener(source, null, "propertyName"));
System\ComponentModel\SortDescriptionCollectionTests.cs (5)
295
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection.Insert(index, description));
384
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection.InsertItem(index, description));
614
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection.RemoveAt(index));
700
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection.RemoveItem(index));
773
Assert.
Throws
<ArgumentOutOfRangeException>("index", () => collection.SetItem(index, description));
System\IO\Packaging\PackageDigitalSignatureManagerTests.cs (1)
319
Assert.
Throws
<ArgumentNullException>("signatureUri", () => manager.RemoveSignature(null));
System\Security\RightsManagement\RightsManagementExceptionTests.cs (1)
272
Assert.
Throws
<ArgumentNullException>("info", () => exception.GetObjectData(null!, default));
System\Security\RightsManagement\SecureEnvironmentTests.cs (3)
183
Assert.
Throws
<ArgumentNullException>("user", () => SecureEnvironment.RemoveActivatedUser(null!));
190
Assert.
Throws
<ArgumentOutOfRangeException>("user", () => SecureEnvironment.RemoveActivatedUser(user));
199
Assert.
Throws
<ArgumentOutOfRangeException>("user", () => SecureEnvironment.RemoveActivatedUser(user));
System\Windows\DependencyObjectTests.cs (6)
410
Assert.
Throws
<ArgumentNullException>("dp", () => obj.ClearValue((DependencyProperty)null!));
773
Assert.
Throws
<ArgumentNullException>("key", () => obj.ClearValue((DependencyPropertyKey)null!));
1711
Assert.
Throws
<ArgumentNullException>("dp", () => obj.InvalidateProperty(null!));
2385
Assert.
Throws
<ArgumentNullException>("dp", () => obj.SetValue((DependencyProperty)null!, true));
2817
Assert.
Throws
<ArgumentNullException>("key", () => obj.SetValue((DependencyPropertyKey)null!, true));
2919
Assert.
Throws
<ArgumentException>("e", () => obj.OnPropertyChanged(e));
System\Windows\DependencyPropertyKeyTests.cs (2)
34
Assert.
Throws
<ArgumentNullException>("forType", () => key.OverrideMetadata(null!, new PropertyMetadata()));
50
Assert.
Throws
<ArgumentNullException>("typeMetadata", () => key.OverrideMetadata(typeof(int), null));
System\Windows\FreezableTests.cs (5)
38
Assert.
Throws
<ArgumentException>("handler", () => freezable.Changed -= handler);
806
Assert.
Throws
<ArgumentNullException>("dp", () => obj.ClearValue((DependencyProperty)null!));
1280
Assert.
Throws
<ArgumentNullException>("key", () => obj.ClearValue((DependencyPropertyKey)null!));
6694
Assert.
Throws
<ArgumentException>("e", () => obj.OnPropertyChanged(e));
6798
Assert.
Throws
<ArgumentNullException>("dp", () => obj.SetValue((DependencyProperty)null!, true));
System\Windows\Markup\ServiceProvidersTests.cs (3)
32
Assert.
Throws
<ArgumentNullException>("serviceType", () => serviceProviders.AddService(null, new object()));
39
Assert.
Throws
<ArgumentNullException>("service", () => serviceProviders.AddService(typeof(object), null));
47
Assert.
Throws
<ArgumentException>("serviceType", () => serviceProviders.AddService(typeof(object), new object()));
System\Windows\NameScopeTests.cs (8)
62
Assert.
Throws
<ArgumentNullException>("dependencyObject", () => NameScope.SetNameScope(null, nameScope));
182
Assert.
Throws
<ArgumentNullException>("key", () => nameScope.Add(null, scopedElement));
329
Assert.
Throws
<ArgumentNullException>("scopedElement", () => nameScope.Add("name", null!));
397
Assert.
Throws
<ArgumentException>("item", () => nameScope.Add(new KeyValuePair<string, object>(null!, scopedElement)));
423
Assert.
Throws
<ArgumentException>("item", () => nameScope.Add(new KeyValuePair<string, object>("name", null!)));
900
Assert.
Throws
<ArgumentNullException>("name", () => nameScope.RegisterName(null, scopedElement));
926
Assert.
Throws
<ArgumentNullException>("scopedElement", () => nameScope.RegisterName("name", null!));
1145
Assert.
Throws
<ArgumentNullException>("name", () => nameScope.UnregisterName(null));
System\Windows\PropertyMetadataTests.cs (1)
499
Assert.
Throws
<ArgumentNullException>("baseMetadata", () => metadata.Merge(null!, null!));
System\Windows\Threading\DispatcherTests.cs (3)
27
Assert.
Throws
<ArgumentNullException>("frame", () => Dispatcher.PushFrame(null!));
81
Assert.
Throws
<InvalidEnumArgumentException>("priority", () => Dispatcher.ValidatePriority(priority, "priority"));
82
Assert.
Throws
<InvalidEnumArgumentException>("", () => Dispatcher.ValidatePriority(priority, ""));
System\Windows\WeakEventManagerTests.cs (5)
1225
Assert.
Throws
<ArgumentNullException>("handler", () => manager.ProtectedAddHandler(source, null!));
1591
Assert.
Throws
<ArgumentNullException>("listener", () => manager.ProtectedAddListener(source, null!));
2129
Assert.
Throws
<ArgumentNullException>("handler", () => manager.ProtectedRemoveHandler(source, null!));
2554
Assert.
Throws
<ArgumentNullException>("listener", () => manager.ProtectedRemoveListener(source, null!));
2921
Assert.
Throws
<ArgumentNullException>("key", () => SubWeakEventManager.SetCurrentManager(null!, new SubWeakEventManager()));
System\Windows\WeakEventManagerTTests.cs (2)
222
Assert.
Throws
<ArgumentNullException>("handler", () => WeakEventManager<object, EventArgs>.AddHandler(new object(), "EventName", null));
343
Assert.
Throws
<ArgumentNullException>("handler", () => WeakEventManager<object, EventArgs>.RemoveHandler(new object(), "EventName", null));