-
Notifications
You must be signed in to change notification settings - Fork 45
/
operation_test.go
44 lines (30 loc) · 1 KB
/
operation_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
package zapdriver
import (
"testing"
"github.com/stretchr/testify/assert"
"go.uber.org/zap"
)
func TestOperation(t *testing.T) {
t.Parallel()
op := &operation{ID: "id", Producer: "producer", First: true, Last: false}
field := Operation("id", "producer", true, false)
assert.Equal(t, zap.Object(operationKey, op), field)
}
func TestOperationStart(t *testing.T) {
t.Parallel()
op := &operation{ID: "id", Producer: "producer", First: true, Last: false}
field := OperationStart("id", "producer")
assert.Equal(t, zap.Object(operationKey, op), field)
}
func TestOperationCont(t *testing.T) {
t.Parallel()
op := &operation{ID: "id", Producer: "producer", First: false, Last: false}
field := OperationCont("id", "producer")
assert.Equal(t, zap.Object(operationKey, op), field)
}
func TestOperationEnd(t *testing.T) {
t.Parallel()
op := &operation{ID: "id", Producer: "producer", First: false, Last: true}
field := OperationEnd("id", "producer")
assert.Equal(t, zap.Object(operationKey, op), field)
}