mirror of
https://github.com/AfterShip/email-verifier.git
synced 2025-02-06 09:44:47 +00:00
24 lines
404 B
Go
24 lines
404 B
Go
package emailverifier
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestCheckMxOK(t *testing.T) {
|
|
domain := "github.com"
|
|
|
|
mx, err := verifier.CheckMX(domain)
|
|
assert.NoError(t, err)
|
|
assert.True(t, mx.HasMXRecord)
|
|
}
|
|
|
|
func TestCheckNoMxOK(t *testing.T) {
|
|
domain := "githubexists.com"
|
|
|
|
mx, err := verifier.CheckMX(domain)
|
|
assert.Nil(t, mx)
|
|
assert.Error(t, err, ErrNoSuchHost)
|
|
}
|