예제 #1
0
        static ApplicationContext()
        {
            _projectDir = GetProjectDirectory();

            var booksPath        = _projectDir + "\\Data\\book\\books.xml";
            var booksMetaInfPath = _projectDir + "\\Data\\book\\meta-inf.xml";
            var booksCountPath   = _projectDir + "\\Data\\book\\count.xml";

            var authorsPath        = _projectDir + "\\Data\\author\\authors.xml";
            var authorsMetaInfPath = _projectDir + "\\Data\\author\\meta-inf.xml";

            var authorDocHolder = new DocumentHolder(authorsPath, authorsMetaInfPath);
            var bookDocHolder   = new DocumentHolder(booksPath, booksMetaInfPath);

            _bookDao   = DaoFactory.BookDao(bookDocHolder, authorDocHolder);
            _authorDao = DaoFactory.AuthorDao(authorDocHolder, bookDocHolder);

            _bookService = new BookService()
            {
                BookDao = _bookDao
            };

            _authorService = new AuthorService()
            {
                AuthorDao = _authorDao
            };

            _bookCounter  = new BookCounter(booksCountPath);
            _bookArranger = new BookArranger(_projectDir + "\\Data\\book\\shelves.xml");
        }
예제 #2
0
 public Library(IBookDao dao)
 {
     this.catalog      = new CatalogBasicImpl(dao);
     this.processState = new LibraryState(dao);
     this.users        = new UsersBasicImpl();
     this.events       = new EventsBasicImpl();
 }
예제 #3
0
 public LibraryClass(IBookDao dao)
 {
     this.catalog      = new Catalog(dao);
     this.processState = new ProcessState(dao);
     this.users        = new Users();
     this.events       = new Events();
 }
예제 #4
0
        private void Setup()
        {
            string connectionString = ConnectionString;

            _authorDao = new AuthorDao(connectionString);
            _bookDao   = new BookDao(connectionString);
        }
예제 #5
0
        public LibraryUOW(LibraryState libData, IBookDao bDao, IUsersDao uDao, IRentalDao rDao)
        {
            libraryData = libData;

            booksDao   = bDao;
            usersDao   = uDao;
            rentalsDao = rDao;
        }
예제 #6
0
        public AuthorDao(DBWorker dBWorker)
        {
            if (dBWorker == null)
            {
                throw new ArgumentException("dBWorker cannot be null");
            }

            _dBWorker = dBWorker;
            _bookDao  = DaoCache.GetBookDao(dBWorker.ConnectionString);
        }
예제 #7
0
        public void SyncBookOrders()
        {
            var orders = this.GetOrders();

            // only get orders of book
            var ordersOfBook = orders.Where(x => x.Type == "Book");

            IBookDao bookDao = this.GetBookDao();

            foreach (var order in ordersOfBook)
            {
                bookDao.Insert(order);
            }
        }
예제 #8
0
 public BookLogic(IBookDao bookDao)
 {
     this._bookDao = bookDao;
 }
예제 #9
0
 public BookController(IBookDao bookDao)
 {
     _bookDao = bookDao;
 }
예제 #10
0
 public ProcessState(IBookDao dao)
 {
     this.dao = dao;
 }
예제 #11
0
 public void TearDown()
 {
     this.processState = null;
     this.dao          = null;
 }
예제 #12
0
 internal void SetBookDao(IBookDao dao)
 {
     _dao = dao;
 }
예제 #13
0
 public BookLogic(IBookDao bookDao)
 {
     _bookDao = bookDao;
 }
예제 #14
0
 /*
  * Dependency injection via constructor injection.
  * We're getting an object that implements a given interface, so we're not coupling it with any concrete class.
  */
 public CatalogBasicImpl(IBookDao dao)
 {
     this.dao = dao;
 }
 public void Setup()
 {
     _orderServiceForTest = new OrderServiceForTest();
     _mockBookDao         = Substitute.For <IBookDao>();
 }
예제 #16
0
 public void SetUp()
 {
     this.dao          = new BookDaoBasicImpl();
     this.processState = new LibraryState(dao);
 }
예제 #17
0
 public StubOrderService(IBookDao boolDao)
 {
     _bookDao = boolDao;
 }
예제 #18
0
 public LibraryState(IBookDao dao)
 {
     this.dao = dao;
 }
예제 #19
0
 public Catalog(IBookDao dao)
 {
     this.dao = dao;
 }
예제 #20
0
 public BooksController(IBookDao bookDao)
 {
     this.bookDao = bookDao;
 }
예제 #21
0
 public BookLogic(IBookDao bookDao, IBookValidationLogic bookValidation)
 {
     this.books      = bookDao;
     this.validation = bookValidation;
 }
예제 #22
0
 public void SetBookDao(IBookDao bookDao)
 {
     BookDao = bookDao;
 }
예제 #23
0
 public BookManagerService(IBookDao dao, IBookDetailsRetrievalService bookDetailsRetrievalService)
 {
     _dao = dao;
     _bookDetailsRetrievalService = bookDetailsRetrievalService;
 }
예제 #24
0
 internal void SetBookDao(IBookDao bookDao)
 {
     this._bookDao = bookDao;
 }
예제 #25
0
 public BookBo(IBookDao bookDao)
 {
     this._bookDao = bookDao;
 }
 internal void SetBookDao(IBookDao bookDao)
 {
     this._bookDao = bookDao;
 }
예제 #27
0
 public FakeOrderService(IBookDao fakeBookDao)
 {
     _fakeBookDao = fakeBookDao;
 }
예제 #28
0
 public void SetBookDao(IBookDao dao)
 {
     this._dao = dao;
 }
예제 #29
0
 public void SetUp()
 {
     this.dao          = new SimpleBookDao();
     this.processState = new ProcessState(dao);
 }
 public void SetBookDao(IBookDao mockBookDao)
 {
     _dao = mockBookDao;
 }
예제 #31
0
 public BookManager(UserInterface ui, IBookDao bookDao, IAuthorDao authorDao) : base(ui)
 {
     _bookDao   = bookDao;
     _authorDao = authorDao;
 }