Skip to content

Commit b51be1c

Browse files
committed
move test helpers to _test.go file
1 parent ac5a621 commit b51be1c

File tree

2 files changed

+44
-41
lines changed

2 files changed

+44
-41
lines changed

cony.go

-41
Original file line numberDiff line numberDiff line change
@@ -46,44 +46,3 @@ type mqChannel interface {
4646
Publish(string, string, bool, bool, amqp.Publishing) error
4747
Qos(int, int, bool) error
4848
}
49-
50-
type mqDeleterTest struct {
51-
_deletePublisher func(*Publisher)
52-
_deleteConsumer func(*Consumer)
53-
}
54-
55-
func (m *mqDeleterTest) deletePublisher(p *Publisher) {
56-
m._deletePublisher(p)
57-
}
58-
59-
func (m *mqDeleterTest) deleteConsumer(c *Consumer) {
60-
m._deleteConsumer(c)
61-
}
62-
63-
type mqChannelTest struct {
64-
_Close func() error
65-
_Consume func(string, string, bool, bool, bool, bool, amqp.Table) (<-chan amqp.Delivery, error)
66-
_NotifyClose func(chan *amqp.Error) chan *amqp.Error
67-
_Publish func(string, string, bool, bool, amqp.Publishing) error
68-
_Qos func(int, int, bool) error
69-
}
70-
71-
func (m *mqChannelTest) Close() error {
72-
return m._Close()
73-
}
74-
75-
func (m *mqChannelTest) Consume(name string, tag string, autoAck bool, exclusive bool, noLocal bool, noWait bool, args amqp.Table) (<-chan amqp.Delivery, error) {
76-
return m._Consume(name, tag, autoAck, exclusive, noLocal, noWait, args)
77-
}
78-
79-
func (m *mqChannelTest) NotifyClose(c chan *amqp.Error) chan *amqp.Error {
80-
return m._NotifyClose(c)
81-
}
82-
83-
func (m *mqChannelTest) Publish(exchange string, key string, mandatory bool, immediate bool, msg amqp.Publishing) error {
84-
return m._Publish(exchange, key, mandatory, immediate, msg)
85-
}
86-
87-
func (m *mqChannelTest) Qos(prefetchCount int, prefetchSize int, global bool) error {
88-
return m._Qos(prefetchCount, prefetchSize, global)
89-
}

cony_test.go

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
package cony
2+
3+
import "github.com/streadway/amqp"
4+
5+
type mqDeleterTest struct {
6+
_deletePublisher func(*Publisher)
7+
_deleteConsumer func(*Consumer)
8+
}
9+
10+
func (m *mqDeleterTest) deletePublisher(p *Publisher) {
11+
m._deletePublisher(p)
12+
}
13+
14+
func (m *mqDeleterTest) deleteConsumer(c *Consumer) {
15+
m._deleteConsumer(c)
16+
}
17+
18+
type mqChannelTest struct {
19+
_Close func() error
20+
_Consume func(string, string, bool, bool, bool, bool, amqp.Table) (<-chan amqp.Delivery, error)
21+
_NotifyClose func(chan *amqp.Error) chan *amqp.Error
22+
_Publish func(string, string, bool, bool, amqp.Publishing) error
23+
_Qos func(int, int, bool) error
24+
}
25+
26+
func (m *mqChannelTest) Close() error {
27+
return m._Close()
28+
}
29+
30+
func (m *mqChannelTest) Consume(name string, tag string, autoAck bool, exclusive bool, noLocal bool, noWait bool, args amqp.Table) (<-chan amqp.Delivery, error) {
31+
return m._Consume(name, tag, autoAck, exclusive, noLocal, noWait, args)
32+
}
33+
34+
func (m *mqChannelTest) NotifyClose(c chan *amqp.Error) chan *amqp.Error {
35+
return m._NotifyClose(c)
36+
}
37+
38+
func (m *mqChannelTest) Publish(exchange string, key string, mandatory bool, immediate bool, msg amqp.Publishing) error {
39+
return m._Publish(exchange, key, mandatory, immediate, msg)
40+
}
41+
42+
func (m *mqChannelTest) Qos(prefetchCount int, prefetchSize int, global bool) error {
43+
return m._Qos(prefetchCount, prefetchSize, global)
44+
}

0 commit comments

Comments
 (0)