I have an interface, IFoo, with some number of methods. I also have an implementation of IFoo which decorates any IFoo, so something like:
class FooDecroator : IFoo {
FooDecorator(IFoo decoratedFoo) {
...
}
public void SomeFooMethod() {
decoraterdFoo.SomeMethod();
}
}
I want to use FakeItEasy to mock the constructor arg so I can assert everything is delegated properly. I could just manually write out every call but I have some logic where certain methods are not delegated.
I know I can iterate over FooDecorator using reflection, get the public methods, get args to each method, and invoke the method using reflection.
What I'm not sure about is how to then assert the mock methods were called with the same parameters using reflection (or some other means). I'm trying to avoid writing code for each method call.
Any thoughts are appreciated.