2026-01-09 22:14:46 +01:00
|
|
|
using LightBDD.Framework;
|
|
|
|
|
using LightBDD.Framework.Scenarios;
|
|
|
|
|
using LightBDD.MsTest3;
|
2026-01-10 11:13:33 +01:00
|
|
|
|
2026-01-09 22:14:46 +01:00
|
|
|
namespace PlanTempus.X.BDD.Scenarios;
|
|
|
|
|
|
|
|
|
|
[TestClass]
|
|
|
|
|
public partial class AccountRegistrationSpecs : FeatureFixtures.AccountRegistrationSpecs
|
|
|
|
|
{
|
2026-01-10 11:13:33 +01:00
|
|
|
[Scenario]
|
|
|
|
|
[TestMethod]
|
|
|
|
|
public async Task Successful_account_registration_with_valid_email()
|
|
|
|
|
{
|
|
|
|
|
await Runner.RunScenarioAsync(
|
|
|
|
|
_ => Given_a_unique_email_address(),
|
|
|
|
|
_ => When_I_submit_registration_with_valid_credentials(),
|
|
|
|
|
_ => Then_the_account_should_be_created_successfully()
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Scenario]
|
|
|
|
|
[TestMethod]
|
|
|
|
|
public async Task Reject_duplicate_email_registration()
|
|
|
|
|
{
|
|
|
|
|
// Use a unique email for this test to avoid conflicts with other test runs
|
|
|
|
|
var uniqueEmail = $"duplicate_{Guid.NewGuid():N}@test.example.com";
|
2026-01-09 22:14:46 +01:00
|
|
|
|
2026-01-10 11:13:33 +01:00
|
|
|
await Runner.RunScenarioAsync(
|
|
|
|
|
_ => Given_an_account_already_exists_with_email(uniqueEmail),
|
|
|
|
|
_ => When_I_try_to_register_with_the_same_email(),
|
|
|
|
|
_ => Then_registration_should_fail_with_duplicate_email_error()
|
|
|
|
|
);
|
|
|
|
|
}
|
2026-01-09 22:14:46 +01:00
|
|
|
}
|