1532 references to Throws
Binding.Http.IntegrationTests (3)
Binding.UDS.IntegrationTests (1)
Client.ClientBase.IntegrationTests (6)
Client.ExpectedExceptions.IntegrationTests (12)
Contract.Fault.IntegrationTests (6)
Contract.Message.IntegrationTests (1)
Contract.Service.IntegrationTests (2)
Encoding.Encoders.IntegrationTests (1)
InMemory.FunctionalTests (40)
Http2\Http2StreamTests.cs (12)
1519ex = Assert.Throws<InvalidOperationException>(() => context.Response.OnStarting(_ => Task.CompletedTask, null));
2144Assert.Throws<InvalidOperationException>(() => context.Response.Headers.Append("Custom你好Name", "Custom Value"));
2146Assert.Throws<InvalidOperationException>(() => context.Response.Headers.Append("CustomName", "Custom 你好 Value"));
2147Assert.Throws<InvalidOperationException>(() => context.Response.Headers.Append("CustomName", "Custom \r Value"));
2185Assert.Throws<InvalidOperationException>(() => context.Response.Headers.Append("Custom你好Name", "Custom Value"));
2186Assert.Throws<InvalidOperationException>(() => context.Response.Headers.Append("CustomName", "Custom \r Value"));
2469Assert.Throws<InvalidOperationException>(() => context.Response.AppendTrailer("Custom你好Name", "Custom Value"));
2470Assert.Throws<InvalidOperationException>(() => context.Response.AppendTrailer("CustomName", "Custom 你好 Value"));
2471Assert.Throws<InvalidOperationException>(() => context.Response.AppendTrailer("CustomName", "Custom \r Value"));
2512Assert.Throws<InvalidOperationException>(() => context.Response.AppendTrailer("Custom你好Name", "Custom Value"));
2513Assert.Throws<InvalidOperationException>(() => context.Response.AppendTrailer("CustomName", "Custom \r Value"));
5386var ex = Assert.Throws<InvalidOperationException>(() => context.Response.BodyWriter.Complete());
Http3\Http3StreamTests.cs (11)
864Assert.Throws<InvalidOperationException>(() => context.Response.Headers.Append("Custom你好Name", "Custom Value"));
866Assert.Throws<InvalidOperationException>(() => context.Response.Headers.Append("CustomName", "Custom 你好 Value"));
867Assert.Throws<InvalidOperationException>(() => context.Response.Headers.Append("CustomName", "Custom \r Value"));
898Assert.Throws<InvalidOperationException>(() => context.Response.Headers.Append("Custom你好Name", "Custom Value"));
899Assert.Throws<InvalidOperationException>(() => context.Response.Headers.Append("CustomName", "Custom \r Value"));
1015Assert.Throws<InvalidOperationException>(() => context.Response.AppendTrailer("Custom你好Name", "Custom Value"));
1016Assert.Throws<InvalidOperationException>(() => context.Response.AppendTrailer("CustomName", "Custom 你好 Value"));
1017Assert.Throws<InvalidOperationException>(() => context.Response.AppendTrailer("CustomName", "Custom \r Value"));
1046Assert.Throws<InvalidOperationException>(() => context.Response.AppendTrailer("Custom你好Name", "Custom Value"));
1047Assert.Throws<InvalidOperationException>(() => context.Response.AppendTrailer("CustomName", "Custom \r Value"));
1664var ex = Assert.Throws<InvalidOperationException>(() => context.Response.BodyWriter.Complete());
Interop.FunctionalTests (2)
Microsoft.Analyzers.Local.Tests (1)
Microsoft.AspNetCore.Antiforgery.Test (1)
Microsoft.AspNetCore.AsyncState.Tests (1)
Microsoft.AspNetCore.Authentication.Negotiate.Test (2)
Microsoft.AspNetCore.Authorization.Test (1)
Microsoft.AspNetCore.Components.Authorization.Tests (3)
Microsoft.AspNetCore.Components.Endpoints.Tests (1)
Microsoft.AspNetCore.Components.Server.Tests (6)
Microsoft.AspNetCore.Components.Tests (71)
Microsoft.AspNetCore.Components.Web.Tests (6)
Microsoft.AspNetCore.Components.WebAssembly.Tests (1)
Microsoft.AspNetCore.ConcurrencyLimiter.Tests (2)
Microsoft.AspNetCore.CookiePolicy.Test (5)
Microsoft.AspNetCore.Cors.Test (2)
Microsoft.AspNetCore.Cryptography.Internal.Tests (1)
Microsoft.AspNetCore.Cryptography.KeyDerivation.Tests (1)
Microsoft.AspNetCore.DataProtection.Abstractions.Tests (3)
Microsoft.AspNetCore.DataProtection.Extensions.Tests (1)
Microsoft.AspNetCore.DataProtection.Tests (18)
Microsoft.AspNetCore.Diagnostics.HealthChecks.Tests (2)
Microsoft.AspNetCore.Diagnostics.Tests (1)
Microsoft.AspNetCore.Hosting.Tests (9)
Microsoft.AspNetCore.Http.Abstractions.Tests (7)
Microsoft.AspNetCore.Http.Extensions.Tests (2)
Microsoft.AspNetCore.Http.Tests (7)
Microsoft.AspNetCore.HttpsPolicy.Tests (2)
Microsoft.AspNetCore.Identity.Test (2)
Microsoft.AspNetCore.InternalTesting.Tests (2)
Microsoft.AspNetCore.JsonPatch.SystemTextJson.Tests (19)
Microsoft.AspNetCore.JsonPatch.Tests (27)
Microsoft.AspNetCore.Mvc.Abstractions.Test (5)
Microsoft.AspNetCore.Mvc.Core.Test (20)
Microsoft.AspNetCore.Mvc.Formatters.Xml.Test (3)
Microsoft.AspNetCore.Mvc.Localization.Test (1)
Microsoft.AspNetCore.Mvc.NewtonsoftJson.Test (2)
Microsoft.AspNetCore.Mvc.Razor.Test (5)
Microsoft.AspNetCore.Mvc.RazorPages.Test (6)
Microsoft.AspNetCore.Mvc.TagHelpers.Test (4)
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (12)
Microsoft.AspNetCore.OutputCaching.Tests (1)
Microsoft.AspNetCore.Owin.Tests (3)
Microsoft.AspNetCore.Razor.Runtime.Test (1)
Microsoft.AspNetCore.RequestDecompression.Tests (9)
Microsoft.AspNetCore.Rewrite.Tests (1)
Microsoft.AspNetCore.Routing.Tests (12)
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (19)
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (92)
src\Shared\test\Shared.Tests\runtime\Http2\HPackDecoderTest.cs (15)
176HPackDecodingException exception = Assert.Throws<HPackDecodingException>(() =>
253HPackDecodingException exception = Assert.Throws<HPackDecodingException>(() => _decoder.Decode(new byte[] { 0x7e }, endHeaders: true, handler: _handler));
277HPackDecodingException exception = Assert.Throws<HPackDecodingException>(() => _decoder.Decode(encoded, endHeaders: true, handler: _handler));
301HPackDecodingException exception = Assert.Throws<HPackDecodingException>(() => _decoder.Decode(encoded, endHeaders: true, handler: _handler));
325HPackDecodingException exception = Assert.Throws<HPackDecodingException>(() => _decoder.Decode(encoded, endHeaders: true, handler: _handler));
371HPackDecodingException exception = Assert.Throws<HPackDecodingException>(() => _decoder.Decode(encoded, endHeaders: true, handler: _handler));
403HPackDecodingException exception = Assert.Throws<HPackDecodingException>(() => _decoder.Decode(new byte[] { 0x0f, 0x2f }, endHeaders: true, handler: _handler));
498HPackDecodingException exception = Assert.Throws<HPackDecodingException>(() => _decoder.Decode(new byte[] { 0x1f, 0x2f }, endHeaders: true, handler: _handler));
621HPackDecodingException exception = Assert.Throws<HPackDecodingException>(() => _decoder.Decode(data, endHeaders: true, handler: _handler));
636HPackDecodingException exception = Assert.Throws<HPackDecodingException>(() => _decoder.Decode(data, endHeaders: true, handler: _handler));
663HPackDecodingException exception = Assert.Throws<HPackDecodingException>(() =>
676HPackDecodingException exception = Assert.Throws<HPackDecodingException>(() => _decoder.Decode(encoded, endHeaders: true, handler: _handler));
727var ex = Assert.Throws<HPackDecodingException>(() => decoder.Decode(encoded, endHeaders: true, handler: _handler));
867HPackDecodingException exception = Assert.Throws<HPackDecodingException>(() => _decoder.Decode(encoded, endHeaders: true, handler: _handler));
901HPackDecodingException exception = Assert.Throws<HPackDecodingException>(() => _decoder.Decode(encoded, endHeaders: true, handler: _handler));
Microsoft.AspNetCore.Server.Kestrel.Tests (14)
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Tests (2)
Microsoft.AspNetCore.Shared.Tests (17)
runtime\Http2\HPackDecoderTest.cs (15)
176HPackDecodingException exception = Assert.Throws<HPackDecodingException>(() =>
253HPackDecodingException exception = Assert.Throws<HPackDecodingException>(() => _decoder.Decode(new byte[] { 0x7e }, endHeaders: true, handler: _handler));
277HPackDecodingException exception = Assert.Throws<HPackDecodingException>(() => _decoder.Decode(encoded, endHeaders: true, handler: _handler));
301HPackDecodingException exception = Assert.Throws<HPackDecodingException>(() => _decoder.Decode(encoded, endHeaders: true, handler: _handler));
325HPackDecodingException exception = Assert.Throws<HPackDecodingException>(() => _decoder.Decode(encoded, endHeaders: true, handler: _handler));
371HPackDecodingException exception = Assert.Throws<HPackDecodingException>(() => _decoder.Decode(encoded, endHeaders: true, handler: _handler));
403HPackDecodingException exception = Assert.Throws<HPackDecodingException>(() => _decoder.Decode(new byte[] { 0x0f, 0x2f }, endHeaders: true, handler: _handler));
498HPackDecodingException exception = Assert.Throws<HPackDecodingException>(() => _decoder.Decode(new byte[] { 0x1f, 0x2f }, endHeaders: true, handler: _handler));
621HPackDecodingException exception = Assert.Throws<HPackDecodingException>(() => _decoder.Decode(data, endHeaders: true, handler: _handler));
636HPackDecodingException exception = Assert.Throws<HPackDecodingException>(() => _decoder.Decode(data, endHeaders: true, handler: _handler));
663HPackDecodingException exception = Assert.Throws<HPackDecodingException>(() =>
676HPackDecodingException exception = Assert.Throws<HPackDecodingException>(() => _decoder.Decode(encoded, endHeaders: true, handler: _handler));
727var ex = Assert.Throws<HPackDecodingException>(() => decoder.Decode(encoded, endHeaders: true, handler: _handler));
867HPackDecodingException exception = Assert.Throws<HPackDecodingException>(() => _decoder.Decode(encoded, endHeaders: true, handler: _handler));
901HPackDecodingException exception = Assert.Throws<HPackDecodingException>(() => _decoder.Decode(encoded, endHeaders: true, handler: _handler));
Microsoft.AspNetCore.SignalR.Common.Tests (2)
Microsoft.AspNetCore.SignalR.Tests (3)
Microsoft.AspNetCore.SpaServices.Extensions.Tests (1)
Microsoft.AspNetCore.TestHost.Tests (1)
Microsoft.AspNetCore.Tests (2)
Microsoft.AspNetCore.WebUtilities.Tests (18)
FormPipeReaderTests.cs (7)
226var exception = Assert.Throws<InvalidDataException>(
455var exception = Assert.Throws<InvalidDataException>(() => formReader.ParseFormValues(ref readOnlySequence, ref accumulator, isFinalBlock: true));
469var exception = Assert.Throws<InvalidDataException>(() => formReader.ParseFormValues(ref readOnlySequence, ref accumulator, isFinalBlock: true));
483var exception = Assert.Throws<InvalidDataException>(() => formReader.ParseFormValues(ref readOnlySequence, ref accumulator, isFinalBlock: true));
497var exception = Assert.Throws<InvalidDataException>(() => formReader.ParseFormValues(ref readOnlySequence, ref accumulator, isFinalBlock: true));
511var exception = Assert.Throws<InvalidDataException>(() => formReader.ParseFormValues(ref readOnlySequence, ref accumulator, isFinalBlock: true));
525var exception = Assert.Throws<InvalidDataException>(() => formReader.ParseFormValues(ref readOnlySequence, ref accumulator, isFinalBlock: true));
Microsoft.Build.CommandLine.UnitTests (1)
Microsoft.Build.Engine.OM.UnitTests (236)
Microsoft.Build.Engine.UnitTests (233)
Microsoft.Build.Tasks.UnitTests (16)
Microsoft.Build.UnitTests.Shared (1)
Microsoft.Build.Utilities.UnitTests (1)
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (5)
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (1)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (15)
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (29)
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (5)
Microsoft.CodeAnalysis.Scripting.Desktop.UnitTests (6)
Microsoft.CodeAnalysis.UnitTests (96)
MetadataReferences\ModuleMetadataTests.cs (4)
24Assert.Throws<ArgumentOutOfRangeException>(() => { fixed (byte* ptr = new byte[] { 1, 2, 3 }) ModuleMetadata.CreateFromMetadata((IntPtr)ptr, 0); });
25Assert.Throws<ArgumentOutOfRangeException>(() => { fixed (byte* ptr = new byte[] { 1, 2, 3 }) ModuleMetadata.CreateFromMetadata((IntPtr)ptr, -1); });
90Assert.Throws<ArgumentOutOfRangeException>(() => { fixed (byte* ptr = new byte[] { 1, 2, 3 }) ModuleMetadata.CreateFromImage((IntPtr)ptr, 0); });
91Assert.Throws<ArgumentOutOfRangeException>(() => { fixed (byte* ptr = new byte[] { 1, 2, 3 }) ModuleMetadata.CreateFromImage((IntPtr)ptr, -1); });
Text\TextChangeTests.cs (6)
243Assert.Throws<ArgumentOutOfRangeException>(() => newText.CopyTo(-1, destination, 0, 2));
244Assert.Throws<ArgumentOutOfRangeException>(() => newText.CopyTo(0, destination, -1, 2));
245Assert.Throws<ArgumentOutOfRangeException>(() => newText.CopyTo(0, destination, 0, -1));
246Assert.Throws<ArgumentNullException>(() => newText.CopyTo(0, null, 0, 2));
247Assert.Throws<ArgumentOutOfRangeException>(() => newText.CopyTo(newText.Length - 1, destination, 0, 2));
248Assert.Throws<ArgumentOutOfRangeException>(() => newText.CopyTo(0, destination, destination.Length - 1, 2));
Microsoft.CodeAnalysis.VisualBasic.Scripting.UnitTests (7)
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (2)
Microsoft.CodeAnalysis.Workspaces.UnitTests (6)
Microsoft.Data.Analysis.Tests (9)
Microsoft.DotNet.Build.Tasks.Workloads.Tests (2)
Microsoft.DotNet.NuGetRepack.Tests (4)
VersionUpdaterTests.cs (4)
138var e1 = Assert.Throws<InvalidOperationException>(() => NuGetVersionUpdater.Run(new[] { c_daily }, outDirectoryOpt: null, VersionTranslation.Release, exactVersions: false));
141var e2 = Assert.Throws<AggregateException>(() => NuGetVersionUpdater.Run(new[] { a_daily }, outDirectoryOpt: null, VersionTranslation.Release, exactVersions: false));
149var e3 = Assert.Throws<AggregateException>(() => NuGetVersionUpdater.Run(new[] { a_daily, b_daily }, outDirectoryOpt: null, VersionTranslation.Release, exactVersions: false));
156var e4 = Assert.Throws<AggregateException>(() => NuGetVersionUpdater.Run(new[] { a_daily, c_daily }, outDirectoryOpt: null, VersionTranslation.Release, exactVersions: false));
Microsoft.DotNet.RemoteExecutor.Tests (3)
Microsoft.DotNet.XUnitAssert.Tests (8)
Microsoft.Extensions.AI.Abstractions.Tests (3)
Microsoft.Extensions.Caching.StackExchangeRedis.Tests (1)
Microsoft.Extensions.Diagnostics.Probes.Tests (1)
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests (1)
Microsoft.Extensions.Diagnostics.Testing.Tests (3)
Microsoft.Extensions.Http.Resilience.Tests (10)
Resilience\HttpClientBuilderExtensionsTests.Standard.cs (4)
107Assert.Throws<ArgumentNullException>(() => AddStandardResilienceHandler(mode, builder, _validConfigurationSection, options => { }));
117Assert.Throws<ArgumentNullException>(() => AddStandardResilienceHandler(mode, builder, _validConfigurationSection, null!));
128Assert.Throws<ArgumentNullException>(() => AddStandardResilienceHandler(mode, builder, null!, options => { }));
138Assert.Throws<ArgumentException>(() => AddStandardResilienceHandler(mode, builder, _emptyConfigurationSection, options => { }));
Microsoft.Extensions.Localization.Tests (1)
Microsoft.Extensions.SecretManager.Tools.Tests (1)
Microsoft.Extensions.Telemetry.Tests (2)
Microsoft.Extensions.TimeProvider.Testing.Tests (2)
Microsoft.JSInterop.Tests (5)
Microsoft.ML.AutoML.Tests (1)
Microsoft.ML.Tests (9)
Microsoft.Net.Http.Headers.Tests (17)
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (2)
PresentationCore.Tests (2)
Security.TransportSecurity.IntegrationTests (6)
Shared.Tests (4)
Sockets.BindTests (5)
System.ServiceModel.Http.Tests (1)
System.ServiceModel.NetTcp.Tests (2)
System.ServiceModel.Primitives.Tests (28)
System.Xaml.Tests (29)
WindowsBase.Tests (172)
System\Windows\FreezableTests.cs (85)
58Assert.Throws<InvalidOperationException>(() => freezable.Changed += handler);
59Assert.Throws<InvalidOperationException>(() => freezable.Changed += null);
60Assert.Throws<InvalidOperationException>(() => freezable.Changed -= handler);
61Assert.Throws<InvalidOperationException>(() => freezable.Changed -= null);
74Assert.Throws<InvalidOperationException>(() => freezable.Changed += handler);
75Assert.Throws<InvalidOperationException>(() => freezable.Changed += null);
76Assert.Throws<InvalidOperationException>(() => freezable.Changed -= handler);
77Assert.Throws<InvalidOperationException>(() => freezable.Changed -= null);
91Assert.Throws<InvalidOperationException>(() => freezable.Changed += handler);
92Assert.Throws<InvalidOperationException>(() => freezable.Changed += null);
93Assert.Throws<InvalidOperationException>(() => freezable.Changed -= handler);
94Assert.Throws<InvalidOperationException>(() => freezable.Changed -= null);
815Assert.Throws<InvalidOperationException>(() => obj.ClearValue(property));
825Assert.Throws<InvalidOperationException>(() => obj.ClearValue(property));
835Assert.Throws<InvalidOperationException>(() => obj.ClearValue(property));
848Assert.Throws<InvalidOperationException>(() => obj.ClearValue(property));
1290Assert.Throws<InvalidOperationException>(() => obj.ClearValue(key));
1301Assert.Throws<InvalidOperationException>(() => obj.ClearValue(key));
1314Assert.Throws<InvalidOperationException>(() => obj.ClearValue(key));
1911Assert.Throws<InvalidOperationException>(() => freezable.CloneCore(sourceFreezable));
1995Assert.Throws<InvalidOperationException>(() => freezable.CloneCore(sourceFreezable));
2085Assert.Throws<InvalidOperationException>(() => freezable.CloneCore(sourceFreezable));
2175Assert.Throws<InvalidOperationException>(() => freezable.CloneCore(sourceFreezable));
2201Assert.Throws<NullReferenceException>(() => freezable.CloneCore(null!));
2794Assert.Throws<InvalidOperationException>(() => freezable.CloneCurrentValueCore(sourceFreezable));
2879Assert.Throws<InvalidOperationException>(() => freezable.CloneCurrentValueCore(sourceFreezable));
2970Assert.Throws<InvalidOperationException>(() => freezable.CloneCurrentValueCore(sourceFreezable));
3061Assert.Throws<InvalidOperationException>(() => freezable.CloneCurrentValueCore(sourceFreezable));
3087Assert.Throws<NullReferenceException>(() => freezable.CloneCurrentValueCore(null!));
3564Assert.Throws<NullReferenceException>(() => obj.CoerceValue(null!));
3593Assert.Throws<ArgumentException>(() => obj.CoerceValue(property));
3632Assert.Throws<ArgumentException>(() => obj.CoerceValue(property));
3659Assert.Throws<InvalidOperationException>(() => obj.CoerceValue(property));
3819Assert.Throws<InvalidOperationException>(() => freezable.Freeze());
3843Assert.Throws<InvalidOperationException>(() => freezable.Freeze());
4017Assert.Throws<InvalidOperationException>(() => freezable.Freeze());
4063Assert.Throws<InvalidOperationException>(() => freezable.Freeze());
4907Assert.Throws<InvalidOperationException>(() => freezable.GetAsFrozenCore(sourceFreezable));
4992Assert.Throws<InvalidOperationException>(() => freezable.GetAsFrozenCore(sourceFreezable));
5083Assert.Throws<InvalidOperationException>(() => freezable.GetAsFrozenCore(sourceFreezable));
5174Assert.Throws<InvalidOperationException>(() => freezable.GetAsFrozenCore(sourceFreezable));
5200Assert.Throws<NullReferenceException>(() => freezable.GetAsFrozenCore(null!));
5760Assert.Throws<InvalidOperationException>(() => freezable.GetCurrentValueAsFrozenCore(sourceFreezable));
5845Assert.Throws<InvalidOperationException>(() => freezable.GetCurrentValueAsFrozenCore(sourceFreezable));
5936Assert.Throws<InvalidOperationException>(() => freezable.GetCurrentValueAsFrozenCore(sourceFreezable));
6026Assert.Throws<InvalidOperationException>(() => freezable.GetCurrentValueAsFrozenCore(sourceFreezable));
6051Assert.Throws<NullReferenceException>(() => freezable.GetCurrentValueAsFrozenCore(null!));
6235Assert.Throws<InvalidOperationException>(() => freezable.ReadPreamble());
6364Assert.Throws<InvalidOperationException>(() => freezable.OnFreezablePropertyChanged(null!, value1));
6365Assert.Throws<InvalidOperationException>(() => freezable.OnFreezablePropertyChanged(null!, value3));
6368Assert.Throws<InvalidOperationException>(() => freezable.OnFreezablePropertyChanged(value1, value3));
6370Assert.Throws<InvalidOperationException>(() => freezable.OnFreezablePropertyChanged(value2, value1));
6371Assert.Throws<InvalidOperationException>(() => freezable.OnFreezablePropertyChanged(value2, value3));
6373Assert.Throws<InvalidOperationException>(() => freezable.OnFreezablePropertyChanged(value3, value1));
6419Assert.Throws<InvalidOperationException>(() => freezable.OnFreezablePropertyChanged(null!, value1));
6420Assert.Throws<InvalidOperationException>(() => freezable.OnFreezablePropertyChanged(null!, value3));
6423Assert.Throws<InvalidOperationException>(() => freezable.OnFreezablePropertyChanged(value1, value3));
6425Assert.Throws<InvalidOperationException>(() => freezable.OnFreezablePropertyChanged(value2, value1));
6426Assert.Throws<InvalidOperationException>(() => freezable.OnFreezablePropertyChanged(value2, value3));
6428Assert.Throws<InvalidOperationException>(() => freezable.OnFreezablePropertyChanged(value3, value1));
6540Assert.Throws<InvalidOperationException>(() => freezable.OnFreezablePropertyChanged(null!, value1, property));
6541Assert.Throws<InvalidOperationException>(() => freezable.OnFreezablePropertyChanged(null!, value3, property));
6544Assert.Throws<InvalidOperationException>(() => freezable.OnFreezablePropertyChanged(value1, value3, property));
6546Assert.Throws<InvalidOperationException>(() => freezable.OnFreezablePropertyChanged(value2, value1, property));
6547Assert.Throws<InvalidOperationException>(() => freezable.OnFreezablePropertyChanged(value2, value3, property));
6549Assert.Throws<InvalidOperationException>(() => freezable.OnFreezablePropertyChanged(value3, value1, property));
6597Assert.Throws<InvalidOperationException>(() => freezable.OnFreezablePropertyChanged(null!, value1, property));
6598Assert.Throws<InvalidOperationException>(() => freezable.OnFreezablePropertyChanged(null!, value3, property));
6601Assert.Throws<InvalidOperationException>(() => freezable.OnFreezablePropertyChanged(value1, value3, property));
6603Assert.Throws<InvalidOperationException>(() => freezable.OnFreezablePropertyChanged(value2, value1, property));
6604Assert.Throws<InvalidOperationException>(() => freezable.OnFreezablePropertyChanged(value2, value3, property));
6606Assert.Throws<InvalidOperationException>(() => freezable.OnFreezablePropertyChanged(value3, value1, property));
6807Assert.Throws<InvalidOperationException>(() => obj.SetValue(property, "value"));
6819Assert.Throws<ArgumentException>(() => obj.SetValue(property, value));
6830Assert.Throws<ArgumentException>(() => obj.SetValue(property, value));
6846Assert.Throws<ArgumentException>(() => obj.SetValue(property, value));
6858Assert.Throws<InvalidOperationException>(() => freezable.SetValue(property, true));
6862Assert.Throws<InvalidOperationException>(() => freezable.SetValue(property, true));
6866Assert.Throws<InvalidOperationException>(() => freezable.SetValue(property, false));
6879Assert.Throws<InvalidOperationException>(() => freezable.SetValue(property, value));
6894Assert.Throws<InvalidOperationException>(() => freezable.SetValue(property, value));
7244Assert.Throws<InvalidOperationException>(() => freezable.WritePreamble());
7247Assert.Throws<InvalidOperationException>(() => freezable.WritePreamble());
7256Assert.Throws<InvalidOperationException>(() => freezable.WritePreamble());
7268Assert.Throws<InvalidOperationException>(() => freezable.WritePreamble());
System\Windows\NameScopeTests.cs (19)
190Assert.Throws<ArgumentException>(() => nameScope.Add(string.Empty, scopedElement));
303Assert.Throws<ArgumentNullException>(() => nameScope.Add(null, scopedElement));
311Assert.Throws<ArgumentException>(() => nameScope.Add(string.Empty, scopedElement));
322Assert.Throws<ArgumentException>(() => nameScope.Add(name, scopedElement));
405Assert.Throws<ArgumentException>(() => nameScope.Add(new KeyValuePair<string, object>(string.Empty, scopedElement)));
416Assert.Throws<ArgumentException>(() => nameScope.Add(new KeyValuePair<string, object>(name, scopedElement)));
432Assert.Throws<ArgumentException>(() => nameScope.Add("name", new object()));
433Assert.Throws<ArgumentException>(() => nameScope.Add(new KeyValuePair<string, object>("name", new object())));
532Assert.Throws<NullReferenceException>(() => nameScope.CopyTo(null, 0));
543Assert.Throws<IndexOutOfRangeException>(() => nameScope.CopyTo(array, 0));
554Assert.Throws<IndexOutOfRangeException>(() => nameScope.CopyTo(array, -1));
555Assert.Throws<IndexOutOfRangeException>(() => nameScope.CopyTo(array, 1));
908Assert.Throws<ArgumentException>(() => nameScope.RegisterName(string.Empty, scopedElement));
919Assert.Throws<ArgumentException>(() => nameScope.RegisterName(name, scopedElement));
935Assert.Throws<ArgumentException>(() => nameScope.RegisterName("name", new object()));
1136Assert.Throws<ArgumentException>(() => nameScope.UnregisterName("name"));
1152Assert.Throws<ArgumentException>(() => nameScope.UnregisterName(string.Empty));
1168Assert.Throws<ArgumentException>(() => nameScope.UnregisterName(name));
1186Assert.Throws<ArgumentException>(() => nameScope.UnregisterName(name));
System\Windows\WeakEventManagerTests.cs (14)
337Assert.Throws<InvalidCastException>(() => manager.DeliverEvent(source, args));
352Assert.Throws<InvalidCastException>(() => manager.DeliverEvent(source, args));
368Assert.Throws<InvalidCastException>(() => manager.DeliverEvent(source, args));
425Assert.Throws<InvalidCastException>(() => manager.DeliverEvent(source, args));
612Assert.Throws<InvalidCastException>(() => manager.DeliverEventToList(sender, args, list));
625Assert.Throws<InvalidCastException>(() => manager.DeliverEventToList(sender, args, list));
639Assert.Throws<InvalidCastException>(() => manager.DeliverEventToList(sender, args, list));
1237Assert.Throws<InvalidCastException>(() => manager.ProtectedAddHandler(source, handler));
1602Assert.Throws<InvalidCastException>(() => manager.ProtectedAddListener(source, listener));
2141Assert.Throws<InvalidCastException>(() => manager.ProtectedRemoveHandler(source, handler));
2565Assert.Throws<InvalidCastException>(() => manager.ProtectedRemoveListener(source, listener));
3912Assert.Throws<NullReferenceException>(() => list.AddHandler(null));
4294Assert.Throws<NullReferenceException>(() => list.CopyTo(null!));
5641Assert.Throws<NullReferenceException>(() => list.RemoveHandler(null));
System\Windows\WeakEventManagerTTests.cs (7)
189Assert.Throws<NullReferenceException>(() => WeakEventManager<object, EventArgs>.AddHandler(new object(), null, (sender, e) => { }));
192Assert.Throws<NullReferenceException>(() => WeakEventManager<object, EventArgs>.AddHandler(new object(), null, (sender, e) => { }));
213Assert.Throws<ArgumentException>(() => WeakEventManager<object, EventArgs>.AddHandler(source, eventName, handler));
216Assert.Throws<ArgumentException>(() => WeakEventManager<object, EventArgs>.AddHandler(source, eventName, handler));
351Assert.Throws<NullReferenceException>(() => WeakEventManager<object, EventArgs>.RemoveHandler(new object(), null, (sender, e) => { }));
372Assert.Throws<ArgumentException>(() => WeakEventManager<object, EventArgs>.RemoveHandler(source, eventName, handler));
375Assert.Throws<ArgumentException>(() => WeakEventManager<object, EventArgs>.RemoveHandler(source, eventName, handler));
xunit.assert (1)