Skip to content

Commit

Permalink
Test role players map of a relation
Browse files Browse the repository at this point in the history
  • Loading branch information
haikalpribadi committed Jul 27, 2020
1 parent e16878f commit f1feb1a
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions behaviour/concept/thing/relation.feature
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ Feature: Concept Relation
Then relation $m get players for role(husband) contain: $b
Then relation $m get players contain: $a
Then relation $m get players contain: $b
Then relation $m get players contain:
| wife | $a |
| husband | $b |
When transaction commits
When session opens transaction of type: read
When $m = relation(marriage) get instance with key(license): m
Expand All @@ -70,6 +73,9 @@ Feature: Concept Relation
Then relation $m get players for role(husband) contain: $b
Then relation $m get players contain: $a
Then relation $m get players contain: $b
Then relation $m get players contain:
| wife | $a |
| husband | $b |

Scenario: Relation without role player cannot be created
When $m = relation(marriage) create new instance with key(license): m
Expand Down Expand Up @@ -104,28 +110,36 @@ Feature: Concept Relation
When relation $m set player for role(wife): $a
When relation $m set player for role(husband): $b
When relation $m remove player for role(wife): $a
Then relation $m get players for role(wife) do not contain: $a
Then entity $a get relations(marriage:wife) do not contain: $m
Then relation $m get players for role(wife) do not contain: $a
Then relation $m get players do not contain:
| wife | $a |
When transaction commits
When session opens transaction of type: write
When $m = relation(marriage) get instance with key(license): m
When $a = entity(person) get instance with key(username): alice
Then relation $m get players for role(wife) do not contain: $a
Then entity $a get relations(marriage:wife) do not contain: $m
Then relation $m get players for role(wife) do not contain: $a
Then relation $m get players do not contain:
| wife | $a |
When relation $m set player for role(wife): $a
When transaction commits
When session opens transaction of type: write
When $m = relation(marriage) get instance with key(license): m
When $a = entity(person) get instance with key(username): alice
When relation $m remove player for role(wife): $a
Then relation $m get players for role(wife) do not contain: $a
Then entity $a get relations(marriage:wife) do not contain: $m
Then relation $m get players for role(wife) do not contain: $a
Then relation $m get players do not contain:
| wife | $a |
When transaction commits
When session opens transaction of type: read
When $m = relation(marriage) get instance with key(license): m
When $a = entity(person) get instance with key(username): alice
Then relation $m get players for role(wife) do not contain: $a
Then entity $a get relations(marriage:wife) do not contain: $m
Then relation $m get players for role(wife) do not contain: $a
Then relation $m get players do not contain:
| wife | $a |

Scenario: Relation without role players get deleted
When $m = relation(marriage) create new instance with key(license): m
Expand Down

0 comments on commit f1feb1a

Please sign in to comment.