Exemplo n.º 1
0
 public Publication Construct(
     BibTexEntryType type,
     string doi,
     string title,
     List <Author> authors,
     int?year,
     int?month,
     int?day,
     string journal,
     string volume,
     int?number,
     string chapter,
     string pages,
     string publisher,
     List <Keyword> keywords)
 {
     return(new Publication()
     {
         Type = type,
         DOI = doi,
         Title = title,
         Authors = authors,
         Year = year,
         Month = month,
         Day = day,
         Journal = journal,
         Volume = volume,
         Number = number,
         Chapter = chapter,
         Pages = pages,
         Publisher = publisher,
         Keywords = keywords
     });
 }
Exemplo n.º 2
0
        public void ExtractType(string bibitem, BibTexEntryType expValue)
        {
            // Act
            var success = _parser.TryParse(bibitem, out Publication pub);

            // Assert
            Assert.True(success);
            Assert.Equal(expValue, pub.Type);
        }
Exemplo n.º 3
0
 private static bool TryGetType(string input, out BibTexEntryType type)
 {
     if (!Enum.TryParse(input, ignoreCase: true, out type))
     {
         type = BibTexEntryType.Unknown;
         return(false);
     }
     else
     {
         return(true);
     }
 }
Exemplo n.º 4
0
 public ParsedPublication(
     string pubMedID                  = default,
     string eID                       = default,
     string scopusID                  = default,
     BibTexEntryType type             = default,
     string title                     = default,
     int?year                         = default,
     int?month                        = default,
     int citedBy                      = default,
     string doi                       = default,
     string bibTeXEntry               = default,
     string journal                   = default,
     string volume                    = default,
     int?number                       = default,
     string chapter                   = default,
     string pages                     = default,
     string publisher                 = default,
     ICollection <Citation> citations = default,
     List <Author> authors            = default,
     List <Keyword> keywords          = default,
     ICollection <ToolPublicationAssociation> toolAssociations = default)
 {
     PubMedID         = pubMedID;
     EID              = eID;
     ScopusID         = scopusID;
     Type             = type;
     Title            = title;
     Year             = year;
     Month            = month;
     CitedBy          = citedBy;
     DOI              = doi;
     BibTeXEntry      = bibTeXEntry;
     Journal          = journal;
     Volume           = volume;
     Number           = number;
     Chapter          = chapter;
     Pages            = pages;
     Publisher        = publisher;
     Citations        = citations;
     Authors          = authors;
     Keywords         = keywords;
     ToolAssociations = toolAssociations;
 }