public void IndexOf_EmptyName() { vCardSubpropertyCollection subs = new vCardSubpropertyCollection(); // IndexOf should not raise an exception for an empty string. Assert.AreEqual( -1, subs.IndexOf(string.Empty)); }
public void IndexOf_Null() { vCardSubpropertyCollection subs = new vCardSubpropertyCollection(); // The IndexOf method should not raise an exception // for a null string. It should return -1 to indicate // the name was not located. Assert.AreEqual( -1, subs.IndexOf((string)null)); }
public void IndexOf_MissingValueInPopulatedCollection() { vCardSubpropertyCollection subs = new vCardSubpropertyCollection(); subs.Add("NAME1"); subs.Add("NAME2"); subs.Add("NAME3"); Assert.AreEqual( -1, subs.IndexOf("NAME")); }
public void IndexOf_MissingValueInEmptyCollection() { vCardSubpropertyCollection subs = new vCardSubpropertyCollection(); // This test ensures that an empty collection // does not cause an error (e.g. it catches any // code that assumes the collection to be non-empty). Assert.AreEqual( -1, subs.IndexOf("NAME")); }
public void IndexOf() { vCardSubpropertyCollection subs = new vCardSubpropertyCollection(); subs.Add("NAME0"); subs.Add("NAME1"); subs.Add("NAME2"); Assert.AreEqual( 0, subs.IndexOf("NAME0"), "The subproperty should be at index 0."); Assert.AreEqual( 1, subs.IndexOf("NAME1"), "The subproperty should be at index 1."); Assert.AreEqual( 2, subs.IndexOf("NAME2"), "The subproperty should be at index 2."); }