Skip to content

Commit

Permalink
add members to contestteam 2
Browse files Browse the repository at this point in the history
  • Loading branch information
0214sh7 committed Oct 26, 2023
1 parent 746e6e3 commit bee01d2
Showing 1 changed file with 22 additions and 10 deletions.
32 changes: 22 additions & 10 deletions interfaces/handler/contest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,10 @@ func TestContestHandler_GetContestTeams(t *testing.T) {
Name: random.AlphaNumeric(),
Result: random.AlphaNumeric(),
},
Members: make([]*domain.User, 0),
Members: []*domain.User{
domain.NewUser(random.UUID(), random.AlphaNumeric(), random.AlphaNumeric(), random.Bool()),
domain.NewUser(random.UUID(), random.AlphaNumeric(), random.AlphaNumeric(), random.Bool()),
},
},
{
ContestTeamWithoutMembers: domain.ContestTeamWithoutMembers{
Expand All @@ -547,21 +550,30 @@ func TestContestHandler_GetContestTeams(t *testing.T) {
Name: random.AlphaNumeric(),
Result: random.AlphaNumeric(),
},
Members: make([]*domain.User, 0),
Members: []*domain.User{
domain.NewUser(random.UUID(), random.AlphaNumeric(), random.AlphaNumeric(), random.Bool()),
domain.NewUser(random.UUID(), random.AlphaNumeric(), random.AlphaNumeric(), random.Bool()),
},
},
}
hres = []*schema.ContestTeam{
{
Id: repoContestTeams[0].ID,
Members: make([]schema.User, 0),
Name: repoContestTeams[0].Name,
Result: repoContestTeams[0].Result,
Id: repoContestTeams[0].ID,
Members: []schema.User{
{Id: repoContestTeams[0].Members[0].ID, Name: repoContestTeams[0].Members[0].Name, RealName: repoContestTeams[0].Members[0].RealName()},
{Id: repoContestTeams[0].Members[1].ID, Name: repoContestTeams[0].Members[1].Name, RealName: repoContestTeams[0].Members[1].RealName()},
},
Name: repoContestTeams[0].Name,
Result: repoContestTeams[0].Result,
},
{
Id: repoContestTeams[1].ID,
Members: make([]schema.User, 0),
Name: repoContestTeams[1].Name,
Result: repoContestTeams[1].Result,
Id: repoContestTeams[1].ID,
Members: []schema.User{
{Id: repoContestTeams[1].Members[0].ID, Name: repoContestTeams[1].Members[0].Name, RealName: repoContestTeams[1].Members[0].RealName()},
{Id: repoContestTeams[1].Members[1].ID, Name: repoContestTeams[1].Members[1].Name, RealName: repoContestTeams[1].Members[1].RealName()},
},
Name: repoContestTeams[1].Name,
Result: repoContestTeams[1].Result,
},
}
s.EXPECT().GetContestTeams(anyCtx{}, contestID).Return(repoContestTeams, nil)
Expand Down

0 comments on commit bee01d2

Please sign in to comment.