-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtransaction_test.go
48 lines (41 loc) · 1.07 KB
/
transaction_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
37
38
39
40
41
42
43
44
45
46
47
48
package cbtransaction
import (
"github.com/codingbeard/cbtransaction/transaction"
"testing"
)
func TestActionEnum_IsAdd(t *testing.T) {
action := transaction.ActionAdd
if !action.IsAdd() {
t.Error("IsAdd is incorrect, got: false, want: true")
}
if action.IsRemove() {
t.Error("IsRemove is incorrect, got: true, want: false")
}
if action.IsClear() {
t.Error("IsClear is incorrect, got: true, want: false")
}
}
func TestActionEnum_IsRemove(t *testing.T) {
action := transaction.ActionRemove
if action.IsAdd() {
t.Error("IsAdd is incorrect, got: true, want: false")
}
if !action.IsRemove() {
t.Error("IsRemove is incorrect, got: false, want: true")
}
if action.IsClear() {
t.Error("IsClear is incorrect, got: true, want: false")
}
}
func TestActionEnum_IsClear(t *testing.T) {
action := transaction.ActionClear
if action.IsAdd() {
t.Error("IsAdd is incorrect, got: true, want: false")
}
if action.IsRemove() {
t.Error("IsRemove is incorrect, got: true, want: false")
}
if !action.IsClear() {
t.Error("IsClear is incorrect, got: false, want: true")
}
}