Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class SUT
- {
- private readonly IFoo _foo;
- private readonly IBar _bar;
- public SUT(IClientFactory clientFactory)
- {
- _foo = clientFactory.CreateClientInstance<Foo>(string.Empty);
- _bar = clientFactory.CreateClientInstance<Bar>(string.Empty);
- }
- }
- public class SUTTests
- {
- [Fact]
- public DoTest()
- {
- var fooMock = new Mock<IFoo>(MockBehavior.Strict);
- var clientFactoryMock = new Mock<IClientFactory>(MockBehavior.Strict);
- var underTest = new SUT(clientFactoryMock.Object);
- //the below setup produces a compile error saying that it cannot convert from IFoo to Foo even though the actua method returns IFoo
- clientFactoryMock.Setup(x => x.CreateClientInstance<Foo>(String.Empty,cts)).Returns(fooMock.Object);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement