From b70253ec48ff177088260d247871c41084ecb67a Mon Sep 17 00:00:00 2001 From: Vartan Benohanian Date: Mon, 22 Jun 2020 20:03:53 -0400 Subject: [PATCH] Rename trophies methods Signed-off-by: Vartan Benohanian --- user.go | 14 +++++++------- user_test.go | 8 ++++---- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/user.go b/user.go index 5932833..544cd46 100644 --- a/user.go +++ b/user.go @@ -40,8 +40,8 @@ type UserService interface { Unblock(ctx context.Context, username string) (*Response, error) // UnblockByID(ctx context.Context, id string) (*Response, error) - GetTrophies(ctx context.Context) (Trophies, *Response, error) - GetTrophiesOf(ctx context.Context, username string) (Trophies, *Response, error) + Trophies(ctx context.Context) (Trophies, *Response, error) + TrophiesOf(ctx context.Context, username string) (Trophies, *Response, error) } // UserServiceOp implements the UserService interface @@ -545,13 +545,13 @@ func (s *UserServiceOp) Unblock(ctx context.Context, username string) (*Response // return s.client.Do(ctx, req, nil) // } -// GetTrophies returns a list of your trophies. -func (s *UserServiceOp) GetTrophies(ctx context.Context) (Trophies, *Response, error) { - return s.GetTrophiesOf(ctx, s.client.Username) +// Trophies returns a list of your trophies. +func (s *UserServiceOp) Trophies(ctx context.Context) (Trophies, *Response, error) { + return s.TrophiesOf(ctx, s.client.Username) } -// GetTrophiesOf returns a list of the specified user's trophies. -func (s *UserServiceOp) GetTrophiesOf(ctx context.Context, username string) (Trophies, *Response, error) { +// TrophiesOf returns a list of the specified user's trophies. +func (s *UserServiceOp) TrophiesOf(ctx context.Context, username string) (Trophies, *Response, error) { path := fmt.Sprintf("api/v1/user/%s/trophies", username) req, err := s.client.NewRequest(http.MethodGet, path, nil) diff --git a/user_test.go b/user_test.go index 5d31aea..5c3a96d 100644 --- a/user_test.go +++ b/user_test.go @@ -734,7 +734,7 @@ func TestUserService_Unblock(t *testing.T) { // assert.NoError(t, err) // } -func TestUserService_GetTrophies(t *testing.T) { +func TestUserService_Trophies(t *testing.T) { setup() defer teardown() @@ -745,12 +745,12 @@ func TestUserService_GetTrophies(t *testing.T) { fmt.Fprint(w, blob) }) - trophies, _, err := client.User.GetTrophies(ctx) + trophies, _, err := client.User.Trophies(ctx) assert.NoError(t, err) assert.Equal(t, expectedTrophies, trophies) } -func TestUserService_GetTrophiesOf(t *testing.T) { +func TestUserService_TrophiesOf(t *testing.T) { setup() defer teardown() @@ -761,7 +761,7 @@ func TestUserService_GetTrophiesOf(t *testing.T) { fmt.Fprint(w, blob) }) - trophies, _, err := client.User.GetTrophiesOf(ctx, "test123") + trophies, _, err := client.User.TrophiesOf(ctx, "test123") assert.NoError(t, err) assert.Equal(t, expectedTrophies, trophies) }