Skip to content

Commit

Permalink
added files
Browse files Browse the repository at this point in the history
  • Loading branch information
KenWilliamson committed Mar 20, 2020
1 parent 6a91757 commit 2f42c03
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 5 deletions.
10 changes: 5 additions & 5 deletions coverage.out
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
mode: set
github.com/Ulbora/go-mail-sender/mockSender.go:13.57,15.2 1 1
github.com/Ulbora/go-mail-sender/mockSender.go:18.43,22.2 3 1
github.com/Ulbora/go-mail-sender/mockSender.go:34.58,36.2 1 1
github.com/Ulbora/go-mail-sender/mockSender.go:39.44,43.2 3 1
github.com/Ulbora/go-mail-sender/sender.go:31.53,33.60 2 1
github.com/Ulbora/go-mail-sender/sender.go:57.2,57.12 1 1
github.com/Ulbora/go-mail-sender/sender.go:33.60,36.36 3 1
github.com/Ulbora/go-mail-sender/sender.go:42.3,51.17 4 1
github.com/Ulbora/go-mail-sender/sender.go:36.36,38.36 2 1
github.com/Ulbora/go-mail-sender/sender.go:38.36,40.5 1 0
github.com/Ulbora/go-mail-sender/sender.go:38.36,40.5 1 1
github.com/Ulbora/go-mail-sender/sender.go:51.17,53.4 1 1
github.com/Ulbora/go-mail-sender/sender.go:53.9,55.4 1 1
github.com/Ulbora/go-mail-sender/sender.go:61.39,65.2 3 1
Expand Down Expand Up @@ -32,7 +36,3 @@ github.com/Ulbora/go-mail-sender/sender.go:130.11,132.6 1 0
github.com/Ulbora/go-mail-sender/sender.go:134.10,136.5 1 0
github.com/Ulbora/go-mail-sender/sender.go:137.9,139.4 1 0
github.com/Ulbora/go-mail-sender/sender.go:145.40,149.2 3 1
github.com/Ulbora/go-mail-sender/mockSender.go:13.57,15.2 1 0
github.com/Ulbora/go-mail-sender/mockSender.go:18.43,22.2 3 0
github.com/Ulbora/go-mail-sender/mockSender.go:34.58,36.2 1 0
github.com/Ulbora/go-mail-sender/mockSender.go:39.44,43.2 3 0
35 changes: 35 additions & 0 deletions mockSender_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package mailsender

import (
"testing"
)

func TestMockSender_SendPlain(t *testing.T) {
var ms MockPlainSender
ms.MockSuccess = true
s := ms.GetNew()
var m Mailer
m.SenderAddress = "sender@gmail.com"
m.Recipients = []string{"you@gmail.com"}
m.Subject = "Test Mail"
m.Body = "This is only a test."
suc := s.SendMail(&m)
if !suc {
t.Fail()
}
}

func TestMockSender_SendSecure(t *testing.T) {
var ms MockSecureSender
ms.MockSuccess = true
s := ms.GetNew()
var m Mailer
m.SenderAddress = "sender@gmail.com"
m.Recipients = []string{"you@gmail.com"}
m.Subject = "Test Mail"
m.Body = "This is only a test."
suc := s.SendMail(&m)
if !suc {
t.Fail()
}
}

0 comments on commit 2f42c03

Please sign in to comment.