Hi Ron, my message of 6:30pm (in england - it was 14 minutes before your
message) answers this question with a simple example.
My aim is simply to put bits of tests into a function, to avoid redundancy
in my test code.
The question is where to put this "bit of test" function.
In a role (in Perl) / interface (in Java) ?
In a package that will keep in my unit test directory ?
This second solution seems less intrusive and dangerous.
On Fri, Aug 31, 2012 at 6:54 PM, RonJeffries <ronjeffries@...> wrote:
**
Why do you have these sugar methods? What do they do? Why can't you test
the Vehicle directly?
R
On Aug 31, 2012, at 1:06 PM, pierre masci <piemas25@...> wrote:
Is it a good or bad idea to subclass the Vehicule class with the
Vehicule_ForTests class,
which would contain all the "sugar" methods that i use to test the
Vehicule
class ?
It seems good, to not add useless methods to the public API...
but one could say that i can obtain the same result by starting my "sugar
for tests" methods with "_T" for instance.
It still feels nice to have these functions in a separate place.
Could it be dangerous or uncomfortable, too ?
Ron Jeffries
www.XProgramming.com
Impossible is not a fact. It is an opinion. -- Muhammad Ali
[Non-text portions of this message have been removed]
[Non-text portions of this message have been removed]