Skip to content

Commit

Permalink
test: create test cases for buildCreateUserRequest
Browse files Browse the repository at this point in the history
  • Loading branch information
christiangda committed Oct 1, 2023
1 parent 4d97a9b commit 9a40b4c
Showing 1 changed file with 90 additions and 0 deletions.
90 changes: 90 additions & 0 deletions internal/scim/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,96 @@ func Test_buildCreateUserRequest(t *testing.T) {
},
},
},
{
name: "user with name and email",
args: args{
user: &model.User{
Name: &model.Name{
FamilyName: "familyName",
GivenName: "givenName",
Formatted: "formatted",
MiddleName: "middleName",
HonorificPrefix: "honorificPrefix",
HonorificSuffix: "honorificSuffix",
},
Emails: []model.Email{
{
Value: "email",
Type: "work",
Primary: true,
},
},
},
},
want: &aws.CreateUserRequest{
Name: &aws.Name{
FamilyName: "familyName",
GivenName: "givenName",
Formatted: "formatted",
MiddleName: "middleName",
HonorificPrefix: "honorificPrefix",
HonorificSuffix: "honorificSuffix",
},
Emails: []aws.Email{
{
Value: "email",
Type: "work",
Primary: true,
},
},
},
},
{
name: "user with name and email and phone",
args: args{
user: &model.User{
Name: &model.Name{
FamilyName: "familyName",
GivenName: "givenName",
Formatted: "formatted",
MiddleName: "middleName",
HonorificPrefix: "honorificPrefix",
HonorificSuffix: "honorificSuffix",
},
Emails: []model.Email{
{
Value: "email",
Type: "work",
Primary: true,
},
},
PhoneNumbers: []model.PhoneNumber{
{
Value: "phone",
Type: "work",
},
},
},
},
want: &aws.CreateUserRequest{
Name: &aws.Name{
FamilyName: "familyName",
GivenName: "givenName",
Formatted: "formatted",
MiddleName: "middleName",
HonorificPrefix: "honorificPrefix",
HonorificSuffix: "honorificSuffix",
},
Emails: []aws.Email{
{
Value: "email",
Type: "work",
Primary: true,
},
},
PhoneNumbers: []aws.PhoneNumber{
{
Value: "phone",
Type: "work",
},
},
},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
Expand Down

0 comments on commit 9a40b4c

Please sign in to comment.