From 8942b08424e441fa6079583c5495fda4711268a9 Mon Sep 17 00:00:00 2001 From: Winni Neessen Date: Fri, 4 Oct 2024 22:36:28 +0200 Subject: [PATCH] Add validation for custom SMTP auth type in client tests Previously, only the presence of the SMTP auth method was checked, but not its type. This additional validation ensures that the SMTP auth type is correctly set to custom, thereby improving test accuracy. --- client_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/client_test.go b/client_test.go index 1539426..d8dc87f 100644 --- a/client_test.go +++ b/client_test.go @@ -602,6 +602,10 @@ func TestSetSMTPAuthCustom(t *testing.T) { if c.smtpAuth == nil { t.Errorf("failed to set custom SMTP auth method. SMTP Auth method is empty") } + if c.smtpAuthType != SMTPAuthCustom { + t.Errorf("failed to set custom SMTP auth method. SMTP Auth type is not custom: %s", + c.smtpAuthType) + } p, _, err := c.smtpAuth.Start(&si) if err != nil { t.Errorf("SMTP Auth Start() method returned error: %s", err)