public void TestMethod1()
        {
            //Create Keyword and Paper
            Keyword expectedKeyword = new Keyword("Testing");
            Paper expectedPaper = new Paper("Some Paper About Testing");

            //Add keyword to paper
            expectedPaper.AddKeyword(expectedKeyword);

            //A mapping system to store the papers in
            SystematicMappingSystem sms = new SystematicMappingSystem();
            //Add paper to the system
            sms.AddPaper(expectedPaper);

            List<Keyword> keyWordsList = sms.GetKeywordsFromPaper("Some Paper About Testing");
            Assert.IsTrue(expectedKeyword.Equals(keyWordsList.First()) && keyWordsList.Count() == 1);
        }
        public void TestMethod3()
        {
            //Create Keyword and Paper
            Keyword expectedKeyword = new Keyword(null);
            Paper expectedPaper = new Paper("Some Paper About Testing");

            //Add keyword to paper
            expectedPaper.AddKeyword(expectedKeyword);

            //A mapping system to store the papers in
            SystematicMappingSystem sms = new SystematicMappingSystem();
            //Add paper to the system
            sms.AddPaper(expectedPaper);

            List<Keyword> keyWordsList = sms.GetKeywordsFromPaper("Some Paper About Testing");
            Assert.Fail();
        }
        public void TestMethod4()
        {
            //Create Keyword and Paper
            Keyword expectedKeyword = new Keyword("abcdefghijklmnopqrstuvwxyznowiknowmyabcsnexttimewontyousingwithme");
            Paper expectedPaper = new Paper("Some Paper About Testing");

            //Add keyword to paper
            expectedPaper.AddKeyword(expectedKeyword);

            //A mapping system to store the papers in
            SystematicMappingSystem sms = new SystematicMappingSystem();
            //Add paper to the system
            sms.AddPaper(expectedPaper);

            List<Keyword> keyWordsList = sms.GetKeywordsFromPaper("Some Paper About Testing");
            Assert.IsTrue(keyWordsList.Count() == 1);
        }
Exemplo n.º 4
0
 //Add a keyword to the paper
 public void AddKeyword(Keyword newkeyword)
 {
     k.Add(newkeyword);
 }