Thanks for your response. I think things are clearer.
I think my first mistake is that I am still not breaking my methods up into enough smaller methods.
I also think I have been trying to test all the code in a method when in fact I should only be testing those things that produce a result which in turn should be a method of its own.
Do to lack of training I have always done things from the seat of my pants and just started writing the code. No real planning accept in my head. I have been working with a flowchart lately to try and outline my approach to a problem. I am thinking that what I need to do in the flowchart is write it in a way to shows each of the smaller methods that will be needed to complete the main method and then a chart for each of those methods. From this I am hoping to be able to develop the tests methods.
Not sure it this doesn't just add more work but I do better with pictures.
Does this sound like I am on the right approach?
Ken
> --
> UnitTester: unit testing and test-driven development for 4D.
> www.unittester4d.com
>
> You received this message because you are subscribed to the Google
> Groups "UnitTester" group.
> To post to this group, send email to unitt...@googlegroups.com
> To unsubscribe from this group, send email to
> unittester+...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/unittester?hl=en
On Aug 4, 2010, at 8:06 PM, Mark Schaake wrote:
> In order to unit test, your code must be designed in a way to
> facilitate unit testing. This means that your code must be able to be
> executed in isolation (think not dependent on other records or system-
> wide configuration settings).
Are you saying that if an action depends on a record or system setting you can't test it?
Let say I want to do a simple query that needs to use a stored date from a [setting] record.
Are you saying that I would need to first get the [Setting]date and assign it to a variable that then is passed to the Query_Method instead of actually using the [setting]date field in the Query_Method?
The main method that assigns the [setting]date would not be tested but the Query_Method could be. Is this correct?
Thanks,
Ken
Thanks, that does clear thing up.
Hopefully I can get things working properly now.
Ken