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 EmailConfirmationSpecs : FeatureFixtures.EmailConfirmationSpecs
|
|
|
|
|
{
|
|
|
|
|
[Scenario]
|
|
|
|
|
[TestMethod]
|
|
|
|
|
public async Task Confirm_valid_email_address()
|
|
|
|
|
{
|
|
|
|
|
await Runner.RunScenarioAsync(
|
2026-01-10 11:13:33 +01:00
|
|
|
_ => Given_an_account_exists_with_unconfirmed_email($"test-{Guid.NewGuid():N}@example.com"),
|
|
|
|
|
_ => And_a_verification_email_is_queued_in_outbox(),
|
|
|
|
|
_ => And_the_outbox_message_is_processed(),
|
|
|
|
|
_ => When_I_confirm_email_with_valid_token(),
|
|
|
|
|
_ => Then_the_accounts_email_should_be_confirmed()
|
2025-03-03 00:42:20 +01:00
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Scenario]
|
|
|
|
|
[TestMethod]
|
2026-01-10 11:13:33 +01:00
|
|
|
public async Task Handle_invalid_confirmation_token()
|
2025-03-03 00:42:20 +01:00
|
|
|
{
|
|
|
|
|
await Runner.RunScenarioAsync(
|
2026-01-10 11:13:33 +01:00
|
|
|
_ => Given_an_account_exists_with_unconfirmed_email($"test-{Guid.NewGuid():N}@example.com"),
|
|
|
|
|
_ => When_I_confirm_email_with_invalid_token(),
|
|
|
|
|
_ => Then_I_should_see_an_error_message("Invalid"),
|
|
|
|
|
_ => And_the_email_remains_unconfirmed()
|
2025-03-03 00:42:20 +01:00
|
|
|
);
|
|
|
|
|
}
|
2026-01-09 22:14:46 +01:00
|
|
|
}
|