Testing a query builder

stelladenim

New Member
I am building a query builder that I want to unit test.
I don't know how to go about it though.It (currently) consists of two parts: the \[code\]QueryBuilder\[/code\] itself which provides a fluent interface for constructing queries. And a \[code\]SqlConstructor\[/code\] that takes care of constructing the actual SQL.So basically, how do I test 'correctness'? Should I just test for the existence of keywords? (Like, \[code\]select\[/code\] being the first keyword in a select-type query?) I think to test correctly, there are a whole lot of things that are important, like the order in which keywords appear etc. etc.
 
Back
Top