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>())); }
/// <summary> /// Returns the given instance of TContract /// </summary> public TContract GetInstance <TContract>() where TContract : class { return(AutoMock.Get <TContract>()); }
/// <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>())); }