public void AddLabelTest()
        {
            LabelElement label = new LabelElement("Friends");
            entry.Labels.Add(label);

            Assert.AreEqual(1, entry.Labels.Count, "Entry's label collection should have size 1 after insertion");
            Assert.IsTrue(entry.Labels.Contains(label), "Entry's label collection does not contain label after insertion");
        }
        public void DeletionTest()
        {
            LabelElement label = new LabelElement("Friends");
            labels.Add(label);

            labels.Remove(label);
            Assert.IsTrue(labels.Count==0, "Label collection should be empty after singleton element is removed");
        }
        public void InsertionTest()
        {
            LabelElement label = new LabelElement("Friends");
            labels.Add(label);

            Assert.AreEqual(1, labels.Count, "Label collection should have size 1 after insertion");
            Assert.AreEqual(0, labels.IndexOf(label), "Index of singleton label should be zero");
            Assert.IsTrue(labels.Contains(label), "Label collection does not contain label after insertion");
        }
Exemple #4
0
        public void SaveTest()
        {
            label = new LabelElement("Friends");

            StringBuilder sb = new StringBuilder();
            XmlWriter writer = new XmlTextWriter(new StringWriter(sb));
            label.Save(writer);
            writer.Close();

            Assert.AreEqual(xmlElementAsText, sb.ToString(),
                "Saved XML form of LabelElement does not match expected value");
        }
Exemple #5
0
 public void SetLabelNameTest()
 {
     label = new LabelElement("Friends");
     Assert.AreEqual("Friends", label.LabelName,
         "Label does not have correct value after setting");
 }
Exemple #6
0
 public void Init()
 {
     label = new LabelElement();
 }
Exemple #7
0
 /// <summary>standard typed Contains method </summary> 
 public bool Contains(LabelElement value)
 {
     // If value is not of type AtomEntry, this will return false.
     return (List.Contains(value));
 }
Exemple #8
0
 /// <summary>standard typed remove method </summary> 
 public void Remove(LabelElement value)
 {
     base.Remove(value);
 }
Exemple #9
0
 /// <summary>standard typed insert method </summary>
 public void Insert(int index, LabelElement value)
 {
     base.Insert(index, value);
 }
Exemple #10
0
 /// <summary>standard typed indexOf method </summary>
 public int IndexOf(LabelElement value)
 {
     return (List.IndexOf(value));
 }
Exemple #11
0
 /// <summary>standard typed add method </summary>
 public int Add(LabelElement value)
 {
     return base.Add(value);
 }