(t *testing.T)
| 37 | } |
| 38 | |
| 39 | func TestResolvePort(t *testing.T) { |
| 40 | port, err := ResolvePort("80", "https") |
| 41 | if err != nil { |
| 42 | t.Error(err) |
| 43 | } |
| 44 | if port != "80" { |
| 45 | t.Errorf("Expected %s, Got %s", "80", port) |
| 46 | } |
| 47 | port, err = ResolvePort("", "http") |
| 48 | if err != nil { |
| 49 | t.Error(err) |
| 50 | } |
| 51 | if port != "80" { |
| 52 | t.Errorf("Expected %s, Got %s", "80", port) |
| 53 | } |
| 54 | _, err = ResolvePort("", "rabbitmq") |
| 55 | if err == nil { |
| 56 | t.Errorf("Expected error %s, Got nil", "schema not found") |
| 57 | } |
| 58 | _, err = ResolvePort("", "") |
| 59 | if err == nil { |
| 60 | t.Errorf("Expected error %s, Got nil", "you should provide at least one of port or schema") |
| 61 | } |
| 62 | } |
nothing calls this directly
no test coverage detected