Skip to content

Commit

Permalink
static variables updated
Browse files Browse the repository at this point in the history
  • Loading branch information
erkanzsy committed Jul 6, 2023
1 parent dc85e32 commit 74af2ad
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions threds_api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,31 @@ import (
"testing"
)

var (
USERNAME = "zuck"
USERID = "314216"
)

func TestUserIDFromUsername_ShouldReturnNoError(t *testing.T) {
userId, _ := UserIDFromUsername("zuck")
userId, _ := UserIDFromUsername(USERNAME)

if "314216" != userId {
if USERID != userId {
t.Errorf(fmt.Sprintf("userId: %s", userId))
}
}

func TestUserProfile_ShouldReturnNoError(t *testing.T) {
userProfile, _ := UserProfile("zuck", "314216")
userProfile, _ := UserProfile(USERNAME, USERID)

if "zuck" != userProfile.Data.UserData.User.Username {
if USERNAME != userProfile.Data.UserData.User.Username {
t.Errorf(fmt.Sprintf("username: %s", userProfile.Data.UserData.User.Username))
}
}

func TestUserThreads_ShouldReturnNoError(t *testing.T) {
threads, _ := UserThreads("zuck", "314216")
threads, _ := UserThreads(USERNAME, USERID)

if "zuck" != threads.Data.MediaData.Threads[0].ThreadItems[0].Post.User.Username {
if USERNAME != threads.Data.MediaData.Threads[0].ThreadItems[0].Post.User.Username {
t.Errorf(fmt.Sprintf("username: %s", threads.Data.MediaData.Threads[0].ThreadItems[0].Post.User.Username))
}
}

0 comments on commit 74af2ad

Please sign in to comment.