Geeks With Blogs
It should just work... March 2012 Entries
RhinoMocks - How to intercept a and re-direct a method call to a stub using the original parameters
Suppose I have a stubbed interface acting as a proxy for the real object:IDatabase databaseStub = MockRepository.GenerateStub... suppose I have a parameterized method which needs redirecting to some utility method, for instance to return some test data:DataSet IDatabase.RetrieveData(int entityId);And I have a local utility method in my test:DataSet GetTestData(int entityId);and I wish for this method to be called whenever the RetrieveData method is called on the stub.I make use ......

Posted On Tuesday, March 13, 2012 1:00 PM

C++ CLI - How to test if a derived class derives from a base class

In this case there is a base class:

struct base {};

and a derived class:

struct derived1:base {};

To test if derived derives from base:

return dynamic_cast<base*>(derived*) != nullptr;

Posted On Thursday, March 1, 2012 10:47 AM

Copyright © cdpcodingblog | Powered by: