public BookService(IUnitOfWork2 uow, IApplicationSettings appSettings, IRoleService roleService, IUserService userService, IMailingService mailingService, IMailTemplate mailTemplate, IOrganizationService organizationService, IBookInfoService bookInfoService, IBookServiceValidator bookServiceValidator, IBookMobileServiceValidator bookMobileServiceValidator, IAsyncRunner asyncRunner) { _uow = uow; _appSettings = appSettings; _roleService = roleService; _userService = userService; _mailingService = mailingService; _mailTemplate = mailTemplate; _organizationService = organizationService; _booksDbSet = uow.GetDbSet <Book>(); _officesDbSet = uow.GetDbSet <Office>(); _bookLogsDbSet = uow.GetDbSet <BookLog>(); _userDbSet = uow.GetDbSet <ApplicationUser>(); _bookOfficesDbSet = uow.GetDbSet <BookOffice>(); _bookInfoService = bookInfoService; _bookServiceValidator = bookServiceValidator; _serviceValidator = bookMobileServiceValidator; _asyncRunner = asyncRunner; }
public void TestInitializer() { var uow = Substitute.For <IUnitOfWork2>(); _bookOfficesDbSet = Substitute.For <IDbSet <BookOffice> >(); uow.GetDbSet <BookOffice>().Returns(_bookOfficesDbSet); _bookLogsDbSet = Substitute.For <IDbSet <BookLog> >(); uow.GetDbSet <BookLog>().Returns(_bookLogsDbSet); _booksDbSet = Substitute.For <IDbSet <Book> >(); uow.GetDbSet <Book>().Returns(_booksDbSet); _officesDbSet = Substitute.For <IDbSet <Office> >(); uow.GetDbSet <Office>().Returns(_officesDbSet); _userDbSet = Substitute.For <IDbSet <ApplicationUser> >(); uow.GetDbSet <ApplicationUser>().Returns(_userDbSet); _validationService = Substitute.For <IBookMobileServiceValidator>(); _bookInfoService = Substitute.For <IBookInfoService>(); _bookServiceValidator = new BookServiceValidator(); var bookNotificationService = Substitute.For <IBooksNotificationService>(); _bookService = new BookService(uow, _bookInfoService, _bookServiceValidator, bookNotificationService, _validationService); }
public void TestInitializer() { var uow = Substitute.For <IUnitOfWork2>(); _bookOfficesDbSet = Substitute.For <DbSet <BookOffice>, IQueryable <BookOffice>, IDbAsyncEnumerable <BookOffice> >(); uow.GetDbSet <BookOffice>().Returns(_bookOfficesDbSet); _bookLogsDbSet = Substitute.For <DbSet <BookLog>, IQueryable <BookLog>, IDbAsyncEnumerable <BookLog> >(); uow.GetDbSet <BookLog>().Returns(_bookLogsDbSet); _booksDbSet = Substitute.For <DbSet <Book>, IQueryable <Book>, IDbAsyncEnumerable <Book> >(); uow.GetDbSet <Book>().Returns(_booksDbSet); _officesDbSet = Substitute.For <DbSet <Office>, IQueryable <Office>, IDbAsyncEnumerable <Office> >(); uow.GetDbSet <Office>().Returns(_officesDbSet); _userDbSet = Substitute.For <DbSet <ApplicationUser>, IQueryable <ApplicationUser>, IDbAsyncEnumerable <ApplicationUser> >(); uow.GetDbSet <ApplicationUser>().Returns(_userDbSet); _appSettings = Substitute.For <IApplicationSettings>(); _validationService = Substitute.For <IBookMobileServiceValidator>(); _bookInfoService = Substitute.For <IBookInfoService>(); _roleService = Substitute.For <IRoleService>(); _userService = Substitute.For <IUserService>(); _mailingService = Substitute.For <IMailingService>(); _mailTemplate = Substitute.For <IMailTemplate>(); _organizationService = Substitute.For <IOrganizationService>(); _bookServiceValidator = new BookServiceValidator(); var asyncRunner = Substitute.For <IAsyncRunner>(); _bookService = new BookService(uow, _appSettings, _roleService, _userService, _mailingService, _mailTemplate, _organizationService, _bookInfoService, _bookServiceValidator, _validationService, asyncRunner); }
public BookMobileService(IUnitOfWork2 uow, IBookMobileServiceValidator serviceValidator, IBookInfoService bookInfoService) { _uow = uow; _bookDbSet = uow.GetDbSet <Book>(); _bookLogDbSet = uow.GetDbSet <BookLog>(); _officeDbSet = uow.GetDbSet <Office>(); _userDbSet = uow.GetDbSet <ApplicationUser>(); _bookOfficeDbSet = uow.GetDbSet <BookOffice>(); _serviceValidator = serviceValidator; _bookInfoService = bookInfoService; }
public BookService( IUnitOfWork2 uow, IBookInfoService bookInfoService, IBookServiceValidator bookServiceValidator, IBooksNotificationService bookNotificationService, IBookMobileServiceValidator bookMobileServiceValidator) { _uow = uow; _booksDbSet = uow.GetDbSet <Book>(); _officesDbSet = uow.GetDbSet <Office>(); _bookLogsDbSet = uow.GetDbSet <BookLog>(); _userDbSet = uow.GetDbSet <ApplicationUser>(); _bookOfficesDbSet = uow.GetDbSet <BookOffice>(); _bookInfoService = bookInfoService; _bookServiceValidator = bookServiceValidator; _serviceValidator = bookMobileServiceValidator; _bookNotificationService = bookNotificationService; }
public BookService( IUnitOfWork2 uow, IBookInfoService bookInfoService, IBookServiceValidator bookServiceValidator, IBookMobileServiceValidator bookMobileServiceValidator, IAsyncRunner asyncRunner) { _uow = uow; _booksDbSet = uow.GetDbSet <Book>(); _officesDbSet = uow.GetDbSet <Office>(); _bookLogsDbSet = uow.GetDbSet <BookLog>(); _userDbSet = uow.GetDbSet <ApplicationUser>(); _bookOfficesDbSet = uow.GetDbSet <BookOffice>(); _bookInfoService = bookInfoService; _bookServiceValidator = bookServiceValidator; _serviceValidator = bookMobileServiceValidator; this._asyncRunner = asyncRunner; }