(t *testing.T)
| 69 | } |
| 70 | |
| 71 | func TestConsumer_Deliveries(t *testing.T) { |
| 72 | c := newTestConsumer() |
| 73 | go func() { |
| 74 | select { |
| 75 | case c.deliveries <- amqp.Delivery{Body: []byte("hello")}: |
| 76 | case <-time.After(1 * time.Millisecond): |
| 77 | t.Error("timeout") |
| 78 | } |
| 79 | }() |
| 80 | |
| 81 | select { |
| 82 | case d := <-c.Deliveries(): |
| 83 | if bytes.Compare(d.Body, []byte("hello")) != 0 { |
| 84 | t.Error("amqp.Delivery should be the same") |
| 85 | } |
| 86 | case <-time.After(1 * time.Millisecond): |
| 87 | t.Error("Deliveries() channel should deliver amqp.Delivery{}") |
| 88 | } |
| 89 | } |
| 90 | |
| 91 | func TestConsumer_Errors(t *testing.T) { |
| 92 | c := newTestConsumer() |
nothing calls this directly
no test coverage detected