(t *testing.T)
| 91 | } |
| 92 | |
| 93 | func TestClient_RemoveUser_HubBody(t *testing.T) { |
| 94 | mh := &mockHub{resp: json.RawMessage(`{}`)} |
| 95 | c := NewClientWithHub("n", mh) |
| 96 | if err := c.RemoveUser(context.Background(), "tag-1", "user@@@tag-1"); err != nil { |
| 97 | t.Fatalf("unexpected: %v", err) |
| 98 | } |
| 99 | got, ok := mh.lastBody.(map[string]string) |
| 100 | if !ok { |
| 101 | t.Fatalf("expected map body, got %T", mh.lastBody) |
| 102 | } |
| 103 | if got["inbound_tag"] != "tag-1" || got["email"] != "user@@@tag-1" { |
| 104 | t.Fatalf("unexpected body: %+v", got) |
| 105 | } |
| 106 | if mh.lastMethod != "RemoveUser" { |
| 107 | t.Fatalf("unexpected method: %q", mh.lastMethod) |
| 108 | } |
| 109 | } |
| 110 | |
| 111 | func TestClient_NilHub_ReturnsErrHubNotConfigured(t *testing.T) { |
| 112 | // hub == nil 是偏执检查路径:所有方法都应返回 ErrHubNotConfigured, |
nothing calls this directly
no test coverage detected