Hey Pradeepa,
If you want to test how class A interacts with class B, you probably
want to use Dependency Injection
(
https://en.wikipedia.org/wiki/Dependency_injection) to give class A
an instance of class B via class A's constructor (or via one of class
A's methods). This is important for allowing you to provide a fake
implementation of class B without doing link-time mocking.
Once you've done this, you need to create a skeleton (or pure abstract
class) for class B that has the methods that you want class A to have
access to. Once you have this, you can create a subclass of class B
that uses CppUMock to "implement" each of the methods defined for
class B.
Finally, you will provide an instance of the mock subclass of class B
to class A in your tests. This lets you interact with a fake version
of class B in your tests but use a "real" version of class B in your
production code by "injecting" the appropriate version of class B.
Hopefully this helps.
Ryan
> --
> You received this message because you are subscribed to the Google Groups
> "cpputest" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
cpputest+u...@googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.