WebHare community

Unit testing in WebHare: e-mail


How do you WebHare devs handle e-mails in unit testing? In other (internal) modules, I’m seeing a lot @beta.webhare.net e-mail addresses. Do you use these in tests and block WebHare from sending to this domain?

I’m guessing something like that and using

TestEq(1, Length(testfw->ExtractAllMailFor(email)));

to check if e-mails have been sent.

Correct? Or is there some (other) way to ‘catch’ outgoing e-mails in the test scripts?



Mail sent to a @beta.webhare.net address is never sent out, so it’s a safe domain for tests. ExtractAllMailFor removes the email from the queue directly, but if the test fails early, the blacklisting of beta.webhare.net will still prevent outgoing mail.

1 Like

closed #5