Skip to content

Tag: tdd

Are 2 references to an object == to each other?

I have a method, move(xSteps, ySteps), which takes a point and moves it according to the parameters on the method by increasing or decreasing x and y. But when the xSteps and ySteps are both 0, I want to store the moved point (which didn’t actually move) in the same memory location as the original point…

Checking the results of a Factory in a unit test

I have developed some classes with similar behavior, they all implement the same interface. I implemented a factory that creates the appropriate object and returns the interface. I am writing a unit test for the factory. All you get back is an interface to the object. What is the best way to test that the fac…