Exam BDD Framework >

DbUnit operations allows to append, update and delete rows.

Before each example

Given:

product
idnameprice
1Adam10
2Bob20

Append rows

.product
[{db-set-insert}]
,===
id, name, price

3, Carl, 30
,===
Example 1. Append rows

When append row:

product
idnameprice
3Carl30

Then row added:

product
idnameprice
1Adam10.00
2Bob20.00
3Carl30.00

Update rows

.product
[{db-set-update}]
,===
id, name, price

2, Bob2, 22
,===
Example 2. Update rows

When update row

product
idnameprice
2Bob222

Then second row updated

product
idnameprice
1Adam10.00
2Bob222.00

Delete rows

.product
[{db-set-delete}]
,===
id

2
,===
Example 3. Delete rows

When delete row

product
id
2

Then second row deleted

product
idnameprice
1Adam10.00