package configloader

import (
    "testing"
)

// Test that ValidateMail() returns the mail address if it is valid.
func TestValidateMailAcceptsValidMailAddress(t *testing.T) {

    _, err := ValidateMail("test@example.com")

    if err != nil {
        t.Fatalf("ValidateMail() returns an error on a valid mail address")
    }

}

// Test that ValidateMail() filters out invalid mail addresses.
func TestValidateMailDoesNotAcceptInvalidMailAddress(t *testing.T) {

    _, err := ValidateMail("test")

    if err == nil {
        t.Fatalf("ValidateMail() does not prevent entering an invalid mail address")
    }

}
