204 references to ExceptionAssert
Microsoft.AspNetCore.Antiforgery.Test (1)
DefaultAntiforgeryTokenGeneratorTest.cs (1)
44ExceptionAssert.ThrowsArgument(
Microsoft.AspNetCore.Components.Endpoints.Tests (1)
EndpointHtmlRendererTest.cs (1)
633var ex = await ExceptionAssert.ThrowsArgumentAsync(
Microsoft.AspNetCore.Components.WebAssembly.Tests (1)
Hosting\RootComponentMappingTest.cs (1)
28ExceptionAssert.ThrowsArgument(
Microsoft.AspNetCore.CookiePolicy.Test (1)
CookieConsentTests.cs (1)
696ExceptionAssert.ThrowsArgument(
Microsoft.AspNetCore.Cors.Test (1)
CorsServiceTests.cs (1)
26ExceptionAssert.ThrowsArgument(
Microsoft.AspNetCore.Cryptography.Internal.Tests (1)
Cng\BCRYPT_KEY_LENGTHS_STRUCT_Tests.cs (1)
51ExceptionAssert.ThrowsArgumentOutOfRange(
Microsoft.AspNetCore.DataProtection.Abstractions.Tests (4)
DataProtectionCommonExtensionsTests.cs (4)
29ExceptionAssert.ThrowsArgument( 46ExceptionAssert.ThrowsArgument( 150ExceptionAssert.ThrowsArgument( 169ExceptionAssert.ThrowsArgument(
Microsoft.AspNetCore.DataProtection.Tests (12)
KeyManagement\DeferredKeyTests.cs (2)
76ExceptionAssert.Throws<Exception>(() => key.Descriptor, "How exceptional."); 77ExceptionAssert.Throws<Exception>(() => key.Descriptor, "How exceptional.");
KeyManagement\KeyRingBasedDataProtectorTests.cs (2)
31ExceptionAssert.ThrowsArgumentNull(() => protector.Protect(plaintext: null), "plaintext"); 136ExceptionAssert.ThrowsArgumentNull(() => protector.Unprotect(protectedData: null), "protectedData");
KeyManagement\KeyRingProviderTests.cs (1)
744ExceptionAssert.Throws<Exception>(() => keyRingProvider.GetCurrentKeyRingCore(throwKeyRingTime, forceRefresh: true), "How exceptional."); // forceRefresh to wait for exception
RegistryPolicyResolverTests.cs (1)
64var ex = ExceptionAssert.Throws<InvalidOperationException>(() => RunTestWithRegValues(registryEntries));
SecretTests.cs (6)
14ExceptionAssert.ThrowsArgument( 91ExceptionAssert.ThrowsArgumentNull( 100ExceptionAssert.ThrowsArgumentOutOfRange( 204ExceptionAssert.ThrowsArgument( 229ExceptionAssert.ThrowsArgumentNull( 241ExceptionAssert.ThrowsArgument(
Microsoft.AspNetCore.Http.Abstractions.Tests (7)
HostStringTest.cs (1)
17ExceptionAssert.ThrowsArgumentOutOfRange(() => new HostString("localhost", port), "port", "The value must be greater than zero.");
PathStringTests.cs (1)
16ExceptionAssert.ThrowsArgument(() => new PathString("hello"), "value", "The path in 'value' must start with '/'.");
QueryStringTests.cs (1)
15ExceptionAssert.ThrowsArgument(() => new QueryString("hello"), "value", "The leading '?' must be included for a non-empty query.");
RouteValueDictionaryTests.cs (4)
163ExceptionAssert.ThrowsArgument( 180ExceptionAssert.ThrowsArgument( 901ExceptionAssert.ThrowsArgument(() => dict.Add("key", "value2"), "key", message); 922ExceptionAssert.ThrowsArgument(() => dict.Add("kEy", "value2"), "key", message);
Microsoft.AspNetCore.Http.Results.Tests (5)
AcceptedAtRouteOfTResultTests.cs (1)
117await ExceptionAssert.ThrowsAsync<InvalidOperationException>(() =>
AcceptedAtRouteResultTests.cs (1)
70await ExceptionAssert.ThrowsAsync<InvalidOperationException>(() =>
CreatedAtRouteOfTResultTests.cs (1)
86await ExceptionAssert.ThrowsAsync<InvalidOperationException>(
CreatedAtRouteResultTests.cs (1)
68await ExceptionAssert.ThrowsAsync<InvalidOperationException>(
RedirectToRouteResultTests.cs (1)
24await ExceptionAssert.ThrowsAsync<InvalidOperationException>(
Microsoft.AspNetCore.InternalTesting.Tests (2)
ExceptionAssertTest.cs (2)
22ExceptionAssert.ThrowsArgumentNullOrEmptyString(action, "foo"); 36ExceptionAssert.ThrowsArgumentOutOfRange(action, "foo", "exception message.", 10);
Microsoft.AspNetCore.Mvc.Core.Test (36)
AcceptedAtActionResultTests.cs (1)
192await ExceptionAssert.ThrowsAsync<InvalidOperationException>(() =>
AcceptedAtRouteResultTests.cs (1)
140await ExceptionAssert.ThrowsAsync<InvalidOperationException>(() =>
ApiConventionMethodAttributeTest.cs (5)
21ExceptionAssert.ThrowsArgument( 43ExceptionAssert.ThrowsArgument( 95ExceptionAssert.ThrowsArgument( 112ExceptionAssert.ThrowsArgument( 129ExceptionAssert.ThrowsArgument(
ApiConventionTypeAttributeTest.cs (3)
22ExceptionAssert.ThrowsArgument( 43ExceptionAssert.ThrowsArgument( 64ExceptionAssert.ThrowsArgument(
ControllerBaseTest.cs (7)
117ExceptionAssert.ThrowsArgument( 132ExceptionAssert.ThrowsArgument( 215ExceptionAssert.ThrowsArgument( 230ExceptionAssert.ThrowsArgument( 245ExceptionAssert.ThrowsArgument( 260ExceptionAssert.ThrowsArgument( 275ExceptionAssert.ThrowsArgument(
CreatedAtActionResultTests.cs (1)
61await ExceptionAssert.ThrowsAsync<InvalidOperationException>(
CreatedAtRouteResultTests.cs (1)
74await ExceptionAssert.ThrowsAsync<InvalidOperationException>(
Filters\FilterCollectionTest.cs (2)
75ExceptionAssert.ThrowsArgument( 146ExceptionAssert.ThrowsArgument(
Formatters\FormatterMappingsTest.cs (3)
52ExceptionAssert.ThrowsArgument( 69ExceptionAssert.ThrowsArgument( 89ExceptionAssert.ThrowsArgument(
Infrastructure\ControllerActionInvokerTest.cs (2)
520await ExceptionAssert.ThrowsAsync<InvalidOperationException>( 1374await ExceptionAssert.ThrowsAsync<InvalidOperationException>(
ModelBinding\Binders\BinderTypeModelBinderTest.cs (1)
62ExceptionAssert.ThrowsArgument(
ModelBinding\BindingSourceValueProviderTest.cs (2)
25ExceptionAssert.ThrowsArgument( 43ExceptionAssert.ThrowsArgument(
ModelBinding\Metadata\BindingSourceTest.cs (1)
22ExceptionAssert.ThrowsArgument(
ModelBinding\Metadata\CompositeBindingSourceTest.cs (1)
26ExceptionAssert.ThrowsArgument(
ModelBinding\Metadata\ModelMetadataProviderExtensionsTest.cs (1)
17ExceptionAssert.ThrowsArgument(
ModelBinding\ModelBindingHelperTest.cs (1)
619var exception = await ExceptionAssert.ThrowsArgumentAsync(
RedirectToActionResultTest.cs (1)
75await ExceptionAssert.ThrowsAsync<InvalidOperationException>(
RedirectToPageResultTest.cs (1)
37await ExceptionAssert.ThrowsAsync<InvalidOperationException>(
RedirectToRouteResultTest.cs (1)
75await ExceptionAssert.ThrowsAsync<InvalidOperationException>(
Microsoft.AspNetCore.Mvc.Core.TestCommon (1)
CommonResourceInvokerTest.cs (1)
947await ExceptionAssert.ThrowsAsync<InvalidOperationException>(
Microsoft.AspNetCore.Mvc.Formatters.Xml.Test (2)
EnumerableWrapperProviderTest.cs (1)
83ExceptionAssert.ThrowsArgument(() => new EnumerableWrapperProvider(
SerializableErrorWrapperProviderTest.cs (1)
50ExceptionAssert.ThrowsArgument(
Microsoft.AspNetCore.Mvc.Razor.Test (4)
RazorPageTest.cs (1)
508ExceptionAssert.Throws<InvalidOperationException>(() => page.IsSectionDefined("foo"),
RazorViewEngineTest.cs (3)
60ExceptionAssert.ThrowsArgument( 215ExceptionAssert.ThrowsArgument( 1132ExceptionAssert.ThrowsArgument(
Microsoft.AspNetCore.Mvc.RazorPages.Test (23)
ApplicationModels\PageConventionCollectionTest.cs (5)
17ExceptionAssert.ThrowsArgument( 31var ex = ExceptionAssert.ThrowsArgument( 44var ex = ExceptionAssert.ThrowsArgument( 56ExceptionAssert.ThrowsArgument( 69var ex = ExceptionAssert.ThrowsArgument(
Infrastructure\DefaultPageActivatorProviderTest.cs (1)
21ExceptionAssert.ThrowsArgument(
Infrastructure\DefaultPageModelActivatorProviderTest.cs (1)
24ExceptionAssert.ThrowsArgument(
Infrastructure\PageActionInvokerTest.cs (1)
1041await ExceptionAssert.ThrowsAsync<InvalidOperationException>(
Infrastructure\ServiceBasedPageModelActivatorProviderTest.cs (1)
21ExceptionAssert.ThrowsArgument(
PageModelTest.cs (7)
108ExceptionAssert.ThrowsArgument( 123ExceptionAssert.ThrowsArgument( 206ExceptionAssert.ThrowsArgument( 221ExceptionAssert.ThrowsArgument( 236ExceptionAssert.ThrowsArgument( 251ExceptionAssert.ThrowsArgument( 266ExceptionAssert.ThrowsArgument(
PageTest.cs (7)
128ExceptionAssert.ThrowsArgument( 143ExceptionAssert.ThrowsArgument( 226ExceptionAssert.ThrowsArgument( 241ExceptionAssert.ThrowsArgument( 256ExceptionAssert.ThrowsArgument( 271ExceptionAssert.ThrowsArgument( 286ExceptionAssert.ThrowsArgument(
Microsoft.AspNetCore.Mvc.TagHelpers.Test (7)
InputTagHelperTest.cs (2)
289ExceptionAssert.ThrowsArgument( 334ExceptionAssert.ThrowsArgument(
SelectTagHelperTest.cs (1)
730ExceptionAssert.ThrowsArgument(
TagHelperOutputExtensionsTest.cs (1)
546ExceptionAssert.ThrowsArgument(
TextAreaTagHelperTest.cs (1)
185ExceptionAssert.ThrowsArgument(
ValidationMessageTagHelperTest.cs (1)
126await ExceptionAssert.ThrowsArgumentAsync(
ValidationSummaryTagHelperTest.cs (1)
580ExceptionAssert.ThrowsArgument(
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (19)
DefaultHtmlGeneratorTest.cs (3)
94ExceptionAssert.ThrowsArgument( 150ExceptionAssert.ThrowsArgument( 450ExceptionAssert.ThrowsArgument(
PageRemoteAttributeTest.cs (1)
89ExceptionAssert.Throws<InvalidOperationException>(
RemoteAttributeBaseTest.cs (2)
105ExceptionAssert.ThrowsArgument( 134ExceptionAssert.ThrowsArgument(
Rendering\HtmlHelperCheckboxTest.cs (1)
97ExceptionAssert.ThrowsArgument(
Rendering\HtmlHelperHiddenTest.cs (1)
434ExceptionAssert.ThrowsArgument(
Rendering\HtmlHelperNameExtensionsTest.cs (2)
335ExceptionAssert.Throws<InvalidOperationException>(() => helper.IdFor(m => collection[m]), message); 336ExceptionAssert.Throws<InvalidOperationException>(() => helper.NameFor(m => collection[m]), message);
Rendering\HtmlHelperPasswordTest.cs (1)
154ExceptionAssert.ThrowsArgument(
Rendering\HtmlHelperRadioButtonExtensionsTest.cs (1)
176ExceptionAssert.ThrowsArgument(
Rendering\HtmlHelperSelectTest.cs (6)
379ExceptionAssert.ThrowsArgument( 1278ExceptionAssert.ThrowsArgument( 1292ExceptionAssert.ThrowsArgument( 1350ExceptionAssert.ThrowsArgument( 1364ExceptionAssert.ThrowsArgument( 1378ExceptionAssert.ThrowsArgument(
Rendering\HtmlHelperTextBoxExtensionsTest.cs (1)
179ExceptionAssert.ThrowsArgument(
Microsoft.AspNetCore.Routing.Tests (63)
Constraints\LengthRouteConstraintTests.cs (4)
52ExceptionAssert.ThrowsArgumentOutOfRange( 66ExceptionAssert.ThrowsArgumentOutOfRange( 80ExceptionAssert.ThrowsArgumentOutOfRange( 95ExceptionAssert.ThrowsArgumentOutOfRange(
Constraints\MaxLengthRouteConstraintTests.cs (1)
35ExceptionAssert.ThrowsArgumentOutOfRange(
Constraints\MinLengthRouteConstraintTests.cs (1)
35ExceptionAssert.ThrowsArgumentOutOfRange(
Constraints\RangeRouteConstraintTests.cs (1)
40ExceptionAssert.ThrowsArgumentOutOfRange(
Patterns\RoutePatternParserTest.cs (26)
358ExceptionAssert.Throws<RoutePatternException>( 370ExceptionAssert.Throws<RoutePatternException>( 387ExceptionAssert.Throws<RoutePatternException>( 402ExceptionAssert.Throws<RoutePatternException>( 411var ex = ExceptionAssert.Throws<RoutePatternException>( 425ExceptionAssert.Throws<RoutePatternException>( 434ExceptionAssert.Throws<RoutePatternException>( 443ExceptionAssert.Throws<RoutePatternException>( 451ExceptionAssert.Throws<RoutePatternException>( 460ExceptionAssert.Throws<RoutePatternException>( 489ExceptionAssert.Throws<RoutePatternException>(() => RoutePatternParser.Parse(template), expectedMessage); 495ExceptionAssert.Throws<RoutePatternException>( 504ExceptionAssert.Throws<RoutePatternException>( 513ExceptionAssert.Throws<RoutePatternException>( 521ExceptionAssert.Throws<RoutePatternException>( 529ExceptionAssert.Throws<RoutePatternException>( 538ExceptionAssert.Throws<RoutePatternException>( 546ExceptionAssert.Throws<RoutePatternException>( 557ExceptionAssert.Throws<RoutePatternException>( 568ExceptionAssert.Throws<RoutePatternException>( 577ExceptionAssert.Throws<RoutePatternException>( 585ExceptionAssert.Throws<RoutePatternException>( 606ExceptionAssert.Throws<RoutePatternException>( 614ExceptionAssert.Throws<RoutePatternException>( 622ExceptionAssert.Throws<RoutePatternException>( 633ExceptionAssert.Throws<RoutePatternException>(
RouteConstraintBuilderTest.cs (2)
79ExceptionAssert.Throws<RouteCreationException>( 95ExceptionAssert.Throws<InvalidOperationException>(
RouteTest.cs (1)
1612var exception = ExceptionAssert.Throws<RouteCreationException>(
Template\TemplateParserTests.cs (26)
503ExceptionAssert.Throws<ArgumentException>( 516ExceptionAssert.Throws<ArgumentException>( 534ExceptionAssert.Throws<ArgumentException>( 550ExceptionAssert.Throws<ArgumentException>( 560var ex = ExceptionAssert.Throws<ArgumentException>( 575ExceptionAssert.Throws<ArgumentException>( 585ExceptionAssert.Throws<ArgumentException>( 595ExceptionAssert.Throws<ArgumentException>( 604ExceptionAssert.Throws<ArgumentException>( 614ExceptionAssert.Throws<ArgumentException>( 644ExceptionAssert.Throws<ArgumentException>( 652ExceptionAssert.Throws<ArgumentException>( 662ExceptionAssert.Throws<ArgumentException>( 672ExceptionAssert.Throws<ArgumentException>( 681ExceptionAssert.Throws<ArgumentException>( 690ExceptionAssert.Throws<ArgumentException>( 700ExceptionAssert.Throws<ArgumentException>( 709ExceptionAssert.Throws<ArgumentException>( 721ExceptionAssert.Throws<ArgumentException>( 733ExceptionAssert.Throws<ArgumentException>( 743ExceptionAssert.Throws<ArgumentException>( 752ExceptionAssert.Throws<ArgumentException>( 774ExceptionAssert.Throws<ArgumentException>( 783ExceptionAssert.Throws<ArgumentException>( 792ExceptionAssert.Throws<ArgumentException>( 804ExceptionAssert.Throws<ArgumentException>(
Tree\TreeRouteBuilderTest.cs (1)
39ExceptionAssert.ThrowsArgument(() =>
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Tests (1)
QuicConnectionContextTests.cs (1)
68var ex = await ExceptionAssert.ThrowsAsync<QuicException>(
Microsoft.AspNetCore.Shared.Tests (3)
AdaptiveCapacityDictionaryTests.cs (3)
65ExceptionAssert.ThrowsArgument( 407ExceptionAssert.ThrowsArgument(() => dict.Add("key", "value2"), "key", message); 428ExceptionAssert.ThrowsArgument(() => dict.Add("kEy", "value2"), "key", message);
Microsoft.AspNetCore.SignalR.Client.FunctionalTests (1)
HubProtocolVersionTests.cs (1)
181await ExceptionAssert.ThrowsAsync<HubException>(
Microsoft.AspNetCore.TestHost.Tests (1)
TestClientTests.cs (1)
543await ExceptionAssert.ThrowsAsync<OperationCanceledException>(
Microsoft.Extensions.Caching.StackExchangeRedis.Tests (5)
TimeExpirationTests.cs (5)
28ExceptionAssert.ThrowsArgumentOutOfRange( 79ExceptionAssert.ThrowsArgumentOutOfRange(() => 95ExceptionAssert.ThrowsArgumentOutOfRange( 145ExceptionAssert.ThrowsArgumentOutOfRange(() => 158ExceptionAssert.ThrowsArgumentOutOfRange(
Microsoft.JSInterop.Tests (2)
Infrastructure\DotNetDispatcherTest.cs (2)
20ExceptionAssert.ThrowsArgument( 32ExceptionAssert.ThrowsArgument(