-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgodog_baseline_example_test.go
36 lines (31 loc) · 1.63 KB
/
godog_baseline_example_test.go
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
28
29
30
31
32
33
34
35
36
package example
import (
"github.com/DATA-DOG/godog"
"github.com/jaysonesmith/godog-baseline-example/config"
)
func FeatureContext(s *godog.Suite) {
config := config.NewConfig()
context := NewTestContext(config)
t := &tester{
TestContext: context,
}
s.BeforeScenario(func(interface{}) {
// reset context between scenarios to avoid
// cross contamination of data
context = NewTestContext(config)
})
s.Step(`^Jack has \$(\d+) in (\d+) bill$`, t.JackHasInBill)
s.Step(`^he tries to deposit the money into an ATM$`, t.HeTriesToDepositTheMoneyIntoAnATM)
s.Step(`^the transaction is successful$`, t.TheTransactionIsSuccessful)
s.Step(`^Jack has \$(\d+) in (\d+) bills$`, t.JackHasInBills)
s.Step(`^the transaction must fail$`, t.TheTransactionMustFail)
s.Step(`^he must be told to try again with fewer bills$`, t.HeMustBeToldToTryAgainWithFewerBills)
s.Step(`^Jack has an account balance of \$(\d+)$`, t.JackHasAnAccountBalanceOf)
s.Step(`^he tries to deposit the money with a teller$`, t.HeTriesToDepositTheMoneyWithATeller)
s.Step(`^his account must accurately reflect the increased balance$`, t.HisAccountMustAccuratelyReflectTheIncreasedBalance)
s.Step(`^Jack has \$(\d+)\.(\d+) in (\d+) bill and (\d+) coin$`, t.JackHasInBillAndCoin)
s.Step(`^Jack attempts to withdraw \$(\d+) from an ATM$`, t.JackAttemptsToWithdrawFromAnATM)
s.Step(`^he must be informed of the daily limit$`, t.HeMustBeInformedOfTheDailyLimit)
s.Step(`^he must be informed that amounts must be in multiples of (\d+)$`, t.HeMustBeInformedThatAmountsMustBeInMultiplesOf)
s.Step(`^Jack attempts to withdraw \$(\d+) from a teller$`, t.JackAttemptsToWithdrawFromATeller)
}