MCPcopy
hub / github.com/sideshow/apns2 / TestClientManagerAddWithoutNew

Function TestClientManagerAddWithoutNew

client_manager_test.go:38–56  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

36}
37
38func TestClientManagerAddWithoutNew(t *testing.T) {
39 wg := sync.WaitGroup{}
40
41 manager := apns2.ClientManager{
42 MaxSize: 1,
43 MaxAge: 5 * time.Minute,
44 Factory: apns2.NewClient,
45 }
46
47 for i := 0; i < 2; i++ {
48 wg.Add(1)
49 go func() {
50 manager.Add(apns2.NewClient(mockCert()))
51 assert.Equal(t, 1, manager.Len())
52 wg.Done()
53 }()
54 }
55 wg.Wait()
56}
57
58func TestClientManagerLenWithoutNew(t *testing.T) {
59 manager := apns2.ClientManager{

Callers

nothing calls this directly

Calls 4

AddMethod · 0.95
LenMethod · 0.95
NewClientFunction · 0.92
mockCertFunction · 0.85

Tested by

no test coverage detected