Beispiel #1
0
 public void AuthorPublication_mutiplePublications()
 {
     Paper publication1 = new Paper("P1");
     Paper publication2 = new Paper("P2");
     Paper publication3 = new Paper("P3");
     Author chosenAuthor = new Author("name2");
     //add authors to papers
     publication1.addAuthor(chosenAuthor);
     publication2.addAuthor(chosenAuthor);
     publication3.addAuthor(chosenAuthor);
     SystematicMappingSystem sms = new SystematicMappingSystem();
     //add papers to the system
     sms.AddPaper(publication1);
     sms.AddPaper(publication2);
     sms.AddPaper(publication3);
     int expected = chosenAuthor.numberOfPublications(sms, chosenAuthor);
     int actual = 3; // author has written three papers
     Assert.AreEqual(expected, actual);
 }
Beispiel #2
0
 public void AuthorPublication_NormalPath()
 {
     Paper publication = new Paper("P1");
     Author chosenAuthor = new Author("name1");
     publication.addAuthor(chosenAuthor); // add author to paper
     SystematicMappingSystem sms = new SystematicMappingSystem();
     sms.AddPaper(publication); // add paper to the system
     int expected = chosenAuthor.numberOfPublications(sms, chosenAuthor); // get the number of papers author has wrote
     int actual = 1; // only 1 paper should exist
     Assert.AreEqual(expected, actual);
 }