Class TestAuthenticationEventAssertions
- Namespace
- XBullet.EasyTesting.Authentication
- Assembly
- XBullet.EasyTesting.dll
Fluently verifies authentication events recorded by a test scenario.
public sealed class TestAuthenticationEventAssertions
- Inheritance
-
TestAuthenticationEventAssertions
- Inherited Members
Methods
HaveChallenge(int, string?)
Verifies that the expected number of challenge events occurred.
public TestAuthenticationEventAssertions HaveChallenge(int exactly = 1, string? authenticationScheme = null)
Parameters
exactlyintThe non-negative number of matching events required. The default is one.
authenticationSchemestringThe exact, case-sensitive scheme to match, or null to count events from every scheme. The default is null.
Returns
- TestAuthenticationEventAssertions
This assertion object so additional event checks can be chained.
Exceptions
- ArgumentOutOfRangeException
exactlyis negative.- TestAuthenticationEventVerificationException
The recorded challenge count does not equal
exactly.
HaveForbidden(int, string?)
Verifies that the expected number of forbidden events occurred.
public TestAuthenticationEventAssertions HaveForbidden(int exactly = 1, string? authenticationScheme = null)
Parameters
exactlyintThe non-negative number of matching events required. The default is one.
authenticationSchemestringThe exact, case-sensitive scheme to match, or null to count events from every scheme. The default is null.
Returns
- TestAuthenticationEventAssertions
This assertion object so additional event checks can be chained.
Exceptions
- ArgumentOutOfRangeException
exactlyis negative.- TestAuthenticationEventVerificationException
The recorded forbidden-event count does not equal
exactly.
HaveValidatedCredential(int, string?)
Verifies that the expected number of successful validations occurred.
public TestAuthenticationEventAssertions HaveValidatedCredential(int exactly = 1, string? authenticationScheme = null)
Parameters
exactlyintThe non-negative number of matching events required. The default is one.
authenticationSchemestringThe exact, case-sensitive scheme to match, or null to count events from every scheme. The default is null.
Returns
- TestAuthenticationEventAssertions
This assertion object so additional event checks can be chained.
Exceptions
- ArgumentOutOfRangeException
exactlyis negative.- TestAuthenticationEventVerificationException
The recorded successful-validation count does not equal
exactly.
HaveValidationFailure(int, string?)
Verifies that the expected number of validation failures occurred.
public TestAuthenticationEventAssertions HaveValidationFailure(int exactly = 1, string? authenticationScheme = null)
Parameters
exactlyintThe non-negative number of matching events required. The default is one.
authenticationSchemestringThe exact, case-sensitive scheme to match, or null to count events from every scheme. The default is null.
Returns
- TestAuthenticationEventAssertions
This assertion object so additional event checks can be chained.
Exceptions
- ArgumentOutOfRangeException
exactlyis negative.- TestAuthenticationEventVerificationException
The recorded validation-failure count does not equal
exactly.
NotHave(TestAuthenticationEventKind, string?)
Verifies that no event of the supplied kind occurred.
public TestAuthenticationEventAssertions NotHave(TestAuthenticationEventKind kind, string? authenticationScheme = null)
Parameters
kindTestAuthenticationEventKindThe authentication-event kind that must be absent.
authenticationSchemestringThe exact, case-sensitive scheme to match, or null to inspect events from every scheme. The default is null.
Returns
- TestAuthenticationEventAssertions
This assertion object so additional event checks can be chained.
Exceptions
- TestAuthenticationEventVerificationException
At least one matching event was recorded.