You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

41 lines
832 B

package dao
import (
"go-common/app/admin/ep/merlin/model"
"testing"
. "github.com/smartystreets/goconvey/convey"
)
var (
username = "[email protected]"
)
func Test_Mail_Log(t *testing.T) {
Convey("test add mail log", t, func() {
ml := &model.MailLog{
ReceiverName: username,
MailType: 1,
SendContext: "test add mail log",
}
err := d.InsertMailLog(ml)
So(err, ShouldBeNil)
})
Convey("test find mail log", t, func() {
mailLogs, err := d.FindMailLog(username)
So(len(mailLogs), ShouldBeGreaterThan, 0)
So(err, ShouldBeNil)
})
Convey("test delete mail log", t, func() {
err := d.DelMailLog(username)
So(err, ShouldBeNil)
})
Convey("test find mail log", t, func() {
mailLogs, err := d.FindMailLog(username)
So(len(mailLogs), ShouldEqual, 0)
So(err, ShouldBeNil)
})
}