示例#1
0
        public void FindNoKeywordAuthor()
        {
            //Create a new author with a keyword
            String expectedAuthor = "Nürnberg";
            Author a = new Author(expectedAuthor);

            //Check if the author names match
            List<String> actualAuthorList = a.getAuthors();
            String actualAuthor = actualAuthorList.Find(s => s == expectedAuthor);
            Assert.AreEqual(actualAuthor, expectedAuthor);

            //Returns an error of no keywords
            List<String> nonexistingKeywords = a.getAuthorKeywords(expectedAuthor);
            Assert.AreEqual(nonexistingKeywords, null);
        }
示例#2
0
        public void FindAllNumericalAuthor()
        {
            //Create a new author with a keyword
            String expectedAuthor ="4526123456";
            Author a = new Author(expectedAuthor);
            String expectedKeyword = "Fusion";
            a.addKeyword(expectedKeyword);

            //Check if the author names match
            List<String> actualAuthorList = a.getAuthors();
            String actualAuthor = actualAuthorList.Find(s => s == expectedAuthor);
            Assert.AreEqual(actualAuthor, expectedAuthor);

            //Check if the keywords from the author match to the inputed keyword
            List<String> actualKeywords = a.getAuthorKeywords(expectedAuthor);
            String actual = actualKeywords.Find(s => s == expectedKeyword);
            Assert.AreEqual(actualKeywords, expectedKeyword);
        }
示例#3
0
        public void FindPartialUnicodeAuthor()
        {
            //Create a new author with a keyword
            String expectedAuthor ="Nürnberg";
            Author a = new Author(expectedAuthor);
            String expectedKeyword = "Mathematics";
            a.addKeyword(expectedKeyword);

            //Check if the author names match
            List<String> actualAuthorList = a.getAuthors();
            String actualAuthor = actualAuthorList.Find(s => s == expectedAuthor);
            Assert.AreEqual(actualAuthor, expectedAuthor);

            //Check if the keywords from the author match to the inputed keyword
            List<String> actualKeywords = a.getAuthorKeywords(expectedAuthor);
            String actual = actualKeywords.Find(s => s == expectedKeyword);
            Assert.AreEqual(actualKeywords, expectedKeyword);
        }