forked from elliotchance/mocksqs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlist_test.go
55 lines (46 loc) · 1.51 KB
/
list_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
50
51
52
53
54
55
package mocksqs_test
import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/sqs"
"github.com/elliotchance/mocksqs"
"github.com/stretchr/testify/assert"
"testing"
)
func TestSQS_ListQueues(t *testing.T) {
t.Run("WithoutQueueNamePrefix", func(t *testing.T) {
client := getSQSClientWithQueue()
defer client.cleanup()
result, err := client.client.ListQueues(&sqs.ListQueuesInput{})
assert.NoError(t, err)
assertContainsAWSString(t, client.queueURL, result.QueueUrls)
})
t.Run("WithQueueNamePrefix", func(t *testing.T) {
client := getSQSClientWithQueue()
defer client.cleanup()
result, err := client.client.ListQueues(&sqs.ListQueuesInput{
QueueNamePrefix: aws.String("wont-match-anything"),
})
assert.NoError(t, err)
assert.Len(t, result.QueueUrls, 0)
})
}
func TestSQS_ListQueuesWithContext(t *testing.T) {
assert.PanicsWithValue(t, "ListQueuesWithContext is not implemented", func() {
mocksqs.New().ListQueuesWithContext(nil, nil)
})
}
func TestSQS_ListQueuesRequest(t *testing.T) {
assert.PanicsWithValue(t, "ListQueuesRequest is not implemented", func() {
mocksqs.New().ListQueuesRequest(nil)
})
}
func TestSQS_ListQueuesPages(t *testing.T) {
assert.PanicsWithValue(t, "ListQueuesPages is not implemented", func() {
mocksqs.New().ListQueuesPages(nil, nil)
})
}
func TestSQS_ListQueuesPagesWithContext(t *testing.T) {
assert.PanicsWithValue(t, "ListQueuesPagesWithContext is not implemented", func() {
mocksqs.New().ListQueuesPagesWithContext(nil, nil, nil)
})
}