Migrate from User to Account domain concept
Renames core domain entities and services from "User" to "Account" Refactors project-wide namespaces, classes, and database tables to use "Account" terminology Updates related components, services, and database schema to reflect new domain naming Standardizes naming conventions across authentication and organization setup features
This commit is contained in:
parent
e5e7c1c19f
commit
88812177a9
29 changed files with 288 additions and 298 deletions
31
PlanTempus.X.BDD/Scenarios/AccountRegistrationSpecs.cs
Normal file
31
PlanTempus.X.BDD/Scenarios/AccountRegistrationSpecs.cs
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
using LightBDD.Framework;
|
||||
using LightBDD.Framework.Scenarios;
|
||||
using LightBDD.MsTest3;
|
||||
namespace PlanTempus.X.BDD.Scenarios;
|
||||
|
||||
[TestClass]
|
||||
public partial class AccountRegistrationSpecs : FeatureFixtures.AccountRegistrationSpecs
|
||||
{
|
||||
[Scenario]
|
||||
[TestMethod]
|
||||
public async Task Successful_account_registration_with_valid_email()
|
||||
{
|
||||
await Runner.RunScenarioAsync(
|
||||
_ => Given_no_account_exists_with_email("test@example.com"),
|
||||
_ => When_I_submit_registration_with_email_and_password("test@example.com", "TestPassword123!"),
|
||||
_ => Then_a_new_account_should_be_created_with_email_and_confirmation_status("test@example.com", false),
|
||||
_ => Then_a_confirmation_email_should_be_sent()
|
||||
);
|
||||
}
|
||||
|
||||
[Scenario]
|
||||
[TestMethod]
|
||||
public async Task Reject_duplicate_email_registration()
|
||||
{
|
||||
await Runner.RunScenarioAsync(
|
||||
_ => Given_an_account_already_exists_with_email("existing@example.com"),
|
||||
_ => When_I_submit_registration_with_email("existing@example.com"),
|
||||
_ => Then_registration_should_fail_with_error("Email already exists")
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -3,19 +3,20 @@ using LightBDD.Framework.Scenarios;
|
|||
using LightBDD.MsTest3;
|
||||
|
||||
namespace PlanTempus.X.BDD.Scenarios;
|
||||
[TestClass]
|
||||
|
||||
[TestClass]
|
||||
public partial class AccountSecuritySpecs : FeatureFixtures.AccountSecuritySpecs
|
||||
{
|
||||
[Scenario]
|
||||
[TestMethod]
|
||||
public async Task User_lockout_after_multiple_failed_attempts()
|
||||
public async Task Account_lockout_after_multiple_failed_attempts()
|
||||
{
|
||||
await Runner.RunScenarioAsync(
|
||||
_ => Given_user_exists("test@example.com"),
|
||||
_ => Given_account_exists("test@example.com"),
|
||||
_ => 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()
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,8 @@ using LightBDD.Framework.Scenarios;
|
|||
using LightBDD.MsTest3;
|
||||
|
||||
namespace PlanTempus.X.BDD.Scenarios;
|
||||
[TestClass]
|
||||
|
||||
[TestClass]
|
||||
public partial class EmailConfirmationSpecs : FeatureFixtures.EmailConfirmationSpecs
|
||||
{
|
||||
[Scenario]
|
||||
|
|
@ -11,9 +12,9 @@ public partial class EmailConfirmationSpecs : FeatureFixtures.EmailConfirmationS
|
|||
public async Task Confirm_valid_email_address()
|
||||
{
|
||||
await Runner.RunScenarioAsync(
|
||||
_ => Given_a_user_exists_with_unconfirmed_email("test@example.com"),
|
||||
_ => Given_an_account_exists_with_unconfirmed_email("test@example.com"),
|
||||
_ => When_I_click_the_valid_confirmation_link_for("test@example.com"),
|
||||
_ => Then_the_users_email_confirmed_should_be_true(),
|
||||
_ => Then_the_accounts_email_confirmed_should_be_true(),
|
||||
_ => And_I_should_be_redirected_to_the_welcome_page()
|
||||
);
|
||||
}
|
||||
|
|
@ -28,4 +29,4 @@ public partial class EmailConfirmationSpecs : FeatureFixtures.EmailConfirmationS
|
|||
_ => And_my_email_remains_unconfirmed()
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,8 @@ using LightBDD.Framework.Scenarios;
|
|||
using LightBDD.MsTest3;
|
||||
|
||||
namespace PlanTempus.X.BDD.Scenarios;
|
||||
[TestClass]
|
||||
|
||||
[TestClass]
|
||||
public partial class OrganizationSetupSpecs : FeatureFixtures.OrganizationSetupSpecs
|
||||
{
|
||||
[Scenario]
|
||||
|
|
@ -11,12 +12,12 @@ public partial class OrganizationSetupSpecs : FeatureFixtures.OrganizationSetupS
|
|||
public async Task Complete_organization_setup_after_confirmation()
|
||||
{
|
||||
await Runner.RunScenarioAsync(
|
||||
_ => Given_user_has_confirmed_their_email("test@example.com"),
|
||||
_ => When_user_submit_organization_name_and_valid_password("Acme Corp", "ValidP@ssw0rd"),
|
||||
_ => Given_account_has_confirmed_their_email("test@example.com"),
|
||||
_ => When_account_submit_organization_name_and_valid_password("Acme Corp", "ValidP@ssw0rd"),
|
||||
_ => Then_a_new_organization_should_be_created_with_expected_properties(),
|
||||
_ => And_the_user_should_be_linked_to_the_organization_in_user_organizations(),
|
||||
_ => And_the_account_should_be_linked_to_the_organization_in_account_organizations(),
|
||||
_ => And_tenant_tables_should_be_created_for_the_organization(),
|
||||
_ => And_user_should_be_logged_into_the_system()
|
||||
_ => And_account_should_be_logged_into_the_system()
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -25,8 +26,8 @@ public partial class OrganizationSetupSpecs : FeatureFixtures.OrganizationSetupS
|
|||
public async Task Prevent_organization_setup_without_password()
|
||||
{
|
||||
await Runner.RunScenarioAsync(
|
||||
_ => Given_user_has_confirmed_their_email("test@example.com"),
|
||||
_ => When_user_submit_organization_name_without_password("Acme Corp"),
|
||||
_ => Given_account_has_confirmed_their_email("test@example.com"),
|
||||
_ => When_account_submit_organization_name_without_password("Acme Corp"),
|
||||
_ => Then_organization_setup_should_fail_with_error("Password required")
|
||||
);
|
||||
}
|
||||
|
|
@ -36,10 +37,10 @@ public partial class OrganizationSetupSpecs : FeatureFixtures.OrganizationSetupS
|
|||
public async Task Handle_multiple_organization_creations()
|
||||
{
|
||||
await Runner.RunScenarioAsync(
|
||||
_ => Given_user_has_completed_initial_setup("test@example.com"),
|
||||
_ => When_user_create_a_new_organization("Second Org"),
|
||||
_ => Given_account_has_completed_initial_setup("test@example.com"),
|
||||
_ => When_account_create_a_new_organization("Second Org"),
|
||||
_ => Then_a_new_organization_entry_should_be_created(),
|
||||
_ => And_the_user_should_be_linked_to_both_organizations()
|
||||
_ => And_the_account_should_be_linked_to_both_organizations()
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,31 +0,0 @@
|
|||
using LightBDD.Framework;
|
||||
using LightBDD.Framework.Scenarios;
|
||||
using LightBDD.MsTest3;
|
||||
namespace PlanTempus.X.BDD.Scenarios;
|
||||
|
||||
[TestClass]
|
||||
public partial class UserRegistrationSpecs : FeatureFixtures.UserRegistrationSpecs
|
||||
{
|
||||
[Scenario]
|
||||
[TestMethod]
|
||||
public async Task Successful_user_registration_with_valid_email()
|
||||
{
|
||||
await Runner.RunScenarioAsync(
|
||||
_ => Given_no_user_exists_with_email("test@example.com"),
|
||||
_ => When_I_submit_registration_with_name_and_email("Test User", "test@example.com"),
|
||||
_ => Then_a_new_user_should_be_created_with_email_and_confirmation_status("test@example.com", false),
|
||||
_ => Then_a_confirmation_email_should_be_sent()
|
||||
);
|
||||
}
|
||||
|
||||
[Scenario]
|
||||
[TestMethod]
|
||||
public async Task Reject_duplicate_email_registration()
|
||||
{
|
||||
await Runner.RunScenarioAsync(
|
||||
_ => Given_a_user_already_exists_with_email("existing@example.com"),
|
||||
_ => When_I_submit_registration_with_email("existing@example.com"),
|
||||
_ => Then_registration_should_fail_with_error("Email already exists")
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue