cdk icon indicating copy to clipboard operation
cdk copied to clipboard

ponder about using parameterized tests to use builder

Open egonw opened this issue 3 years ago • 4 comments

in the past, JUnit did not make it easy to use the same test with various settings, e.g. various IChemObjectBuilder. At the time, this was solved by using abstract classes, static methods, and dedicated subclasses extending the abstract class and setting the builder to use.

I wonder with the modern JUnit and parameterized tests, we can just say run this test with these classes. Problem, if the parameters are all builders, these tests would have to be in a (test) module that depends on all the implementations...

Comment, ideas, etc welcome! Maybe it should just stay with wondering and maybe the current solution is not that bad after all...

egonw avatar Feb 07 '22 11:02 egonw

I think these are good as the AbstractAtomContainerTest ATM.

johnmay avatar Feb 07 '22 11:02 johnmay

Parameterised tests are more for lots of different inputs, e.g. a validation suite. It would be hard to this for silent/data since the tests are in different modules.

johnmay avatar Feb 07 '22 11:02 johnmay

Close as stale... I don't think parameterised tests make sense here. Particularly because you would have to test them all in a module which included all dependencies. I prefer it at the moment where the test for silent and in silent/test (cdk-test-silent).

johnmay avatar Sep 12 '22 07:09 johnmay

Somewhere they could/should be used is AtomTyping...

johnmay avatar Sep 12 '22 07:09 johnmay