public void Remove_CollectionWithSingleElement_CollectionShouldBeEmpty() { using (var listBox = new FwListBox()) { using (var collection = new FwListBox.ObjectCollection(listBox)) { ITsString testString = TsStringHelper.MakeTSS("test", m_hvoEnglishWs); collection.Add(testString); // The Test collection.Remove(testString); Assert.AreEqual(0, collection.Count); Assert.IsFalse(collection.Contains(testString)); } } }
public void Add_EmptyObjectCollection_CollectionContainsSingleElement() { using (var listBox = new FwListBox()) { using (var collection = new FwListBox.ObjectCollection(listBox)) { ITsString testString = TsStringHelper.MakeTSS("test", m_hvoEnglishWs); // The Test collection.Add(testString); Assert.AreEqual(1, collection.Count); Assert.IsTrue(collection.Contains(testString)); } } }
public void SetIndex_CollectionWithSingleElement_ValueShouldHaveChanged() { using (var listBox = new FwListBox()) { using (var collection = new FwListBox.ObjectCollection(listBox)) { ITsString testString1 = TsStringHelper.MakeTSS("test1", m_hvoEnglishWs); ITsString testString2 = TsStringHelper.MakeTSS("test2", m_hvoEnglishWs); collection.Add(testString1); // The Test collection[0] = testString2; Assert.AreEqual(1, collection.Count); Assert.IsFalse(collection.Contains(testString1)); Assert.IsTrue(collection.Contains(testString2)); } } }