| 10 | ) |
| 11 | |
| 12 | func TestConnectedState_String(t *testing.T) { |
| 13 | testCases := []struct { |
| 14 | connectionState ConnectionState |
| 15 | expectedString string |
| 16 | }{ |
| 17 | {ConnectionStateUnknown, "Invalid"}, |
| 18 | {ConnectionStateNew, "New"}, |
| 19 | {ConnectionStateChecking, "Checking"}, |
| 20 | {ConnectionStateConnected, "Connected"}, |
| 21 | {ConnectionStateCompleted, "Completed"}, |
| 22 | {ConnectionStateFailed, "Failed"}, |
| 23 | {ConnectionStateDisconnected, "Disconnected"}, |
| 24 | {ConnectionStateClosed, "Closed"}, |
| 25 | } |
| 26 | |
| 27 | for i, testCase := range testCases { |
| 28 | require.Equal(t, |
| 29 | testCase.expectedString, |
| 30 | testCase.connectionState.String(), |
| 31 | "testCase: %d %v", i, testCase, |
| 32 | ) |
| 33 | } |
| 34 | } |
| 35 | |
| 36 | func TestGatheringState_String(t *testing.T) { |
| 37 | testCases := []struct { |