예제 #1
0
        public AdminController(JournalsImport journalsImport, UlrichsImport ulrichsImport, DoajImport doajImport, JournalTocsImport journalsTocImport, JournalsExport journalsExport, IJournalRepository journalRepository, IUserProfileRepository userProfileRepository, IAuthentication authentication, IInstitutionRepository institutionRepository, IBlockedISSNRepository blockedIssnRepository, IBaseScoreCardRepository baseScoreCardRepository, IValuationScoreCardRepository valuationScoreCardRepository, IBulkImporter<SubmissionPageLink> bulkImporter, IBulkImporter<Institution> institutionImporter)
            : base(baseScoreCardRepository, valuationScoreCardRepository, userProfileRepository, authentication)
        {
            Requires.NotNull(journalsImport, nameof(journalsImport));
            Requires.NotNull(ulrichsImport, nameof(ulrichsImport));
            Requires.NotNull(journalsTocImport, nameof(journalsTocImport));
            Requires.NotNull(doajImport, nameof(doajImport));
            Requires.NotNull(journalsExport, nameof(journalsExport));
            Requires.NotNull(journalRepository, nameof(journalRepository));
            Requires.NotNull(institutionRepository, nameof(institutionRepository));
            Requires.NotNull(blockedIssnRepository, nameof(blockedIssnRepository));
            Requires.NotNull(bulkImporter, nameof(bulkImporter));
            Requires.NotNull(institutionImporter, nameof(institutionImporter));

            this.journalsImport = journalsImport;
            this.ulrichsImport = ulrichsImport;
            this.doajImport = doajImport;
            _journalsTocImport = journalsTocImport;
            this.journalsExport = journalsExport;
            this.journalRepository = journalRepository;
            this.institutionRepository = institutionRepository;
            this.blockedIssnRepository = blockedIssnRepository;

            _bulkImporter = bulkImporter;
            _institutionImporter = institutionImporter;
        }
예제 #2
0
        public void ParseJournalWithJournalWithAlternateEditionsReturnsCorrectlyParsedJournal()
        {
            // Arrange
            var ulrichsSettings = new UlrichsSettings();
            var ulrichsImport = new UlrichsImport(new UlrichsClient(ulrichsSettings), new UlrichsCache(ulrichsSettings));

            // Act
            var journals = ulrichsImport.ParseJournal(XElement.Parse(GetUlrichsJournalXmlWithAlternateEditions()));

            // Assert
            AssertEqualJournal(GetExpectedJournal(), journals.First());
        }
예제 #3
0
        public void ParseJournalsWithJournalTypeIsOpenAccessAndXmlWithoutAlternateEditionsWillParseOnlyOpenAccessJournalsFromXml()
        {
            // Arrange
            var ulrichsSettings = new UlrichsSettings();
            var ulrichsImport = new UlrichsImport(new UlrichsClient(ulrichsSettings), new UlrichsCache(ulrichsSettings));

            // Act
            var journals = ulrichsImport.ParseJournals(GetUlrichsXml(), UlrichsImport.UlrichsJournalType.OpenAccess);

            // Assert
            Assert.Equal(77, journals.Count);
        }
예제 #4
0
        public void ParseJournalsWithJournalTypeIsAllAndXmlWithAlternateEditionsWillParseAllJournalsAndAlternateEditionsFromXml()
        {
            // Arrange
            var ulrichsSettings = new UlrichsSettings();
            var ulrichsImport = new UlrichsImport(new UlrichsClient(ulrichsSettings), new UlrichsCache(ulrichsSettings));

            // Act
            var journals = ulrichsImport.ParseJournals(GetUlrichsXmlWithAlternateEditions(), UlrichsImport.UlrichsJournalType.All);

            // Assert
            Assert.Equal(483, journals.Count);
        }
예제 #5
0
        public AdminController(JournalsImport journalsImport, UlrichsImport ulrichsImport, DoajImport doajImport, JournalsExport journalsExport, IJournalRepository journalRepository, IUserProfileRepository userProfileRepository, IAuthentication authentication, IInstitutionRepository institutionRepository)
            : base(userProfileRepository, authentication)
        {
            Requires.NotNull(journalsImport, "journalsImport");
            Requires.NotNull(ulrichsImport, "ulrichsImport");
            Requires.NotNull(doajImport, "doajImport");
            Requires.NotNull(journalsExport, "journalsExport");
            Requires.NotNull(journalRepository, "journalRepository");
            Requires.NotNull(institutionRepository, "institutionRepository");

            this.journalsImport = journalsImport;
            this.ulrichsImport = ulrichsImport;
            this.doajImport = doajImport;
            this.journalsExport = journalsExport;
            this.journalRepository = journalRepository;
            this.institutionRepository = institutionRepository;
        }
예제 #6
0
        public void ParseJournalWithJournalWithAlternateEditionsReturnsMultipleJournals()
        {
            // Arrange
            var ulrichsSettings = new UlrichsSettings();
            var ulrichsImport = new UlrichsImport(new UlrichsClient(ulrichsSettings), new UlrichsCache(ulrichsSettings));

            // Act
            var journals = ulrichsImport.ParseJournal(XElement.Parse(GetUlrichsJournalXmlWithAlternateEditions()));

            // Assert
            Assert.Equal(2, journals.Count());
        }
예제 #7
0
        public void ParseJournalWithJournalWithoutPublisherReturnsJournalWithDefaultPublisherName()
        {
            // Arrange
            var ulrichsSettings = new UlrichsSettings();
            var ulrichsImport = new UlrichsImport(new UlrichsClient(ulrichsSettings), new UlrichsCache(ulrichsSettings));

            // Act
            var journals = ulrichsImport.ParseJournal(XElement.Parse(GetUlrichsJournalXmlWithoutPublisher()));

            // Assert
            var parsedJournal = journals.First();
            Assert.Equal("<none indicated>", parsedJournal.Publisher.Name);
        }