Ejemplo n.º 1
0
 public ScanStation(LibraryContext _context, int branchId, IClassificationService classificationService,
                    HoldingsService holdingsService, PatronsService patronsService)
 {
     this.classificationService = classificationService;
     this.holdingsService       = holdingsService;
     this.patronsService        = patronsService;
     BranchId = branchId;
     brId     = BranchId;
 }
Ejemplo n.º 2
0
        public void SetUp()
        {
            _transactionQueryService = Substitute.For <ITransactionQueryService>();

            _holdingsProcessor = Substitute.For <IHoldingsProcessor>();

            _stockService = Substitute.For <IStockService>();

            _walletQueryService = Substitute.For <IWalletQueryService>();

            _sut = new HoldingsService(_transactionQueryService,
                                       _holdingsProcessor,
                                       _stockService,
                                       _walletQueryService);
        }
        public ScanStation_WhenNewMaterialCheckedOutTest(DbContextFixture fixture)
        {
            fixture.Seed();
            context         = new LibraryContext(fixture.ContextOptions);
            holdingsService = new HoldingsService(context);
            patronsService  = new PatronsService(context);

            classificationServiceMock = new Mock <IClassificationService>();
            classificationService     = classificationServiceMock.Object;

            scanner = new ScanStation(context, 1, classificationService, holdingsService, patronsService);

            savedPatronId = patronsService.Create(new Patron {
                Name = ""
            });

            CheckOutNewMaterial();
        }
        public ScanStation_WhenNothingCheckedOutTest(DbContextFixture fixture)
        {
            fixture.Seed();
            context         = new LibraryContext(fixture.ContextOptions);
            patronsService  = new PatronsService(context);
            holdingsService = new HoldingsService(context);

            classificationServiceMock = new Mock <IClassificationService>();
            classificationService     = classificationServiceMock.Object;
            AlwaysReturnBookMaterial(classificationServiceMock);

            somePatronId = patronsService.Create(new Patron {
                Name = "x"
            });

            scanner = new ScanStation(context, 1, classificationService, new HoldingsService(context),
                                      new PatronsService(context));
        }
        public ScanStation_WhenMaterialCheckedInTest(DbContextFixture fixture)
        {
            fixture.Seed();
            context         = new LibraryContext(fixture.ContextOptions);
            patronsService  = new PatronsService(context);
            holdingsService = new HoldingsService(context);

            classificationServiceMock = new Mock <IClassificationService>();
            classificationService     = classificationServiceMock.Object;

            somePatronId = patronsService.Create(new Patron {
                Name = "x"
            });

            scanner = new ScanStation(context, 1, classificationService, holdingsService, patronsService);

            scanner.ScanNewMaterial(SomeBarcode, classificationServiceMock);
            scanner.CheckOut(SomeBarcode, somePatronId, now);
            scanner.CompleteCheckout();
            scanner.CheckIn(SomeBarcode, now);
        }
Ejemplo n.º 6
0
 public CheckOutService(LibraryContext context, HoldingsService holdingsService)
 {
     this.context         = context;
     this.holdingsService = holdingsService;
 }
Ejemplo n.º 7
0
 public HoldingsServiceTest(DbContextFixture fixture)
 {
     fixture.Seed();
     context = new LibraryContext(fixture.ContextOptions);
     service = new HoldingsService(context);
 }