[go-nuts] Re: How to build mock class?

2016-09-07 Thread Simon Ritchie
When I said that you can only mock well-behaved classes, I should have said more. When I say mock, I mean something that satisfies an interface and drives a test. You can also use what I call a dummy to drive your test. To me a dummy is a real structure, such as an http Request, which you cre

[go-nuts] Re: How to build mock class?

2016-09-07 Thread Simon Ritchie
I think your problem is this: You have a piece of code that uses a class. You have two classes, one real, one mock and you want to write some client code that can use either of them. Is that right? If you want to use mocking, you must write your classes in the appropriate way, so you may nee