public static void TestOptionValueCollectionIndexOf() { OptionValueCollection ovc = CreateOptionValueCollection(); ovc.Add("first"); ovc.Add("Second"); Assert.That(ovc.IndexOf("Second"), Is.EqualTo(1)); }
public static void TestOptionValueCollectionContains() { OptionValueCollection ovc = CreateOptionValueCollection(); ovc.Add("first"); ovc.Add("second"); Assert.That(ovc.Contains("first")); Assert.That(ovc.Contains("first")); Assert.That(ovc.Contains("third"), Is.False); }
public static void TestOptionValueCollectionRemoveAt() { OptionValueCollection ovc = CreateOptionValueCollection(); ovc.Add("first"); ovc.Add("second"); ovc.RemoveAt(0); Assert.That(ovc.Count, Is.EqualTo(1)); Assert.That(ovc[0], Is.EqualTo("second")); }
public static void TestOptionValueCollectionToList() { OptionValueCollection ovc = CreateOptionValueCollection(); ovc.Add("first"); ovc.Add("second"); List <string> list = ovc.ToList(); Assert.That(list.Count, Is.EqualTo(2)); Assert.That(list[0], Is.EqualTo("first")); Assert.That(list[1], Is.EqualTo("second")); }
public static void TestOptionValueCollectionToArray() { OptionValueCollection ovc = CreateOptionValueCollection(); ovc.Add("first"); ovc.Add("second"); string[] array = ovc.ToArray(); Assert.That(array.Length, Is.EqualTo(2)); Assert.That(array[0], Is.EqualTo("first")); Assert.That(array[1], Is.EqualTo("second")); }
public static void TestOptionValueCollectionCopyTo() { OptionValueCollection ovc = CreateOptionValueCollection(); ovc.Add("first"); ovc.Add("second"); string[] array = new string[] { "one", "two", "three" }; ovc.CopyTo(array, 1); Assert.That(array.Length, Is.EqualTo(3)); Assert.That(array[0], Is.EqualTo("one")); Assert.That(array[1], Is.EqualTo("first")); Assert.That(array[2], Is.EqualTo("second")); }
public static void TestOptionValueCollectionGetEnumerator() { OptionValueCollection ovc = CreateOptionValueCollection(); ovc.Add("first"); ovc.Add("second"); string v = String.Empty; foreach (string s in ovc) { v += s; } Assert.That(v, Is.EqualTo("firstsecond")); }
public static void TestOptionValueCollectionItemSetter() { OptionValueCollection ovc = CreateOptionValueCollection(); ovc.Add("first"); ovc[0] = "value"; Assert.That(ovc[0], Is.EqualTo("value")); }
public static void TestOptionValueCollectionInsert() { OptionValueCollection ovc = CreateOptionValueCollection(); ovc.Add("first"); ovc.Insert(0, "half"); Assert.That(ovc.Count, Is.EqualTo(2)); Assert.That(ovc[0], Is.EqualTo("half")); Assert.That(ovc[1], Is.EqualTo("first")); }