PlanTempusApp/PlanTempus.X.BDD/Scenarios/OrganizationSetupSpecs.cs

47 lines
1.5 KiB
C#
Raw Normal View History

2025-03-03 00:42:20 +01:00
using LightBDD.Framework;
using LightBDD.Framework.Scenarios;
using LightBDD.MsTest3;
namespace PlanTempus.X.BDD.Scenarios;
[TestClass]
2025-03-03 00:42:20 +01:00
public partial class OrganizationSetupSpecs : FeatureFixtures.OrganizationSetupSpecs
{
[Scenario]
[TestMethod]
public async Task Complete_organization_setup_after_confirmation()
{
await Runner.RunScenarioAsync(
_ => Given_account_has_confirmed_their_email("test@example.com"),
_ => When_account_submit_organization_name_and_valid_password("Acme Corp", "ValidP@ssw0rd"),
2025-03-03 00:42:20 +01:00
_ => Then_a_new_organization_should_be_created_with_expected_properties(),
_ => And_the_account_should_be_linked_to_the_organization_in_account_organizations(),
2025-03-03 00:42:20 +01:00
_ => And_tenant_tables_should_be_created_for_the_organization(),
_ => And_account_should_be_logged_into_the_system()
2025-03-03 00:42:20 +01:00
);
}
[Scenario]
[TestMethod]
public async Task Prevent_organization_setup_without_password()
{
await Runner.RunScenarioAsync(
_ => Given_account_has_confirmed_their_email("test@example.com"),
_ => When_account_submit_organization_name_without_password("Acme Corp"),
2025-03-03 00:42:20 +01:00
_ => Then_organization_setup_should_fail_with_error("Password required")
);
}
[Scenario]
[TestMethod]
public async Task Handle_multiple_organization_creations()
{
await Runner.RunScenarioAsync(
_ => Given_account_has_completed_initial_setup("test@example.com"),
_ => When_account_create_a_new_organization("Second Org"),
2025-03-03 00:42:20 +01:00
_ => Then_a_new_organization_entry_should_be_created(),
_ => And_the_account_should_be_linked_to_both_organizations()
2025-03-03 00:42:20 +01:00
);
}
}