Esempio n. 1
0
        public static ArgConditionCopyNonLazyBinder FromIFactory <TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract>(
            this FactoryFromBinder <TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract> fromBinder,
            Action <ConcreteBinderGeneric <IFactory <TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract> > > factoryBindGenerator)
        {
            Guid factoryId;

            factoryBindGenerator(
                fromBinder.CreateIFactoryBinder <IFactory <TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract> >(out factoryId));

            fromBinder.ProviderFunc =
                (container) => { return(new IFactoryProvider <TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract>(container, factoryId)); };

            return(new ArgConditionCopyNonLazyBinder(fromBinder.BindInfo));
        }
Esempio n. 2
0
 public static ConditionCopyNonLazyBinder FromMock <TContract>(this FactoryFromBinder <TContract> binder)
     where TContract : class
 {
     return(binder.FromInstance(Mock.Of <TContract>()));
 }
        public static ConditionCopyNonLazyBinder FromSubstitute <TContract>(this FactoryFromBinder <TContract> binder)
            where TContract : class
        {
//            return binder.FromInstance(Mock.Of<TContract>());
            return(binder.FromInstance(Substitute.For <TContract>()));
        }