45 references to ThrowsAny
Analyzer.Utilities.UnitTests (6)
Lightup\LightupHelpersTests.cs (6)
37Assert.ThrowsAny<NotSupportedException>(() => withPropertyAccessor(SyntaxFactory.AccessorList(), new object())); 56Assert.ThrowsAny<NotSupportedException>(() => withPropertyAccessor(new EmptySymbol(), new object())); 78Assert.ThrowsAny<InvalidOperationException>(() => LightupHelpers.CreateSyntaxPropertyAccessor<MethodDeclarationSyntax, BlockSyntax?>(typeof(BaseMethodDeclarationSyntax), nameof(BaseMethodDeclarationSyntax.Body), fallbackResult: null)); 82Assert.ThrowsAny<InvalidOperationException>(() => LightupHelpers.CreateSyntaxPropertyAccessor<MethodDeclarationSyntax, BlockSyntax?>(typeof(MethodDeclarationSyntax), nameof(MethodDeclarationSyntax.ExpressionBody), fallbackResult: null)); 90Assert.ThrowsAny<InvalidOperationException>(() => LightupHelpers.CreateSyntaxWithPropertyAccessor<MethodDeclarationSyntax, BlockSyntax?>(typeof(BaseMethodDeclarationSyntax), nameof(BaseMethodDeclarationSyntax.Body), fallbackResult: null)); 94Assert.ThrowsAny<InvalidOperationException>(() => LightupHelpers.CreateSyntaxWithPropertyAccessor<MethodDeclarationSyntax, BlockSyntax?>(typeof(MethodDeclarationSyntax), nameof(MethodDeclarationSyntax.ExpressionBody), fallbackResult: null));
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.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 (2)
AnalyzerAssemblyLoaderTests.cs (2)
279Assert.ThrowsAny<Exception>(() => loader.LoadFromPath(path)); 1385var ex = Assert.ThrowsAny<Exception>(() => analyzer.GetType().GetMethod("Method")!.Invoke(analyzer, new object[] { sb }));
Microsoft.CodeAnalysis.Workspaces.UnitTests (1)
SolutionTests\SolutionTests.cs (1)
2697Assert.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) }));