Last active
May 4, 2020 13:44
-
-
Save AntonStoeckl/ef8fbe8a72ca567b37f538b193bf0dc0 to your computer and use it in GitHub Desktop.
Acceptance Test Scenarios for my iDDD with Go blog article series at https://medium.com/@TonyBologni
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SCENARIO: A prospective Customer registers her account | |
When a Customer registers as [Fiona Gallagher] with [[email protected]] | |
Then her account should show the data she supplied: | |
GivenName: Fiona | |
FamilyName: Gallagher | |
EmailAddress: [email protected] | |
IsEmailAddressConfirmed: false | |
SCENARIO: A prospective Customer can't register because her email address is already used | |
Given a Customer registered as [Fiona Gallagher] with [[email protected]] | |
When another Customer registers with the same email address [[email protected]] | |
Then she should receive an error | |
SCENARIO: A prospective Customer can register with an email address that is not used any more | |
Given a Customer registered as [Fiona Gallagher] with [[email protected]] | |
And given the first Customer deleted her account | |
When another Customer registers with the same email address [[email protected]] | |
Then she should be able to register | |
Or given the first Customer changed her email address to [[email protected]] | |
When another Customer registers with the same email address [[email protected]] | |
Then she should be able to register | |
SCENARIO: A prospective Customer tries to register with invalid input | |
When she supplies an invalid email address [[email protected]] | |
Then she should receive an error | |
When she supplies an empty givenName | |
Then she should receive an error | |
When she supplies an empty familyName | |
Then she should receive an error | |
SCENARIO: A Customer confirms his email address | |
Given a Customer registered as [Kevin Ball] with [[email protected]] | |
When he confirms his email address | |
Then his email address should be confirmed | |
And when he confirms his email address again | |
Then his email address should still be confirmed | |
SCENARIO: A Customer can't confirm his email address, because the confirmation hash is not matching | |
Given a Customer registered as [Kevin Ball] with [[email protected]] | |
When he tries to confirm his email address with a wrong confirmation hash | |
Then he should receive an error | |
And his email address should still be unconfirmed | |
SCENARIO: A Customer fails to confirm his already confirmed email address | |
Given a Customer registered as [Kevin Ball] with [[email protected]] | |
And given he confirmed his email address | |
When he tries to confirm his email address again with a wrong confirmation hash | |
Then he should receive an error | |
And his email address should still be confirmed | |
SCENARIO: A Customer confirms his changed email address | |
Given a Customer registered as [Kevin Ball] with [[email protected]] | |
And given he confirmed his email address | |
And given he changed his email address to [[email protected]] | |
When he confirms his changed email address | |
Then his email address should be [[email protected]] and confirmed | |
SCENARIO: A Customer tries to confirm his email address with invalid input | |
Given a Customer registered as [Kevin Ball] with [[email protected]] | |
When he supplies an empty confirmation hash | |
Then he should receive an error | |
SCENARIO: A Customer changes her (confirmed) email address | |
Given a Customer registered as [Veronica Fisher] with [[email protected]] | |
And given she confirmed her email address | |
When she changes her email address to [[email protected]] | |
Then her email address should be [[email protected]] and unconfirmed | |
And when she tries to change her email address to [[email protected]] again | |
Then her email address should still be [[email protected]] | |
SCENARIO: A Customer can't change her email address because it is already used | |
Given a Customer registered as [Veronica Fisher] with [[email protected]] | |
And given she changed her email address to [[email protected]] | |
And given another Customer registered as [Veronica Fisher] with [[email protected]] | |
When she also tries to change her email address to [[email protected]] | |
Then she should receive an error | |
SCENARIO: A Customer tries to change her email address with invalid input | |
Given a Customer registered as [Veronica Fisher] with [[email protected]] | |
When she supplies an invalid email address [[email protected]] | |
Then she should receive an error | |
SCENARIO: A Customer changes his name | |
Given a Customer registered as [Mikhailo Milkovich] with [[email protected]] | |
When he changes his name to [Mickey Milkovich] | |
Then his name should be [Mickey Milkovich] | |
And when he tries to change his name to [Mickey Milkovich] again | |
Then his name should still be [Mickey Milkovich] | |
SCENARIO: A Customer tries to change his name with invalid input | |
Given a Customer registered as [Mikhailo Milkovich] with [[email protected]] | |
When he supplies an empty given name | |
Then he should receive an error | |
When he supplies an empty family name | |
Then he should receive an error | |
SCENARIO: A Customer adds a billing profile to her account | |
Given a Customer registered as [Karen Jackson] with [[email protected]] | |
When she adds a billing profile | |
Then her account should contain one billing profile | |
SCENARIO: A Customer removes a billing profile from her account | |
Given a Customer registered as [Karen Jackson] with [[email protected]] | |
And given she added a billing profile | |
And given she added another billing profile | |
When she removes the first billing profile from her account | |
Then her account should contain only the second billing profile | |
SCENARIO: A Customer tries to remove the only billing profile from her account | |
Given a Customer registered as [Karen Jackson] with [[email protected]] | |
And given she added a billing profile | |
When she tries to remove the billing profile from her account | |
Then she should receive an error | |
SCENARIO: A Customer deletes her account | |
Given a Customer registered as [Karen Jackson] with [[email protected]] | |
When she deletes her account | |
And when she tries to retrieve her account data | |
Then she should receive an error | |
And when she tries to delete her account again | |
Then her account should still be deleted | |
And when she tries to confirm her email address | |
Then she should receive an error | |
And when she tries to change her email address | |
Then she should receive an error | |
And when she tries to change her name | |
Then she should receive an error | |
SCENARIO: A hacker tries to play around with a non existing Customer account by guessing IDs | |
When he tries to retrieve data for a non existing account | |
Then he should receive an error | |
And when he tries to confirm an email address | |
Then he should receive an error | |
And when he tries to change an email address | |
Then he should receive an error | |
And when he tries to change a name | |
Then he should receive an error | |
And when he tries to delete an account | |
Then he should receive an error | |
SCENARIO: A client (web, app, ...) of the application sends an empty id | |
Given a Customer registered as [Fiona Gallagher] with [[email protected]] | |
When she tries to confirm her email address with an empty id | |
Then she should receive an error | |
When she tries to change her email address with an empty id | |
Then she should receive an error | |
When she tries to change her name with an empty id | |
Then she should receive an error | |
When she tries to delete her account with an empty id | |
Then she should receive an error | |
When she tries to retrieve her account with an empty id | |
Then she should receive an error |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment