Tom Joe wrote:Is there any other way besides reflection
Tom Joe wrote:... reflection ...
Tom Joe wrote:Let me clarify.
Tom Joe wrote:Suppose that there are many tests/functions which could use different combinations of filters. But, some of these tests/functions use the exact same set of filters. So, I thought of creating combinations of filters which could be reused in different tests/functions. There are two possible solutions to create such combinations that I can think of at the moment.
Junilu Lacar wrote:First of all, if you really going to target Selenium, then learn about the Page Object pattern in Selenium. This will save you a lot of time and effort (and pain) if you start using this pattern in your tests.
Junilu Lacar wrote:
Ok, I think I see what you're trying to do and yes, the semantics are closer to what I would think of as a Command rather than a Predicate/Filter. However, the approach you show is totally backwards from what I would do. To tie this in to the other thread you started about TDD, this would be a perfect example of how TDD and the kind of thinking it develops coulda/woulda led you to a much better solution. If you're up for it, I can show you how I would do it, TDD style.
Tom Joe wrote:I sort of used TDD here. I wrote what the interface should look like and built the code accordingly. I wonder if it would be better to pick a new problem instead of this one for TDD, since I have a (ok ?) solution and hindsight might mess the TDD approach.
Tom Joe wrote:I sort of used TDD here. I wrote what the interface should look like and built the code accordingly.