mirror of
https://github.com/wneessen/go-mail.git
synced 2024-11-22 05:40:50 +01:00
Update client tests for message delivery indication
This commit adds checks in the testing functions to verify the successful implementation of message delivery status. A new attribute `isDelivered` is now being validated in our tests, reinforcing the message tracking system and enhancing the overall reliability of our application.
This commit is contained in:
parent
0b622368ba
commit
6746af4605
1 changed files with 6 additions and 1 deletions
|
@ -763,6 +763,9 @@ func TestClient_DialSendClose(t *testing.T) {
|
|||
if err := c.Close(); err != nil {
|
||||
t.Errorf("Close() failed: %s", err)
|
||||
}
|
||||
if !m.IsDelivered() {
|
||||
t.Errorf("message should be delivered but is indicated no to")
|
||||
}
|
||||
}
|
||||
|
||||
// TestClient_DialAndSendWithContext tests the DialAndSendWithContext() method of Client
|
||||
|
@ -1134,7 +1137,9 @@ func TestClient_DialAndSendWithContext_withSendError(t *testing.T) {
|
|||
}
|
||||
if se.IsTemp() {
|
||||
t.Errorf("expected permanent error but IsTemp() returned true")
|
||||
return
|
||||
}
|
||||
if m.IsDelivered() {
|
||||
t.Errorf("message is indicated to be delivered but shouldn't")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue