Mocking and faking are ways to isolate code or components to ensure that unit tests run against the testable unit of code only without actually utilizing other components or dependencies of an application. Mocking differs from faking in that a mock can be inspected to assert the results of a test.

learn more… | top users | synonyms (1)

0
votes
2answers
93 views

Using interfaces as part of encapsulation

I'm creating interfaces for a number of our existing classes for mocking reasons. Many of these classes also have package scope methods as an attempt to give some level of encapsulation by ensuring ...
3
votes
1answer
289 views

What is the most appropriate testing method in this scenario?

I'm writing some Objective-C apps (for OS X/iOS) and I'm currently implementing a service to be shared across them. The service is intended to be fairly self-contained. For the current functionality ...
2
votes
1answer
25 views

Using mocks to set up object even if you will not be mocking any behavior or verifying any interaction with it?

When building a unit test, is it appropriate to use a mocking tool to help you set up an object even if you will not be mocking any behavior or verifying any interaction with that object? Here is a ...