예제 #1
0
        public UlrichsClient(UlrichsSettings ulrichsSettings)
        {
            Requires.NotNull(ulrichsSettings, nameof(ulrichsSettings));

            this.ulrichsSettings = ulrichsSettings;
            this.webService = new UlrichsWebService { CookieContainer = new CookieContainer() };
        }
예제 #2
0
        public UlrichsClient(UlrichsSettings ulrichsSettings)
        {
            Requires.NotNull(ulrichsSettings, "ulrichsSettings");

            this.ulrichsSettings = ulrichsSettings;
            this.webService      = new UlrichsWebService {
                CookieContainer = new CookieContainer()
            };
        }
예제 #3
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());
        }
예제 #4
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);
        }
예제 #5
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);
        }
예제 #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);
        }
예제 #8
0
 private static UlrichsImport CreateUlrichsImport()
 {
     var ulrichsSettings = new UlrichsSettings();
     return new UlrichsImport(new UlrichsClient(ulrichsSettings), new UlrichsCache(ulrichsSettings), Mock.Of<IBlockedISSNRepository>());
 }
예제 #9
0
        public UlrichsCache(UlrichsSettings ulrichsSettings)
        {
            Requires.NotNull(ulrichsSettings, nameof(ulrichsSettings));

            this.ulrichsSettings = ulrichsSettings;
        }
예제 #10
0
        private UlrichsImport CreateUlrichsClient()
        {
            var ulrichsSettings = new UlrichsSettings();

            return new Mock<UlrichsImport>(new UlrichsClient(ulrichsSettings), new UlrichsCache(ulrichsSettings)).Object;
        }
예제 #11
0
        public UlrichsCache(UlrichsSettings ulrichsSettings)
        {
            Requires.NotNull(ulrichsSettings, "ulrichsSettings");

            this.ulrichsSettings = ulrichsSettings;
        }