Esempio n. 1
0
        public override void BeforeInstanceGenerated()
        {
            AutoMock.Container.Configure(x => {
                x.For <ILogger>().Use(new Mock <ILogger>().Object);
            });

            AutoMock.Container.Inject <IExceptionHandler>(new ExceptionHandler(AutoMock.Get <ILogger>()));
        }
Esempio n. 2
0
 /// <summary>
 /// Returns the given instance of TContract
 /// </summary>
 public TContract GetInstance <TContract>() where TContract : class
 {
     return(AutoMock.Get <TContract>());
 }
Esempio n. 3
0
 /// <summary>
 /// Returns the Mock that owns the TContract interface
 /// </summary>
 /// <typeparam name="TContract">The interface for which you want to obtain a mock</typeparam>
 /// <returns>The mock that owns the instance of the interface</returns>
 public Mock <TContract> GetMockFor <TContract>() where TContract : class
 {
     return(Mock.Get(AutoMock.Get <TContract>()));
 }