Exemplo n.º 1
0
        public void TestEntityDelete()
        {
            var pub = PublicationBuilder.New().Build();

            var mockTeste = new Mock <IDeleteDB <Publication> >();

            var publicationRepository = new PublicationRepository(mockTeste.Object);

            publicationRepository.Delete(pub);

            mockTeste.Verify(x => x.DeleteRegister(It.IsAny <Publication>()));
        }
Exemplo n.º 2
0
        public void DeleteBrochure(string id)
        {
            var Brochure = GetBrochureById(id);
            var publicationInPublisihngHouses = _publicationInPublisihngHouses.Where(x => x.Publication.Id == Brochure.Publication.Id).ToList();

            foreach (var publicationInPublisihngHouse in publicationInPublisihngHouses)
            {
                _publicationInPublisihngHouseRepository.Delete(publicationInPublisihngHouse.Id);
            }
            _publicationRepository.Delete(Brochure.Publication.Id);

            _brochureRepository.Delete(id);
            _brochureRepository.Save();
        }
Exemplo n.º 3
0
        public void DeleteBook(string id)
        {
            var book = GetBookById(id);
            var publicationInPublisihngHouses = _publicationInPublisihngHouses.Where(x => x.Publication.Id == book.Publication.Id).ToList();

            foreach (var publicationInPublisihngHouse in publicationInPublisihngHouses)
            {
                _publicationInPublisihngHouseRepository.Delete(publicationInPublisihngHouse.Id);
                _publicationInPublisihngHouseRepository.Save();
            }
            _publicationRepository.Delete(book.Publication.Id);
            _publicationRepository.Save();

            _bookRepository.Delete(id);
            _bookRepository.Save();
        }
Exemplo n.º 4
0
        public void DeleteMagazine(string id)
        {
            var Magazine = GetMagazineById(id);
            var publicationInPublisihngHouses = _publicationInPublisihngHouses.Where(x => x.Publication.Id == Magazine.Publication.Id).ToList();

            foreach (var publicationInPublisihngHouse in publicationInPublisihngHouses)
            {
                _publicationInPublisihngHouseRepository.Delete(publicationInPublisihngHouse.Id);
                _publicationInPublisihngHouseRepository.Save();
            }
            _publicationRepository.Delete(Magazine.Publication.Id);
            _publicationRepository.Save();

            _magazineRepository.Delete(id);
            _magazineRepository.Save();
        }
Exemplo n.º 5
0
 public void Delete(int id)
 {
     _publicationRepository.Delete(id);
 }
Exemplo n.º 6
0
 public /*async*/ void Delete(int id)
 {
     /*await*/ publicationRepository.Delete(id);
 }