示例#1
0
 public void AddPaperTest_NormalPath()
 {
     Paper p = new Paper("not winning", "sean boyd", "teaches you how to lose", 1535);
     PaperList actual = new PaperList();
     actual.addPaper(p);
     Paper expected = new Paper("not winning", "sean boyd", "teaches you how to lose", 1535);
     Assert.AreEqual(expected.getName(), actual.getPaper("not winning").getName());
 }
示例#2
0
 public void AddPaperTest_HasPaper()
 {
     Paper p = new Paper("not winning", "sean boyd", "teaches you how to lose", 1535);
     Paper p1 = new Paper("test", "test mcgee", "how to test", 2012);
     PaperList actual = new PaperList();
     actual.addPaper(p1);
     actual.addPaper(p);
     Paper expected = new Paper("not winning", "sean boyd", "teaches you how to lose", 1535);
     Assert.AreEqual(expected.getName(), actual.getPaper("not winning").getName());
 }
示例#3
0
 public void addPaper(Paper paper)
 {
     if (String.IsNullOrEmpty(paper.getName()))
     {
         return;
     }
     if (this.list == null)
     {
         this.list = new List<Paper>() { paper };
     }
     for (int i = 0; i < this.list.Count; i++)
     {
         if (this.list[i].getName().Equals(paper.getName()))
         {
             return;
         }
     }
     this.list.Add(paper);
 }
示例#4
0
 public PaperList(Paper paper)
 {
     this.list = new List<Paper> { paper };
 }