Base solution for your next web application
Open Closed

NSubstitute Test #1170


User avatar
0
place222 created

this is my Code

var b = Substitute.For<IB>();

            LocalIocManager.IocContainer.Register(Component.For<IB>().UsingFactoryMethod(() => b).LifestyleSingleton());

            var a = Resolve<IA>();


    public interface IA : IApplicationService    {}

    public interface IB : IApplicationService    { }

<span style="color:#FF0040"> public class B : IB
{ public B() {

    }
}&lt;/span&gt;
public class TestA : IA
    {
        private readonly IB _b;

        public TestA(IB b)
        {
            _b = b;
        }
    }

<span style="color:#FF0000">when i imp Ib interface i got the object is not then Stub obj, any thing wrong?</span>


No answer yet!