You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[TestFixture]
public class Test
{
[Test]
public void MockAddedToEnumerableEvenIfTypeIsRegistered()
{
var autoMock = AutoMock.GetLoose(c =>
{
c.RegisterType<TestA>().As<ITest>();
c.RegisterType<TestB>().As<ITest>();
c.RegisterType<TestWrapper>().As<TestWrapper>();
});
var wrapper = autoMock.Create<TestWrapper>();
Assert.AreEqual(2, wrapper.All.Count());
}
public interface ITest
{
}
public class TestA : ITest { }
public class TestB : ITest { }
public class TestWrapper
{
public IEnumerable<ITest> All { get; }
public TestWrapper(IEnumerable<ITest> all)
{
All = all;
}
}
}
I expect the MoqRegistrationHandler not to create mocks for types that I registered.
The text was updated successfully, but these errors were encountered:
slangeder
pushed a commit
to slangeder/Autofac.Extras.Moq
that referenced
this issue
Jul 28, 2019
The following code describes the issue.
I expect the MoqRegistrationHandler not to create mocks for types that I registered.
The text was updated successfully, but these errors were encountered: