ninject / Ninject.MockingKernel

Extension for Ninject aiding testability in Moq, NSubstitute, and FakeItEasy
http://ninject.org/
Other
62 stars 25 forks source link

Support additional interfaces when mock #18

Closed scott-xu closed 9 years ago

scott-xu commented 9 years ago

Hi @remogloor , This PR is to implement additional interfaces when mock. The use case is as below. Can you please help have a review?

[Fact]
public void ToMockCanBeUsedToAddAdditionalInterfaces()
{
    using (var kernel = this.CreateKernel())
    {
        kernel.Bind<IDummyService>().ToMock(typeof(IDummyService2));

        var mock = kernel.Get<IDummyService>();

        mock.Should().BeAssignableTo<IDummyService2>();
    }
}
scott-xu commented 9 years ago

Since there's no public API change nor any UT failure, I'd merge it for now.