-
-
Notifications
You must be signed in to change notification settings - Fork 19
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 #193 from mocktools/develop
Golang smtpmock v2.3.3
- Loading branch information
Showing
12 changed files
with
66 additions
and
30 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
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -226,20 +226,28 @@ func TestHandlerMaifromIsInvalidCmdArg(t *testing.T) { | |
} | ||
|
||
func TestHandlerMailfromMailfromEmail(t *testing.T) { | ||
handler := new(handlerMailfrom) | ||
validEmail, handler := "[email protected]", new(handlerMailfrom) | ||
|
||
t.Run("when request includes valid email address without <> sign", func(t *testing.T) { | ||
validEmail := "[email protected]" | ||
|
||
assert.Equal(t, validEmail, handler.mailfromEmail("MAIL FROM: "+validEmail)) | ||
}) | ||
|
||
t.Run("when request includes valid email address with <> sign", func(t *testing.T) { | ||
validEmail := "[email protected]" | ||
|
||
assert.Equal(t, validEmail, handler.mailfromEmail("MAIL FROM: "+"<"+validEmail+">")) | ||
}) | ||
|
||
t.Run("when request includes valid email address without <> sign, with name", func(t *testing.T) { | ||
assert.Equal(t, validEmail, handler.mailfromEmail("MAIL FROM: John Doe <"+validEmail+">")) | ||
}) | ||
|
||
t.Run("when request includes valid email address with <> sign, name with space", func(t *testing.T) { | ||
assert.Equal(t, validEmail, handler.mailfromEmail("MAIL FROM: "+"<John Doe <"+validEmail+">>")) | ||
}) | ||
|
||
t.Run("when request includes valid email address with <> sign and name without space", func(t *testing.T) { | ||
assert.Equal(t, validEmail, handler.mailfromEmail("MAIL FROM: "+"<JohnDoe<"+validEmail+">>")) | ||
}) | ||
|
||
t.Run("when request includes invalid email address", func(t *testing.T) { | ||
invalidEmail := "user@invalid" | ||
|
||
|
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 |
---|---|---|
|
@@ -326,20 +326,28 @@ func TestHandlerRcpttoIsInvalidCmdArg(t *testing.T) { | |
} | ||
|
||
func TestHandlerRcpttoRcpttoEmail(t *testing.T) { | ||
handler := new(handlerRcptto) | ||
validEmail, handler := "[email protected]", new(handlerRcptto) | ||
|
||
t.Run("when request includes valid email address without <> sign", func(t *testing.T) { | ||
validEmail := "[email protected]" | ||
|
||
assert.Equal(t, validEmail, handler.rcpttoEmail("RCPT TO: "+validEmail)) | ||
}) | ||
|
||
t.Run("when request includes valid email address with <> sign", func(t *testing.T) { | ||
validEmail := "[email protected]" | ||
|
||
assert.Equal(t, validEmail, handler.rcpttoEmail("RCPT TO: "+"<"+validEmail+">")) | ||
}) | ||
|
||
t.Run("when request includes valid email address without <> sign, with name", func(t *testing.T) { | ||
assert.Equal(t, validEmail, handler.rcpttoEmail("RCPT TO: John Doe <"+validEmail+">")) | ||
}) | ||
|
||
t.Run("when request includes valid email address with <> sign, name with space", func(t *testing.T) { | ||
assert.Equal(t, validEmail, handler.rcpttoEmail("RCPT TO: "+"<John Doe <"+validEmail+">>")) | ||
}) | ||
|
||
t.Run("when request includes valid email address with <> sign and name without space", func(t *testing.T) { | ||
assert.Equal(t, validEmail, handler.rcpttoEmail("RCPT TO: "+"<JohnDoe<"+validEmail+">>")) | ||
}) | ||
|
||
t.Run("when request includes invalid email address", func(t *testing.T) { | ||
invalidEmail := "user@invalid" | ||
|
||
|
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