Add test for invalid SMTPAuthType

Introduce a new test case to verify that `UnmarshalString` fails when given an invalid string. This ensures the robustness of the error handling in the `SMTPAuthType` unmarshalling process.
This commit is contained in:
Winni Neessen 2024-10-21 22:34:47 +02:00
parent bf44fd2ad1
commit 09133ef2a4
Signed by: wneessen
GPG key ID: 385AC9889632126E

View file

@ -48,4 +48,10 @@ func TestSMTPAuthType_UnmarshalString(t *testing.T) {
}
})
}
t.Run("should fail", func(t *testing.T) {
var authType SMTPAuthType
if err := authType.UnmarshalString("invalid"); err == nil {
t.Error("UnmarshalString() should have failed")
}
})
}