(t *testing.T)
| 573 | } |
| 574 | |
| 575 | func TestPsyNetRPC_IsConnected(t *testing.T) { |
| 576 | mockServer := NewMockWSServer() |
| 577 | defer mockServer.Close() |
| 578 | |
| 579 | psyNet := NewPsyNet() |
| 580 | rpc, err := psyNet.establishSocket(mockServer.URL(), "test-token", "test-session", "test-player") |
| 581 | if err != nil { |
| 582 | t.Fatalf("Failed to establish socket: %v", err) |
| 583 | } |
| 584 | |
| 585 | defer rpc.Close() |
| 586 | |
| 587 | // Should be connected initially |
| 588 | if !rpc.IsConnected() { |
| 589 | t.Error("Expected connection to be active initially") |
| 590 | } |
| 591 | |
| 592 | // Close connection |
| 593 | rpc.Close() |
| 594 | |
| 595 | // Should not be connected after close |
| 596 | if rpc.IsConnected() { |
| 597 | t.Error("Expected connection to be inactive after close") |
| 598 | } |
| 599 | } |
| 600 | |
| 601 | func TestPsyNetRPC_PingPongHandling(t *testing.T) { |
| 602 | mockServer := NewMockWSServer() |
nothing calls this directly
no test coverage detected