コード例 #1
0
 public void AuthorPublication_authorDoesNotExist()
 {
     string fakeAuthor = "Joe";
       Author chosenAuthor = new Author(fakeAuthor);
       chosenAuthor.findPublications(chosenAuthor.getName());// will throw the exception(not implemented)
       Assert.Fail();
 }
コード例 #2
0
 public void AuthorPublication_mutiplePublications()
 {
     string[] publication = new string[3] {"publication1","publication2","publication3"};
     Author chosenAuthor = new Author("name2");
     bool correctName = chosenAuthor.checkName(chosenAuthor.name); //for this check i assume it will pass this test
     chosenAuthor.findPublications(chosenAuthor.getName()); // make a array of all publications
     string[] authorPublication = chosenAuthor.getPublication(); //getter method for findPublications
     for (int i = 0; i < 3; i++)
     {
         string expected = publication[i];
         string actual = authorPublication[i];
         Assert.Equals(expected, actual);
     }
 }
コード例 #3
0
 public void AuthorPublication_NormalPath()
 {
     string[] publication = new string[1] {"publication1"};
     Author chosenAuthor = new Author("name1");
     bool correctName = chosenAuthor.checkName(chosenAuthor.name); //for this check i assume it will pass this test
     chosenAuthor.findPublications(chosenAuthor.getName()); // make a array of all publications
     string[] authorPublication = chosenAuthor.getPublication(); //getter method for findPublication
     int i = 1;
     string expected = publication[i];
     string actual = authorPublication[i];
     Assert.Equals(expected, actual);
 }
コード例 #4
0
 public void AuthorPublication_nullPublications()
 {
     string[] publication = null; //assuming that by default publication array is set to null if no items are added
      Author chosenAuthor = new Author("name1");
      bool correctName = chosenAuthor.checkName(chosenAuthor.name); //for this check i assume it will pass this test
      chosenAuthor.findPublications(chosenAuthor.getName());// will throw the exception(not implemented)
      string[] authorPublication = chosenAuthor.getPublication(); //getter method for findPublication
      int i = 1;
      string expected = publication[i];
      string actual = authorPublication[i];
      Assert.Equals(expected, actual);
 }
コード例 #5
0
 public void AuthorPublication_noPublications()
 {
     //string[] publication = new string[1];
     Author chosenAuthor = new Author("name1");
     bool correctName = chosenAuthor.checkName(chosenAuthor.name); //for this check i assume it will pass this test
     chosenAuthor.findPublications(chosenAuthor.getName());// will throw the exception(not implemented)
     Assert.Fail();
 }