3 ms·
That terminology makes much more sense, especially the "spies" part. Personally, I tend to think of stubs as being super basic. A stub class for me returns def
by dpark 10y ago
That terminology makes much more sense, especially the "spies" part.
Personally, I tend to think of stubs as being super basic. A stub class for me returns default values or throws NotImplemented or something as simple as possible. It doesn't maintain meaningful state. Mocks for me are generally simplified implementations like an in-memory store that replaces a DB. Frameworks like Moq have muddied my definition though because they call things mocks when they only return canned data. Building a real mock (fake) with real state using Moq tends to be a pain.