RajOpteamix / moq

Automatically exported from code.google.com/p/moq
Other
0 stars 0 forks source link

Mocking two interfaces #372

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I need to mock types from external library:

public interface ISome
{

}

public interface IAnother
{

}

// I don't see that class
internal class SomeAnother 
{

}

Library API can provide ISome example for me.

public class Api
{
   public ISome Get(); // - this method will be mocked
}

But I need to work with IAnother example. I can't mock Get() to provide for me 
a stub, that implements ISome and IAnother at the same time.

var stubApi = Mock.Of<Api>(a => a.Get() == Mock.Of<ISome, IAnother>())

I am using Moq 4.1.1309.1617.

Original issue reported on code.google.com by d.o.kozh...@gmail.com on 15 Nov 2013 at 7:43