Skip to content

Bulk user creation (xUnit)

### ✅ Bulk user creation
- **Given** the following users exist
**Users**
| email | role | status |
| ----------------- | ----- | ------ |
| [email protected] | admin | active |
| [email protected] | user | active |
| [email protected] | user | locked |
- **When** the admin opens the user list
- **Then** the user list should include
**Expected**
| email | role | status |
| ----------------- | ----- | ------ |
| [email protected] | admin | active |
| [email protected] | user | active |
| [email protected] | user | locked |
using ExecutableStories.Xunit;
using Xunit;
public class UsersTests : IDisposable
{
[Fact]
public void BulkUserCreation()
{
Story.Init("Bulk user creation");
Story.Given("the following users exist");
Story.Table("Users",
new[] { "email", "role", "status" },
new[]
{
new[] { "[email protected]", "admin", "active" },
new[] { "[email protected]", "user", "active" },
new[] { "[email protected]", "user", "locked" },
}
);
Story.When("the admin opens the user list");
Story.Then("the user list should include");
Story.Table("Expected",
new[] { "email", "role", "status" },
new[]
{
new[] { "[email protected]", "admin", "active" },
new[] { "[email protected]", "user", "active" },
new[] { "[email protected]", "user", "locked" },
}
);
}
public void Dispose() => Story.RecordAndClear();
}