示例#1
0
文件: UnitTest1.cs 项目: Mef1STo/List
 public void TestListItemSetGetNextItem()
 {
     ListItem item1 = new ListItem(null, null, 1);
     ListItem item2 = new ListItem(null, null, 1);
     item1.NextItem = item2;      
     Assert.AreEqual(item1.NextItem, item2);
 }
示例#2
0
文件: UnitTest1.cs 项目: Mef1STo/List
 public void TestListItemSetGetValue()
 {
     ListItem listItem = new ListItem(null, null, 0);
     listItem.Value = 1;
     int value = listItem.Value;
     Assert.AreEqual(1, value);
 }
示例#3
0
文件: UnitTest1.cs 项目: Mef1STo/List
 public void TestListItemValues()
 {
     ListItem item1 = new ListItem(null, null, 1);
     ListItem item2 = new ListItem(null, null, 1);
     item1.NextItem = item2;
     int value = item1.NextItem.Value;
     Assert.AreEqual(value, item2.Value);
 }
示例#4
0
文件: List.cs 项目: Mef1STo/List
 public void Add(int value)
 {
     if (_headItem == null && _lastItem == null)
     {
         _headItem = new ListItem(null, null, value);
         _lastItem = _headItem;
     }
     else
     {
         _lastItem = new ListItem(_lastItem, null, value);
         _lastItem.SetConnect();
     }         
 }
示例#5
0
文件: List.cs 项目: Mef1STo/List
 public ListItem(ListItem previous, ListItem next, int value)
 {
     _previous = previous;
     _next = next;
     _value = value;
 }
示例#6
0
文件: UnitTest1.cs 项目: Mef1STo/List
 public void TestListItemConstructor()
 {
     ListItem listItem = new ListItem(null, null, 0);
     Assert.IsNotNull(listItem);
 }