I have an interface that has a method which has an out parameter which is another interface. Something like this:
bool GetA(string name, out IA a);
I can find plenty of examples of doing this with simple out parameters like ints and strings but I want the out parameter to be assigned to a Mock object of that interface. I thought something like the following would work but it doesn’t
Mock<IB> b = new Mock<IB>();
Mock<IA> a = new Mock<IA>();
b.Setup(m => m.GetA("test", out a.Object)).Returns(true);