SymSpell icon indicating copy to clipboard operation
SymSpell copied to clipboard

Introduce an interface to SymSpell class to simplify mocking/testing

Open sergii-sakharov opened this issue 6 years ago • 2 comments

At the moment we're forced to writing our own wrappers around SymSpell that would allow mocking the class in our unit tests. A predefined interface (or at least virtual attributes on most of the compute-intensive methods) would remove this requirement.

P.S. I'm happy with doing a pull request in case it is an acceptable change

sergii-sakharov avatar Jan 25 '19 12:01 sergii-sakharov

I see your point. But both Javascript and Python don't support the interface concept, while they are the most actively used ports of SymSpell. And even in the other languages probably not all developers are familiar with that concept. This would lead to fewer or more deviating ports. Therefore I would like to keep it simple and stick to basic language features which easily can be understood and ported to other languages.

wolfgarbe avatar Jan 27 '19 13:01 wolfgarbe

What about making methods virtual then as that would allow mocking too?

sergii-sakharov avatar Jan 28 '19 11:01 sergii-sakharov