コード例 #1
0
        public Incubator Returns <T>(Func <Incubator, T> instanciator)
        {
            Incubator inc = Incubator ?? new Incubator();

            inc.Set <T>(() => instanciator(inc));
            return(inc);
        }
コード例 #2
0
        /// <summary>
        /// Specify the return type T for the specified
        /// type I ( same as To )
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <returns></returns>
        public Incubator Returns <T>()
        {
            Incubator inc = Incubator ?? new Incubator();

            inc.Set(typeof(I), inc.Construct(typeof(T)));
            return(inc);
        }
コード例 #3
0
        public Incubator Returns <T>(Func <T> instanciator)
        {
            Incubator inc = Incubator ?? new Incubator();

            inc.Set(instanciator, false);
            return(inc);
        }
コード例 #4
0
        public Incubator Returns(object instance)
        {
            Incubator inc = Incubator ?? new Incubator();

            inc.Set(typeof(I), instance);
            return(inc);
        }