News for hackers. Stuff that matters.
Re:Questions to ask yourself when writing tests by falsedan on Tuesday January 02, 2018 @05:33AM (#16051082)
Yeah, exactly. To put it another way: get your business logic components to return data structures (a list of DB actions or an updated dict), and your core controller to turn those data structures into DB calls. Then your tests simply say: here’s a certain environment, what action do you think should be performed?

If you think this sounds like mocking, you’re right (it is like mocking, it isn’t mocking). It has the bonus of making it easier to inspect the logic & expose it to the user ("hey I’m about to do these things, does that sound ok to you?").

There are no comments on this comment yet.