(t *testing.T)
| 83 | } |
| 84 | |
| 85 | func TestClient_Loop(t *testing.T) { |
| 86 | c := NewClient() |
| 87 | c.run = noRun |
| 88 | |
| 89 | if c.Loop() { |
| 90 | t.Error("should not run if noRun") |
| 91 | } |
| 92 | |
| 93 | // immitate connection |
| 94 | c.conn.Store(&amqp.Connection{}) |
| 95 | c.run = run |
| 96 | |
| 97 | if !c.Loop() { |
| 98 | t.Error("should tell loop to run") |
| 99 | } |
| 100 | } |
| 101 | |
| 102 | func TestClient_reportErr(t *testing.T) { |
| 103 | c := NewClient() |