Promote a mock

| 2 Comments
I knew it would happen eventually... As mentioned earlier all of the email filtering code has been developed without any sign of a main(). Now that the time has come to create the actual filter program I found that I didn't actually have a real version of one of the objects that I required, I only had a mock version for testing. The thing is, the mock version is pretty much all I need for the real version, so it looks like it's time to promote it...

Filters can be supplied with configuration data via the IManageFilterData interface. Whilst testing the filters that I've been developing I've used a mock filter data manager. Now that I'm building the real filter process I find that I don't have a real filter data manager. I expect that eventually I'll need a filter data manager that reads configuration data from files or a database but right now some hard coded strings will do; and for that, the mock version does pretty much all I need.

So I'm going to hoist the mock filter data manager out of the test suite and into the production code. To do this I need to write a test for it and move it into the production code library. I'll leave all of the tests using the mock version for now as I expect the production filter data manager will evolve reasonably quickly into something that doesn't support the current functionality...

2 Comments

Couple of things that spring to mind:

1) Have I missed something - Isn't procmail you friend?

2) How are you dealing with BCCs - I seem to remember you get a blank To:, because the BCC bit is in the SNMP stuff, and not available in the POP header?

Nice to see you're keeping youself busy, btw ;)

1) It's not really about the destination. It's about the journey.

2) I dont know, havent looked into that yet.

Leave a comment