82 references to ThrowsAny
Microsoft.Analyzers.Local.Tests (4)
Json\JsonArrayTest.cs (4)
46Assert.ThrowsAny<ArgumentOutOfRangeException>(() => obj[-1] = 0); 47Assert.ThrowsAny<ArgumentException>(() => obj[1] = 0); 80Assert.ThrowsAny<ArgumentOutOfRangeException>(() => obj.Remove(-1)); 81Assert.ThrowsAny<ArgumentException>(() => obj.Remove(obj.Count));
Microsoft.AspNetCore.Grpc.JsonTranscoding.Tests (2)
ConverterTests\JsonConverterReadTests.cs (2)
682var ex = Assert.ThrowsAny<Exception>(() => JsonSerializer.Deserialize<TValue>(value, jsonSerializerOptions)); 691ex = Assert.ThrowsAny<Exception>(() => formatter.Parse<TValue>(value));
Microsoft.AspNetCore.Routing.Tests (1)
Template\TemplateSegmentTest.cs (1)
15var actual = Assert.ThrowsAny<ArgumentNullException>(() => new TemplateSegment(other));
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (1)
ServerTests.cs (1)
330Assert.ThrowsAny<IOException>(() => client.GetStream().Read(new byte[10], 0, 10));
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (9)
Http1\Http1ConnectionTests.cs (9)
80var exception = Assert.ThrowsAny<Http.BadHttpRequestException>(() => TakeMessageHeaders(readableBuffer, trailers: false, out _consumed, out _examined)); 97var exception = Assert.ThrowsAny<Http.BadHttpRequestException>(() => TakeMessageHeaders(readableBuffer, trailers: false, out _consumed, out _examined)); 465var exception = Assert.ThrowsAny<Http.BadHttpRequestException>(() => TakeStartLine(readableBuffer, out _consumed, out _examined)); 479var exception = Assert.ThrowsAny<Http.BadHttpRequestException>(() => 493var exception = Assert.ThrowsAny<Http.BadHttpRequestException>(() => 510var exception = Assert.ThrowsAny<Http.BadHttpRequestException>(() => 527var exception = Assert.ThrowsAny<Http.BadHttpRequestException>(() => 544var exception = Assert.ThrowsAny<Http.BadHttpRequestException>(() => 848var exception = Assert.ThrowsAny<Http.BadHttpRequestException>(() =>
Microsoft.AspNetCore.Tests (1)
WebApplicationTests.cs (1)
1794Assert.ThrowsAny<Exception>(() => builder.Build());
Microsoft.Build.Engine.OM.UnitTests (16)
ObjectModelRemoting\LinkedConstructionModify_Tests.cs (16)
339Assert.ThrowsAny<InvalidOperationException>(() => newOutputProp.View.ItemType = "foo"); 342Assert.ThrowsAny<InvalidOperationException>(() => newOutputItem.View.PropertyName = "foo"); 381Assert.ThrowsAny<InvalidOperationException>(() => choose.View.Condition = "ccc"); 496Assert.ThrowsAny<InvalidOperationException>(() => usingTaskFile.View.AssemblyName = "xxx"); 514Assert.ThrowsAny<InvalidOperationException>(() => usingTaskName.View.AssemblyFile = "xxx"); 653Assert.ThrowsAny<InvalidOperationException>(() => item.View.Remove = "xx"); // Include/Update/Remove are exclusive 654Assert.ThrowsAny<InvalidOperationException>(() => item.View.Update = "xx"); // Include/Update/Remove are exclusive 657Assert.ThrowsAny<InvalidOperationException>(() => item.View.Include = "xx"); // Include/Update/Remove are exclusive 658Assert.ThrowsAny<InvalidOperationException>(() => item.View.Update = "xx"); // Include/Update/Remove are exclusive 661Assert.ThrowsAny<InvalidOperationException>(() => item.View.Include = "xx"); // Include/Update/Remove are exclusive 662Assert.ThrowsAny<InvalidOperationException>(() => item.View.Remove = "xx"); // Include/Update/Remove are exclusive 665Assert.ThrowsAny<InvalidOperationException>(() => item.View.KeepMetadata = "xx"); 666Assert.ThrowsAny<InvalidOperationException>(() => item.View.KeepDuplicates = "xx"); 667Assert.ThrowsAny<InvalidOperationException>(() => item.View.RemoveMetadata = "xx"); 683Assert.ThrowsAny<InvalidOperationException>(() => itemInTargt.View.RemoveMetadata = "xx"); // RemoveMetadata/KeepDuplicate exclusive 686Assert.ThrowsAny<InvalidOperationException>(() => itemInTargt.View.KeepMetadata = "xx"); // RemoveMetadata/KeepDuplicate exclusive
Microsoft.Build.Engine.UnitTests (2)
Collections\CopyOnWritePropertyDictionary_Tests.cs (2)
64Assert.ThrowsAny<Exception>(() => dic["a"] = null!); 67Assert.ThrowsAny<Exception>(() => dic["a"] = b);
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (1)
IOperation\IOperationTests_IBranchOperation.Extensions.cs (1)
23Assert.ThrowsAny<ArgumentNullException>(() => OperationExtensions.GetCorrespondingOperation(null));
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (2)
DocumentationComments\CrefTests.cs (2)
1571Assert.ThrowsAny<Exception>(() => p.GetEffectiveBaseClass(null)); 1572Assert.ThrowsAny<Exception>(() => p.GetDeducedBaseType(null));
Microsoft.CodeAnalysis.UnitTests (1)
AnalyzerAssemblyLoaderTests.cs (1)
1208var ex = Assert.ThrowsAny<Exception>(() => analyzer.GetType().GetMethod("Method")!.Invoke(analyzer, new object[] { sb }));
Microsoft.CodeAnalysis.Workspaces.UnitTests (1)
SolutionTests\SolutionTests.cs (1)
2527Assert.ThrowsAny<InvalidOperationException>(() => solution.AddDocuments(ImmutableArray.Create(documentInfo1, documentInfo2)));
Microsoft.Data.Analysis.Tests (8)
ArrowIntegrationTests.cs (1)
224Assert.ThrowsAny<ArgumentException>(() => DataFrame.FromArrowRecordBatch(originalBatch));
DataFrame.IOTests.cs (3)
406Assert.ThrowsAny<ArgumentException>(() => DataFrame.LoadCsv(GetStream(data), 410Assert.ThrowsAny<ArgumentException>(() => DataFrame.LoadCsvFromString(data, 699var exp = Assert.ThrowsAny<ArgumentException>(() => DataFrame.LoadCsvFromString(data, header: true));
DataFrameTests.BinaryOperations.cs (4)
431Assert.ThrowsAny<ArgumentException>(() => column.Add(5.5, inPlace: true)); 432Assert.ThrowsAny<ArgumentException>(() => column.ReverseAdd(5.5, inPlace: true)); 434Assert.ThrowsAny<ArgumentException>(() => column.Add(str, inPlace: true)); 435Assert.ThrowsAny<ArgumentException>(() => column.ReverseAdd(str, inPlace: true));
Microsoft.DotNet.XUnitAssert.Tests (6)
ExceptionAssertsTests.cs (6)
561 Assert.Throws<ArgumentNullException>("testCode", () => Assert.ThrowsAny<ArgumentException>(default(Func<object>)!)); 569 var ex = Record.Exception(() => Assert.ThrowsAny<Exception>(testCode)); 580 var ex = Record.Exception(() => Assert.ThrowsAny<ArgumentException>(testCode)); 596 Assert.ThrowsAny<ArgumentException>(testCode); 605 var ex = Record.Exception(() => Assert.ThrowsAny<ArgumentException>(testCode)); 622 Assert.ThrowsAny<ArgumentException>(testCode);
System.Drawing.Common.Tests (24)
System\Drawing\Drawing2D\GraphicsPathTests.cs (1)
132Assert.ThrowsAny<ArgumentException>(() => gp.FillMode = fillMode);
System\Drawing\Drawing2D\LinearGradientBrushTests.cs (3)
228Assert.ThrowsAny<ArgumentException>(() => new LinearGradientBrush(new Rectangle(1, 2, 3, 4), Color.Empty, Color.Empty, linearGradientMode)); 229Assert.ThrowsAny<ArgumentException>(() => new LinearGradientBrush(new RectangleF(1, 2, 3, 4), Color.Empty, Color.Empty, linearGradientMode)); 616Assert.ThrowsAny<ArgumentException>(() => brush.WrapMode = wrapMode);
System\Drawing\Drawing2D\PathGradientBrushTests.cs (3)
87Assert.ThrowsAny<ArgumentException>(() => 90Assert.ThrowsAny<ArgumentException>(() => 937Assert.ThrowsAny<ArgumentException>(() => brush.WrapMode = (WrapMode)int.MinValue);
System\Drawing\Imaging\BitmapDataTests.cs (1)
121Assert.ThrowsAny<ArgumentException>(() => bd.PixelFormat = (PixelFormat)(-1));
System\Drawing\PenTests.cs (6)
135Assert.ThrowsAny<ArgumentException>(() => pen.Alignment = alignment); 487Assert.ThrowsAny<ArgumentException>(() => pen.DashCap = dashCap); 627Assert.ThrowsAny<ArgumentException>(() => pen.DashStyle = dashStyle); 681Assert.ThrowsAny<ArgumentException>(() => pen.EndCap = lineCap); 715Assert.ThrowsAny<ArgumentException>(() => pen.LineJoin = lineJoin); 1045Assert.ThrowsAny<ArgumentException>(() => pen.StartCap = lineCap);
System\Drawing\Printing\PrinterSettingsTests.cs (2)
125Assert.ThrowsAny<ArgumentException>(() => printerSettings.Duplex = duplex); 326Assert.ThrowsAny<ArgumentException>(() => printerSettings.PrintRange = printRange);
System\Drawing\StringFormatTests.cs (4)
253Assert.ThrowsAny<ArgumentException>(() => format.Alignment = alignment); 320Assert.ThrowsAny<ArgumentException>(() => format.LineAlignment = alignment); 349Assert.ThrowsAny<ArgumentException>(() => format.HotkeyPrefix = prefix); 376Assert.ThrowsAny<ArgumentException>(() => format.Trimming = trimming);
System\Drawing\TextureBrushTests.cs (4)
273Assert.ThrowsAny<ArgumentException>(() => new TextureBrush(image, wrapMode)); 274Assert.ThrowsAny<ArgumentException>(() => new TextureBrush(image, wrapMode, RectangleF.Empty)); 275Assert.ThrowsAny<ArgumentException>(() => new TextureBrush(image, wrapMode, Rectangle.Empty)); 708Assert.ThrowsAny<ArgumentException>(() => brush.WrapMode = wrapMode);
System.Windows.Forms.Tests (3)
System\Windows\Forms\InputLanguageTests.cs (1)
171Assert.ThrowsAny<ArgumentException>(() => language.Culture);
System\Windows\Forms\PictureBoxTests.cs (2)
793Assert.ThrowsAny<Exception>(() => pictureBox.ImageLocation = value); 798Assert.ThrowsAny<Exception>(() => pictureBox.ImageLocation = value);