(t *testing.T)
| 401 | } |
| 402 | |
| 403 | func TestIsClosed(t *testing.T) { |
| 404 | ts := startReconnectServer(t) |
| 405 | defer ts.Shutdown() |
| 406 | |
| 407 | nc := NewConnection(t, TEST_PORT) |
| 408 | defer nc.Close() |
| 409 | |
| 410 | if nc.IsClosed() { |
| 411 | t.Fatalf("IsClosed returned true when the connection is still open.") |
| 412 | } |
| 413 | ts.Shutdown() |
| 414 | if nc.IsClosed() { |
| 415 | t.Fatalf("IsClosed returned true when the connection is still open.") |
| 416 | } |
| 417 | ts = startReconnectServer(t) |
| 418 | defer ts.Shutdown() |
| 419 | if nc.IsClosed() { |
| 420 | t.Fatalf("IsClosed returned true when the connection is still open.") |
| 421 | } |
| 422 | nc.Close() |
| 423 | if !nc.IsClosed() { |
| 424 | t.Fatalf("IsClosed returned false after Close() was called.") |
| 425 | } |
| 426 | } |
| 427 | |
| 428 | func TestIsReconnectingAndStatus(t *testing.T) { |
| 429 | ts := startReconnectServer(t) |
nothing calls this directly
no test coverage detected