54 references to ThrowsAny
Microsoft.AspNetCore.DataProtection.Tests (1)
TypeForwardingActivatorTests.cs (1)
38var exception = Assert.ThrowsAny<Exception>(() => activator.CreateInstance<object>(name));
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.Server.Kestrel.Tests (1)
KestrelConfigurationLoaderTests.cs (1)
418Assert.ThrowsAny<CryptographicException>(() => serverOptions.ConfigurationLoader.Reload());
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.UnitTests (1)
AnalyzerAssemblyLoaderTests.cs (1)
1385var ex = Assert.ThrowsAny<Exception>(() => analyzer.GetType().GetMethod("Method")!.Invoke(analyzer, new object[] { sb }));
Microsoft.CodeAnalysis.Workspaces.UnitTests (1)
SolutionTests\SolutionTests.cs (1)
2694Assert.ThrowsAny<InvalidOperationException>(() => solution.AddDocuments(ImmutableArray.Create(documentInfo1, documentInfo2)));
Microsoft.Data.Analysis.Tests (8)
ArrowIntegrationTests.cs (1)
235Assert.ThrowsAny<ArgumentException>(() => DataFrame.FromArrowRecordBatch(originalBatch));
DataFrame.IOTests.cs (3)
432Assert.ThrowsAny<ArgumentException>(() => DataFrame.LoadCsv(GetStream(data), 436Assert.ThrowsAny<ArgumentException>(() => DataFrame.LoadCsvFromString(data, 725var exp = Assert.ThrowsAny<ArgumentException>(() => DataFrame.LoadCsvFromString(data, header: true));
DataFrameTests.BinaryOperations.cs (4)
437Assert.ThrowsAny<ArgumentException>(() => column.Add(5.5, inPlace: true)); 438Assert.ThrowsAny<ArgumentException>(() => column.ReverseAdd(5.5, inPlace: true)); 440Assert.ThrowsAny<ArgumentException>(() => column.Add(str, inPlace: true)); 441Assert.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);
Microsoft.JSInterop.Tests (3)
Infrastructure\DotNetDispatcherTest.cs (3)
795Assert.ThrowsAny<JsonException>(() => DotNetDispatcher.ParseArguments(new TestJSRuntime(), "SomeMethod", arguments, new[] { typeof(string) })); 804Assert.ThrowsAny<JsonException>(() => DotNetDispatcher.ParseArguments(new TestJSRuntime(), "SomeMethod", arguments, new[] { typeof(string) })); 813Assert.ThrowsAny<JsonException>(() => DotNetDispatcher.ParseArguments(new TestJSRuntime(), "SomeMethod", arguments, new[] { typeof(string) }));