-
Notifications
You must be signed in to change notification settings - Fork 1
/
delete_test.go
49 lines (37 loc) · 864 Bytes
/
delete_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
49
package main
import (
"context"
"testing"
)
func TestDelete(t *testing.T) {
ctx := context.Background()
opts := appOptions{}
t.Run("Subscription", func(t *testing.T) {
t.Parallel()
cb := fakeSubscriptionCallbacks{}
deleteSubscriptions(fakeClient{}, &cb, ctx, mockConfig, opts)
if !cb.IsInitialized {
t.Error("It must be initialized")
}
if !cb.IsFinazlied {
t.Error("It must be finalized")
}
if cb.Calls != 9 {
t.Errorf("Calls must be 9, but it is %d", cb.Calls)
}
})
t.Run("Topic", func(t *testing.T) {
t.Parallel()
cb := fakeTopicCallbacks{}
deleteTopics(fakeClient{}, &cb, ctx, mockConfig, opts)
if !cb.IsInitialized {
t.Error("It must be initialized")
}
if !cb.IsFinazlied {
t.Error("It must be finalized")
}
if cb.Calls != 3 {
t.Errorf("Calls must be 3, but it is %d", cb.Calls)
}
})
}