예제 #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 };
 }