示例#1
0
        public void GetJournalsWillNotReturnJournalsWithBlockedIssn()
        {
            // Arrange
            var blockedIssns = new List <BlockedISSN>
            {
                new BlockedISSN {
                    ISSN = "0001-3765"
                },
                new BlockedISSN {
                    ISSN = "2282-0035"
                }
            };

            var doajImport = new DoajImport(ImportSettings.Current.Doaj, new BlockedISSNRepository(new ApplicationDbContext {
                BlockedISSNs = CreateDbSet(blockedIssns)
            }));

            // Act
            var journals = doajImport.GetJournals();

            // Assert
            foreach (var blockedIssn in blockedIssns)
            {
                Assert.False(journals.Any(j => j.ISSN == blockedIssn.ISSN));
            }
        }
示例#2
0
        public void GetJournalsWillImportJournals()
        {
            // Arrange
            var doajImport = new DoajImport(ImportSettings.Current.Doaj);

            // Act
            var journalsImportResult = doajImport.GetJournals();

            // Assert
            Assert.True(journalsImportResult.Count > 0);
        }
示例#3
0
        public void GetJournalsWillImportJournals()
        {
            // Arrange
            var doajImport = new DoajImport(ImportSettings.Current.Doaj, new BlockedISSNRepository(new ApplicationDbContext { BlockedISSNs = CreateDbSet(new List<BlockedISSN>()) }));

            // Act
            var journalsImportResult = doajImport.GetJournals();

            // Assert
            Assert.True(journalsImportResult.Count > 0);
        }
示例#4
0
        public void GetJournalsWillImportJournals()
        {
            // Arrange
            var doajImport = new DoajImport(ImportSettings.Current.Doaj, new BlockedISSNRepository(new ApplicationDbContext {
                BlockedISSNs = CreateDbSet(new List <BlockedISSN>())
            }));

            // Act
            var journalsImportResult = doajImport.GetJournals();

            // Assert
            Assert.True(journalsImportResult.Count > 0);
        }
示例#5
0
        IList <Journal> GetJournalsFromSource(JournalsImportSource importSource, JournalTocsFetchMode action = JournalTocsFetchMode.Update)
        {
            switch (importSource)
            {
            case JournalsImportSource.DOAJ:
                return(doajImport.GetJournals());

            case JournalsImportSource.Ulrichs:
                return(ulrichsImport.GetJournals(UlrichsImport.UlrichsJournalType.All));

            case JournalsImportSource.JournalTOCs:
                return(_journalsTocImport.DownloadJournals(action));

            default:
                throw new ArgumentOutOfRangeException(nameof(importSource));
            }
        }
示例#6
0
        public void GetJournalsWillNotReturnJournalsWithBlockedIssn()
        {
            // Arrange
            var blockedIssns = new List<BlockedISSN>
            {
                new BlockedISSN { ISSN = "0001-3765" },
                new BlockedISSN { ISSN = "2282-0035" }
            };

            var doajImport = new DoajImport(ImportSettings.Current.Doaj, new BlockedISSNRepository(new ApplicationDbContext { BlockedISSNs = CreateDbSet(blockedIssns) }));

            // Act
            var journals = doajImport.GetJournals();

            // Assert
            foreach (var blockedIssn in blockedIssns)
            {
                Assert.False(journals.Any(j => j.ISSN == blockedIssn.ISSN));
            }
        }