-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathresult_steps.go
36 lines (29 loc) · 1022 Bytes
/
result_steps.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 (
"fmt"
"github.com/DATA-DOG/godog"
)
func (t *tester) TheTransactionIsSuccessful() error {
if t.TestContext.TransactionResponse != "" {
return fmt.Errorf("expected transaction to be successful, but got %s", t.TestContext.TransactionResponse)
}
return nil
}
func (t *tester) TheTransactionMustFail() error {
if t.TestContext.TransactionResponse == "" {
return fmt.Errorf("expected transaction to have failed, but it was successful")
}
return nil
}
func (t *tester) HeMustBeToldToTryAgainWithFewerBills() error {
return godog.ErrPending
}
func (t *tester) HeMustBeInformedOfTheDailyLimit() error {
if t.TestContext.TransactionResponse == "unable to process transaction as desired amount exceeds daily limit" {
return fmt.Errorf("expected daily limit message but an unexpected transaction response was returned: %s", t.TestContext.TransactionResponse)
}
return nil
}
func (t *tester) HeMustBeInformedThatAmountsMustBeInMultiplesOf(arg1 int) error {
return godog.ErrPending
}