MCPcopy
hub / github.com/minio/minio-go / TestConfig_Equal

Function TestConfig_Equal

pkg/notification/notification_test.go:111–214  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

109}
110
111func TestConfig_Equal(t *testing.T) {
112 type fields struct {
113 ID string
114 Arn Arn
115 Events []EventType
116 Filter *Filter
117 }
118 type args struct {
119 events []EventType
120 prefix string
121 suffix string
122 }
123 tests := []struct {
124 name string
125 fields fields
126 args args
127 want bool
128 }{
129 {
130 name: "same order",
131 fields: fields{
132 Arn: NewArn("minio", "sqs", "", "1", "postgresql"),
133 Events: []EventType{ObjectCreatedAll, ObjectAccessedAll},
134 Filter: &Filter{
135 S3Key: S3Key{
136 FilterRules: []FilterRule{{Name: "prefix", Value: "prefix1"}, {Name: "suffix", Value: "suffix1"}},
137 },
138 },
139 },
140 args: args{
141 events: []EventType{ObjectCreatedAll, ObjectAccessedAll},
142 prefix: "prefix1",
143 suffix: "suffix1",
144 },
145 want: true,
146 },
147 {
148 name: "different order",
149 fields: fields{
150 Arn: NewArn("minio", "sqs", "", "1", "postgresql"),
151 Events: []EventType{ObjectAccessedAll, ObjectCreatedAll},
152 Filter: &Filter{
153 S3Key: S3Key{
154 FilterRules: []FilterRule{{Name: "suffix", Value: "suffix1"}, {Name: "prefix", Value: "prefix1"}},
155 },
156 },
157 },
158 args: args{
159 events: []EventType{ObjectCreatedAll, ObjectAccessedAll},
160 prefix: "prefix1",
161 suffix: "suffix1",
162 },
163 want: true,
164 },
165 {
166 name: "not equal",
167 fields: fields{
168 Arn: NewArn("minio", "sqs", "", "1", "postgresql"),

Callers

nothing calls this directly

Calls 2

EqualMethod · 0.95
NewArnFunction · 0.85

Tested by

no test coverage detected