2159 references to Throws
Aspire.Azure.AI.OpenAI.Tests (5)
Aspire.Azure.Messaging.WebPubSub.Tests (1)
Aspire.Elastic.Clients.Elasticsearch.Tests (6)
Aspire.Hosting.Azure.Tests (1)
Aspire.Hosting.Containers.Tests (3)
Aspire.Hosting.Tests (9)
Aspire.Microsoft.EntityFrameworkCore.Cosmos.Tests (2)
Aspire.Microsoft.EntityFrameworkCore.SqlServer.Tests (2)
Aspire.Milvus.Client.Tests (6)
Aspire.MongoDB.Driver.Tests (6)
Aspire.MongoDB.Driver.v3.Tests (6)
Aspire.NATS.Net.Tests (7)
Aspire.Npgsql.EntityFrameworkCore.PostgreSQL.Tests (2)
Aspire.OpenAI.Tests (4)
Aspire.Oracle.EntityFrameworkCore.Tests (2)
Aspire.Pomelo.EntityFrameworkCore.MySql.Tests (2)
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)
862Assert.Throws<InvalidOperationException>(() => context.Response.Headers.Append("Custom你好Name", "Custom Value"));
864Assert.Throws<InvalidOperationException>(() => context.Response.Headers.Append("CustomName", "Custom 你好 Value"));
865Assert.Throws<InvalidOperationException>(() => context.Response.Headers.Append("CustomName", "Custom \r Value"));
896Assert.Throws<InvalidOperationException>(() => context.Response.Headers.Append("Custom你好Name", "Custom Value"));
897Assert.Throws<InvalidOperationException>(() => context.Response.Headers.Append("CustomName", "Custom \r Value"));
1013Assert.Throws<InvalidOperationException>(() => context.Response.AppendTrailer("Custom你好Name", "Custom Value"));
1014Assert.Throws<InvalidOperationException>(() => context.Response.AppendTrailer("CustomName", "Custom 你好 Value"));
1015Assert.Throws<InvalidOperationException>(() => context.Response.AppendTrailer("CustomName", "Custom \r Value"));
1044Assert.Throws<InvalidOperationException>(() => context.Response.AppendTrailer("Custom你好Name", "Custom Value"));
1045Assert.Throws<InvalidOperationException>(() => context.Response.AppendTrailer("CustomName", "Custom \r Value"));
1662var ex = Assert.Throws<InvalidOperationException>(() => context.Response.BodyWriter.Complete());
Interop.FunctionalTests (2)
Microsoft.Analyzers.Local.Tests (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 (5)
Microsoft.AspNetCore.Components.Tests (64)
Microsoft.AspNetCore.Components.Web.Tests (6)
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 (5)
Microsoft.AspNetCore.Diagnostics.HealthChecks.Tests (2)
Microsoft.AspNetCore.Diagnostics.Tests (1)
Microsoft.AspNetCore.Hosting.Tests (7)
Microsoft.AspNetCore.Http.Abstractions.Tests (3)
Microsoft.AspNetCore.Http.Extensions.Tests (2)
Microsoft.AspNetCore.Http.Tests (6)
Microsoft.AspNetCore.HttpsPolicy.Tests (2)
Microsoft.AspNetCore.Identity.Test (2)
Microsoft.AspNetCore.InternalTesting.Tests (2)
Microsoft.AspNetCore.JsonPatch.Tests (26)
Microsoft.AspNetCore.Mvc.Abstractions.Test (5)
Microsoft.AspNetCore.Mvc.Core.Test (5)
Microsoft.AspNetCore.Mvc.Formatters.Xml.Test (3)
Microsoft.AspNetCore.Mvc.Localization.Test (1)
Microsoft.AspNetCore.Mvc.Razor.Test (4)
Microsoft.AspNetCore.Mvc.TagHelpers.Test (4)
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (9)
Microsoft.AspNetCore.Owin.Tests (3)
Microsoft.AspNetCore.Razor.Runtime.Test (1)
Microsoft.AspNetCore.RequestDecompression.Tests (3)
Microsoft.AspNetCore.Routing.Tests (12)
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (14)
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (65)
Microsoft.AspNetCore.Server.Kestrel.Tests (13)
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 (2)
Microsoft.AspNetCore.SpaServices.Extensions.Tests (1)
Microsoft.AspNetCore.Tests (2)
Microsoft.AspNetCore.WebUtilities.Tests (11)
Microsoft.Build.CommandLine.UnitTests (1)
Microsoft.Build.Engine.OM.UnitTests (236)
Microsoft.Build.Engine.UnitTests (230)
Microsoft.Build.Tasks.UnitTests (16)
Microsoft.Build.UnitTests.Shared (1)
Microsoft.Build.Utilities.UnitTests (1)
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (5)
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 (97)
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)
220Assert.Throws<ArgumentOutOfRangeException>(() => newText.CopyTo(-1, destination, 0, 2));
221Assert.Throws<ArgumentOutOfRangeException>(() => newText.CopyTo(0, destination, -1, 2));
222Assert.Throws<ArgumentOutOfRangeException>(() => newText.CopyTo(0, destination, 0, -1));
223Assert.Throws<ArgumentNullException>(() => newText.CopyTo(0, null, 0, 2));
224Assert.Throws<ArgumentOutOfRangeException>(() => newText.CopyTo(newText.Length - 1, destination, 0, 2));
225Assert.Throws<ArgumentOutOfRangeException>(() => newText.CopyTo(0, destination, destination.Length - 1, 2));
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (11)
CodeGen\CodeGenTuples.vb (11)
6866Assert.Throws(Of ArgumentNullException)(Sub() comp.CreateTupleTypeSymbol(underlyingType:=Nothing, elementNames:=Nothing))
7220Assert.Throws(Of ArgumentNullException)(Sub() comp.CreateTupleTypeSymbol(elementTypes:=Nothing, elementNames:=Nothing))
7223Assert.Throws(Of ArgumentException)(Sub() comp.CreateTupleTypeSymbol(elementTypes:=ImmutableArray(Of ITypeSymbol).Empty, elementNames:=Nothing))
7224Assert.Throws(Of ArgumentException)(Sub() comp.CreateTupleTypeSymbol(elementTypes:=ImmutableArray.Create(intType), elementNames:=Nothing))
7227Assert.Throws(Of ArgumentException)(Sub() comp.CreateTupleTypeSymbol(elementTypes:=ImmutableArray.Create(intType, intType), elementNames:=ImmutableArray.Create("Item1")))
7230Assert.Throws(Of ArgumentNullException)(Sub() comp.CreateTupleTypeSymbol(elementTypes:=ImmutableArray.Create(intType, Nothing), elementNames:=Nothing))
7483Assert.Throws(Of ArgumentException)(Sub() comp.CreateTupleTypeSymbol(ImmutableArray.Create(stringType, csType), Nothing))
8940Assert.Throws(Of ArgumentNullException)(Sub() comp.CreateErrorTypeSymbol(Nothing, Nothing, 2))
8941Assert.Throws(Of ArgumentException)(Sub() comp.CreateErrorTypeSymbol(Nothing, "a", -1))
8944Assert.Throws(Of ArgumentNullException)(Sub() comp.CreateErrorNamespaceSymbol(Nothing, "a"))
14851Assert.Throws(Of ArgumentNullException)(Sub() Compilation.GetRequiredLanguageVersion(Nothing))
Microsoft.CodeAnalysis.VisualBasic.Scripting.UnitTests (7)
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (3)
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (2)
Microsoft.CodeAnalysis.Workspaces.UnitTests (6)
Microsoft.Data.Analysis.Tests (9)
Microsoft.DotNet.Build.Tasks.Workloads.Tests (1)
Microsoft.DotNet.RemoteExecutor.Tests (3)
Microsoft.DotNet.XUnitAssert.Tests (8)
Microsoft.Extensions.AI.Abstractions.Tests (11)
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 (8)
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 (4)
Microsoft.ML.AutoML.Tests (1)
Microsoft.ML.Tests (9)
Microsoft.Net.Http.Headers.Tests (17)
Microsoft.VisualBasic.IntegrationTests (1)
Microsoft.VisualBasic.Tests (20)
Microsoft\VisualBasic\MyServices\FileSystemProxyTests.cs (18)
73Assert.Throws<IOException>(() => _fileSystem.CopyDirectory(FullPathToSourceDirectory, FullPathToTargetDirectory));
98Assert.Throws<IOException>(() => _fileSystem.CopyDirectory(FullPathToSourceDirectory, FullPathToTargetDirectory, overwrite: false));
136Assert.Throws<IOException>(() => _fileSystem.CopyFile(testFileSource, testFileDest));
158Assert.Throws<IOException>(() => _fileSystem.CopyFile(testFileSource, testFileDest, overwrite: false));
226Assert.Throws<IOException>(() => _fileSystem.DeleteDirectory(FullPathToNewDirectory, DeleteDirectoryOption.ThrowIfDirectoryNonEmpty));
511Assert.Throws<IOException>(() => _fileSystem.MoveDirectory(FullPathToSourceDirectory, FullPathToTargetDirectory));
537Assert.Throws<IOException>(() => _fileSystem.MoveDirectory(FullPathToSourceDirectory, FullPathToTargetDirectory, overwrite: false));
586Assert.Throws<IOException>(() => _fileSystem.MoveFile(SourceFileNameWithPath, DestinationFileNameWithPath));
603Assert.Throws<IOException>(() => _fileSystem.MoveFile(SourceFileNameWithPath, DestinationFileNameWithPath, overwrite: false));
641Assert.Throws<DirectoryNotFoundException>(() => _fileSystem.RenameDirectory(Path.Combine(TestDirectory, "DoesNotExistDirectory"), "NewDirectory"));
645Assert.Throws<ArgumentNullException>(() => _fileSystem.RenameDirectory(OrigDirectoryWithPath, ""));
648Assert.Throws<ArgumentException>(() => _fileSystem.RenameDirectory(OrigDirectoryWithPath, DirectoryNameWithPath));
658Assert.Throws<IOException>(() => _fileSystem.RenameDirectory(NewFDirectoryPath, "OriginalDirectory"));
665Assert.Throws<FileNotFoundException>(() => _fileSystem.RenameFile(Path.Combine(TestDirectory, "DoesNotExistFile"), "NewFile"));
669Assert.Throws<ArgumentNullException>(() => _fileSystem.RenameFile(OrigFileWithPath, ""));
671Assert.Throws<ArgumentException>(() => _fileSystem.RenameFile(OrigFileWithPath, ExistingFileWithPath));
677Assert.Throws<IOException>(() => _fileSystem.RenameFile(NewFileWithPath, "NewFile"));
679Assert.Throws<IOException>(() => _fileSystem.RenameFile(NewFileWithPath, "NewFDirectory"));
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (2)
Security.TransportSecurity.IntegrationTests (6)
Shared.Tests (4)
Sockets.BindTests (5)
System.Drawing.Common.Tests (188)
mono\System.Drawing\BitmapTests.cs (8)
128Assert.Throws<InvalidOperationException>(() => bmp.SetPixel(0, 0, c));
137Assert.Throws<InvalidOperationException>(() => bmp.SetPixel(0, 0, c));
146Assert.Throws<InvalidOperationException>(() => bmp.SetPixel(0, 0, c));
1148public void SetResolution_Zero() => Assert.Throws<ArgumentException>(() => SetResolution(0.0f, 0.0f));
1151public void SetResolution_Negative_X() => Assert.Throws<ArgumentException>(() => SetResolution(-1.0f, 1.0f));
1154public void SetResolution_Negative_Y() => Assert.Throws<ArgumentException>(() => SetResolution(1.0f, -1.0f));
1163public void SetResolution_NaN() => Assert.Throws<ArgumentException>(() => SetResolution(float.NaN, float.NaN));
1166public void SetResolution_NegativeInfinity() => Assert.Throws<ArgumentException>(() => SetResolution(float.NegativeInfinity, float.NegativeInfinity));
mono\System.Drawing\GraphicsTests.cs (57)
437Assert.Throws<ArgumentException>(() => g.MultiplyTransform(matrix));
659Assert.Throws<ArgumentException>(() => g.ScaleTransform(0, 1));
667Assert.Throws<ArgumentException>(() => g.ScaleTransform(1, 0));
739Assert.Throws<ArgumentException>(() => g.DrawCurve(Pens.Black, s_tooSmallCurve, 0, 2, 0.5f));
773Assert.Throws<ArgumentException>(() => g.DrawCurve(Pens.Black, s_smallCurveF, 0, 0));
781Assert.Throws<ArgumentException>(() => g.DrawCurve(Pens.Black, s_smallCurveF, 0, -1));
790Assert.Throws<ArgumentException>(() => g.DrawCurve(Pens.Black, s_smallCurveF, 1, 2));
1057Assert.Throws<ArgumentException>(() => BeginContainer_GraphicsUnit(GraphicsUnit.Display));
1073Assert.Throws<ArgumentException>(() => BeginContainer_GraphicsUnit(GraphicsUnit.World));
1079Assert.Throws<ArgumentException>(() => BeginContainer_GraphicsUnit((GraphicsUnit)int.MinValue));
1087Assert.Throws<ArgumentNullException>(() => g.EndContainer(null));
1135Assert.Throws<NullReferenceException>(() => g.Restore(null));
1143Assert.Throws<ArgumentNullException>(() => g.FillRectangles(null, new Rectangle[1]));
1151Assert.Throws<ArgumentNullException>(() => g.FillRectangles(Brushes.Red, (Rectangle[])null));
1159Assert.Throws<ArgumentException>(() => g.FillRectangles(Brushes.Red, Array.Empty<Rectangle>()));
1167Assert.Throws<ArgumentNullException>(() => g.FillRectangles(null, new RectangleF[1]));
1175Assert.Throws<ArgumentNullException>(() => g.FillRectangles(Brushes.Red, (RectangleF[])null));
1183Assert.Throws<ArgumentException>(() => g.FillRectangles(Brushes.Red, Array.Empty<RectangleF>()));
1943Assert.Throws<ArgumentException>(() => MeasureCharacterRanges(text, text.Length, 1, useSpan));
1952Assert.Throws<ArgumentException>(() => MeasureCharacterRanges(text, 0, text.Length + 1, useSpan));
2147Assert.Throws<ArgumentException>(() => g.ReleaseHdcInternal(IntPtr.Zero));
2157Assert.Throws<ArgumentException>(() => g.ReleaseHdcInternal(hdc));
2177Assert.Throws<ArgumentException>(g.ReleaseHdc);
2187Assert.Throws<ArgumentException>(g.ReleaseHdc);
2337Assert.Throws<ArgumentNullException>(() => g.DrawIcon(null, new Rectangle(0, 0, 32, 32)));
2361Assert.Throws<ArgumentNullException>(() => g.DrawIcon(null, 4, 2));
2378Assert.Throws<ArgumentNullException>(() => g.DrawIconUnstretched(null, new Rectangle(0, 0, 40, 20)));
2402Assert.Throws<ArgumentNullException>(() => g.DrawImage(null, new RectangleF(0, 0, 0, 0)));
2421Assert.Throws<ArgumentNullException>(() => g.DrawImage(null, new PointF(0, 0)));
2437Assert.Throws<ArgumentNullException>(() => g.DrawImage(null, Array.Empty<PointF>()));
2445Assert.Throws<ArgumentNullException>(() => g.DrawImage(bmp, (PointF[])null));
2453Assert.Throws<ArgumentException>(() => g.DrawImage(bmp, Array.Empty<PointF>()));
2472Assert.Throws<ArgumentNullException>(() => g.DrawImage(null, new Rectangle(0, 0, 0, 0)));
2495Assert.Throws<ArgumentNullException>(() => g.DrawImage(null, new Point(0, 0)));
2511Assert.Throws<ArgumentNullException>(() => g.DrawImage(null, Array.Empty<Point>()));
2519Assert.Throws<ArgumentNullException>(() => g.DrawImage(bmp, (Point[])null));
2527Assert.Throws<ArgumentException>(() => g.DrawImage(bmp, Array.Empty<Point>()));
2543Assert.Throws<ArgumentNullException>(() => g.DrawImage(null, int.MaxValue, int.MinValue));
2551Assert.Throws<OverflowException>(() => g.DrawImage(bmp, int.MaxValue, int.MinValue));
2567Assert.Throws<ArgumentNullException>(() => g.DrawImage(null, float.MaxValue, float.MinValue));
2575Assert.Throws<OverflowException>(() => g.DrawImage(bmp, float.MaxValue, float.MinValue));
2591Assert.Throws<ArgumentNullException>(() => g.DrawImage(null, default(Rectangle), default, GraphicsUnit.Display));
2605Assert.Throws<ArgumentException>(() => DrawImage_ImageRectangleRectangleGraphicsUnit(GraphicsUnit.Display));
2618Assert.Throws<ArgumentException>(() => DrawImage_ImageRectangleRectangleGraphicsUnit(GraphicsUnit.World));
2628Assert.Throws<ArgumentNullException>(() => g.DrawImage(null, pts, r, GraphicsUnit.Pixel));
2642Assert.Throws<ArgumentNullException>(() => DrawImage_ImagePointRectangleGraphicsUnit(null));
2686Assert.Throws<ArgumentNullException>(() => g.DrawImage(null, pts, r, GraphicsUnit.Pixel));
2700Assert.Throws<ArgumentNullException>(() => DrawImage_ImagePointFRectangleGraphicsUnit(null));
2765Assert.Throws<ArgumentNullException>(() => g.DrawImageUnscaled(null, new Point(0, 0)));
2781Assert.Throws<ArgumentNullException>(() => g.DrawImageUnscaled(null, new Rectangle(0, 0, -1, -1)));
2797Assert.Throws<ArgumentNullException>(() => g.DrawImageUnscaled(null, 0, 0));
2813Assert.Throws<ArgumentNullException>(() => g.DrawImageUnscaled(null, 0, 0, -1, -1));
2829Assert.Throws<ArgumentNullException>(() => g.DrawImageUnscaledAndClipped(null, new Rectangle(0, 0, 0, 0)));
2857Assert.Throws<ArgumentNullException>(() => g.DrawPath(null, path));
2865Assert.Throws<ArgumentNullException>(() => g.DrawPath(Pens.Black, null));
2899Assert.Throws<ArgumentNullException>(() => g.FillPath(null, path));
2907Assert.Throws<ArgumentNullException>(() => g.FillPath(Brushes.Black, null));
System\Drawing\Graphics_DrawBezierTests.cs (5)
92Assert.Throws<InvalidOperationException>(() => graphics.DrawBezier(pen, 1, 2, 3, 4, 5, 6, 7, 8));
93Assert.Throws<InvalidOperationException>(() => graphics.DrawBezier(pen, Point.Empty, Point.Empty, Point.Empty, Point.Empty));
94Assert.Throws<InvalidOperationException>(() => graphics.DrawBezier(pen, PointF.Empty, PointF.Empty, PointF.Empty, PointF.Empty));
166Assert.Throws<InvalidOperationException>(() => graphics.DrawBeziers(pen, new Point[2]));
167Assert.Throws<InvalidOperationException>(() => graphics.DrawBeziers(pen, new PointF[2]));
System\Drawing\Graphics_DrawLineTests.cs (6)
72Assert.Throws<InvalidOperationException>(() => graphics.DrawLine(pen, Point.Empty, Point.Empty));
73Assert.Throws<InvalidOperationException>(() => graphics.DrawLine(pen, 0, 0, 0, 0));
74Assert.Throws<InvalidOperationException>(() => graphics.DrawLine(pen, PointF.Empty, PointF.Empty));
75Assert.Throws<InvalidOperationException>(() => graphics.DrawLine(pen, 0f, 0f, 0f, 0f));
149Assert.Throws<InvalidOperationException>(() => graphics.DrawLines(pen, new Point[2]));
150Assert.Throws<InvalidOperationException>(() => graphics.DrawLines(pen, new PointF[2]));
System\Drawing\GraphicsTests.Core.cs (2)
102Assert.Throws<InvalidOperationException>(() => graphics.DrawRectangle(pen, new RectangleF(0f, 0f, 1f, 1f)));
178Assert.Throws<InvalidOperationException>(() => graphics.FillPie(brush, new RectangleF(0, 0, 1, 1), 0, 90));
System\Drawing\GraphicsTests.cs (54)
559Assert.Throws<InvalidOperationException>(graphics.Flush);
560Assert.Throws<InvalidOperationException>(() => graphics.Flush(FlushIntention.Sync));
1166Assert.Throws<InvalidOperationException>(graphics.ResetTransform);
1270Assert.Throws<InvalidOperationException>(() => graphics.MultiplyTransform(matrix));
1271Assert.Throws<InvalidOperationException>(() => graphics.MultiplyTransform(matrix, MatrixOrder.Append));
1346Assert.Throws<InvalidOperationException>(() => graphics.TranslateTransform(0, 0));
1347Assert.Throws<InvalidOperationException>(() => graphics.TranslateTransform(0, 0, MatrixOrder.Append));
1427Assert.Throws<InvalidOperationException>(() => graphics.ScaleTransform(0, 0));
1428Assert.Throws<InvalidOperationException>(() => graphics.ScaleTransform(0, 0, MatrixOrder.Append));
1503Assert.Throws<InvalidOperationException>(() => graphics.RotateTransform(0));
1504Assert.Throws<InvalidOperationException>(() => graphics.RotateTransform(0, MatrixOrder.Append));
1660Assert.Throws<InvalidOperationException>(() => graphics.CopyFromScreen(0, 0, 0, 0, Size.Empty));
1661Assert.Throws<InvalidOperationException>(() => graphics.CopyFromScreen(0, 0, 0, 0, Size.Empty, CopyPixelOperation.DestinationInvert));
1662Assert.Throws<InvalidOperationException>(() => graphics.CopyFromScreen(Point.Empty, Point.Empty, Size.Empty));
1663Assert.Throws<InvalidOperationException>(() => graphics.CopyFromScreen(Point.Empty, Point.Empty, Size.Empty, CopyPixelOperation.DestinationInvert));
2013Assert.Throws<InvalidOperationException>(() => graphics.DrawArc(pen, new Rectangle(0, 0, 1, 1), 0, 90));
2014Assert.Throws<InvalidOperationException>(() => graphics.DrawArc(pen, 0, 0, 1, 1, 0, 90));
2015Assert.Throws<InvalidOperationException>(() => graphics.DrawArc(pen, new RectangleF(0, 0, 1, 1), 0, 90));
2016Assert.Throws<InvalidOperationException>(() => graphics.DrawArc(pen, 0f, 0f, 1f, 1f, 0, 90));
2070Assert.Throws<InvalidOperationException>(() => graphics.DrawRectangle(pen, new Rectangle(0, 0, 1, 1)));
2071Assert.Throws<InvalidOperationException>(() => graphics.DrawRectangle(pen, 0, 0, 1, 1));
2072Assert.Throws<InvalidOperationException>(() => graphics.DrawRectangle(pen, 0f, 0f, 1f, 1f));
2143Assert.Throws<InvalidOperationException>(() => graphics.DrawRectangles(pen, new Rectangle[2]));
2144Assert.Throws<InvalidOperationException>(() => graphics.DrawRectangles(pen, new RectangleF[2]));
2198Assert.Throws<InvalidOperationException>(() => graphics.DrawEllipse(pen, new Rectangle(0, 0, 1, 1)));
2199Assert.Throws<InvalidOperationException>(() => graphics.DrawEllipse(pen, 0, 0, 1, 1));
2200Assert.Throws<InvalidOperationException>(() => graphics.DrawEllipse(pen, new RectangleF(0, 0, 1, 1)));
2201Assert.Throws<InvalidOperationException>(() => graphics.DrawEllipse(pen, 0f, 0f, 1f, 1f));
2281Assert.Throws<InvalidOperationException>(() => graphics.DrawPie(pen, new Rectangle(0, 0, 1, 1), 0, 90));
2282Assert.Throws<InvalidOperationException>(() => graphics.DrawPie(pen, 0, 0, 1, 1, 0, 90));
2283Assert.Throws<InvalidOperationException>(() => graphics.DrawPie(pen, new RectangleF(0, 0, 1, 1), 0, 90));
2284Assert.Throws<InvalidOperationException>(() => graphics.DrawPie(pen, 0f, 0f, 1f, 1f, 0, 90));
2358Assert.Throws<InvalidOperationException>(() => graphics.DrawPolygon(pen, new Point[2]));
2359Assert.Throws<InvalidOperationException>(() => graphics.DrawPolygon(pen, new PointF[2]));
2431Assert.Throws<InvalidOperationException>(() => graphics.DrawPath(pen, graphicsPath));
2539Assert.Throws<InvalidOperationException>(() => graphics.DrawCurve(pen, new Point[2]));
2540Assert.Throws<InvalidOperationException>(() => graphics.DrawCurve(pen, new PointF[2]));
2541Assert.Throws<InvalidOperationException>(() => graphics.DrawCurve(pen, new Point[2], 1));
2542Assert.Throws<InvalidOperationException>(() => graphics.DrawCurve(pen, new PointF[2], 1));
2543Assert.Throws<InvalidOperationException>(() => graphics.DrawCurve(pen, new PointF[2], 0, 2));
2544Assert.Throws<InvalidOperationException>(() => graphics.DrawCurve(pen, new Point[2], 0, 2, 1));
2545Assert.Throws<InvalidOperationException>(() => graphics.DrawCurve(pen, new PointF[2], 0, 2, 1));
2631Assert.Throws<InvalidOperationException>(() => graphics.DrawClosedCurve(pen, new Point[3]));
2632Assert.Throws<InvalidOperationException>(() => graphics.DrawClosedCurve(pen, new Point[3], 1, FillMode.Winding));
2633Assert.Throws<InvalidOperationException>(() => graphics.DrawClosedCurve(pen, new PointF[3]));
2634Assert.Throws<InvalidOperationException>(() => graphics.DrawClosedCurve(pen, new PointF[3], 1, FillMode.Winding));
2710Assert.Throws<InvalidOperationException>(() => graphics.FillPie(brush, new Rectangle(0, 0, 1, 1), 0, 90));
2711Assert.Throws<InvalidOperationException>(() => graphics.FillPie(brush, 0, 0, 1, 1, 0, 90));
2712Assert.Throws<InvalidOperationException>(() => graphics.FillPie(brush, 0f, 0f, 1f, 1f, 0, 90));
2760Assert.Throws<InvalidOperationException>(() => graphics.Clear(Color.Red));
2867Assert.Throws<ArgumentNullException>(() => graphics.DrawCachedBitmap(null!, 0, 0));
2878Assert.Throws<ArgumentException>(() => graphics.DrawCachedBitmap(cachedBitmap, 0, 0));
2910Assert.Throws<InvalidOperationException>(() => graphics.DrawCachedBitmap(cachedBitmap, 0, 0));
2935Assert.Throws<InvalidOperationException>(() => graphics2.DrawCachedBitmap(cachedBitmap, 0, 0));
System.ServiceModel.Http.Tests (1)
System.ServiceModel.NetTcp.Tests (2)
System.ServiceModel.Primitives.Tests (28)
System.Windows.Forms.Design.Tests (76)
System.Windows.Forms.Primitives.TestUtilities (7)
System.Windows.Forms.Tests (393)
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)