forked from estuary/flow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbalances-test.flow.yaml
27 lines (25 loc) · 1.03 KB
/
balances-test.flow.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
tests:
acmeBank/tests/balances:
- ingest:
collection: acmeBank/transfers
description: Initial deposits into user accounts.
documents:
- { id: 1, sender: DEPOSIT, recipient: alice, amount: 100 }
- { id: 2, sender: DEPOSIT, recipient: bob, amount: 100 }
- { id: 3, sender: DEPOSIT, recipient: carol, amount: 100 }
- ingest:
collection: acmeBank/transfers
description: Transfers between users, and a withdraw.
documents:
- { id: 4, sender: alice, recipient: bob, amount: 20 }
- { id: 5, sender: bob, recipient: carol, amount: 40 }
- { id: 6, sender: carol, recipient: alice, amount: 90 }
- { id: 7, sender: bob, recipient: DEPOSIT, amount: 40 }
- verify:
collection: acmeBank/balances
description: Verify expected balances.
documents:
- { user: DEPOSIT, balance: -260 }
- { user: alice, balance: 170 }
- { user: bob, balance: 40 }
- { user: carol, balance: 50 }