public ScannedPageFacadeTest() 
        {
            _scannedPageMapper = new ScannedPageMapper();

            _fixture = new Fixture();
            _fixture.Behaviors.Remove(new ThrowingRecursionBehavior());
            _fixture.Behaviors.Add(new OmitOnRecursionBehavior());
            _fixture.Customizations.Add(new TypeRelay(typeof(Item), typeof(Book)));
            _fixture.Customizations.Add(new TypeRelay(typeof(ItemBusinessModel), typeof(BookBusinessModel)));

            _scannedPage = _fixture.Create<ScannedPage>();
            _scannedPageBusinessModel = _fixture.Create<ScannedPageBusinessModel>();

            _readerBusinessModel = _fixture.Create<ReaderBusinessModel>();
            ReaderMapper readerMapper = new ReaderMapper();
            _reader = readerMapper.Map(_readerBusinessModel);

            _itemBusinessModel = _fixture.Create<ItemBusinessModel>();
            ItemMapper itemMapper = new ItemMapper();
            _item = itemMapper.Map(_itemBusinessModel);

            this.uow = Initializer.GetLibraryUow();
            uow.ScannedPages.Add(this._scannedPage);
            uow.Readers.Add(this._reader);
            uow.Items.Add(this._item);
            this._scannedPageFacade = new ScannedPageFacade(uow);
        }
        public SearchItemFacadeTest() 
        {
            _itemMapper = new ItemMapper();

            _fixture = new Fixture();
            _fixture.Behaviors.Remove(new ThrowingRecursionBehavior());
            _fixture.Behaviors.Add(new OmitOnRecursionBehavior());
            _fixture.Customizations.Add(new TypeRelay(typeof(Item), typeof(Book)));
            _fixture.Customizations.Add(new TypeRelay(typeof(ItemBusinessModel), typeof(BookBusinessModel)));

            _readerBusinessModel = _fixture.Create<ReaderBusinessModel>();
            ReaderMapper readerMapper = new ReaderMapper();
            _reader = readerMapper.Map(_readerBusinessModel);

            _item = _fixture.Create<Item>();
            _itemBusinessModel = _itemMapper.Map(_item);

            _tag = _fixture.Create<Tag>();

            this.uow = Initializer.GetLibraryUow();

            uow.Readers.Add(this._reader);
            uow.Items.Add(this._item);
            uow.Tags.Add(_tag);
            this._searchItemFacade = new SearchItemFacade(uow);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Inits the Pdf document and first page.
 /// </summary>
 /// <param name="item">
 /// The item params of Name and Year for first page.
 /// </param>
 /// <param name="consignment">
 /// The consignment ArivalDate for first page.
 /// </param>
 public void PdfInit(ItemBusinessModel item,ConsignmentBusinessModel consignment)
 {
     
     BaseFont baseTimes = BaseFont.CreateFont(BaseFont.TIMES_ROMAN, BaseFont.CP1250, false);
     Font defaultFont = new Font(baseTimes, FontSize, Font.NORMAL, BaseColor.BLACK);
     Paragraph title1 = new Paragraph(item.Name + ".- " + item.Year, defaultFont);
     this.document.Add(title1);
     if (consignment.ArrivalDate != null)
     {
         Paragraph title2 = new Paragraph(consignment.ArrivalDate.Value.Date.ToShortDateString(), defaultFont);
         this.document.Add(title2);
     }
 }