Esempio n. 1
0
        /// <summary>
        /// Registers a component so all dependant components will resolve the same shared instance within the test
        /// lifetime scope.
        /// </summary>
        public static IBindingNamedWithOrOnSyntax <T> InstancePerTest <T>(this IBindingInSyntax <T> binding)
        {
            if (binding == null)
            {
                throw new ArgumentNullException("binding");
            }

            return(binding.InNamedScope(NinjectDependencyResolver.TestLifetimeScopeTag));
        }
 /// <summary>
 /// Defines the unit of work scope on the requested service.
 /// </summary>
 /// <typeparam name="T">The requested service type.</typeparam>
 /// <param name="syntax">The syntax.</param>
 /// <returns>The binding.</returns>
 public static IBindingNamedWithOrOnSyntax <T> InUnitOfWorkScope <T>(this IBindingInSyntax <T> syntax)
 {
     return(syntax.InNamedScope(ScopeName));
 }