(t *testing.T)
| 47 | } |
| 48 | |
| 49 | func TestConnectionStatus(t *testing.T) { |
| 50 | s := RunDefaultServer() |
| 51 | defer s.Shutdown() |
| 52 | |
| 53 | nc := NewDefaultConnection(t) |
| 54 | defer nc.Close() |
| 55 | |
| 56 | if nc.Status() != nats.CONNECTED || nc.Status().String() != "CONNECTED" { |
| 57 | t.Fatal("Should have status set to CONNECTED") |
| 58 | } |
| 59 | |
| 60 | if !nc.IsConnected() { |
| 61 | t.Fatal("Should have status set to CONNECTED") |
| 62 | } |
| 63 | nc.Close() |
| 64 | if nc.Status() != nats.CLOSED || nc.Status().String() != "CLOSED" { |
| 65 | t.Fatal("Should have status set to CLOSED") |
| 66 | } |
| 67 | if !nc.IsClosed() { |
| 68 | t.Fatal("Should have status set to CLOSED") |
| 69 | } |
| 70 | } |
| 71 | |
| 72 | func TestConnClosedCB(t *testing.T) { |
| 73 | s := RunDefaultServer() |
nothing calls this directly
no test coverage detected