github.com/lingyao2333/mo-zero@v1.4.1/core/stores/mongo/pipe_test.go (about) 1 package mongo 2 3 import ( 4 "testing" 5 6 "github.com/lingyao2333/mo-zero/core/breaker" 7 "github.com/stretchr/testify/assert" 8 ) 9 10 func TestRejectedPipe_All(t *testing.T) { 11 assert.Equal(t, breaker.ErrServiceUnavailable, new(rejectedPipe).All(nil)) 12 } 13 14 func TestRejectedPipe_AllowDiskUse(t *testing.T) { 15 var p rejectedPipe 16 assert.Equal(t, p, p.AllowDiskUse()) 17 } 18 19 func TestRejectedPipe_Batch(t *testing.T) { 20 var p rejectedPipe 21 assert.Equal(t, p, p.Batch(1)) 22 } 23 24 func TestRejectedPipe_Collation(t *testing.T) { 25 var p rejectedPipe 26 assert.Equal(t, p, p.Collation(nil)) 27 } 28 29 func TestRejectedPipe_Explain(t *testing.T) { 30 assert.Equal(t, breaker.ErrServiceUnavailable, new(rejectedPipe).Explain(nil)) 31 } 32 33 func TestRejectedPipe_Iter(t *testing.T) { 34 assert.EqualValues(t, rejectedIter{}, new(rejectedPipe).Iter()) 35 } 36 37 func TestRejectedPipe_One(t *testing.T) { 38 assert.Equal(t, breaker.ErrServiceUnavailable, new(rejectedPipe).One(nil)) 39 } 40 41 func TestRejectedPipe_SetMaxTime(t *testing.T) { 42 var p rejectedPipe 43 assert.Equal(t, p, p.SetMaxTime(0)) 44 }