public UlrichsClient(UlrichsSettings ulrichsSettings) { Requires.NotNull(ulrichsSettings, nameof(ulrichsSettings)); this.ulrichsSettings = ulrichsSettings; this.webService = new UlrichsWebService { CookieContainer = new CookieContainer() }; }
public UlrichsClient(UlrichsSettings ulrichsSettings) { Requires.NotNull(ulrichsSettings, "ulrichsSettings"); this.ulrichsSettings = ulrichsSettings; this.webService = new UlrichsWebService { CookieContainer = new CookieContainer() }; }
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()); }
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); }
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); }
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()); }
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); }
private static UlrichsImport CreateUlrichsImport() { var ulrichsSettings = new UlrichsSettings(); return new UlrichsImport(new UlrichsClient(ulrichsSettings), new UlrichsCache(ulrichsSettings), Mock.Of<IBlockedISSNRepository>()); }
public UlrichsCache(UlrichsSettings ulrichsSettings) { Requires.NotNull(ulrichsSettings, nameof(ulrichsSettings)); this.ulrichsSettings = ulrichsSettings; }
private UlrichsImport CreateUlrichsClient() { var ulrichsSettings = new UlrichsSettings(); return new Mock<UlrichsImport>(new UlrichsClient(ulrichsSettings), new UlrichsCache(ulrichsSettings)).Object; }
public UlrichsCache(UlrichsSettings ulrichsSettings) { Requires.NotNull(ulrichsSettings, "ulrichsSettings"); this.ulrichsSettings = ulrichsSettings; }