public Successful()
 {
     db      = new EFInMemoryDatabase();
     context = db.CreateDataContext <EFDataContext>();
     efBorrowedBookRepository = new EFBorrowedBookRepository(context);
     efUnitOfWork             = new EFUnitOfWork(context);
     sut = new BorrowedBookAppService(efBorrowedBookRepository, efUnitOfWork);
 }
 public FailedBecauseInvalidAgeRange()
 {
     db      = new EFInMemoryDatabase();
     context = db.CreateDataContext <EFDataContext>();
     efBorrowedBookRepository = new EFBorrowedBookRepository(context);
     efUnitOfWork             = new EFUnitOfWork(context);
     sut = new BorrowedBookAppService(efBorrowedBookRepository, efUnitOfWork);
 }
        public BorrowedBookServiceTests()
        {
            var db = new EFInMemoryDatabase();

            context                 = db.CreateDataContext <EFDataContext>();
            readContext             = db.CreateDataContext <EFDataContext>();
            _borrowedBookRepository = new EFBorrowedBookRepository(context);
            _unitOfWork             = new EFUnitOfWork(context);
            sut = new BorrowedBookAppService(_borrowedBookRepository, _unitOfWork);
        }
示例#4
0
        static void Main()
        {
            var                     connectionString       = "Data Source = LUNA\\SQLEXPRESS; Initial Catalog = Library; Integrated Security = True";
            IBookRepository         bookRepository         = new BookRepository(new BookContext(connectionString));
            ILibrarianRepository    librarianRepository    = new LibrarianRepository(new LibrarianContext(connectionString));
            ISubscriberRepository   subscriberRepository   = new SubscriberRepository(new SubscriberContext(connectionString));
            IBorrowedBookRepository borrowedBookRepository = new BorrowedBookRepository(new BorrowedBookContext(connectionString));
            IReservedBookRepository reservedBookRepository = new ReservedBookRepository(new ReservedBookContext(connectionString));
            IReturnedBookRepository returnedBookRepository = new ReturnedBookRepository(new ReturnedBookContext(connectionString));
            IService                service = new Service.Service(bookRepository, librarianRepository, subscriberRepository, borrowedBookRepository, reservedBookRepository, returnedBookRepository);


            Application.SetHighDpiMode(HighDpiMode.SystemAware);
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new LogInForm(service));
        }
示例#5
0
 public BorrowedBookAppService(BorrowedBookRepository borrowedBookRepository,
                               UnitOfWork unitOfWork)
 {
     _borrowedBookRepository = borrowedBookRepository;
     _unitOfWork             = unitOfWork;
 }