2025-03-03 00:42:20 +01:00
|
|
|
using LightBDD.Framework;
|
|
|
|
|
using LightBDD.Framework.Scenarios;
|
|
|
|
|
using LightBDD.MsTest3;
|
|
|
|
|
|
|
|
|
|
namespace PlanTempus.X.BDD.Scenarios;
|
2026-01-09 22:14:46 +01:00
|
|
|
|
|
|
|
|
[TestClass]
|
2025-03-03 00:42:20 +01:00
|
|
|
public partial class AccountSecuritySpecs : FeatureFixtures.AccountSecuritySpecs
|
|
|
|
|
{
|
|
|
|
|
[Scenario]
|
|
|
|
|
[TestMethod]
|
2026-01-09 22:14:46 +01:00
|
|
|
public async Task Account_lockout_after_multiple_failed_attempts()
|
2025-03-03 00:42:20 +01:00
|
|
|
{
|
|
|
|
|
await Runner.RunScenarioAsync(
|
2026-01-09 22:14:46 +01:00
|
|
|
_ => Given_account_exists("test@example.com"),
|
2025-03-03 00:42:20 +01:00
|
|
|
_ => When_I_attempt_5_failed_logins_within_5_minutes(),
|
|
|
|
|
_ => Then_the_account_should_be_locked(),
|
|
|
|
|
_ => And_lockout_end_should_be_set(),
|
|
|
|
|
_ => And_subsequent_login_attempts_should_fail_until_lockout_end()
|
|
|
|
|
);
|
|
|
|
|
}
|
2026-01-09 22:14:46 +01:00
|
|
|
}
|