Пример #1
0
        /// <summary>
        /// Gets the mock object for type T that would be injected into the constructor function
        /// of the ClassUnderTest
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <returns></returns>
        public T Get <T>() where T : class
        {
            if (!_container.Model.HasDefaultImplementationFor(typeof(T)))
            {
                _container.Inject(_serviceLocator.Service <T>());
            }

            return(_container.GetInstance <T>());
        }
Пример #2
0
 /// <summary>
 ///     Gets the mock object for type T that would be injected into the constructor function
 ///     of the ClassUnderTest
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <returns></returns>
 public T Get <T>() where T : class
 {
     return(_container.GetInstance <T>());
 }