Exemplo n.º 1
0
 public void AuthorPublication_invalidAuthorName_EmptyString()
 {
     string invalidName = "";
        Author chosenAuthor = new Author(invalidName);
        bool correctName = chosenAuthor.checkName(chosenAuthor.name);
        Assert.IsFalse(correctName);
 }
Exemplo n.º 2
0
 public void AuthorPublication_invalidAuthorName_controlCharacters()
 {
     string invalidName = "./(())())()()";
        Author chosenAuthor = new Author(invalidName);
        bool correctName = chosenAuthor.checkName(chosenAuthor.name);
        Assert.IsFalse(correctName);
 }
Exemplo n.º 3
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();
 }
Exemplo n.º 4
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);
     }
 }
Exemplo n.º 5
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);
 }
Exemplo n.º 6
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);
 }
Exemplo n.º 7
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();
 }