Main icon indicating copy to clipboard operation
Main copied to clipboard

redo our test utils

Open NivShalmon opened this issue 8 years ago • 0 comments

Our test utils became very messy as we added new utils we needs, and have a lot of code duplication. Currently, we have TestOperand and OperandBloating, whose main difference is whether names are significant or not, yet their names and factories don't really tell that. Then, OperandBloating also allows testing with binding, bu tin a very aqward manner of: bloatingOf(class).givesWithBinding(res,function) This should instead look like: bloatingWithBindingOf(class,function).gives(res) for many reasons, such as preventing givesWithBinding on a non-binding OperandBloating and removing the need of writing givesWithBloating() over and over again on long tests, and also inherently solving #1453 this way.

This change will involve changing the class hierarchy below TestOperand, and the factories that create them, to offer both better names and usuabillity, as well as the missing case of tests with binding where the names do matter.

What are your opinions about this @SpartanRefactoring/zoomers?

NivShalmon avatar Jun 12 '17 10:06 NivShalmon