예제 #1
0
 public void Initialize()
 {
     _serviceProvider = ServiceTestHelper.InitProvider(services =>
     {
         _userRepositoryMock = new Mock <IUserRepository>();
         services.AddTransient <IUserRepository>((serviceProvicer) => _userRepositoryMock.Object);
     });
 }
예제 #2
0
        public void InitTest()
        {
            _configuration = ServiceTestHelper.LoadTestConfiguration();

            _serviceProvider = ServiceTestHelper.InitProvider(services =>
            {
                services.Configure <AppSettings>(_configuration);
                _webSiteRepositoryMock = new Mock <IWebSiteRepository>();
                services.AddTransient <IWebSiteRepository>((x) => _webSiteRepositoryMock.Object);

                _repositorySessionMock = new Mock <IRepositorySession>();
                services.AddTransient <IRepositorySession>((x) => _repositorySessionMock.Object);
            });
        }