Contains() публичный Метод

See if the item is present.
public Contains ( object item ) : bool
item object
Результат bool
Пример #1
0
		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));
				}
			}
		}
Пример #2
0
		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));
				}
			}
	}
Пример #3
0
		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));
				}
			}
		}