-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #82 from ctreminiom/feature/sm-models-migration
🚚 Moved the common models to a dedicated shared package
- Loading branch information
Showing
33 changed files
with
798 additions
and
915 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,30 +57,6 @@ func TestCustomerService_Create(t *testing.T) { | |
wantErr: true, | ||
}, | ||
|
||
{ | ||
name: "CreateCustomerWhenTheEmailIsIncorrect", | ||
email: "examplegmail.com", | ||
displayName: "Example", | ||
mockFile: "./mocks/create-customer.json", | ||
wantHTTPMethod: http.MethodPost, | ||
endpoint: "/rest/servicedeskapi/customer", | ||
context: context.Background(), | ||
wantHTTPCodeReturn: http.StatusCreated, | ||
wantErr: true, | ||
}, | ||
|
||
{ | ||
name: "CreateCustomerWhenTheEmailIsToShort", | ||
email: "exa", | ||
displayName: "Example", | ||
mockFile: "./mocks/create-customer.json", | ||
wantHTTPMethod: http.MethodPost, | ||
endpoint: "/rest/servicedeskapi/customer", | ||
context: context.Background(), | ||
wantHTTPCodeReturn: http.StatusCreated, | ||
wantErr: true, | ||
}, | ||
|
||
{ | ||
name: "CreateCustomerWhenTheRequestMethodIsIncorrect", | ||
email: "[email protected]", | ||
|
@@ -210,51 +186,6 @@ func TestCustomerService_Create(t *testing.T) { | |
|
||
} | ||
|
||
func Test_isEmailValid(t *testing.T) { | ||
|
||
testCases := []struct { | ||
name string | ||
email string | ||
wantErr bool | ||
}{ | ||
{ | ||
name: "ValidateEmailWhenTheEmailIsCorrect", | ||
email: "[email protected]", | ||
wantErr: false, | ||
}, | ||
{ | ||
name: "ValidateEmailWhenTheEmailDoesNotHaveFormat", | ||
email: "ex", | ||
wantErr: true, | ||
}, | ||
{ | ||
name: "ValidateEmailWhenTheEmailIsIncorrect", | ||
email: "exampleeaasc", | ||
wantErr: true, | ||
}, | ||
{ | ||
name: "ValidateEmailWhenTheEmailIsEmpty", | ||
email: "", | ||
wantErr: true, | ||
}, | ||
} | ||
|
||
for _, testCase := range testCases { | ||
t.Run(testCase.name, func(t *testing.T) { | ||
|
||
isValid := isEmailValid(testCase.email) | ||
|
||
if testCase.wantErr { | ||
assert.Equal(t, false, isValid) | ||
} else { | ||
assert.Equal(t, true, isValid) | ||
} | ||
|
||
}) | ||
} | ||
|
||
} | ||
|
||
func TestCustomerService_Get(t *testing.T) { | ||
|
||
testCases := []struct { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.